From 42e16b69e4b272db0419f6c5bb32d7e48a3af56b Mon Sep 17 00:00:00 2001 From: jianbo <263303411@qq.com> Date: Tue, 26 Oct 2021 15:44:55 +0800 Subject: [PATCH] atom --- .../fisherbone/fuzhu/abllib/BaseAblStep.java | 21 ++++++ .../fisherbone/fuzhu/step/HongbaoBase.java | 65 +++++++++--------- .../fisherbone/fuzhu/step/TestAblStep0.java | 51 +++++++++++++- .../fisherbone/fuzhu/step/TestAblStep34.java | 3 +- .../fuzhu/step/TestAblStepXin5.java | 18 ++--- app/src/main/res/layout/activity_main.xml | 22 ++++++ app_config.gradle | 4 +- .../build/libs/arouter_compiler.jar | Bin 16243 -> 16243 bytes 测试问题 | 2 +- 9 files changed, 141 insertions(+), 45 deletions(-) diff --git a/app/src/main/java/com/fisherbone/fuzhu/abllib/BaseAblStep.java b/app/src/main/java/com/fisherbone/fuzhu/abllib/BaseAblStep.java index be31130..90cbfbe 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/abllib/BaseAblStep.java +++ b/app/src/main/java/com/fisherbone/fuzhu/abllib/BaseAblStep.java @@ -537,4 +537,25 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener { return flag; } + + /** + * 判断当前页面是否包含某文本 + */ + public AccessibilityNodeInfo isContainText(String str) { + AccessibilityNodeInfo nodeInfo = null; + List nodeInfos = AblViewUtil.findByText(str); + for (int i=0;i0&&rect.top>2000&&rect.top<=2210&&rect.bottom>0&&rect.bottom<=2210&&rect.right<1080) { + Log.e("TIAOSHI###", "----twoNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription()); + nodeZuobiao(child); + nodeInfo = child; + } + } + return nodeInfo; + } } diff --git a/app/src/main/java/com/fisherbone/fuzhu/step/HongbaoBase.java b/app/src/main/java/com/fisherbone/fuzhu/step/HongbaoBase.java index 2d95a6a..6e55fad 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/step/HongbaoBase.java +++ b/app/src/main/java/com/fisherbone/fuzhu/step/HongbaoBase.java @@ -131,35 +131,35 @@ class HongbaoBase extends BaseAblStep implements RedEnv.RedEnvFunc, RedEnv.TimeF * * @return */ - public AccessibilityNodeInfo getNodeInfoS() { - AccessibilityNodeInfo nodeinfo = null; - AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow(); - for (int i = 0; i < root.getChildCount(); i++) { - AccessibilityNodeInfo child = root.getChild(i); - // Log.e("TIAOSHI###", "one----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription()); - for (int y = 0; y < child.getChildCount(); y++) { - AccessibilityNodeInfo child1 = child.getChild(y); - // Log.e("TIAOSHI###", "one----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() + ":" + child2.getContentDescription()); -// nodeZuobiao(child2); - if (child2 != null) { - if ("android.widget.TextView".equals(child2.getClassName())) { - if (child2.getText() != null) { - if ("说点什么...".equals(child2.getText().toString())) { - nodeinfo = child2; - } - } - } - } - } - } - } - } - return nodeinfo; - } +// public AccessibilityNodeInfo getNodeInfoS() { +// AccessibilityNodeInfo nodeinfo = null; +// AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow(); +// for (int i = 0; i < root.getChildCount(); i++) { +// AccessibilityNodeInfo child = root.getChild(i); +// // Log.e("TIAOSHI###", "one----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription()); +// for (int y = 0; y < child.getChildCount(); y++) { +// AccessibilityNodeInfo child1 = child.getChild(y); +// // Log.e("TIAOSHI###", "one----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() + ":" + child2.getContentDescription()); +//// nodeZuobiao(child2); +// if (child2 != null) { +// if ("android.widget.TextView".equals(child2.getClassName())) { +// if (child2.getText() != null) { +// if ("说点什么...".equals(child2.getText().toString())) { +// nodeinfo = child2; +// } +// } +// } +// } +// } +// } +// } +// } +// return nodeinfo; +// } /** * 点击直播间下方的更多按钮(备注:通过搜索点击直播进去的可用) @@ -570,7 +570,9 @@ class HongbaoBase extends BaseAblStep implements RedEnv.RedEnvFunc, RedEnv.TimeF AblViewUtil.mySleep(5); enterOneNodeInfo(); AblViewUtil.mySleep(4); - AccessibilityNodeInfo nodeInfoS = getNodeInfoS(); + // AccessibilityNodeInfo nodeInfoS = getNodeInfoS(); + + AccessibilityNodeInfo nodeInfoS = isContainText("说点什么..."); if (nodeInfoS != null) { ifEnterOne = true; } @@ -891,7 +893,8 @@ class HongbaoBase extends BaseAblStep implements RedEnv.RedEnvFunc, RedEnv.TimeF } public boolean enterLivetwo() { boolean ifEnterOne = false; - AccessibilityNodeInfo nodeInfoS = getNodeInfoS(); + // AccessibilityNodeInfo nodeInfoS = getNodeInfoS(); + AccessibilityNodeInfo nodeInfoS = isContainText("说点什么..."); if (nodeInfoS != null) { ifEnterOne = true; } diff --git a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep0.java b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep0.java index 05e8f9d..f451ee7 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep0.java +++ b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep0.java @@ -50,8 +50,13 @@ public class TestAblStep0 extends BaseAblStep { // getNodeInfoh(); // cancelGuanzhu(AblService.getInstance()); - int randumInt40 = RandumInt.getRandumInt40(); - zhibodianzanc(randumInt40); + boolean nodeInfoh = ifGaunzhu(); + if(nodeInfoh){ + Log.e("TIAOSHI###", "此视频没有关注过"); + }else { + Log.e("TIAOSHI###", "此视频已关注"); + return; + } break; default: } @@ -329,6 +334,48 @@ public class TestAblStep0 extends BaseAblStep { } } + /** + * 是否关注过 (判断的准确率在百分之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; + } + } diff --git a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep34.java b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep34.java index c8e347a..d3d87fc 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep34.java +++ b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep34.java @@ -192,7 +192,8 @@ public class TestAblStep34 extends HongbaoBase implements RedEnv.RedEnvFunc, Red break; case AblSteps.STEP_254: - AccessibilityNodeInfo nodeInfoS = getNodeInfoS(); + //AccessibilityNodeInfo nodeInfoS = getNodeInfoS(); + AccessibilityNodeInfo nodeInfoS = isContainText("说点什么..."); if (nodeInfoS != null) { Log.e("TIAOSHI###", "页面在直播页面"); againStart("1"); diff --git a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStepXin5.java b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStepXin5.java index 79be3e8..eda0983 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStepXin5.java +++ b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStepXin5.java @@ -136,14 +136,14 @@ public class TestAblStepXin5 extends BaseAblStep { AblStepHandler.sendMsg(AblSteps.STEP_31); return; } - boolean nodeInfoh = ifGaunzhu(); - if(nodeInfoh){ - Log.e("TIAOSHI###", "此视频没有关注过"); - }else { - Log.e("TIAOSHI###", "此视频已关注"); - AblStepHandler.sendMsg(AblSteps.STEP_31); - return; - } +// boolean nodeInfoh = ifGaunzhu(); +// if(nodeInfoh){ +// Log.e("TIAOSHI###", "此视频没有关注过"); +// }else { +// Log.e("TIAOSHI###", "此视频已关注"); +// AblStepHandler.sendMsg(AblSteps.STEP_31); +// return; +// } } AblStepHandler.sendMsg(AblSteps.STEP_29); @@ -176,6 +176,8 @@ public class TestAblStepXin5 extends BaseAblStep { } else { ChangLiang.condition = "1"; } + }else { + ChangLiang.condition = "1"; } AblStepHandler.sendMsg(AblSteps.STEP_30); } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 09c81c6..b1018ac 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -390,7 +390,29 @@ /> + + + + + + + + + + diff --git a/app_config.gradle b/app_config.gradle index b607943..d9f6908 100644 --- a/app_config.gradle +++ b/app_config.gradle @@ -12,8 +12,8 @@ ext { applicationId : "com.fisherbone.fuzhu", minSdkVersion : 24, targetSdkVersion : 29, - versionCode : 171, - versionName : "1.7.1", + versionCode : 172, + versionName : "1.7.2", testInstrumentationRunner: "androidx.test.runner.AndroidJUnitRunner" ] diff --git a/arouter_compiler/build/libs/arouter_compiler.jar b/arouter_compiler/build/libs/arouter_compiler.jar index ccf93f4ddb7fde24f7e2f41b7915139c8dac89bf..756836bfe6e30b21e77caad46e4b3774b41423dc 100644 GIT binary patch delta 274 zcmexd_qmQIz?+$ci-CcIgJDtML>_gPGuui6Cz^XQ&nz>X*sKVqmTQ5jE7p8K!Qggb zuBMNo3=GnylRwC)Onz@IwmF>fwYH3|WeRr8u1+{lVhDY*WB=qFpkWK5l0VrrGUt0Dt>qf&c&j delta 274 zcmexd_qmQIz?+$ci-CcIgQ2r|B9A)DjcT*tiRPZnJhf&Mn-#&-axLafH5L=ESn~m? z;C5lIrjMcw4AQ2PKgg&|es3+dIh^sgC`ifTP;o{Oy*Waniv`ShD)WL9%($Qy!wX_e z);Dnk3ly6?X96=~&11og$$KsJ!7AQc_AzxfPp-Ez1v_T)4l6s5GbaDE(g)Mp))ruO zY1W=#dXsfLm=>`~1k)8Z>0tVi4Mg0<79zgF)*meX%Qgi}C)y>0>Em{`V4B@N2LQr; BW2688 diff --git a/测试问题 b/测试问题 index 80450ec..e9c0de3 100644 --- a/测试问题 +++ b/测试问题 @@ -10,5 +10,5 @@ 5.后台扫码24个手机,分组显示23个,但手机都可以自动运行 6.(群控)直播间加热,有个别手机进入不了直播间 - +---------------------------------------------------------------------------------------------------- 3.(群控)直播间加热,后台设置的话术不评论,还是之前的话术 (解决) \ No newline at end of file