This commit is contained in:
2021-10-18 08:42:27 +08:00
parent 62812f9baa
commit d9188f8499
4 changed files with 299 additions and 210 deletions

View File

@@ -38,8 +38,7 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
} else if (ChangLiang.phonetype.equals("3")) { } else if (ChangLiang.phonetype.equals("3")) {
AblViewUtil.mySleep(6); AblViewUtil.mySleep(6);
AblService.getInstance().clickPoint(972, 2103, 300); AblService.getInstance().clickPoint(972, 2103, 300);
} } else {
else {
instance.clickPoint(648, 1536, 300);//华为畅享20 [632,1521][664,1552] instance.clickPoint(648, 1536, 300);//华为畅享20 [632,1521][664,1552]
} }
Log.e("TIAOSHI###", "点击了我按钮"); Log.e("TIAOSHI###", "点击了我按钮");
@@ -73,6 +72,7 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
/** /**
* 开启运行倒计时 * 开启运行倒计时
*
* @param type 任务类型 5.大v粉丝 6.抢红包 * @param type 任务类型 5.大v粉丝 6.抢红包
* @param davruntime 倒计时 * @param davruntime 倒计时
*/ */
@@ -119,6 +119,7 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
/** /**
* 关闭青少年保护弹框 * 关闭青少年保护弹框
*
* @param instance * @param instance
*/ */
public void closedQDialog(AblService instance) { public void closedQDialog(AblService instance) {
@@ -135,6 +136,7 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
/** /**
* 关闭设置抖音号弹框 * 关闭设置抖音号弹框
*
* @param instance * @param instance
*/ */
public void setdoyinQDialog(AblService instance) { public void setdoyinQDialog(AblService instance) {
@@ -165,6 +167,7 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
/** /**
* 关闭检测到更新弹框 * 关闭检测到更新弹框
*
* @param instance * @param instance
*/ */
public void closedJDialog(AblService instance) { public void closedJDialog(AblService instance) {
@@ -182,6 +185,7 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
/** /**
* 关闭检测到更新弹框 * 关闭检测到更新弹框
*
* @param instance * @param instance
*/ */
public void closedzsDialog(AblService instance) { public void closedzsDialog(AblService instance) {
@@ -199,6 +203,7 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
/** /**
* 关闭朋友推荐弹框 * 关闭朋友推荐弹框
*
* @param instance * @param instance
*/ */
public void closedtjDialog(AblService instance) { public void closedtjDialog(AblService instance) {
@@ -216,6 +221,7 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
/** /**
* 个人信息保护指引 * 个人信息保护指引
*
* @param instance * @param instance
*/ */
public void yinsiDialog(AblService instance) { public void yinsiDialog(AblService instance) {
@@ -236,6 +242,7 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
/** /**
* 关闭个人信息保护指引 * 关闭个人信息保护指引
*
* @param instance * @param instance
*/ */
public void closedBDialog(AblService instance) { public void closedBDialog(AblService instance) {
@@ -264,8 +271,6 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
} }
protected void againStart(String str) { protected void againStart(String str) {
final HttpParams paramsPost = new HttpParams(); final HttpParams paramsPost = new HttpParams();
paramsPost.put("task_status", str); paramsPost.put("task_status", str);
@@ -310,6 +315,7 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
return flag; return flag;
} }
/** /**
* 当前页面如果有切换账号和管理,说明账号切换任务运行正常 * 当前页面如果有切换账号和管理,说明账号切换任务运行正常
*/ */
@@ -331,6 +337,7 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
return flag; return flag;
} }
/** /**
* 当前页面是否在我的页面 * 当前页面是否在我的页面
*/ */
@@ -439,7 +446,6 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
return infooos; return infooos;
} }
/** /**
* 寻找控件 * 寻找控件
*/ */
@@ -489,5 +495,46 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
} }
} }
} }
/**
* 是否关注过 判断的准确率在百分之90之上
*/
public boolean ifGaunzhu() {
boolean flag = false;
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
for (int i = 0; i < root.getChildCount(); i++) {
AccessibilityNodeInfo child = root.getChild(i);
if ("dmt.viewpager.DmtViewPager$d".equals(child.getClassName())) {
// 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);
Rect rect = new Rect();
child2.getBoundsInScreen(rect);
if (rect.left > 0 && rect.left <= 1080 && rect.top > 0 && rect.top <= 2210 && rect.bottom > 0 && rect.bottom <= 2210 && rect.right <= 1080) {
Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child2.getContentDescription());
nodeZuobiao(child2);
if ("android.widget.Button".equals(child2.getClassName())) {
if (child2.getContentDescription() != null) {
if ("关注".equals(child2.getContentDescription().toString())) {
flag = true;
}
}
}
}
}
}
}
}
return flag;
}
} }

