This commit is contained in:
2021-10-19 11:26:35 +08:00
parent d556b49e68
commit f9543489d8
7 changed files with 225 additions and 34 deletions

Binary file not shown.

View File

@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":170,"versionName":"1.7.0","enabled":true,"outputFile":"atom-latest.apk","fullName":"release","baseName":"release"},"path":"atom-latest.apk","properties":{}}] [{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":171,"versionName":"1.7.1","enabled":true,"outputFile":"atom-latest.apk","fullName":"release","baseName":"release"},"path":"atom-latest.apk","properties":{}}]

View File

@@ -17,6 +17,10 @@ public class RandumInt {
return new Random().nextInt(15)+1; return new Random().nextInt(15)+1;
} }
public static int getRandumInt40(){ public static int getRandumInt40(){
return new Random().nextInt(95)+40; return new Random().nextInt(40)+40;
}
public static int getRandumInt10(){
return new Random().nextInt(15)+10;
} }
} }

View File

@@ -18,6 +18,7 @@ import com.fisherbone.fuzhu.abllib.AblService;
import com.fisherbone.fuzhu.abllib.AblStepHandler; import com.fisherbone.fuzhu.abllib.AblStepHandler;
import com.fisherbone.fuzhu.abllib.AblSteps; import com.fisherbone.fuzhu.abllib.AblSteps;
import com.fisherbone.fuzhu.abllib.BaseAblStep; import com.fisherbone.fuzhu.abllib.BaseAblStep;
import com.fisherbone.fuzhu.abllib.RandumInt;
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;
@@ -26,6 +27,7 @@ import com.google.gson.Gson;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Random;
/** /**
* 获得作品时间 * 获得作品时间
@@ -45,13 +47,43 @@ public class TestAblStep0 extends BaseAblStep {
break; break;
case AblSteps.STEP_2: case AblSteps.STEP_2:
AblViewUtil.mySleep(5); AblViewUtil.mySleep(5);
getNodeInfoh(); // getNodeInfoh();
// cancelGuanzhu(AblService.getInstance()); // cancelGuanzhu(AblService.getInstance());
int randumInt40 = RandumInt.getRandumInt40();
zhibodianzanc(randumInt40);
break; break;
default: default:
} }
} }
/**
* 直播间点赞
*100-300
* @param mun
*/
public void zhibodianzanc(int mun) {
// for (int i = 0; i < mun; i++) {
// int a = 640 + RandumInt.getRandumInt4() * 30;
// int b = 490;
// int c = 200 - RandumInt.getRandumInt4() * 20;
// AblService.getInstance().clickPoint(a, b, 100);
// try {
// //隔200 ms
// Thread.sleep(c);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// }
Random r = new Random();
for (int i = 0; i < 10; i++) {
//r.nextInt(n) n为几 就产生0~n-1的随机数
int num = r.nextInt(2)+1;
// System.out.print(num+"\t");
Log.e("TIAOSHI###", num+"");
}
}
/** /**
* 发送节点 * 发送节点
* @return * @return
@@ -191,10 +223,14 @@ public class TestAblStep0 extends BaseAblStep {
if("android.widget.RelativeLayout".equals(child3.getClassName())) { if("android.widget.RelativeLayout".equals(child3.getClassName())) {
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);
if("android.widget.FrameLayout".equals(child4.getClassName())) {
Log.e("TIAOSHI###", "----5Node:" + child4.getClassName() + ":" + child4.getText() + ":" + child4.getContentDescription()); Log.e("TIAOSHI###", "----5Node:" + child4.getClassName() + ":" + child4.getText() + ":" + child4.getContentDescription());
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());
for (int p = 0; p < child5.getChildCount(); p++) {
AccessibilityNodeInfo child6 = child5.getChild(p);
Log.e("TIAOSHI###", "----7Node:" + child6.getClassName() + ":" + child6.getText() + ":" + child6.getContentDescription());
// nodeZuobiao(child5); // nodeZuobiao(child5);
// yiguanzhu(child5); // yiguanzhu(child5);
} }
@@ -205,6 +241,8 @@ public class TestAblStep0 extends BaseAblStep {
} }
} }
} }
}
}
// 3.遍历info中的子节点 (优化方法,正在测试) // 3.遍历info中的子节点 (优化方法,正在测试)
public void yiguanzhu(AccessibilityNodeInfo child2) { public void yiguanzhu(AccessibilityNodeInfo child2) {

View File

@@ -115,16 +115,10 @@ public class TestAblStep30 extends NoticeBase {
case AblSteps.STEP_214: case AblSteps.STEP_214:
AblViewUtil.mySleep(1); AblViewUtil.mySleep(1);
if(liveBean.getSwitchtwo()) { if(liveBean.getSwitchtwo()) {
//直播间点赞 //每次点赞次数40-80次
if ("3".equals(ChangLiang.phonetype)) { //每个功能间隔时间随机在5到15s之间
//每秒点赞4-9次 每次点赞10-15秒
//点赞次数40-145次
int randumInt40 = RandumInt.getRandumInt40(); int randumInt40 = RandumInt.getRandumInt40();
zhibodianzanc(randumInt40); zhibodianzanc(randumInt40);
} else {
int randumInt40 = RandumInt.getRandumInt40();
zhibodianzan(randumInt40);
}
} }
AblViewUtil.mySleep(2); AblViewUtil.mySleep(2);
AblStepHandler.sendMsg(AblSteps.STEP_215); AblStepHandler.sendMsg(AblSteps.STEP_215);
@@ -135,7 +129,9 @@ public class TestAblStep30 extends NoticeBase {
String conment = getConment(); String conment = getConment();
//直播间发送评论 //直播间发送评论
fasongpinglun(conment); fasongpinglun(conment);
AblViewUtil.mySleep(5);
int randumInt10 = RandumInt.getRandumInt10();
AblViewUtil.mySleep(randumInt10);
} }
AblStepHandler.sendMsg(AblSteps.STEP_216); AblStepHandler.sendMsg(AblSteps.STEP_216);
//AblStepHandler.sendMsg(AblSteps.STEP_217); //AblStepHandler.sendMsg(AblSteps.STEP_217);
@@ -191,6 +187,9 @@ public class TestAblStep30 extends NoticeBase {
} }
} }
// AblStepHandler.sendMsg(AblSteps.STEP_217); // AblStepHandler.sendMsg(AblSteps.STEP_217);
int randumInt10 = RandumInt.getRandumInt10();
AblViewUtil.mySleep(randumInt10);
AblStepHandler.sendMsg(AblSteps.STEP_214); AblStepHandler.sendMsg(AblSteps.STEP_214);
break; break;
case AblSteps.STEP_217: case AblSteps.STEP_217:
@@ -537,6 +536,9 @@ public class TestAblStep30 extends NoticeBase {
* @param mun * @param mun
*/ */
public void zhibodianzanc(int mun) { public void zhibodianzanc(int mun) {
Random r = new Random();
int num = r.nextInt(2)+1;
if(num==1) {
for (int i = 0; i < mun; i++) { for (int i = 0; i < mun; i++) {
int a = 540 + RandumInt.getRandumInt4() * 10; int a = 540 + RandumInt.getRandumInt4() * 10;
int b = 500 - RandumInt.getRandumInt4() * 12; int b = 500 - RandumInt.getRandumInt4() * 12;
@@ -549,6 +551,21 @@ public class TestAblStep30 extends NoticeBase {
e.printStackTrace(); e.printStackTrace();
} }
} }
}else {
for (int i = 0; i < mun; i++) {
int a = 640 + RandumInt.getRandumInt4() * 30;
int b = 490;
int c = 200 - RandumInt.getRandumInt4() * 20;
AblService.getInstance().clickPoint(a, b, 100);
try {
//隔200 ms
Thread.sleep(c);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
} }

View File

@@ -229,6 +229,132 @@ public class TestAblStep6 extends BaseAblStep {
} }
} }
// private void cancelGuanzhu(AblService instance) {
// 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);
// if ("android.widget.RelativeLayout".equals(child3.getClassName())) {
// for (int r = 0; r < child3.getChildCount(); r++) {
// AccessibilityNodeInfo child4 = child3.getChild(r);
// if ("android.widget.FrameLayout".equals(child4.getClassName())) {
// 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());
// for (int p = 0; p < child5.getChildCount(); p++) {
// AccessibilityNodeInfo child6 = child5.getChild(p);
// Log.e("TIAOSHI###", "----7Node:" + child6.getClassName() + ":" + child6.getText() + ":" + child6.getContentDescription());
// nodeZuobiao(child5);
// yiguanzhutwo(child6);
// }
// }
// }
// }
// }
// }
// }
// }
// }
// }
// 3.遍历info中的子节点 (优化方法,正在测试)
public void yiguanzhutwo(AccessibilityNodeInfo child2) {
boolean cancelclosed = ProfileSpUtils.getInstance().getCan().getCancelclosed();
boolean cancelcrosscor = ProfileSpUtils.getInstance().getCan().getCancelcrosscor();
if (cancelclosed && !cancelcrosscor) {
Log.e("TIAOSHI###", "QQQQQQQQQQQQQQQQQQ");
try {
Thread.sleep(300);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (child2.getText() != null) {
if (child2.getText().toString().equals("已关注")) {
Rect rect = new Rect();
if (child2 != null) {
child2.getBoundsInScreen(rect);
if (rect.top <= 2100) {
clickcommontwo(child2, "已关注");
}
}
}
}
}
if (cancelcrosscor && !cancelclosed) {
Log.e("TIAOSHI###", "VVVVVVVVVVVVVVVVVVVVVV");
AblViewUtil.mySleep(1);
if (child2.getText() != null) {
if (child2.getText().toString().equals("互相关注")) {
Rect rect = new Rect();
if (child2 != null) {
child2.getBoundsInScreen(rect);
if (rect.top <= 2100) {
clickcommontwo(child2, "互相关注");
AblViewUtil.mySleep(2);
//(0,1868),(1080,2028)
AblService.getInstance().clickPoint(720, 1948, 300);
// AccessibilityNodeInfo quxiao = AblViewUtil.findByText("取消关注", 1);
// clickcommontwo(quxiao, "取消关注");
AblViewUtil.mySleep(1);
}
}
}
}
}
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);
}
}
}
}
}
}
// 3.遍历info中的子节点 (优化方法,正在测试) // 3.遍历info中的子节点 (优化方法,正在测试)
public void yiguanzhu(AccessibilityNodeInfo child2) { public void yiguanzhu(AccessibilityNodeInfo child2) {
boolean cancelclosed = ProfileSpUtils.getInstance().getCan().getCancelclosed(); boolean cancelclosed = ProfileSpUtils.getInstance().getCan().getCancelclosed();
@@ -286,13 +412,19 @@ public class TestAblStep6 extends BaseAblStep {
childw.getBoundsInScreen(rect); childw.getBoundsInScreen(rect);
if (rect.top <= 2100) { if (rect.top <= 2100) {
clickcommontwo(childw, "互相关注"); clickcommontwo(childw, "互相关注");
}
}
AblViewUtil.mySleep(2); AblViewUtil.mySleep(2);
AccessibilityNodeInfo quxiao = AblViewUtil.findByText("取消关注", 1); List<AccessibilityNodeInfo> liats = AblViewUtil.findByText("取消关注");
clickcommontwo(quxiao, "取消关注"); if(liats.size()>0) {
AblService.getInstance().clickPoint(720, 1948, 300);
AblViewUtil.mySleep(1);
}
}
}
// AblViewUtil.mySleep(2);
// AccessibilityNodeInfo quxiao = AblViewUtil.findByText("取消关注", 1);
// clickcommontwo(quxiao, "取消关注");
} }
} }

View File

@@ -12,8 +12,8 @@ ext {
applicationId : "com.fisherbone.fuzhu", applicationId : "com.fisherbone.fuzhu",
minSdkVersion : 24, minSdkVersion : 24,
targetSdkVersion : 29, targetSdkVersion : 29,
versionCode : 170, versionCode : 171,
versionName : "1.7.0", versionName : "1.7.1",
testInstrumentationRunner: "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner: "androidx.test.runner.AndroidJUnitRunner"
] ]