atom
This commit is contained in:
5
.idea/jarRepositories.xml
generated
5
.idea/jarRepositories.xml
generated
@@ -26,5 +26,10 @@
|
||||
<option name="name" value="maven" />
|
||||
<option name="url" value="https://jitpack.io" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="MavenRepo" />
|
||||
<option name="name" value="MavenRepo" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
@@ -129,3 +129,4 @@ dependencies {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":166,"versionName":"1.6.6","enabled":true,"outputFile":"atom-latest.apk","fullName":"release","baseName":"release"},"path":"atom-latest.apk","properties":{}}]
|
||||
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":168,"versionName":"1.6.8","enabled":true,"outputFile":"atom-latest.apk","fullName":"release","baseName":"release"},"path":"atom-latest.apk","properties":{}}]
|
||||
@@ -5,12 +5,6 @@ public interface InfoMessage {
|
||||
|
||||
void mesagezhuang(String str);
|
||||
|
||||
/**
|
||||
* 登录
|
||||
* @param str
|
||||
*/
|
||||
void mesagefinish(String str);
|
||||
|
||||
/**
|
||||
* 潜在客户加关
|
||||
* @param str
|
||||
|
||||
@@ -9,8 +9,10 @@ import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.fisherbone.fuzhu.ChangLiang;
|
||||
import com.fisherbone.fuzhu.abllib.utils.AblViewUtil;
|
||||
import com.fisherbone.fuzhu.entity.MessageBean;
|
||||
import com.fisherbone.fuzhu.okgonet.HttpConstants;
|
||||
import com.fisherbone.fuzhu.okgonet.NetApi;
|
||||
import com.jeremyliao.liveeventbus.LiveEventBus;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.lzy.okgo.model.Response;
|
||||
|
||||
@@ -69,6 +71,17 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
|
||||
Log.e("TIAOSHI###", "点击搜索按钮");
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启运行倒计时
|
||||
* @param type 任务类型 5.大v粉丝 6.抢红包
|
||||
* @param davruntime 倒计时
|
||||
*/
|
||||
public void TurnCount(String type,int davruntime) {
|
||||
MessageBean messageBean = new MessageBean();
|
||||
messageBean.setFromtype(type);
|
||||
messageBean.setRuntime(davruntime);
|
||||
LiveEventBus.get("task_runtime").post(messageBean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看节点的坐标点
|
||||
@@ -220,77 +233,6 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 我们才能继续为你提供服务
|
||||
* @param instance
|
||||
*/
|
||||
public void fuwuDialog(AblService instance) {
|
||||
//处理我知道了的弹框
|
||||
AccessibilityNodeInfo zhidao = AblViewUtil.findByText("我们才能继续为你提供服务", 0);
|
||||
if(zhidao==null){
|
||||
Log.e("TIAOSHI###", "没有找到我们才能继续为你提供服务的弹窗" );
|
||||
}else {
|
||||
Log.e("TIAOSHI###", "弹出了我们才能继续为你提供服务的弹窗" );
|
||||
List<AccessibilityNodeInfo> list = AblViewUtil.findByText("同意并继续");
|
||||
for (AccessibilityNodeInfo item : list) {
|
||||
clickcommontwo(item, "同意并继续");
|
||||
}
|
||||
AblViewUtil.mySleep(1);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 访问以下权限吗
|
||||
* @param instance
|
||||
*/
|
||||
public void quanxianDialog(AblService instance) {
|
||||
//处理我知道了的弹框
|
||||
AccessibilityNodeInfo zhidao = AblViewUtil.findByText("访问以下权限吗", 0);
|
||||
if(zhidao==null){
|
||||
Log.e("TIAOSHI###", "没有找到访问以下权限吗的弹窗" );
|
||||
}else {
|
||||
Log.e("TIAOSHI###", "弹出了访问以下权限吗的弹窗" );
|
||||
List<AccessibilityNodeInfo> list = AblViewUtil.findByText("始终允许");
|
||||
for (AccessibilityNodeInfo item : list) {
|
||||
clickcommontwo(item, "始终允许");
|
||||
}
|
||||
AblViewUtil.mySleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 关闭地理位置信息弹框
|
||||
* @param instance
|
||||
*/
|
||||
public void closedDDialog(AblService instance) {
|
||||
//处理我知道了的弹框
|
||||
AccessibilityNodeInfo zhidao = AblViewUtil.findByText("地理位置信息", 0);
|
||||
if(zhidao==null){
|
||||
Log.e("TIAOSHI###", "没有找到地理位置信息的弹窗" );
|
||||
}else {
|
||||
Log.e("TIAOSHI###", "弹出了检测到地理位置信息的弹窗" );
|
||||
AccessibilityNodeInfo zaishuo = AblViewUtil.findByText("取消", 0);
|
||||
AblService.getInstance().clickcommontwo(zaishuo, "取消");
|
||||
AblViewUtil.mySleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭地理位置=授权弹框
|
||||
* @param instance
|
||||
*/
|
||||
public void closedSDialog(AblService instance) {
|
||||
//处理我知道了的弹框
|
||||
AccessibilityNodeInfo zhidao = AblViewUtil.findByText("地理位置授权", 0);
|
||||
if(zhidao==null){
|
||||
Log.e("TIAOSHI###", "没有找到地理位置授权的弹窗" );
|
||||
}else {
|
||||
Log.e("TIAOSHI###", "弹出了检测到地理位置授权的弹窗" );
|
||||
AccessibilityNodeInfo zaishuo = AblViewUtil.findByText("不允许", 0);
|
||||
AblService.getInstance().clickcommontwo(zaishuo, "不允许");
|
||||
AblViewUtil.mySleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭个人信息保护指引
|
||||
@@ -309,112 +251,6 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 寻找控件
|
||||
*/
|
||||
public void getNodeInfo() {
|
||||
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
|
||||
for (int i = 0; i < root.getChildCount(); i++) {
|
||||
AccessibilityNodeInfo child = root.getChild(i);
|
||||
Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
||||
nodeZuobiao(child);
|
||||
for (int y = 0; y < child.getChildCount(); y++) {
|
||||
AccessibilityNodeInfo child1 = child.getChild(y);
|
||||
|
||||
Rect rect = new Rect();
|
||||
child1.getBoundsInScreen(rect);
|
||||
if (rect.left >0&& rect.left<1080) {
|
||||
Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
||||
nodeZuobiao(child1);
|
||||
}
|
||||
|
||||
// for (int j = 0; j < child1.getChildCount(); j++) {
|
||||
// AccessibilityNodeInfo child2 = child1.getChild(j);
|
||||
// Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child2.getContentDescription());
|
||||
// nodeZuobiao(child2);
|
||||
// for (int x = 0; x < child2.getChildCount(); x++) {
|
||||
// AccessibilityNodeInfo child3 = child2.getChild(x);
|
||||
// Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription());
|
||||
// nodeZuobiao(child3);
|
||||
// for (int r = 0; r < child3.getChildCount(); r++) {
|
||||
// AccessibilityNodeInfo child4 = child3.getChild(r);
|
||||
// Log.e("TIAOSHI###", "----5Node:" + child4.getClassName() + ":" + child4.getText()+ ":" + child4.getContentDescription());
|
||||
// nodeZuobiao(child4);
|
||||
// for (int m = 0; m < child4.getChildCount(); m++) {
|
||||
// AccessibilityNodeInfo child5 = child4.getChild(m);
|
||||
// Log.e("TIAOSHI###", "----6Node:" + child5.getClassName() + ":" + child5.getText()+ ":" + child5.getContentDescription());
|
||||
// nodeZuobiao(child5);
|
||||
// for (int p = 0; p < child5.getChildCount();p++) {
|
||||
// AccessibilityNodeInfo child6 = child5.getChild(p);
|
||||
// Log.e("TIAOSHI###", "----7Node:" + child6.getClassName() + ":" + child6.getText()+ ":" + child6.getContentDescription());
|
||||
// for (int t = 0; t < child6.getChildCount();t++) {
|
||||
// AccessibilityNodeInfo child7 = child6.getChild(t);
|
||||
// Log.e("TIAOSHI###", "----8Node:" + child7.getClassName() + ":" + child7.getText()+ ":" + child7.getContentDescription());
|
||||
// for (int q = 0; q < child7.getChildCount();t++) {
|
||||
// AccessibilityNodeInfo child8 = child7.getChild(q);
|
||||
// Log.e("TIAOSHI###", "----9Node:" + child8.getClassName() + ":" + child8.getText()+ ":" + child8.getContentDescription());
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 寻找控件
|
||||
*/
|
||||
public void getNodeInfoh() {
|
||||
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
|
||||
for (int i = 0; i < root.getChildCount(); i++) {
|
||||
AccessibilityNodeInfo child = root.getChild(i);
|
||||
Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
||||
nodeZuobiao(child);
|
||||
for (int y = 0; y < child.getChildCount(); y++) {
|
||||
AccessibilityNodeInfo child1 = child.getChild(y);
|
||||
Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
||||
nodeZuobiao(child1);
|
||||
for (int j = 0; j < child1.getChildCount(); j++) {
|
||||
AccessibilityNodeInfo child2 = child1.getChild(j);
|
||||
Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child2.getContentDescription());
|
||||
nodeZuobiao(child2);
|
||||
for (int x = 0; x < child2.getChildCount(); x++) {
|
||||
AccessibilityNodeInfo child3 = child2.getChild(x);
|
||||
Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription());
|
||||
nodeZuobiao(child3);
|
||||
for (int r = 0; r < child3.getChildCount(); r++) {
|
||||
AccessibilityNodeInfo child4 = child3.getChild(r);
|
||||
Log.e("TIAOSHI###", "----5Node:" + child4.getClassName() + ":" + child4.getText()+ ":" + child4.getContentDescription());
|
||||
nodeZuobiao(child4);
|
||||
// for (int m = 0; m < child4.getChildCount(); m++) {
|
||||
// AccessibilityNodeInfo child5 = child4.getChild(m);
|
||||
// Log.e("TIAOSHI###", "----6Node:" + child5.getClassName() + ":" + child5.getText()+ ":" + child5.getContentDescription());
|
||||
// nodeZuobiao(child5);
|
||||
// for (int p = 0; p < child5.getChildCount();p++) {
|
||||
// AccessibilityNodeInfo child6 = child5.getChild(p);
|
||||
// Log.e("TIAOSHI###", "----7Node:" + child6.getClassName() + ":" + child6.getText()+ ":" + child6.getContentDescription());
|
||||
// for (int t = 0; t < child6.getChildCount();t++) {
|
||||
// AccessibilityNodeInfo child7 = child6.getChild(t);
|
||||
// Log.e("TIAOSHI###", "----8Node:" + child7.getClassName() + ":" + child7.getText()+ ":" + child7.getContentDescription());
|
||||
// for (int q = 0; q < child7.getChildCount();t++) {
|
||||
// AccessibilityNodeInfo child8 = child7.getChild(q);
|
||||
// Log.e("TIAOSHI###", "----9Node:" + child8.getClassName() + ":" + child8.getText()+ ":" + child8.getContentDescription());
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
public void clickNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo, String s) {
|
||||
if (accessibilityNodeInfo != null) {
|
||||
@@ -533,4 +369,72 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
|
||||
return ifOpen;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 选择搜索的分类
|
||||
* 1为用户 2为直播
|
||||
*/
|
||||
public void selecttype(String type) {
|
||||
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
|
||||
for (int i = 0; i < root.getChildCount(); i++) {
|
||||
AccessibilityNodeInfo child = root.getChild(i);
|
||||
// Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
||||
for (int y = 0; y < child.getChildCount(); y++) {
|
||||
AccessibilityNodeInfo child1 = child.getChild(y);
|
||||
// Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
||||
for (int j = 0; j < child1.getChildCount(); j++) {
|
||||
AccessibilityNodeInfo child2 = child1.getChild(j);
|
||||
// Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child1.getContentDescription());
|
||||
for (int x = 0; x < child2.getChildCount(); x++) {
|
||||
AccessibilityNodeInfo child3 = child2.getChild(x);
|
||||
// Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription());
|
||||
// nodeZuobiao(child3);
|
||||
switch (type) {
|
||||
case "1":
|
||||
if ("android.widget.TextView".equals(child3.getClassName())) {
|
||||
if (child3.getText() != null) {
|
||||
if (child3.getText().toString().equals("用户")) {
|
||||
AblService.getInstance().clickcommontwo(child3, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "2":
|
||||
if ("android.widget.TextView".equals(child3.getClassName())) {
|
||||
if (child3.getText() != null) {
|
||||
if (child3.getText().toString().equals("直播")) {
|
||||
AblService.getInstance().clickcommontwo(child3, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 抖音顶部搜索框搜索输入框
|
||||
*/
|
||||
public AccessibilityNodeInfo findEditText() {
|
||||
AccessibilityNodeInfo infooos = null;
|
||||
AccessibilityNodeInfo rootttt = AblService.getInstance().getRootInActiveWindow();
|
||||
for (int j = 0; j < rootttt.getChildCount(); j++) {
|
||||
AccessibilityNodeInfo child = rootttt.getChild(j);
|
||||
// Log.e("TIAOSHI###", "----1Node:" + child.getClassName() + ":" + child.getText());
|
||||
for (int y = 0; y < child.getChildCount(); y++) {
|
||||
AccessibilityNodeInfo child1 = child.getChild(y);
|
||||
// Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
||||
// nodeZuobiao(child1);
|
||||
if ("android.widget.EditText".equals(child1.getClassName())) {
|
||||
infooos = child1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return infooos;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -523,11 +523,6 @@ public class AblViewUtil {
|
||||
infoMessag.mesagesuccess(str);
|
||||
}
|
||||
|
||||
public static void mesagefinish(String str){
|
||||
infoMessag.mesagefinish(str);
|
||||
}
|
||||
|
||||
|
||||
public static void zhuanghaoMessage(String str){
|
||||
infoMessag.mesagezhuang(str);
|
||||
}
|
||||
|
||||
@@ -328,6 +328,7 @@ public class ControlWindow {
|
||||
* 退出悬浮窗
|
||||
*/
|
||||
public void closedWin(){
|
||||
Log.e("TIAOSHI###", "退出悬浮窗执行了");
|
||||
WindowManager windowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
|
||||
windowManager.removeView(binding.getRoot());
|
||||
addWinEntity.isopen = false;
|
||||
|
||||
@@ -51,6 +51,7 @@ import com.fisherbone.fuzhu.db.dao.daoutil;
|
||||
import com.fisherbone.fuzhu.db.zhuanghaoBeanData;
|
||||
import com.fisherbone.fuzhu.entity.FourEvent;
|
||||
import com.fisherbone.fuzhu.entity.HusshuBean;
|
||||
import com.fisherbone.fuzhu.entity.MessageBean;
|
||||
import com.fisherbone.fuzhu.entity.PotCusBean;
|
||||
import com.fisherbone.fuzhu.entity.SixEvent;
|
||||
import com.fisherbone.fuzhu.entity.UrgentTaskBean;
|
||||
@@ -191,6 +192,7 @@ public class MainActivity extends BaseActivity implements InfoMessage {
|
||||
|
||||
|
||||
|
||||
|
||||
Settings.Secure.putString(getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, "com.fisherbone.fuzhu/com.fisherbone.fuzhu.abllib.AblService");
|
||||
Settings.Secure.putString(getContentResolver(), Settings.Secure.ACCESSIBILITY_ENABLED, "1");//1表示开启
|
||||
if (AblUtil.isAccessibilityServiceOpen(MainActivity.this)) {
|
||||
@@ -202,7 +204,6 @@ public class MainActivity extends BaseActivity implements InfoMessage {
|
||||
Settings.Secure.putString(getContentResolver(), Settings.Secure.ACCESSIBILITY_ENABLED, "0");//1表示开启
|
||||
}
|
||||
|
||||
checkAccessibilityEnabled("");
|
||||
ChangLiang.task_id = "";//当前执行任务id
|
||||
ChangLiang.id = "";//当前执行任务功能id
|
||||
ChangLiang.task_type = "";//当前执行任务类型
|
||||
@@ -268,6 +269,13 @@ public class MainActivity extends BaseActivity implements InfoMessage {
|
||||
}
|
||||
}
|
||||
});
|
||||
LiveEventBus.get("task_runtime", MessageBean.class).observe(this, new Observerlife<String>() {
|
||||
@Override
|
||||
public void onChanged(Object o) {
|
||||
MessageBean mesg = (MessageBean) o;
|
||||
taskDaojishi(mesg.getRuntime(),mesg);
|
||||
}
|
||||
});
|
||||
InjectUtils.injectEvent(this);
|
||||
requestVersion();
|
||||
|
||||
@@ -694,28 +702,13 @@ public class MainActivity extends BaseActivity implements InfoMessage {
|
||||
|
||||
@Override
|
||||
public void mesagesuccess(String str) {
|
||||
|
||||
if ("停止".equals(str)) {
|
||||
// mdDisposable.dispose();
|
||||
AblStepHandler.getInstance().setStop(true);
|
||||
controlWindow.stutas(true);
|
||||
controlWindow.closedWin();
|
||||
FinishTask();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 帐号登录回调
|
||||
*
|
||||
* @param str
|
||||
*/
|
||||
@Override
|
||||
public void mesagefinish(String str) {
|
||||
if ("停止".equals(str)) {
|
||||
if(mdDisposable!=null) {
|
||||
mdDisposable.dispose();
|
||||
}
|
||||
AblStepHandler.getInstance().setStop(true);
|
||||
controlWindow.stutas(true);
|
||||
controlWindow.closedWin();
|
||||
FinishTask();
|
||||
}
|
||||
}
|
||||
@@ -755,6 +748,7 @@ public class MainActivity extends BaseActivity implements InfoMessage {
|
||||
AblStepHandler.getInstance().setStop(false);
|
||||
Log.e("step###", "开始执行关闭抖音程序");
|
||||
AblStepHandler.sendMsg(192);
|
||||
|
||||
FinishTask();
|
||||
}
|
||||
}
|
||||
@@ -1377,4 +1371,44 @@ public class MainActivity extends BaseActivity implements InfoMessage {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 全局统一任务倒计时
|
||||
*
|
||||
* @param a
|
||||
*/
|
||||
private void taskDaojishi(final int a,MessageBean mesg ) {
|
||||
|
||||
//启动计时器
|
||||
//从0开始发射11个数字为:0-10依次输出,延时0s执行,每1s发射一次。
|
||||
mdDisposable = Flowable.intervalRange(0, a + 1, 0, 1, TimeUnit.SECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnNext(new Consumer<Long>() {
|
||||
@Override
|
||||
public void accept(Long aLong) throws Exception {
|
||||
long b = a - aLong;
|
||||
long c = 0 + aLong;
|
||||
Log.e("TIAOSHI###运行剩余时长", b + "");
|
||||
LiveEventBus.get("run_time").post("任务已运行"+c/60+"分钟");
|
||||
}
|
||||
})
|
||||
.doOnComplete(new Action() {
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
switch (mesg.getFromtype()) {
|
||||
case "5":
|
||||
ChangLiang.dav_ishuadong = "F";
|
||||
AblViewUtil.potgegin("停止");
|
||||
break;
|
||||
case "6":
|
||||
LiveEventBus.get("some_key").post("任务运行即将结束");
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
}
|
||||
})
|
||||
.subscribe();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.fisherbone.fuzhu.entity;
|
||||
|
||||
import com.j256.ormlite.field.DatabaseField;
|
||||
import com.j256.ormlite.table.DatabaseTable;
|
||||
|
||||
/**
|
||||
* Time: 2020/8/28
|
||||
* Author: jianbo
|
||||
* Description:
|
||||
*/
|
||||
public class MessageBean {
|
||||
|
||||
public int getRuntime() {
|
||||
return runtime;
|
||||
}
|
||||
|
||||
public void setRuntime(int runtime) {
|
||||
this.runtime = runtime;
|
||||
}
|
||||
|
||||
private int runtime;
|
||||
|
||||
public String getFromtype() {
|
||||
return fromtype;
|
||||
}
|
||||
|
||||
public void setFromtype(String fromtype) {
|
||||
this.fromtype = fromtype;
|
||||
}
|
||||
|
||||
private String fromtype;
|
||||
|
||||
}
|
||||
@@ -509,73 +509,6 @@ class NoticeBase extends BaseAblStep {
|
||||
Log.e("TIAOSHI###", "点击搜索按钮");
|
||||
}
|
||||
|
||||
/**
|
||||
* 寻找搜索输入框
|
||||
*/
|
||||
public AccessibilityNodeInfo findEditText() {
|
||||
AccessibilityNodeInfo infooos = null;
|
||||
AccessibilityNodeInfo rootttt = AblService.getInstance().getRootInActiveWindow();
|
||||
for (int j = 0; j < rootttt.getChildCount(); j++) {
|
||||
AccessibilityNodeInfo child = rootttt.getChild(j);
|
||||
// Log.e("TIAOSHI###", "----1Node:" + child.getClassName() + ":" + child.getText());
|
||||
for (int y = 0; y < child.getChildCount(); y++) {
|
||||
AccessibilityNodeInfo child1 = child.getChild(y);
|
||||
// Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
||||
// nodeZuobiao(child1);
|
||||
if ("android.widget.EditText".equals(child1.getClassName())) {
|
||||
infooos = child1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return infooos;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 选择搜索的分类
|
||||
* 1为用户 2为直播
|
||||
*/
|
||||
public void selecttype(String type) {
|
||||
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
|
||||
for (int i = 0; i < root.getChildCount(); i++) {
|
||||
AccessibilityNodeInfo child = root.getChild(i);
|
||||
// Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
||||
|
||||
for (int y = 0; y < child.getChildCount(); y++) {
|
||||
AccessibilityNodeInfo child1 = child.getChild(y);
|
||||
// Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
||||
|
||||
for (int j = 0; j < child1.getChildCount(); j++) {
|
||||
AccessibilityNodeInfo child2 = child1.getChild(j);
|
||||
// Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child1.getContentDescription());
|
||||
|
||||
switch (type) {
|
||||
case "1":
|
||||
if ("android.widget.TextView".equals(child2.getClassName())) {
|
||||
if (child2.getText() != null) {
|
||||
if (child2.getText().toString().equals("用户")) {
|
||||
AblService.getInstance().clickcommontwo(child2, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "2":
|
||||
if ("android.widget.TextView".equals(child2.getClassName())) {
|
||||
if (child2.getText() != null) {
|
||||
if (child2.getText().toString().equals("直播")) {
|
||||
AblService.getInstance().clickcommontwo(child2, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 说点什么节点
|
||||
* @return
|
||||
|
||||
@@ -45,124 +45,103 @@ public class TestAblStep0 extends BaseAblStep {
|
||||
AblViewUtil.mySleep(2);
|
||||
// getNodeInfoh();
|
||||
|
||||
geliwu("");
|
||||
// geliwu("");
|
||||
// ArrayList<AccessibilityNodeInfo> getrecy = getrecy();
|
||||
// Log.e("TIAOSHI###", "向上滑动");
|
||||
// getrecy.get(1).performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD); //触发容器元素的滚动事件
|
||||
|
||||
clickGuanzhu();
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得背包中第一排位置的了礼物
|
||||
* 添加关注
|
||||
*/
|
||||
private int geliwu(String text) {
|
||||
int doubiNum = 0;
|
||||
ArrayList<LiwuBean> liwuBeans = new ArrayList<>();
|
||||
ArrayList<AccessibilityNodeInfo> oneInfos = new ArrayList<>();
|
||||
ArrayList<AccessibilityNodeInfo> twoInfos = new ArrayList<>();
|
||||
ArrayList<AccessibilityNodeInfo> threeInfos = new ArrayList<>();
|
||||
ArrayList<AccessibilityNodeInfo> fourInfos = new ArrayList<>();
|
||||
|
||||
private void getdouyin() {
|
||||
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
|
||||
for (int i = 0; i < root.getChildCount(); i++) {
|
||||
AccessibilityNodeInfo child = root.getChild(i);
|
||||
// Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
||||
// nodeZuobiao(child);
|
||||
for (int y = 0; y < child.getChildCount(); y++) {
|
||||
AccessibilityNodeInfo child1 = child.getChild(y);
|
||||
// Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
||||
// nodeZuobiao(child1);
|
||||
if(child1!=null) {
|
||||
for (int j = 0; j < child1.getChildCount(); j++) {
|
||||
AccessibilityNodeInfo child2 = child1.getChild(j);
|
||||
// Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child2.getContentDescription());
|
||||
// Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child1.getContentDescription());
|
||||
// nodeZuobiao(child2);
|
||||
for (int x = 0; x < child2.getChildCount(); x++) {
|
||||
AccessibilityNodeInfo child3 = child2.getChild(x);
|
||||
// Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription());
|
||||
// nodeZuobiao(child3);
|
||||
|
||||
Rect rect = new Rect();
|
||||
child3.getBoundsInScreen(rect);
|
||||
if (rect.top >= 1438 && rect.bottom <= 1698 && rect.left >= 30 && rect.right <= 248) {
|
||||
|
||||
Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription());
|
||||
if (rect.top >= 364 && rect.top <= 2100) {
|
||||
if ("android.widget.RelativeLayout".equals(child3.getClassName())) {
|
||||
// Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription());
|
||||
nodeZuobiao(child3);
|
||||
oneInfos.add(child3);
|
||||
|
||||
for (int r = 0; r < child3.getChildCount(); r++) {
|
||||
AccessibilityNodeInfo child4 = child3.getChild(r);
|
||||
// Log.e("TIAOSHI###", "----5Node:" + child4.getClassName() + ":" + child4.getText() + ":" + child4.getContentDescription());
|
||||
for (int m = 0; m < child4.getChildCount(); m++) {
|
||||
AccessibilityNodeInfo child5 = child4.getChild(m);
|
||||
// Log.e("TIAOSHI###", "----6Node:" + child5.getClassName() + ":" + child5.getText() + ":" + child5.getContentDescription());
|
||||
nodeZuobiao(child5);
|
||||
if (child5.getText() != null) {
|
||||
if (child5.getText().toString().equals("关注")) {
|
||||
AblViewUtil.mySleep(1);
|
||||
//点击进入详情页
|
||||
clickcommontwo(child3, "进入详情页");
|
||||
AblViewUtil.mySleep(2);
|
||||
//获取参数
|
||||
// getCondition();
|
||||
AblViewUtil.mySleep(2);
|
||||
//是否加关
|
||||
if (ChangLiang.dav_condition.equals("0")) {
|
||||
clickGuanzhu();
|
||||
AblViewUtil.mySleep(2);
|
||||
}
|
||||
AblViewUtil.back();
|
||||
AblViewUtil.mySleep(1);
|
||||
|
||||
}
|
||||
if (rect.top >= 1438 && rect.bottom <= 1698 && rect.left >= 248 && rect.right <= 540) {
|
||||
|
||||
Log.e("TIAOSHI###", "----fourNodetwo:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription());
|
||||
nodeZuobiao(child3);
|
||||
twoInfos.add(child3);
|
||||
|
||||
}
|
||||
if (rect.top >= 1438 && rect.bottom <= 1698 && rect.left >= 540 && rect.right <= 810) {
|
||||
|
||||
Log.e("TIAOSHI###", "----fourNodehree:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription());
|
||||
nodeZuobiao(child3);
|
||||
threeInfos.add(child3);
|
||||
|
||||
}
|
||||
if (rect.top >= 1438 && rect.bottom <= 1698 && rect.left >= 810 && rect.right <= 1080) {
|
||||
|
||||
Log.e("TIAOSHI###", "----fourNodefour:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription());
|
||||
nodeZuobiao(child3);
|
||||
fourInfos.add(child3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
addLiwuData(liwuBeans, oneInfos);
|
||||
addLiwuData(liwuBeans, twoInfos);
|
||||
addLiwuData(liwuBeans, threeInfos);
|
||||
addLiwuData(liwuBeans, fourInfos);
|
||||
Gson gson = new Gson();
|
||||
String s1 = gson.toJson(liwuBeans);
|
||||
Log.e("礼物的字符串", s1);//[{"login_status":"1","short_id":"xiao629972576","short_name":""}]
|
||||
for(int j=0;j<liwuBeans.size();j++){
|
||||
LiwuBean liwuBean = liwuBeans.get(j);
|
||||
String liwuDoubi = liwuBean.getLiwuDoubi();
|
||||
int integer = Integer.valueOf(liwuDoubi);
|
||||
doubiNum = integer+doubiNum;
|
||||
}
|
||||
return doubiNum;
|
||||
}
|
||||
|
||||
private void addLiwuData(ArrayList<LiwuBean> liwuBeans, ArrayList<AccessibilityNodeInfo> oneInfos) {
|
||||
LiwuBean liwuBean = new LiwuBean();
|
||||
if (oneInfos.size() > 0) {
|
||||
String s0 = oneInfos.get(0).getText().toString();
|
||||
liwuBean.setLiwuTime(s0);
|
||||
String s1 = oneInfos.get(1).getText().toString();
|
||||
liwuBean.setLiwuName(s1);
|
||||
String s2 = oneInfos.get(2).getText().toString();
|
||||
if(s1.equals("大啤酒")) {
|
||||
liwuBean.setLiwuDanjia("2");
|
||||
}else if(s1.equals("小心心")){
|
||||
liwuBean.setLiwuDanjia("1");
|
||||
}else if(s1.equals("棒棒糖")){
|
||||
liwuBean.setLiwuDanjia("9");
|
||||
}else if(s1.equals("玫瑰")){
|
||||
liwuBean.setLiwuDanjia("1");
|
||||
}else{
|
||||
liwuBean.setLiwuDanjia("1");
|
||||
}
|
||||
String s3 = oneInfos.get(3).getText().toString();
|
||||
if (s3.contains(IFCONTIAN)) {
|
||||
String substring = s3.substring(1);
|
||||
liwusubstring = Integer.valueOf(substring);
|
||||
Log.e("TIAOSHI###", "----礼物个数=:" + substring);
|
||||
}
|
||||
liwuBean.setLiwuNum(liwusubstring+"");
|
||||
String liwuDanjia = liwuBean.getLiwuDanjia();
|
||||
int danjia = Integer.valueOf(liwuDanjia);
|
||||
liwuBean.setLiwuDoubi(liwusubstring*danjia+"");
|
||||
liwuBeans.add(liwuBean);
|
||||
}
|
||||
}
|
||||
|
||||
private void clickGuanzhu() {
|
||||
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
|
||||
for (int i = 0; i < root.getChildCount(); i++) {
|
||||
AccessibilityNodeInfo child = root.getChild(i);
|
||||
Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
||||
nodeZuobiao(child);
|
||||
for (int y = 0; y < child.getChildCount(); y++) {
|
||||
AccessibilityNodeInfo child1 = child.getChild(y);
|
||||
Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
||||
nodeZuobiao(child1);
|
||||
Rect rect = new Rect();
|
||||
child1.getBoundsInScreen(rect);
|
||||
if (rect.top >= 800 && rect.bottom <= 1366) {
|
||||
if ("android.widget.TextView".equals(child1.getClassName())) {
|
||||
if(child1.getText()!=null) {
|
||||
if ("关注".equals(child1.getText().toString())) {
|
||||
clickcommontwo(child1, "关注");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ public class TestAblStep12 extends BaseAblStep {
|
||||
AblService.getInstance().clickPoint(360, 399, 300);
|
||||
AblViewUtil.mySleep(5);
|
||||
Log.e("TIAOSHI###", "测试停止1");
|
||||
AblViewUtil.mesagefinish("停止");
|
||||
AblViewUtil.onMessage("停止");
|
||||
break;
|
||||
case AblSteps.STEP_100://效验验证码是否正确
|
||||
AccessibilityNodeInfo yazhenginfo = AblViewUtil.findByText("请输入验证码", 0);
|
||||
@@ -216,7 +216,7 @@ public class TestAblStep12 extends BaseAblStep {
|
||||
AblViewUtil.back();
|
||||
AblViewUtil.mySleep(1);
|
||||
Log.e("TIAOSHI###", "测试停止4");
|
||||
AblViewUtil.mesagefinish("停止");
|
||||
AblViewUtil.onMessage("停止");
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -295,7 +295,7 @@ public class TestAblStep12 extends BaseAblStep {
|
||||
AblViewUtil.back();
|
||||
AblViewUtil.mySleep(1);
|
||||
Log.e("TIAOSHI###", "测试停止4");
|
||||
AblViewUtil.mesagefinish("停止");
|
||||
AblViewUtil.onMessage("停止");
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -715,7 +715,7 @@ public class TestAblStep12 extends BaseAblStep {
|
||||
AblViewUtil.back();
|
||||
AblViewUtil.mySleep(1);
|
||||
Log.e("TIAOSHI###", "测试停止3");
|
||||
AblViewUtil.mesagefinish("停止");
|
||||
AblViewUtil.onMessage("停止");
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class TestAblStep18 extends BaseAblStep {
|
||||
AblViewUtil.mySleep(2);
|
||||
AblService.getInstance().clickPoint(400, 1000, 300);//红米7a
|
||||
Log.e("TIAOSHI###", "停止关闭抖音任务");
|
||||
AblViewUtil.mesagefinish("停止");
|
||||
AblViewUtil.onMessage("停止");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -62,7 +62,7 @@ public class TestAblStep18 extends BaseAblStep {
|
||||
}
|
||||
|
||||
Log.e("TIAOSHI###", "停止关闭抖音任务");
|
||||
AblViewUtil.mesagefinish("停止");
|
||||
AblViewUtil.onMessage("停止");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -129,24 +129,6 @@ public class TestAblStep19 extends BaseAblStep {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 寻找搜索输入框
|
||||
*/
|
||||
private AccessibilityNodeInfo findEditText() {
|
||||
AccessibilityNodeInfo infooos = null;
|
||||
AccessibilityNodeInfo rootttt = AblService.getInstance().getRootInActiveWindow();
|
||||
for (int j = 0; j < rootttt.getChildCount(); j++) {
|
||||
AccessibilityNodeInfo child = rootttt.getChild(j);
|
||||
Log.e("TIAOSHI###", "----1Node:" + child.getClassName() + ":" + child.getText());
|
||||
if ("android.widget.EditText".equals(child.getClassName())) {
|
||||
infooos = child;
|
||||
}
|
||||
}
|
||||
return infooos;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 列表第一条
|
||||
*/
|
||||
|
||||
@@ -1,35 +1,19 @@
|
||||
package com.fisherbone.fuzhu.step;
|
||||
|
||||
import android.accessibilityservice.AccessibilityService;
|
||||
import android.accessibilityservice.GestureDescription;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Build;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.fisherbone.fuzhu.ChangLiang;
|
||||
import com.fisherbone.fuzhu.abllib.AblService;
|
||||
import com.fisherbone.fuzhu.abllib.AblStepHandler;
|
||||
import com.fisherbone.fuzhu.abllib.AblSteps;
|
||||
import com.fisherbone.fuzhu.abllib.BaseAblStep;
|
||||
import com.fisherbone.fuzhu.abllib.RandumInt;
|
||||
import com.fisherbone.fuzhu.abllib.callback.GestureCallBack;
|
||||
import com.fisherbone.fuzhu.abllib.utils.AblViewUtil;
|
||||
import com.jeremyliao.liveeventbus.LiveEventBus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Flowable;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.Action;
|
||||
import io.reactivex.functions.Consumer;
|
||||
|
||||
/**
|
||||
* @param
|
||||
@@ -39,7 +23,6 @@ import io.reactivex.functions.Consumer;
|
||||
public class TestAblStep24 extends BaseAblStep {
|
||||
private ArrayList<String> objects = new ArrayList<>();
|
||||
private AccessibilityNodeInfo child3;
|
||||
private List<AccessibilityNodeInfo> accessibilityNodeInfos;
|
||||
private String guanzhunum;
|
||||
private String fensinum;
|
||||
private String zuopinnum = "";
|
||||
@@ -53,13 +36,9 @@ public class TestAblStep24 extends BaseAblStep {
|
||||
AblViewUtil.startApplication();
|
||||
objects.clear();
|
||||
objects.add(ChangLiang.dav_douyinhao);
|
||||
// objects.add("dyh48hvfd4yc");
|
||||
AblViewUtil.mySleep(3);
|
||||
AblViewUtil.mySleep(10);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_131);
|
||||
//开启运行倒计时
|
||||
|
||||
daojishitwo(Integer.parseInt(ChangLiang.dav_runningtime) * 60 *60);
|
||||
// daojishitwo(40);
|
||||
// TurnCount("5",Integer.parseInt(ChangLiang.dav_runningtime) * 60 *60);
|
||||
break;
|
||||
case AblSteps.STEP_131:
|
||||
//点击右上角搜索
|
||||
@@ -71,7 +50,6 @@ public class TestAblStep24 extends BaseAblStep {
|
||||
AblViewUtil.mySleep(1);
|
||||
ChangLiang.dav_ishuadong = "T";
|
||||
//输入关键词
|
||||
//判断有无要加关的关键词,如果有则执行112,没有则执行113
|
||||
if (objects.size() > 0) {
|
||||
AccessibilityNodeInfo findcomentt = findEditText();
|
||||
String conment = objects.get(0);
|
||||
@@ -86,7 +64,6 @@ public class TestAblStep24 extends BaseAblStep {
|
||||
//点击列表第一个,进入加关页面
|
||||
DianSou();
|
||||
AblViewUtil.mySleep(2);
|
||||
// AblService.getInstance().inputClickId("用户");//红米7a
|
||||
selecttype("1");
|
||||
AblViewUtil.mySleep(2);
|
||||
//用坐标点的方式点击第一条 0,256 720,404
|
||||
@@ -106,19 +83,22 @@ public class TestAblStep24 extends BaseAblStep {
|
||||
}
|
||||
break;
|
||||
case AblSteps.STEP_135:
|
||||
//获取一屏幕数据:快照
|
||||
AccessibilityNodeInfo roott = AblService.getInstance().getRootInActiveWindow();
|
||||
List<AccessibilityNodeInfo> idsj = roott.findAccessibilityNodeInfosByText("暂时没有更多");
|
||||
List<AccessibilityNodeInfo> idsj = roott.findAccessibilityNodeInfosByText("暂时没有更多了");
|
||||
if (idsj.size() > 0) {
|
||||
AccessibilityNodeInfo accessibilityNodeInfo = idsj.get(0);
|
||||
CharSequence text1 = accessibilityNodeInfo.getText();
|
||||
if (text1.equals("暂时没有更多")) {
|
||||
if (text1.equals("暂时没有更多了")) {
|
||||
ChangLiang.dav_ishuadong = "F";
|
||||
AblViewUtil.back();
|
||||
}
|
||||
}
|
||||
if (ChangLiang.dav_ishuadong.equals("T")) {
|
||||
randomSwipe();
|
||||
AblViewUtil.mySleep(1);
|
||||
ArrayList<AccessibilityNodeInfo> getrecy = getrecy();
|
||||
Log.e("TIAOSHI###", "向上滑动");
|
||||
getrecy.get(1).performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD); //触发容器元素的滚动事件
|
||||
AblViewUtil.mySleep(1);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_134);
|
||||
}
|
||||
break;
|
||||
@@ -127,101 +107,29 @@ public class TestAblStep24 extends BaseAblStep {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 选择搜索的分类
|
||||
* 1为用户 2为直播
|
||||
*/
|
||||
public void selecttype(String type) {
|
||||
private ArrayList<AccessibilityNodeInfo> getrecy() {
|
||||
ArrayList<AccessibilityNodeInfo> accessibilityNodeInfos = new ArrayList<>();
|
||||
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
|
||||
for (int i = 0; i < root.getChildCount(); i++) {
|
||||
AccessibilityNodeInfo child = root.getChild(i);
|
||||
// Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
||||
|
||||
Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
||||
nodeZuobiao(child);
|
||||
for (int y = 0; y < child.getChildCount(); y++) {
|
||||
AccessibilityNodeInfo child1 = child.getChild(y);
|
||||
// Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
||||
|
||||
Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
||||
nodeZuobiao(child1);
|
||||
for (int j = 0; j < child1.getChildCount(); j++) {
|
||||
AccessibilityNodeInfo child2 = child1.getChild(j);
|
||||
// Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child1.getContentDescription());
|
||||
for (int x = 0; x < child2.getChildCount(); x++) {
|
||||
AccessibilityNodeInfo child3 = child2.getChild(x);
|
||||
// Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription());
|
||||
// nodeZuobiao(child3);
|
||||
switch (type) {
|
||||
case "1":
|
||||
if ("android.widget.TextView".equals(child3.getClassName())) {
|
||||
if (child3.getText() != null) {
|
||||
if (child3.getText().toString().equals("用户")) {
|
||||
AblService.getInstance().clickcommontwo(child3, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "2":
|
||||
if ("android.widget.TextView".equals(child3.getClassName())) {
|
||||
if (child3.getText() != null) {
|
||||
if (child3.getText().toString().equals("直播")) {
|
||||
AblService.getInstance().clickcommontwo(child3, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if ("androidx.recyclerview.widget.RecyclerView".equals(child2.getClassName())) {
|
||||
Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child2.getContentDescription());
|
||||
nodeZuobiao(child2);
|
||||
accessibilityNodeInfos.add(child2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return accessibilityNodeInfos;
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
public void randomSwipe() {
|
||||
if (ChangLiang.phonetype.equals("0")) {
|
||||
int a = 170 + RandumInt.getRandumInt4() * 8;
|
||||
int b = 170 - RandumInt.getRandumInt4() * 10;
|
||||
int c = 1200 - RandumInt.getRandumInt4() * 8; // 1280分辨率起步的滑动方式 2160--1080
|
||||
int d = 400 - RandumInt.getRandumInt4() * 9; // 刚才是300, 延迟350~400
|
||||
// 800毫秒的时候,有时候有点卡,但是能用,再试试其他的
|
||||
swipe(a, c, b, d, 320); //延迟330毫秒
|
||||
} else {
|
||||
int a = 500 + RandumInt.getRandumInt4() * 8;
|
||||
int b = 500 - RandumInt.getRandumInt4() * 10;
|
||||
int c = 1500 - RandumInt.getRandumInt4() * 8; // 1280分辨率起步的滑动方式
|
||||
int d = 700 - RandumInt.getRandumInt4() * 9; // 刚才是300, 延迟350~400
|
||||
// 800毫秒的时候,有时候有点卡,但是能用,再试试其他的
|
||||
swipe(a, c, b, d, 420); //延迟330毫秒
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
public void swipe(float x1, float y1, float x2, float y2, long duration) {
|
||||
Path path = new Path();
|
||||
path.moveTo(x1, y1);
|
||||
path.lineTo(x2, y2);
|
||||
|
||||
Log.e("TIAOSHI###", "MyAccessibilityService中滑动swipe()方法滑动点,reset:(" + x1 + "," + y1 + "),(" + x2 + "," + y2 + ")" + "滑动的时长是:" + duration);
|
||||
GestureDescription.Builder builder = new GestureDescription.Builder();
|
||||
GestureDescription gestureDescription = builder
|
||||
.addStroke(new GestureDescription.StrokeDescription(path, 0, duration))
|
||||
.build();
|
||||
boolean b = AblService.getInstance().dispatchGesture(gestureDescription, new AccessibilityService.GestureResultCallback() {
|
||||
@Override
|
||||
public void onCompleted(GestureDescription gestureDescription) {
|
||||
super.onCompleted(gestureDescription);
|
||||
Log.e("TIAOSHI###", "滑动结束..." + gestureDescription.getStrokeCount());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancelled(GestureDescription gestureDescription) {
|
||||
super.onCancelled(gestureDescription);
|
||||
Log.e("TIAOSHI###", "滑动取消");
|
||||
}
|
||||
}, null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加关注
|
||||
@@ -231,10 +139,10 @@ public class TestAblStep24 extends BaseAblStep {
|
||||
for (int i = 0; i < root.getChildCount(); i++) {
|
||||
AccessibilityNodeInfo child = root.getChild(i);
|
||||
// Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
||||
|
||||
for (int y = 0; y < child.getChildCount(); y++) {
|
||||
AccessibilityNodeInfo child1 = child.getChild(y);
|
||||
// Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
||||
if(child1!=null) {
|
||||
for (int j = 0; j < child1.getChildCount(); j++) {
|
||||
AccessibilityNodeInfo child2 = child1.getChild(j);
|
||||
// Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child1.getContentDescription());
|
||||
@@ -261,7 +169,7 @@ public class TestAblStep24 extends BaseAblStep {
|
||||
clickcommontwo(child3, "进入详情页");
|
||||
AblViewUtil.mySleep(2);
|
||||
//获取参数
|
||||
getCondition();
|
||||
// getCondition();
|
||||
AblViewUtil.mySleep(2);
|
||||
//是否加关
|
||||
if (ChangLiang.dav_condition.equals("0")) {
|
||||
@@ -281,24 +189,29 @@ public class TestAblStep24 extends BaseAblStep {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void clickGuanzhu() {
|
||||
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
|
||||
for (int i = 0; i < root.getChildCount(); i++) {
|
||||
AccessibilityNodeInfo child = root.getChild(i);
|
||||
// Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
||||
// nodeZuobiao(child);
|
||||
Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
||||
nodeZuobiao(child);
|
||||
for (int y = 0; y < child.getChildCount(); y++) {
|
||||
AccessibilityNodeInfo child1 = child.getChild(y);
|
||||
// Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
||||
// nodeZuobiao(child1);
|
||||
Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
||||
nodeZuobiao(child1);
|
||||
Rect rect = new Rect();
|
||||
child1.getBoundsInScreen(rect);
|
||||
if (rect.top >= 800 && rect.bottom <= 1350) {
|
||||
if ("android.widget.TextView".equals(child1.getClassName())) {
|
||||
if(child1.getText()!=null) {
|
||||
if ("关注".equals(child1.getText().toString())) {
|
||||
clickcommontwo(child1, "关注");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -390,28 +303,6 @@ public class TestAblStep24 extends BaseAblStep {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 寻找搜索输入框
|
||||
*/
|
||||
private AccessibilityNodeInfo findEditText() {
|
||||
AccessibilityNodeInfo infooos = null;
|
||||
AccessibilityNodeInfo rootttt = AblService.getInstance().getRootInActiveWindow();
|
||||
for (int j = 0; j < rootttt.getChildCount(); j++) {
|
||||
AccessibilityNodeInfo child = rootttt.getChild(j);
|
||||
// Log.e("TIAOSHI###", "----1Node:" + child.getClassName() + ":" + child.getText());
|
||||
for (int y = 0; y < child.getChildCount(); y++) {
|
||||
AccessibilityNodeInfo child1 = child.getChild(y);
|
||||
// Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
||||
// nodeZuobiao(child1);
|
||||
if ("android.widget.EditText".equals(child1.getClassName())) {
|
||||
infooos = child1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return infooos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得最近作品时间
|
||||
*/
|
||||
@@ -515,36 +406,4 @@ public class TestAblStep24 extends BaseAblStep {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟结束任务
|
||||
*
|
||||
* @param a
|
||||
*/
|
||||
private void daojishitwo(final int a) {
|
||||
|
||||
//启动计时器
|
||||
//从0开始发射11个数字为:0-10依次输出,延时0s执行,每1s发射一次。
|
||||
Disposable mdDisposable = Flowable.intervalRange(0, a + 1, 0, 1, TimeUnit.SECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnNext(new Consumer<Long>() {
|
||||
@Override
|
||||
public void accept(Long aLong) throws Exception {
|
||||
long b = a - aLong;
|
||||
long c = 0 + aLong;
|
||||
Log.e("TIAOSHI###运行剩余时长", b + "");
|
||||
LiveEventBus.get("run_time").post("任务已运行"+c/60+"分钟");
|
||||
}
|
||||
})
|
||||
.doOnComplete(new Action() {
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
ChangLiang.dav_ishuadong = "F";
|
||||
Log.e("TIAOSHI###", "运行时间已到,停止自动加关");
|
||||
// runLog("任务运行即将结束");
|
||||
AblViewUtil.potgegin("停止");
|
||||
}
|
||||
})
|
||||
.subscribe();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,14 +67,9 @@ public class TestAblStep31 extends HongbaoBase {
|
||||
enfirstLive();
|
||||
}
|
||||
break;
|
||||
// case AblSteps.STEP_222:
|
||||
// Log.e("TIAOSHI###", "福袋测试STEP_222");
|
||||
// AblViewUtil.mySleep(2);
|
||||
// AblStepHandler.sendMsg(AblSteps.STEP_223);
|
||||
// break;
|
||||
case AblSteps.STEP_222:
|
||||
Log.e("TIAOSHI###", "福袋测试STEP_222");
|
||||
AblViewUtil.mySleep(2);
|
||||
AblViewUtil.mySleep(4);
|
||||
if (ifControlView()) {
|
||||
AblViewUtil.mySleep(2);
|
||||
kongjiandingweitwo();
|
||||
@@ -259,8 +254,6 @@ public class TestAblStep31 extends HongbaoBase {
|
||||
} else if (pagetype == 21) {
|
||||
jiluBeans.add("红包");
|
||||
AblViewUtil.mySleep(1);
|
||||
// AblService.getInstance().clickPoint(100, 100, 300);
|
||||
// AblViewUtil.mySleep(1);
|
||||
if (!ProfileSpUtils.getInstance().getLiveSuiJiBean().getSwitchthree()) {
|
||||
AblService.getInstance().clickPoint(100, 100, 300);
|
||||
AblViewUtil.mySleep(1);
|
||||
@@ -288,58 +281,6 @@ public class TestAblStep31 extends HongbaoBase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 参与抢福袋
|
||||
*/
|
||||
private AccessibilityNodeInfo canyuqiangfeidai() {
|
||||
AccessibilityNodeInfo kongjian = null;
|
||||
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
|
||||
for (int i = 0; i < root.getChildCount(); i++) {
|
||||
AccessibilityNodeInfo child = root.getChild(i);
|
||||
for (int y = 0; y < child.getChildCount(); y++) {
|
||||
AccessibilityNodeInfo child1 = child.getChild(y);
|
||||
if ("android.widget.HorizontalScrollView".equals(child1.getClassName())) {
|
||||
kongjian = child1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return kongjian;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得红包的位置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private int hongbaoweizhi() {
|
||||
int position = 0;
|
||||
for (int i = 0; i < hongbaos.size(); i++) {
|
||||
String s = hongbaos.get(i);
|
||||
if ("红包".equals(s)) {
|
||||
position = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return position;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得福袋的位置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private int fudaiposition() {
|
||||
int position = 0;
|
||||
for (int i = 0; i < hongbaos.size(); i++) {
|
||||
String s = hongbaos.get(i);
|
||||
if ("福袋".equals(s)) {
|
||||
position = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return position;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取参与抢福袋的条件值
|
||||
*
|
||||
|
||||
@@ -79,8 +79,8 @@ public class TestAblStep34 extends HongbaoBase implements RedEnv.RedEnvFunc, Red
|
||||
allowed();
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_250);
|
||||
//开启运行倒计时
|
||||
|
||||
daojishitwo(Integer.parseInt(redEnvBean.getRuntime()) * 60);
|
||||
TurnCount("6",Integer.parseInt(redEnvBean.getRuntime()) * 60);
|
||||
// daojishitwo(Integer.parseInt(redEnvBean.getRuntime()) * 60);
|
||||
break;
|
||||
case AblSteps.STEP_250:
|
||||
closedtjDialog(AblService.getInstance());
|
||||
|
||||
@@ -432,23 +432,6 @@ public class TestAblStepBase extends BaseAblStep {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 寻找搜索输入框
|
||||
*/
|
||||
public AccessibilityNodeInfo findEditText() {
|
||||
AccessibilityNodeInfo infooos = null;
|
||||
AccessibilityNodeInfo rootttt = AblService.getInstance().getRootInActiveWindow();
|
||||
for (int j = 0; j < rootttt.getChildCount(); j++) {
|
||||
AccessibilityNodeInfo child = rootttt.getChild(j);
|
||||
// Log.e("TIAOSHI###", "----1Node:" + child.getClassName() + ":" + child.getText());
|
||||
if ("android.widget.EditText".equals(child.getClassName())) {
|
||||
infooos = child;
|
||||
}
|
||||
}
|
||||
return infooos;
|
||||
}
|
||||
|
||||
|
||||
//点击右上角搜索
|
||||
//[624,67][688,131]
|
||||
public void DianSou() {
|
||||
|
||||
@@ -12,8 +12,8 @@ ext {
|
||||
applicationId : "com.fisherbone.fuzhu",
|
||||
minSdkVersion : 24,
|
||||
targetSdkVersion : 29,
|
||||
versionCode : 166,
|
||||
versionName : "1.6.6",
|
||||
versionCode : 168,
|
||||
versionName : "1.6.8",
|
||||
testInstrumentationRunner: "androidx.test.runner.AndroidJUnitRunner"
|
||||
]
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
i/
|
||||
@@ -4,6 +4,7 @@
|
||||
apply from : "app_config.gradle"
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.3.72'
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
@@ -11,6 +12,7 @@ buildscript {
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.4.1'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user