View File

@@ -21,6 +21,7 @@ import com.fisherbone.fuzhu.abllib.BaseAblStep;
import com.fisherbone.fuzhu.abllib.callback.GestureCallBack; import com.fisherbone.fuzhu.abllib.callback.GestureCallBack;
import com.fisherbone.fuzhu.abllib.utils.AblViewUtil; import com.fisherbone.fuzhu.abllib.utils.AblViewUtil;
import com.fisherbone.fuzhu.entity.LiwuBean; import com.fisherbone.fuzhu.entity.LiwuBean;
import com.fisherbone.fuzhu.utils.ProfileSpUtils;
import com.google.gson.Gson; import com.google.gson.Gson;
import java.util.ArrayList; import java.util.ArrayList;
@@ -45,61 +46,139 @@ public class TestAblStep0 extends BaseAblStep {
case AblSteps.STEP_2: case AblSteps.STEP_2:
AblViewUtil.mySleep(2); AblViewUtil.mySleep(2);
// getNodeInfoh(); // getNodeInfoh();
// AblService.getInstance().randomSwipetwo(); cancelGuanzhu(AblService.getInstance());
// ArrayList<AccessibilityNodeInfo> nodeInfodh = getNodeInfodh();
// AccessibilityNodeInfo nodeInfo = nodeInfodh.get(0);
// clickcommontwo(nodeInfo,"");
DianSou();
AblViewUtil.mySleep(2);
selecttype("1");
AblViewUtil.mySleep(2);
AblViewUtil.mySleep(2);
//用坐标点的方式点击第一条 0256 720404
//华为畅享20
AblService.getInstance().clickPoint(790, 456, 300);
// AblService.getInstance().clickPoint(540, 478, 300);
break; break;
default: default:
} }
} }
/** private void cancelGuanzhu(AblService instance) {
* 寻找控件
*/
public ArrayList<AccessibilityNodeInfo> getNodeInfodh() {
ArrayList<AccessibilityNodeInfo> accessibilityNodeInfos = new ArrayList<>();
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow(); AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
for (int i = 0; i < root.getChildCount(); i++) { for (int i = 0; i < root.getChildCount(); i++) {
AccessibilityNodeInfo child = root.getChild(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); // nodeZuobiao(child);
for (int y = 0; y < child.getChildCount(); y++) { for (int y = 0; y < child.getChildCount(); y++) {
AccessibilityNodeInfo child1 = child.getChild(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); // nodeZuobiao(child1);
for (int j = 0; j < child1.getChildCount(); j++) { for (int j = 0; j < child1.getChildCount(); j++) {
AccessibilityNodeInfo child2 = child1.getChild(j); AccessibilityNodeInfo child2 = child1.getChild(j);
Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child2.getContentDescription()); // Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child2.getContentDescription());
nodeZuobiao(child2); // nodeZuobiao(child2);
for (int x = 0; x < child2.getChildCount(); x++) { for (int x = 0; x < child2.getChildCount(); x++) {
AccessibilityNodeInfo child3 = child2.getChild(x); AccessibilityNodeInfo child3 = child2.getChild(x);
Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription()); Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription());
nodeZuobiao(child3); // nodeZuobiao(child3);
if("android.widget.FrameLayout".equals(child3.getClassName())){ if("android.widget.RelativeLayout".equals(child3.getClassName())) {
accessibilityNodeInfos.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());
// nodeZuobiao(child4);
// Rect rect = new Rect();
// if(child4!=null) {
// child4.getBoundsInScreen(rect);
// if (rect.top <= 2100) {
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);
yiguanzhu(child5);
}
}
}
// }
// }
}
}
}
}
}
// 3.遍历info中的子节点 (优化方法,正在测试)
public void yiguanzhu(AccessibilityNodeInfo child2) {
boolean cancelclosed = ProfileSpUtils.getInstance().getCan().getCancelclosed();
boolean cancelcrosscor = ProfileSpUtils.getInstance().getCan().getCancelcrosscor();
if (cancelclosed&&!cancelcrosscor) {
Log.e("TIAOSHI###", "QQQQQQQQQQQQQQQQQQ");
if (child2.getChildCount() != 0) {
for (int i = 0; i < child2.getChildCount(); i++) {
AccessibilityNodeInfo child = child2.getChild(i);
if (child.getText() != null) {
if (!child.getText().toString().equals("已关注")) {
continue;
}
}
try {
Thread.sleep(300);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (child.getText() != null) {
if (child.getText().toString().equals("已关注")) {
clickcommontwo(child, "已关注");
}
}
}
}
}
if (cancelcrosscor&&!cancelclosed) {
Log.e("TIAOSHI###", "VVVVVVVVVVVVVVVVVVVVVV");
if (child2.getChildCount() != 0) {
for (int w = 0; w < child2.getChildCount(); w++) {
AccessibilityNodeInfo childw = child2.getChild(w);
if (childw != null) {
if (childw.getText() != null) {
if (!childw.getText().toString().equals("互相关注")) {
continue;
}
}
AblViewUtil.mySleep(1);
if (childw.getText() != null) {
if (childw.getText().toString().equals("互相关注")) {
clickcommontwo(childw, "互相关注");
AblViewUtil.mySleep(2);
AccessibilityNodeInfo quxiao = AblViewUtil.findByText("取消关注", 1);
clickcommontwo(quxiao, "取消关注");
}
}
}
}
}
}
if(cancelclosed&&cancelcrosscor){
Log.e("TIAOSHI###", "WWWWWWWWWWWWWWWWWWWWW");
if (child2.getChildCount() != 0) {
for (int i = 0; i < child2.getChildCount(); i++) {
AccessibilityNodeInfo child = child2.getChild(i);
if (child.getText() != null) {
if (child.getText().toString().equals("已关注")) {
try {
Thread.sleep(300);
} catch (InterruptedException e) {
e.printStackTrace();
}
clickcommontwo(child, "已关注");
}
if (child.getText().toString().equals("互相关注")) {
AblViewUtil.mySleep(1);
clickcommontwo(child, "互相关注");
AblViewUtil.mySleep(2);
AccessibilityNodeInfo quxiao = AblViewUtil.findByText("取消关注", 1);
clickcommontwo(quxiao, "取消关注");
AblViewUtil.mySleep(1);
} }
} }
} }
} }
} }
return accessibilityNodeInfos;
} }
} }

