指定抖音号点赞评论
This commit is contained in:
15
app/src/main/java/com/derry/wechat/debug/BuildConfig.java
Normal file
15
app/src/main/java/com/derry/wechat/debug/BuildConfig.java
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Automatically generated file. DO NOT MODIFY
|
||||
*/
|
||||
package com.derry.wechat.debug;
|
||||
|
||||
public final class BuildConfig {
|
||||
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
||||
public static final String APPLICATION_ID = "com.derry.wechat.debug";
|
||||
public static final String BUILD_TYPE = "debug";
|
||||
public static final String FLAVOR = "";
|
||||
public static final int VERSION_CODE = 181;
|
||||
public static final String VERSION_NAME = "1.8.1";
|
||||
// Fields from default config.
|
||||
public static final boolean isRelease = false;
|
||||
}
|
||||
@@ -417,6 +417,14 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "3":
|
||||
if ("android.widget.TextView".equals(child3.getClassName())){
|
||||
if (child3.getText() != null) {
|
||||
if (child3.getText().toString().equals("综合")) {
|
||||
AblService.getInstance().clickcommontwo(child3,"");
|
||||
}
|
||||
}
|
||||
}
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.fisherbone.fuzhu.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.accessibilityservice.AccessibilityServiceInfo;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.content.ComponentName;
|
||||
@@ -24,7 +25,7 @@ import android.widget.TextView;
|
||||
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.fisherbone.fuzhu.BaseActivity;
|
||||
import com.fisherbone.fuzhu.BuildConfig;
|
||||
import com.derry.wechat.debug.BuildConfig;
|
||||
import com.fisherbone.fuzhu.ChangLiang;
|
||||
import com.fisherbone.fuzhu.FZConfig;
|
||||
import com.fisherbone.fuzhu.FuzhuApplication;
|
||||
@@ -170,6 +171,7 @@ public class MainActivity extends BaseActivity implements InfoMessage {
|
||||
private TextView tvShowInfo, tvStutas,yunduanStu,tv_ifcunzai;
|
||||
private ZhanghaoDao zhanghaoDao;
|
||||
|
||||
@SuppressLint("ObsoleteSdkInt")
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
@@ -60,6 +60,7 @@ class NoticeBase extends BaseAblStep {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean allowed() {
|
||||
boolean ifOpen = false;
|
||||
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
|
||||
@@ -487,6 +488,7 @@ class NoticeBase extends BaseAblStep {
|
||||
}
|
||||
}
|
||||
//点击右上角搜索
|
||||
@Override
|
||||
public void DianSou() {
|
||||
//华为畅享20
|
||||
AblService.getInstance().clickPoint(990, 163, 300);
|
||||
|
||||
@@ -205,6 +205,7 @@ public class TestAblStep2 extends BaseAblStep {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean allowed() {
|
||||
boolean ifOpen = false;
|
||||
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
|
||||
|
||||
@@ -499,6 +499,7 @@ public class TestAblStep30 extends NoticeBase {
|
||||
/**
|
||||
* 判断当前页面是否包含某文本
|
||||
*/
|
||||
@Override
|
||||
public AccessibilityNodeInfo isContainText(String str) {
|
||||
AccessibilityNodeInfo nodeInfo = null;
|
||||
List<AccessibilityNodeInfo> nodeInfos = AblViewUtil.findByText(str);
|
||||
|
||||
@@ -6,14 +6,19 @@ import android.util.Log;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
|
||||
import com.fisherbone.fuzhu.ChangLiang;
|
||||
import com.fisherbone.fuzhu.FuzhuApplication;
|
||||
import com.fisherbone.fuzhu.abllib.AblService;
|
||||
import com.fisherbone.fuzhu.abllib.AblStepHandler;
|
||||
import com.fisherbone.fuzhu.abllib.AblSteps;
|
||||
import com.fisherbone.fuzhu.abllib.utils.AblViewUtil;
|
||||
import com.fisherbone.fuzhu.db.CommentBeanData;
|
||||
import com.fisherbone.fuzhu.db.dao.CommentDao;
|
||||
import com.fisherbone.fuzhu.entity.AppoBean;
|
||||
import com.fisherbone.fuzhu.utils.ProfileSpUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @author keriezhang
|
||||
@@ -68,12 +73,12 @@ public class TestAblStep32 extends NoticeBase {
|
||||
// AccessibilityNodeInfo getdaohang = getdaohang();
|
||||
// //触发容器元素的滚动事件
|
||||
// getdaohang.performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
|
||||
AblViewUtil.mySleep(1);
|
||||
//1为用户 2为直播
|
||||
//AblViewUtil.mySleep(1);
|
||||
//1为用户 2为直播 3为综合
|
||||
selecttype("1");
|
||||
AblViewUtil.mySleep(3);
|
||||
getNodeInfoy();
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_234);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_235);
|
||||
break;
|
||||
case AblSteps.STEP_234:
|
||||
AblViewUtil.mySleep(2);
|
||||
@@ -85,6 +90,20 @@ public class TestAblStep32 extends NoticeBase {
|
||||
//搜索下一个
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_232);
|
||||
break;
|
||||
case AblSteps.STEP_235:
|
||||
AblViewUtil.mySleep(1);
|
||||
selecttype("3");
|
||||
AblViewUtil.mySleep(1);
|
||||
AblService.getInstance().clickPoint(256,1198,300);
|
||||
AblViewUtil.mySleep(3);
|
||||
AblService.getInstance().clickPoint(999,1261,300);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_236);
|
||||
break;
|
||||
case AblSteps.STEP_236:
|
||||
AblViewUtil.mySleep(2);
|
||||
pinglun();
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_234);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
@@ -150,6 +169,148 @@ public class TestAblStep32 extends NoticeBase {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void pinglun() {
|
||||
|
||||
AblViewUtil.mySleep(2);
|
||||
commentClick(AblService.getInstance());
|
||||
AblViewUtil.mySleep(3);
|
||||
if (ChangLiang.phonetype.equals("0")) {
|
||||
//红米7a
|
||||
AblService.getInstance().clickPoint(153, 1292, 300);
|
||||
} else if ("3".equals(ChangLiang.phonetype)) {
|
||||
//红米9a
|
||||
AblService.getInstance().clickPoint(288, 2121, 300);
|
||||
} else {
|
||||
//华为
|
||||
AblService.getInstance().clickPoint(288, 1548, 300);
|
||||
}
|
||||
AblViewUtil.mySleep(2);
|
||||
//复制文本粘贴在留言板
|
||||
AccessibilityNodeInfo findcomentt = findcoment();
|
||||
String conment = getConment();
|
||||
Log.e("TIAOSHI###", "获得的评论内容" + conment);
|
||||
AblViewUtil.mySleep(1);
|
||||
Log.e("TIAOSHI###", "获得的评论内容" + conment);
|
||||
if (findcomentt != null) {
|
||||
if (ChangLiang.phonetype.equals("0")) {
|
||||
Log.e("TIAOSHI###", "获得手机类型" + ChangLiang.phonetype);
|
||||
//郝总的手机用第一个评论不上去
|
||||
// AblViewUtil.paste(findcomentt, conment);//红米7a
|
||||
AblViewUtil.sayInput(conment, findcomentt);
|
||||
} else {
|
||||
Log.e("TIAOSHI###", "获得手机类型" + ChangLiang.phonetype);
|
||||
AblViewUtil.sayInput(conment, findcomentt);//华为畅享20
|
||||
}
|
||||
}
|
||||
//发送
|
||||
AblViewUtil.mySleep(2);
|
||||
AccessibilityNodeInfo findcomenttt = findcomentt();
|
||||
if (findcomenttt != null) {
|
||||
AblService.getInstance().clickcommontwo(findcomenttt, "发送");
|
||||
AblViewUtil.mySleep(2);
|
||||
}
|
||||
//返回上级页面
|
||||
AblViewUtil.back();
|
||||
}
|
||||
/**
|
||||
* 随机获取评论话术
|
||||
*/
|
||||
private String getConment() {
|
||||
CommentDao commentDao = new CommentDao(FuzhuApplication.getContext());
|
||||
List<CommentBeanData> CommentBeanDatas = CommentDao.queryInByCustom("type", "1");
|
||||
if (CommentBeanDatas.size() == 0) {
|
||||
return "哈哈";
|
||||
} else if (CommentBeanDatas.size() == 1) {
|
||||
CommentBeanData commentBeanData = CommentBeanDatas.get(0);
|
||||
String comment = commentBeanData.getComment();
|
||||
return comment;
|
||||
} else {
|
||||
int i = new Random().nextInt(CommentBeanDatas.size() - 1);
|
||||
CommentBeanData commentBeanData = CommentBeanDatas.get(i);
|
||||
String comment = commentBeanData.getComment();
|
||||
return comment;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 点击评论
|
||||
*
|
||||
* @param instance
|
||||
*/
|
||||
private void commentClick(AblService instance) {
|
||||
if (ChangLiang.phonetype.equals("0")) {
|
||||
instance.clickPoint(659, 810, 300);//红米7a
|
||||
} else if ("3".equals(ChangLiang.phonetype)) {
|
||||
//红米9a
|
||||
AblService.getInstance().clickPoint(996, 1469, 300);
|
||||
} else {
|
||||
instance.clickPoint(659, 1066, 300);//华为畅享20 3.评论 [619,1026][699,1106]
|
||||
}
|
||||
Log.e("TIAOSHI###", "点击评论按钮");
|
||||
}
|
||||
/**
|
||||
* 寻找留下你的精彩评论
|
||||
*/
|
||||
private AccessibilityNodeInfo findcoment() {
|
||||
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 (!"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());
|
||||
// if ("android.widget.LinearLayout".equals(child1.getClassName())) {
|
||||
for (int x = 0; x < child1.getChildCount(); x++) {
|
||||
AccessibilityNodeInfo child6 = child1.getChild(x);
|
||||
// Log.e("TIAOSHI###", "----3Node:" + child6.getClassName() + ":" + child6.getText());
|
||||
if ("android.widget.EditText".equals(child6.getClassName())) {
|
||||
infooos = child1.getChild(x);
|
||||
// Log.e("TIAOSHI###", "----4Node:" + infooos.getClassName() + ":" + infooos.getText());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return infooos;
|
||||
}
|
||||
/**
|
||||
* 寻找发送
|
||||
*/
|
||||
private AccessibilityNodeInfo findcomentt() {
|
||||
AccessibilityNodeInfo child3 = null;
|
||||
ArrayList<AccessibilityNodeInfo> objects = new ArrayList<>();
|
||||
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 (!"dmt.viewpager.DmtViewPager$d".equals(child.getClassName())) {
|
||||
// Log.e("TIAOSHI###ViewPager", "----2Node:" + child.getChildCount());
|
||||
for (int y = 0; y < child.getChildCount(); y++) {
|
||||
AccessibilityNodeInfo child2 = child.getChild(y);
|
||||
// Log.e("TIAOSHI###", "----2Node:" + child2.getClassName() + ":" + child2.getText());
|
||||
|
||||
for (int x = 0; x < child2.getChildCount(); x++) {
|
||||
AccessibilityNodeInfo child1 = child2.getChild(x);
|
||||
// Log.e("TIAOSHI###", "----3Node:" + child1.getClassName() + ":" + child1.getText());
|
||||
|
||||
if ("android.widget.ImageView".equals(child2.getChild(x).getClassName())) {
|
||||
AccessibilityNodeInfo infooos = child2.getChild(x);
|
||||
objects.add(infooos);
|
||||
}
|
||||
}
|
||||
// Log.e("TIAOSHI###", "----4Node:" + objects.size());
|
||||
if (objects.size() > 0) {
|
||||
child3 = objects.get(objects.size() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return child3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -231,6 +231,7 @@ public class TestAblStep34 extends HongbaoBase implements RedEnv.RedEnvFunc, Red
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean allowed() {
|
||||
boolean ifOpen = false;
|
||||
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
|
||||
|
||||
@@ -434,6 +434,7 @@ public class TestAblStepBase extends BaseAblStep {
|
||||
|
||||
//点击右上角搜索
|
||||
//[624,67][688,131]
|
||||
@Override
|
||||
public void DianSou() {
|
||||
|
||||
if (ChangLiang.phonetype.equals("0")) {
|
||||
|
||||
@@ -28,17 +28,17 @@
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@mipmap/icon_recfllow"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/btn_01"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="14dp"
|
||||
android:text="推荐加关"
|
||||
android:textColor="#ffffffff"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_below="@+id/icon_pic"
|
||||
android:textSize="10sp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_01"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_below="@+id/icon_pic"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="推荐加关"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp" />
|
||||
</RelativeLayout>
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_02"
|
||||
@@ -309,19 +309,18 @@
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@mipmap/icon_keyword"
|
||||
/>
|
||||
android:background="@mipmap/icon_keyword" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_011"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="14dp"
|
||||
android:text="指定直播间加关"
|
||||
android:textColor="#ffffffff"
|
||||
android:layout_below="@+id/icon_pic11"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_below="@+id/icon_pic11"
|
||||
android:textSize="10sp"
|
||||
/>
|
||||
android:text="指定直播间加关"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp" />
|
||||
</RelativeLayout>
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_12"
|
||||
|
||||
Reference in New Issue
Block a user