diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 8f32900..2fbfd9c 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -5,14 +5,14 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index dbf0c76..22956b0 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -4,7 +4,7 @@
-
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..6560a98
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 892046b..d804014 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,6 +1,17 @@
-
+
+
+
+
+
+
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
deleted file mode 100644
index 7f68460..0000000
--- a/.idea/runConfigurations.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 10e2eda..847c853 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -86,6 +86,10 @@ this.android.sourceSets {
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'com.google.android.material:material:1.3.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
+ implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
// 循环引入第三方库
app_dependencies.each {k, v ->
@@ -129,4 +133,3 @@ dependencies {
}
}
-
diff --git a/app/fuzhu.jks b/app/fuzhu.jks
deleted file mode 100644
index 5c1d6f4..0000000
Binary files a/app/fuzhu.jks and /dev/null differ
diff --git a/app/release/atom-latest.apk b/app/release/atom-latest.apk
deleted file mode 100644
index d83a047..0000000
Binary files a/app/release/atom-latest.apk and /dev/null differ
diff --git a/app/release/output.json b/app/release/output.json
deleted file mode 100644
index 86eb96e..0000000
--- a/app/release/output.json
+++ /dev/null
@@ -1 +0,0 @@
-[{"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":{}}]
\ No newline at end of file
diff --git a/app/src/androidTest/java/com/xiangxue/new_modular_customarouter/test2.java b/app/src/androidTest/java/com/xiangxue/new_modular_customarouter/test2.java
index 328649e..388065d 100644
--- a/app/src/androidTest/java/com/xiangxue/new_modular_customarouter/test2.java
+++ b/app/src/androidTest/java/com/xiangxue/new_modular_customarouter/test2.java
@@ -22,9 +22,8 @@ public class test2 {
@Test
public void onCreate() {
- int i = Integer.parseInt("0");
- Log.e("TIAOSHI###", i+"");
- // gaizaotime("关注 389");
+
+ gaizaotime("关注 389");
}
private void gaizaotime(String end_time) {
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 759bad7..db8d47f 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -2,7 +2,9 @@
+
+
@@ -55,9 +57,11 @@
-
-
-
-
-
-
-
+
+
+
+
@@ -101,7 +106,9 @@
android:name=".activity.PublishActivity"
android:theme="@style/ActivityDialog" />
-
+
@@ -122,7 +129,6 @@
-
CommentBeanDatas = commentDao.queryInByCustom("type", "3");
+ 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;
+ }
+ }
}
diff --git a/app/src/main/java/com/fisherbone/fuzhu/abllib/AblSteps.java b/app/src/main/java/com/fisherbone/fuzhu/abllib/AblSteps.java
index 3092b08..ac97c85 100644
--- a/app/src/main/java/com/fisherbone/fuzhu/abllib/AblSteps.java
+++ b/app/src/main/java/com/fisherbone/fuzhu/abllib/AblSteps.java
@@ -302,9 +302,7 @@ public class AblSteps {
public final static int STEP_257 = 257;
public final static int STEP_258 = 258;
public final static int STEP_259 = 259;
-
-
- /*****************************************/
+ /**************************************/
public final static int STEP_260 = 260;
public final static int STEP_261 = 261;
public final static int STEP_262 = 262;
@@ -313,6 +311,6 @@ public class AblSteps {
public final static int STEP_265 = 265;
public final static int STEP_266 = 266;
public final static int STEP_267 = 267;
- public final static int STEP_268 = 268;
- public final static int STEP_269 = 269;
+
+
}
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..e10ca27 100644
--- a/app/src/main/java/com/fisherbone/fuzhu/abllib/BaseAblStep.java
+++ b/app/src/main/java/com/fisherbone/fuzhu/abllib/BaseAblStep.java
@@ -9,10 +9,8 @@ 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;
@@ -31,62 +29,25 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
* 点击我的
*/
@RequiresApi(api = Build.VERSION_CODES.N)
- public void myClick() {
+ public void myClick(){
AblService instance = AblService.getInstance();
- if (ChangLiang.phonetype.equals("0")) {
- instance.clickPoint(648, 1286, 300);//红米7a
- } else if (ChangLiang.phonetype.equals("3")) {
+ if(ChangLiang.phonetype.equals("0")){
+ instance.clickPoint(648,1286, 300);//红米7a
+ }else if(ChangLiang.phonetype.equals("3")){
AblViewUtil.mySleep(6);
AblService.getInstance().clickPoint(972, 2103, 300);
- } else {
- instance.clickPoint(648, 1536, 300);//华为畅享20 [632,1521][664,1552]
+ }
+ else {
+ instance.clickPoint(648,1536, 300);//华为畅享20 [632,1521][664,1552]
}
Log.e("TIAOSHI###", "点击了我按钮");
}
- public void DianSou() {
-
- //华为畅享20
- AblService.getInstance().clickPoint(990, 163, 300);
- switch (ChangLiang.phonetype) {
- case "0":
- //红米7a
- AblService.getInstance().clickPoint(656, 99, 300);
- break;
- case "1":
- //华为畅享20
- AblService.getInstance().clickPoint(659, 99, 300);
- break;
- case "2":
- //华为畅享20
- AblService.getInstance().clickPoint(990, 163, 300);
- break;
- case "3":
- //note9
- AblService.getInstance().clickPoint(990, 163, 300);
- break;
- default:
- }
- 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);
- }
/**
* 查看节点的坐标点
*/
- public void nodeZuobiao(AccessibilityNodeInfo nodeinfo) {
+ public void nodeZuobiao(AccessibilityNodeInfo nodeinfo){
Rect rect = new Rect();
nodeinfo.getBoundsInScreen(rect);
Log.e("TIAOSHI###", "----显示节点的坐标:" + "(" + rect.left + "," + rect.top + ")" + "," + "(" + rect.right + "," + rect.bottom + ")");
@@ -96,7 +57,7 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
/**
* 查看节点的坐标点
*/
- public void nodeZuobiaoii(AccessibilityNodeInfo nodeinfo) {
+ public void nodeZuobiaoii(AccessibilityNodeInfo nodeinfo){
Rect rect = new Rect();
nodeinfo.getBoundsInScreen(rect);
Log.e("TIAOSHI###", "----显示控件点击的坐标:" + "(" + rect.left + "," + rect.top + ")" + "," + "(" + rect.right + "," + rect.bottom + ")");
@@ -119,16 +80,15 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
/**
* 关闭青少年保护弹框
- *
* @param instance
*/
public void closedQDialog(AblService instance) {
//处理我知道了的弹框
AccessibilityNodeInfo zhidao = AblViewUtil.findByText("我知道了", 0);
- if (zhidao == null) {
- Log.e("TIAOSHI###", "没有找到我知道了的弹窗");
- } else {
- Log.e("TIAOSHI###", "弹出了我知道了的弹窗");
+ if(zhidao==null){
+ Log.e("TIAOSHI###", "没有找到我知道了的弹窗" );
+ }else {
+ Log.e("TIAOSHI###", "弹出了我知道了的弹窗" );
AblService.getInstance().clickcommontwo(zhidao, "我知道了");
AblViewUtil.mySleep(2);
}
@@ -136,16 +96,15 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
/**
* 关闭设置抖音号弹框
- *
* @param instance
*/
public void setdoyinQDialog(AblService instance) {
//处理我知道了的弹框
AccessibilityNodeInfo zhidao = AblViewUtil.findByText("设置抖音号", 0);
- if (zhidao == null) {
- Log.e("TIAOSHI###", "没有找到设置抖音号的弹窗");
- } else {
- Log.e("TIAOSHI###", "弹出了设置抖音号的弹窗");
+ if(zhidao==null){
+ Log.e("TIAOSHI###", "没有找到设置抖音号的弹窗" );
+ }else {
+ Log.e("TIAOSHI###", "弹出了设置抖音号的弹窗" );
AblService.getInstance().clickPoint(1025, 1630, 300);
AblViewUtil.mySleep(3);
fangqiQDialog(instance);
@@ -155,10 +114,10 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
public void fangqiQDialog(AblService instance) {
//处理我知道了的弹框
AccessibilityNodeInfo zhidao = AblViewUtil.findByText("放弃", 0);
- if (zhidao == null) {
- Log.e("TIAOSHI###", "没有找到放弃的弹窗");
- } else {
- Log.e("TIAOSHI###", "弹出了放弃的弹窗");
+ if(zhidao==null){
+ Log.e("TIAOSHI###", "没有找到放弃的弹窗" );
+ }else {
+ Log.e("TIAOSHI###", "弹出了放弃的弹窗" );
//[623,1146][799,1295]
AblService.getInstance().clickPoint(711, 1220, 300);
AblViewUtil.mySleep(2);
@@ -167,16 +126,15 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
/**
* 关闭检测到更新弹框
- *
* @param instance
*/
public void closedJDialog(AblService instance) {
//处理我知道了的弹框
AccessibilityNodeInfo zhidao = AblViewUtil.findByText("检测到更新", 0);
- if (zhidao == null) {
- Log.e("TIAOSHI###", "没有找到检测到更新的弹窗");
- } else {
- Log.e("TIAOSHI###", "弹出了检测到更新的弹窗");
+ if(zhidao==null){
+ Log.e("TIAOSHI###", "没有找到检测到更新的弹窗" );
+ }else {
+ Log.e("TIAOSHI###", "弹出了检测到更新的弹窗" );
AccessibilityNodeInfo zaishuo = AblViewUtil.findByText("以后再说", 0);
AblService.getInstance().clickcommontwo(zaishuo, "以后再说");
AblViewUtil.mySleep(1);
@@ -185,16 +143,15 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
/**
* 关闭检测到更新弹框
- *
* @param instance
*/
public void closedzsDialog(AblService instance) {
//处理我知道了的弹框
AccessibilityNodeInfo zhidao = AblViewUtil.findByText("暂时不要", 0);
- if (zhidao == null) {
- Log.e("TIAOSHI###", "没有找到暂时不要的弹窗");
- } else {
- Log.e("TIAOSHI###", "弹出了暂时不要的弹窗");
+ if(zhidao==null){
+ Log.e("TIAOSHI###", "没有找到暂时不要的弹窗" );
+ }else {
+ Log.e("TIAOSHI###", "弹出了暂时不要的弹窗" );
AccessibilityNodeInfo zaishuo = AblViewUtil.findByText("暂时不要", 0);
AblService.getInstance().clickcommontwo(zaishuo, "暂时不要");
AblViewUtil.mySleep(1);
@@ -203,16 +160,15 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
/**
* 关闭朋友推荐弹框
- *
* @param instance
*/
public void closedtjDialog(AblService instance) {
//处理我知道了的弹框
AccessibilityNodeInfo zhidao = AblViewUtil.findByText("朋友推荐", 0);
- if (zhidao == null) {
- Log.e("TIAOSHI###", "没有找到朋友推荐的弹窗");
- } else {
- Log.e("TIAOSHI###", "弹出了朋友推荐的弹窗");
+ if(zhidao==null){
+ Log.e("TIAOSHI###", "没有找到朋友推荐的弹窗" );
+ }else {
+ Log.e("TIAOSHI###", "弹出了朋友推荐的弹窗" );
//[890,489][956,555]
AblService.getInstance().clickPoint(923, 522, 300);
AblViewUtil.mySleep(1);
@@ -221,16 +177,15 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
/**
* 个人信息保护指引
- *
* @param instance
*/
public void yinsiDialog(AblService instance) {
//处理我知道了的弹框
AccessibilityNodeInfo zhidao = AblViewUtil.findByText("个人信息保护指引", 0);
- if (zhidao == null) {
- Log.e("TIAOSHI###", "没有找到个人信息保护指引的弹窗");
- } else {
- Log.e("TIAOSHI###", "弹出了个人信息保护指引的弹窗");
+ if(zhidao==null){
+ Log.e("TIAOSHI###", "没有找到个人信息保护指引的弹窗" );
+ }else {
+ Log.e("TIAOSHI###", "弹出了个人信息保护指引的弹窗" );
List list = AblViewUtil.findByText("同意");
for (AccessibilityNodeInfo item : list) {
clickcommontwo(item, "同意");
@@ -239,25 +194,201 @@ 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 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 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);
+ }
+ }
/**
* 关闭个人信息保护指引
- *
* @param instance
*/
public void closedBDialog(AblService instance) {
//处理我知道了的弹框
AccessibilityNodeInfo zhidao = AblViewUtil.findByText("个人信息保护指引", 0);
- if (zhidao == null) {
- Log.e("TIAOSHI###", "没有找到个人信息保护指引");
- } else {
- Log.e("TIAOSHI###", "弹出了个人信息保护指引的弹窗");
+ if(zhidao==null){
+ Log.e("TIAOSHI###", "没有找到个人信息保护指引" );
+ }else {
+ Log.e("TIAOSHI###", "弹出了个人信息保护指引的弹窗" );
AccessibilityNodeInfo zaishuo = AblViewUtil.findByText("同意", 0);
AblService.getInstance().clickcommontwo(zaishuo, "同意");
AblViewUtil.mySleep(1);
}
}
+ /**
+ * 寻找控件
+ */
+ 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) {
@@ -271,6 +402,8 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
}
+
+
protected void againStart(String str) {
final HttpParams paramsPost = new HttpParams();
paramsPost.put("task_status", str);
@@ -300,13 +433,13 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
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);
Rect rect = new Rect();
child.getBoundsInScreen(rect);
if (rect.left >= 0 && rect.left < 1080) {
- // Log.e("TIAOSHI###", "----twoNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
- // nodeZuobiao(child);
+ // Log.e("TIAOSHI###", "----twoNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
+ // nodeZuobiao(child);
if ("com.bytedance.ies.dmt.ui.widget.DmtTextView".equals(child.getClassName())) {
flag = true;
}
@@ -315,7 +448,6 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
return flag;
}
-
/**
* 当前页面如果有切换账号和管理,说明账号切换任务运行正常
*/
@@ -326,18 +458,17 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
AccessibilityNodeInfo child = root.getChild(i);
// Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
// nodeZuobiao(child);
- if ("android.widget.TextView".equals(child.getClassName())) {
- if ("管理".equals(child.getText().toString())) {
- flag = true;
- }
+ if ("android.widget.TextView".equals(child.getClassName())) {
+ if("管理".equals(child.getText().toString())){
+ flag = true;
+ }
- }
+ }
}
return flag;
}
-
/**
* 当前页面是否在我的页面
*/
@@ -359,182 +490,21 @@ public abstract class BaseAblStep implements AblStepHandler.StepListener {
public boolean allowed() {
boolean ifOpen = false;
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
- if (root != null) {
- for (int i = 0; i < root.getChildCount(); i++) {
- AccessibilityNodeInfo child = root.getChild(i);
- // Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
- if ("android.widget.TextView".equals(child.getClassName())) {
- if (child.getText() != null) {
- if (child.getText().toString().contains("正在尝试开启") || child.getText().toString().contains("是否允许")) {
- int childCount = root.getChildCount();
- AccessibilityNodeInfo child1 = root.getChild(childCount - 1);
- clickNodeInfo(child1, "点击了允许");
- }
+ for (int i = 0; i < root.getChildCount(); i++) {
+ AccessibilityNodeInfo child = root.getChild(i);
+ // Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
+ if ("android.widget.TextView".equals(child.getClassName())) {
+ if(child.getText()!=null) {
+ if (child.getText().toString().contains("正在尝试开启") || child.getText().toString().contains("是否允许")) {
+ int childCount = root.getChildCount();
+ AccessibilityNodeInfo child1 = root.getChild(childCount - 1);
+ clickNodeInfo(child1, "点击了允许");
}
- ifOpen = true;
}
+ ifOpen = true;
}
}
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;
- }
-
- /**
- * 寻找控件
- */
- 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());
-//
-// }
-// }
- }
- }
- }
- }
- }
- }
- }
- }
- /**
- * 是否关注过 (判断的准确率在百分之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/abllib/RandumInt.java b/app/src/main/java/com/fisherbone/fuzhu/abllib/RandumInt.java
index ef7218c..524faba 100644
--- a/app/src/main/java/com/fisherbone/fuzhu/abllib/RandumInt.java
+++ b/app/src/main/java/com/fisherbone/fuzhu/abllib/RandumInt.java
@@ -17,10 +17,6 @@ public class RandumInt {
return new Random().nextInt(15)+1;
}
public static int getRandumInt40(){
- return new Random().nextInt(40)+40;
- }
-
- public static int getRandumInt10(){
- return new Random().nextInt(15)+10;
+ return new Random().nextInt(95)+40;
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/fisherbone/fuzhu/abllib/utils/AblUtil.java b/app/src/main/java/com/fisherbone/fuzhu/abllib/utils/AblUtil.java
index ec82473..96c3987 100644
--- a/app/src/main/java/com/fisherbone/fuzhu/abllib/utils/AblUtil.java
+++ b/app/src/main/java/com/fisherbone/fuzhu/abllib/utils/AblUtil.java
@@ -68,7 +68,25 @@ public class AblUtil {
}
}
-
+ /**
+ * 添加悬浮界面(取关)
+ *
+ * @param context
+ * @param view
+ */
+ public static void addSuspensionWindowViewtwo(Context context, View view) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ if (Settings.canDrawOverlays(context)) {
+ addSuspensionView(context, view);
+ addWinEntity.cancleisopen=true;
+ } else {
+ ToastUtils.showShort("请先开启允许显示在其他应用上权限");
+ AblUtil.openDrawOverlaysAnth(context);
+ }
+ } else {
+ addSuspensionView(context, view);
+ }
+ }
/**
* 添加悬浮界面
diff --git a/app/src/main/java/com/fisherbone/fuzhu/abllib/utils/AblViewUtil.java b/app/src/main/java/com/fisherbone/fuzhu/abllib/utils/AblViewUtil.java
index 20c3baa..379425f 100644
--- a/app/src/main/java/com/fisherbone/fuzhu/abllib/utils/AblViewUtil.java
+++ b/app/src/main/java/com/fisherbone/fuzhu/abllib/utils/AblViewUtil.java
@@ -252,7 +252,6 @@ public class AblViewUtil {
}
-
/**
* x轴居中竖直滑动屏幕
*
@@ -449,57 +448,6 @@ public class AblViewUtil {
}
- /**
- * 判断当前页面是否包含某文本
- */
- public static boolean isContainText(String str) {
- boolean flag = false;
- List nodeInfos = AblViewUtil.findByText(str);
- for (int i=0;i0&&rect.top>0&&rect.top<=2210&&rect.bottom>0&&rect.bottom<=2210&&rect.right<1080) {
- Log.e("TIAOSHI###", "----twoNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
- nodeZuobiao(child);
- flag = true;
- }
- }
- return flag;
- }
-
- /**
- * 根据范围获和输入的文本获取节点
- */
- public static AccessibilityNodeInfo getNodeInfo(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;
- }
-
- /**
- * 查看节点的坐标点
- */
- public static void nodeZuobiao(AccessibilityNodeInfo nodeinfo){
- Rect rect = new Rect();
- nodeinfo.getBoundsInScreen(rect);
- Log.e("TIAOSHI###", "----显示节点的坐标:" + "(" + rect.left + "," + rect.top + ")" + "," + "(" + rect.right + "," + rect.bottom + ")");
-
- }
/**
* @param
@@ -541,6 +489,8 @@ public class AblViewUtil {
/**
+ *
+
* @param nikename 方法内字符串变量
* @param child1
* @param numt 上坐标点
@@ -572,6 +522,11 @@ public class AblViewUtil {
infoMessag.mesagesuccess(str);
}
+ public static void mesagefinish(String str){
+ infoMessag.mesagefinish(str);
+ }
+
+
public static void zhuanghaoMessage(String str){
infoMessag.mesagezhuang(str);
}
diff --git a/app/src/main/java/com/fisherbone/fuzhu/activity/CancleFollowActivity.java b/app/src/main/java/com/fisherbone/fuzhu/activity/CancleFollowActivity.java
index 1861bfb..b8d6c74 100644
--- a/app/src/main/java/com/fisherbone/fuzhu/activity/CancleFollowActivity.java
+++ b/app/src/main/java/com/fisherbone/fuzhu/activity/CancleFollowActivity.java
@@ -73,7 +73,22 @@ public class CancleFollowActivity extends BaseActivity {
}
if(!addWinEntity.cancleisopen){
- EventBus.getDefault().post(new FourEvent("success","2"));
+ //下面两个步骤不能同时执行
+ //取消已关
+ if (ChangLiang.cancelclosed&&!ChangLiang.cancelcrosscor) {
+ Log.e("TIAOSHI###==发送的一键取关参数", "执行取消已关");
+ EventBus.getDefault().post(new FourEvent("success","2"));
+ }
+ //取消互关
+ if (ChangLiang.cancelcrosscor&&!ChangLiang.cancelclosed) {
+ Log.e("TIAOSHI###==发送的一键取关参数", "执行取消互关");
+ EventBus.getDefault().post(new FourEvent("success","2"));
+ }
+
+ if(ChangLiang.cancelclosed&&ChangLiang.cancelcrosscor){
+ Log.e("TIAOSHI###==发送的一键取关参数", "执行取消互关");
+ EventBus.getDefault().post(new FourEvent("success","2"));
+ }
}
}
});
diff --git a/app/src/main/java/com/fisherbone/fuzhu/activity/ControlWindow.java b/app/src/main/java/com/fisherbone/fuzhu/activity/ControlWindow.java
index 209dd92..809ef1b 100644
--- a/app/src/main/java/com/fisherbone/fuzhu/activity/ControlWindow.java
+++ b/app/src/main/java/com/fisherbone/fuzhu/activity/ControlWindow.java
@@ -14,10 +14,11 @@ import com.fisherbone.fuzhu.R;
import com.fisherbone.fuzhu.abllib.AblStepHandler;
import com.fisherbone.fuzhu.abllib.AblSteps;
import com.fisherbone.fuzhu.abllib.utils.AblUtil;
+import com.fisherbone.fuzhu.abllib.utils.AblViewUtil;
import com.fisherbone.fuzhu.databinding.ViewTestBinding;
import com.fisherbone.fuzhu.entity.ControlBean;
import com.fisherbone.fuzhu.entity.addWinEntity;
-import com.fisherbone.fuzhu.step.TestAblStep24;
+import com.fisherbone.fuzhu.quzan.AblStep1;
import com.fisherbone.fuzhu.step.TestAblStep30;
import com.fisherbone.fuzhu.step.TestAblStep34;
import com.fisherbone.fuzhu.step.TestAblStep6;
@@ -63,7 +64,7 @@ public class ControlWindow {
binding = DataBindingUtil.inflate(inflater, R.layout.view_test, null, false);
controlBean = new ControlBean();
controlBean.setContent("");
- controlBean.setPhonetype(Integer.valueOf(ChangLiang.phonetype));
+ controlBean.setPhonetype(Integer.parseInt(ChangLiang.phonetype));
binding.setControlBean(controlBean);
stutas(true);
binding.image01.setBackgroundResource(R.mipmap.icon_bianzu);
@@ -79,14 +80,15 @@ public class ControlWindow {
if (AblUtil.isAccessibilityServiceOpen(mContext)) {
AblStepHandler.getInstance().initStepClass(new TestAblStep6());
stutas(ChangLiang.isrun);
- AblStepHandler.sendMsg(AblSteps.STEP_11);
+ AblStepHandler.sendMsg(AblSteps.STEP_11);
} else {
ToastUtils.showShort("点到了");
ToastUtils.showShort("请先开启辅助服务");
AblUtil.openAccessibilitySettings();
}
break;
- case "3"://执行幢号任务
+ case "3":
+ //执行幢号任务
if (ChangLiang.if_quguan.equals("0")) {
stutas(ChangLiang.isrun);
ChangLiang.zishuodong = "T";
@@ -97,7 +99,8 @@ public class ControlWindow {
AblStepHandler.sendMsg(AblSteps.STEP_70);
}
break;
- case "4"://帐号登录任务
+ case "4":
+ //帐号登录任务
stutas(ChangLiang.isrun);
AblStepHandler.sendMsg(AblSteps.STEP_90);
break;
@@ -119,19 +122,21 @@ public class ControlWindow {
break;
//大V粉丝截流
case "61":
- AblStepHandler.getInstance().initStepClass(new TestAblStep24());
stutas(ChangLiang.isrun);
AblStepHandler.sendMsg(AblSteps.STEP_130);
break;
- case "7"://潜在客户加关(大咖)
+ case "7":
+ //潜在客户加关(大咖)
stutas(ChangLiang.isrun);
AblStepHandler.sendMsg(AblSteps.STEP_170);
break;
- case "8"://潜在客户加关(关键词)
+ case "8":
+ //潜在客户加关(关键词)
stutas(ChangLiang.isrun);
AblStepHandler.sendMsg(AblSteps.STEP_160);
break;
- case "9"://粉丝通知
+ case "9":
+ //粉丝通知
stutas(ChangLiang.isrun);
String lettertype = ProfileSpUtils.getInstance().getFensiNotice().getLettertype();
Log.e("类型", lettertype);
@@ -165,6 +170,18 @@ public class ControlWindow {
//直播间抢红包
case "15":
+ break;
+ case "16":
+ //取赞
+ if (AblUtil.isAccessibilityServiceOpen(mContext)) {
+ AblStepHandler.getInstance().initStepClass(new AblStep1());
+ stutas(ChangLiang.isrun);
+ AblStepHandler.sendMsg(AblSteps.STEP_260);
+ } else {
+ ToastUtils.showShort("点到了");
+ ToastUtils.showShort("请先开启辅助服务");
+ AblUtil.openAccessibilitySettings();
+ }
break;
default:
Log.e("TIAOSHI###", "执行的功能类型不匹配");
@@ -265,6 +282,16 @@ public class ControlWindow {
break;
case "15"://直播间抢红包
+ break;
+ case "16"://取赞
+ if (AblUtil.isAccessibilityServiceOpen(mContext)) {
+ stutas(ChangLiang.isrun);
+ AblStepHandler.sendMsg(AblSteps.STEP_260);
+ } else {
+ ToastUtils.showShort("点到了");
+ ToastUtils.showShort("请先开启辅助服务");
+ AblUtil.openAccessibilitySettings();
+ }
break;
default:
Log.e("TIAOSHI###", "执行的功能类型不匹配");
@@ -328,7 +355,6 @@ public class ControlWindow {
* 退出悬浮窗
*/
public void closedWin(){
- Log.e("TIAOSHI###", "退出悬浮窗执行了");
WindowManager windowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
windowManager.removeView(binding.getRoot());
addWinEntity.isopen = false;
diff --git a/app/src/main/java/com/fisherbone/fuzhu/activity/DavActivity.java b/app/src/main/java/com/fisherbone/fuzhu/activity/DavActivity.java
index 88f76ed..ce7031a 100644
--- a/app/src/main/java/com/fisherbone/fuzhu/activity/DavActivity.java
+++ b/app/src/main/java/com/fisherbone/fuzhu/activity/DavActivity.java
@@ -45,6 +45,14 @@ public class DavActivity extends BaseActivity {
mTitleBar = (TitleBar) findViewById(R.id.title_bar);
mTitleBar.setTitle("大V粉丝截流");
initNormalBack();
+ commentDao = new CommentDao(DavActivity.this);
+ //给数据库插入十条默认数据
+ ArrayList commentBeanData = commentDao.queryAll();
+ if(commentBeanData.size()==0) {
+ Log.e("ceshi","添加了数据");
+ madeData();
+ }
+
binding.rlStart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -105,4 +113,18 @@ public class DavActivity extends BaseActivity {
});
}
+
+ private void madeData() {
+ String JsonData = new GetJsonDataUtil().getJson(DavActivity.this, "huashu.json");//获取assets目录下的json文件数据
+ HusshuBean resultt = JsonUtils.fromJson(JsonData, HusshuBean.class);
+ List data = resultt.getData();
+ for (int i = 0; i < data.size(); i++) {
+ CommentBeanData commentBeanData = data.get(i);
+ if (null != commentDao.queryByCustom("Id", commentBeanData.getId()) && commentDao.queryByCustom("Id", commentBeanData.getId()).size() > 0) {
+ commentDao.updateData(commentBeanData);
+ } else {
+ commentDao.addInsert(commentBeanData);
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/fisherbone/fuzhu/activity/HongBaoActivity.java b/app/src/main/java/com/fisherbone/fuzhu/activity/HongBaoActivity.java
index 05f0a86..cf403c4 100644
--- a/app/src/main/java/com/fisherbone/fuzhu/activity/HongBaoActivity.java
+++ b/app/src/main/java/com/fisherbone/fuzhu/activity/HongBaoActivity.java
@@ -43,10 +43,45 @@ public class HongBaoActivity extends BaseActivity {
.subscribe(new Consumer