View File

@@ -35,6 +35,8 @@ public class TestAblStep6 extends BaseAblStep {
private int numb;//阈值 private int numb;//阈值
private String guanzhunum; private String guanzhunum;
private AccessibilityNodeInfo child3; private AccessibilityNodeInfo child3;
private int num;
private int num2;
@Override @Override
public void onStep(int step, Message msg) { public void onStep(int step, Message msg) {
@@ -54,27 +56,35 @@ public class TestAblStep6 extends BaseAblStep {
//获取关注数(对比关注数是否满足预设的取关值;)若不满足,则直接结束任务,若满足,则点击【关注】,进入关注页; //获取关注数(对比关注数是否满足预设的取关值;)若不满足,则直接结束任务,若满足,则点击【关注】,进入关注页;
getargone(); getargone();
AblViewUtil.mySleep(1); AblViewUtil.mySleep(1);
if (guanzhunum == null) { // if (guanzhunum == null) {
Log.e("TIAOSHI###", "关注数==null结束任务"); // Log.e("TIAOSHI###", "关注数==null结束任务");
ToastUtils.showShort("关注数==null结束任务"); // ToastUtils.showShort("关注数==null结束任务");
AblStepHandler.getInstance().setStop(true); // AblStepHandler.getInstance().setStop(true);
// AblViewUtil.onMessage("停止"); // // AblViewUtil.onMessage("停止");
return; // return;
} // }
Log.e("TIAOSHI###", "获得的关注数==" + guanzhunum); // Log.e("TIAOSHI###", "获得的关注数==" + guanzhunum);
int num = Integer.parseInt(guanzhunum); //
Log.e("TIAOSHI###", "关注数" + num); // if (guanzhunum.contains("w")) {
numb = Integer.parseInt(ChangLiang.minthrthr) - Integer.parseInt(ChangLiang.passnumber); // String substring = guanzhunum.substring(0, guanzhunum.indexOf("w"));
if (num <= Integer.parseInt(ChangLiang.minthrthr) - Integer.parseInt(ChangLiang.passnumber)) { // double personmun = Double.parseDouble(substring) * 10000;
Log.e("TIAOSHI###", "关注数小于等于设定的取关数结束任务"); // num= new Double(personmun).intValue();
ToastUtils.showShort("关注数小于等于设定的取关数结束任务"); // }else {
AblStepHandler.getInstance().setStop(true); // num = Integer.parseInt(guanzhunum);
// AblViewUtil.onMessage("停止"); // }
return; // Log.e("TIAOSHI###", "关注数" + num);
} // numb = Integer.parseInt(ChangLiang.minthrthr) - Integer.parseInt(ChangLiang.passnumber);
// if (num <= Integer.parseInt(ChangLiang.minthrthr) - Integer.parseInt(ChangLiang.passnumber)) {
// Log.e("TIAOSHI###", "关注数小于等于设定的取关数结束任务");
// ToastUtils.showShort("关注数小于等于设定的取关数结束任务");
// AblStepHandler.getInstance().setStop(true);
// // AblViewUtil.onMessage("停止");
// return;
// }
//点击进入用户关注页 //点击进入用户关注页
AblViewUtil.mySleep(2); AblViewUtil.mySleep(2);
AblService.getInstance().clickcommontwo(child3, "进入用户关注页"); AblService.getInstance().clickPoint(653, 464, 300);
// AblService.getInstance().clickcommontwo(child3, "进入用户关注页");
AblStepHandler.sendMsg(AblSteps.STEP_13); AblStepHandler.sendMsg(AblSteps.STEP_13);
break; break;
case AblSteps.STEP_13: case AblSteps.STEP_13:
@@ -83,7 +93,14 @@ public class TestAblStep6 extends BaseAblStep {
String[] all = num1.split(" "); String[] all = num1.split(" ");
String num22 = all[1]; String num22 = all[1];
Log.e("TIAOSHI###", "获得的关注数==" + num22); Log.e("TIAOSHI###", "获得的关注数==" + num22);
int num2 = Integer.parseInt(num22); if (num22.contains("W")) {
String substring = num22.substring(0, num22.indexOf("W"));
double personmun = Double.parseDouble(substring) * 10000;
num2= new Double(personmun).intValue();
}else {
num2 = Integer.parseInt(num22);
}
if (num2 > numb) { if (num2 > numb) {
// AblViewUtil.mySleep(1); // AblViewUtil.mySleep(1);
cancelGuanzhu(AblService.getInstance()); cancelGuanzhu(AblService.getInstance());
@@ -194,12 +211,16 @@ public class TestAblStep6 extends BaseAblStep {
// nodeZuobiao(child2); // nodeZuobiao(child2);
for (int x = 0; x < child2.getChildCount(); x++) { for (int x = 0; x < child2.getChildCount(); x++) {
AccessibilityNodeInfo child3 = child2.getChild(x); AccessibilityNodeInfo child3 = child2.getChild(x);
// Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription()); Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription());
// nodeZuobiao(child3); // nodeZuobiao(child3);
for (int r = 0; r < child3.getChildCount(); r++) { for (int r = 0; r < child3.getChildCount(); r++) {
AccessibilityNodeInfo child4 = child3.getChild(r); AccessibilityNodeInfo child4 = child3.getChild(r);
// Log.e("TIAOSHI###", "----5Node:" + child4.getClassName() + ":" + child4.getText()+ ":" + child4.getContentDescription()); Log.e("TIAOSHI###", "----5Node:" + child4.getClassName() + ":" + child4.getText()+ ":" + child4.getContentDescription());
// nodeZuobiao(child4); // nodeZuobiao(child4);
// Rect rect = new Rect();
// if(child4!=null) {
// child4.getBoundsInScreen(rect);
// if (rect.top <= 2100) {
for (int m = 0; m < child4.getChildCount(); m++) { for (int m = 0; m < child4.getChildCount(); m++) {
AccessibilityNodeInfo child5 = child4.getChild(m); AccessibilityNodeInfo child5 = child4.getChild(m);
// Log.e("TIAOSHI###", "----6Node:" + child5.getClassName() + ":" + child5.getText()+ ":" + child5.getContentDescription()); // Log.e("TIAOSHI###", "----6Node:" + child5.getClassName() + ":" + child5.getText()+ ":" + child5.getContentDescription());
@@ -207,6 +228,8 @@ public class TestAblStep6 extends BaseAblStep {
yiguanzhu(child5); yiguanzhu(child5);
} }
} }
// }
// }
} }
} }
} }
@@ -235,12 +258,19 @@ public class TestAblStep6 extends BaseAblStep {
} }
if (child.getText() != null) { if (child.getText() != null) {
if (child.getText().toString().equals("已关注")) { if (child.getText().toString().equals("已关注")) {
// clickcommontwo(child, "已关注");
Rect rect = new Rect();
if(child!=null) {
child.getBoundsInScreen(rect);
if (rect.top <= 2100) {
clickcommontwo(child, "已关注"); clickcommontwo(child, "已关注");
} }
} }
} }
} }
} }
}
}
if (cancelcrosscor&&!cancelclosed) { if (cancelcrosscor&&!cancelclosed) {
Log.e("TIAOSHI###", "VVVVVVVVVVVVVVVVVVVVVV"); Log.e("TIAOSHI###", "VVVVVVVVVVVVVVVVVVVVVV");
@@ -257,7 +287,16 @@ public class TestAblStep6 extends BaseAblStep {
AblViewUtil.mySleep(1); AblViewUtil.mySleep(1);
if (childw.getText() != null) { if (childw.getText() != null) {
if (childw.getText().toString().equals("互相关注")) { if (childw.getText().toString().equals("互相关注")) {
// clickcommontwo(childw, "互相关注");
Rect rect = new Rect();
if(childw!=null) {
childw.getBoundsInScreen(rect);
if (rect.top <= 2100) {
clickcommontwo(childw, "互相关注"); clickcommontwo(childw, "互相关注");
}
}
AblViewUtil.mySleep(2); AblViewUtil.mySleep(2);
AccessibilityNodeInfo quxiao = AblViewUtil.findByText("取消关注", 1); AccessibilityNodeInfo quxiao = AblViewUtil.findByText("取消关注", 1);
clickcommontwo(quxiao, "取消关注"); clickcommontwo(quxiao, "取消关注");
@@ -353,23 +392,12 @@ public class TestAblStep6 extends BaseAblStep {
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow(); AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
for (int i = 0; i < root.getChildCount(); i++) { for (int i = 0; i < root.getChildCount(); i++) {
AccessibilityNodeInfo child = root.getChild(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());
for (int y = 0; y < child.getChildCount(); y++) { for (int y = 0; y < child.getChildCount(); y++) {
AccessibilityNodeInfo child1 = child.getChild(y); AccessibilityNodeInfo child1 = child.getChild(y);
if (child1 != null) { if (child1 != null) {
// Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription()); Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
if (child1.getText() != null) { if (child1.getText() != null) {
// if (child1.getText().equals("获赞")) {
// AccessibilityNodeInfo parent = child1.getParent();
// AccessibilityNodeInfo child3 = parent.getChild(1);
// if (child3.getText() != null) {
// Log.e("TIAOSHI###", "获得的获赞数==" + child3.getText().toString());
// huozannum = child3.getText().toString();
// if (child3.getText().toString().equals("-")) {
// Log.e("TIAOSHI###", "数据异常,停止服务。。。。。。。。。。。。");
// }
// }
// }
if (child1.getText().equals("关注")) { if (child1.getText().equals("关注")) {
AccessibilityNodeInfo parent = child1.getParent(); AccessibilityNodeInfo parent = child1.getParent();
child3 = parent.getChild(1); child3 = parent.getChild(1);
@@ -382,18 +410,6 @@ public class TestAblStep6 extends BaseAblStep {
} }
} }
} }
// if (child1.getText().equals("粉丝")) {
// AccessibilityNodeInfo parent = child1.getParent();
// AccessibilityNodeInfo child3 = parent.getChild(1);
// if (child3.getText() != null) {
// Log.e("TIAOSHI###", "获得的粉丝数==" + child3.getText().toString());
// fensinum = child3.getText().toString();
// if (child3.getText().toString().equals("-")) {
// Log.e("TIAOSHI###", "数据异常,停止服务。。。。。。。。。。。。");
// }
// }
// return;
// }
} }
} }
} }

View File

@@ -136,8 +136,14 @@ public class TestAblStepXin5 extends BaseAblStep {
AblStepHandler.sendMsg(AblSteps.STEP_31); AblStepHandler.sendMsg(AblSteps.STEP_31);
return; return;
} }
//如果有查看详情,则滑动到下一个视频 boolean nodeInfoh = ifGaunzhu();
zhijieshanghua(); if(nodeInfoh){
Log.e("TIAOSHI###", "此视频没有关注过");
}else {
Log.e("TIAOSHI###", "此视频已关注");
AblStepHandler.sendMsg(AblSteps.STEP_31);
return;
}
} }
AblStepHandler.sendMsg(AblSteps.STEP_29); AblStepHandler.sendMsg(AblSteps.STEP_29);
@@ -664,65 +670,6 @@ public class TestAblStepXin5 extends BaseAblStep {
} }
/**
* 直接上滑
*/
private void zhijieshanghua() {
AccessibilityNodeInfo rootttt = AblService.getInstance().getRootInActiveWindow();
if (rootttt != null) {
for (int j = 0; j < rootttt.getChildCount(); j++) {
AccessibilityNodeInfo child = rootttt.getChild(j);
// Log.e("TIAOSHI###", "----1Node:" + child.getClassName() + ":" + child.getText());
//if ("dmt.viewpager.DmtViewPager$d".equals(child.getClassName())) {
// Log.e("TIAOSHI###ViewPager", "----2Node:" + child.getChildCount());
for (int y = 0; y < child.getChildCount(); y++) {
AccessibilityNodeInfo child1 = child.getChild(y);
// Log.e("TIAOSHI###", "----2Node:" + child1.getClassName() + ":" + child1.getText());
for (int x = 0; x < child1.getChildCount(); x++) {
AccessibilityNodeInfo child6 = child1.getChild(x);
// Log.e("TIAOSHI###", "----3Node:" + child6.getClassName() + ":" + child6.getText());
for (int z = 0; z < child6.getChildCount(); z++) {
AccessibilityNodeInfo child7 = child6.getChild(z);
// Log.e("TIAOSHI###", "----4Node:" + child7.getClassName() + ":" + child7.getText());
for (int r = 0; r < child7.getChildCount(); r++) {
AccessibilityNodeInfo child2 = child7.getChild(r);
// Log.e("TIAOSHI###", "----5Node:" + child2.getClassName() + ":" + child2.getText() + ":" + child2.getContentDescription());
for (int m = 0; m < child2.getChildCount(); m++) {
AccessibilityNodeInfo child3 = child2.getChild(m);
// Log.e("TIAOSHI###", "----6Node:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription());
for (int p = 0; p < child3.getChildCount(); p++) {
AccessibilityNodeInfo child9 = child3.getChild(p);
// Log.e("TIAOSHI###", "----7Node:" + child9.getClassName() + ":" + child9.getText() + ":" + child9.getContentDescription());
if (child9.getText() != null) {
if (child9.getText().toString().equals("查看详情")) {
//直接上滑
Log.e("TIAOSHI###", "有查看详情的广告,直接滑动到下一个视频");
// AblService.getInstance().randomSwipetwo();
// AblViewUtil.mySleep(5);
AblStepHandler.sendMsg(AblSteps.STEP_31);
return;
}
}
}
}
}
}
}
// }
}
}
} else {
Log.e("TIAOSHI###", "节点为null直接滑动到下一个视频");
AblStepHandler.sendMsg(AblSteps.STEP_31);
}
}
/** /**
* 抖音加粉托管账号每日数据统计 * 抖音加粉托管账号每日数据统计
* E/TIAOSHI###: 0取消关注 * E/TIAOSHI###: 0取消关注