diff --git a/app/release/atom-latest.apk b/app/release/atom-latest.apk index e69de29..3473013 100644 Binary files a/app/release/atom-latest.apk and b/app/release/atom-latest.apk differ diff --git a/app/release/output.json b/app/release/output.json index 86eb96e..5137ba7 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"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 +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":173,"versionName":"1.7.3","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/main/java/com/fisherbone/fuzhu/activity/MainActivity.java b/app/src/main/java/com/fisherbone/fuzhu/activity/MainActivity.java index b3b77e5..7ed934b 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/activity/MainActivity.java +++ b/app/src/main/java/com/fisherbone/fuzhu/activity/MainActivity.java @@ -714,8 +714,6 @@ public class MainActivity extends BaseActivity implements InfoMessage { mdDisposable.dispose(); } AblStepHandler.getInstance().setStop(true); - controlWindow.stutas(true); - controlWindow.closedWin(); FinishTask(); } } diff --git a/app/src/main/java/com/fisherbone/fuzhu/activity/SettingActivity.java b/app/src/main/java/com/fisherbone/fuzhu/activity/SettingActivity.java index 3b794ba..77db548 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/activity/SettingActivity.java +++ b/app/src/main/java/com/fisherbone/fuzhu/activity/SettingActivity.java @@ -32,6 +32,7 @@ import com.fisherbone.fuzhu.abllib.AblStepHandler; import com.fisherbone.fuzhu.abllib.AblSteps; import com.fisherbone.fuzhu.abllib.utils.AblUtil; import com.fisherbone.fuzhu.api.GetVesionResponseBean; +import com.fisherbone.fuzhu.api.NewsApiInterface; import com.fisherbone.fuzhu.databinding.ActivitySettingBinding; import com.fisherbone.fuzhu.db.DouyinBean; import com.fisherbone.fuzhu.db.dao.DouyinDao; @@ -58,6 +59,8 @@ import com.jeremyliao.liveeventbus.LiveEventBus; import com.lzy.okgo.model.HttpParams; import com.lzy.okgo.model.Response; import com.tbruyelle.rxpermissions2.RxPermissions; +import com.xiangxue.common.network.TecentNetworkApi; +import com.xiangxue.common.network.observer.BaseObserver; import org.json.JSONException; import org.json.JSONObject; @@ -86,30 +89,30 @@ public class SettingActivity extends BaseActivity { initNormalBack(); douyinDao = new DouyinDao(SettingActivity.this); InjectUtils.injectEvent(this); - if(ChangLiang.control_status.equals("1")&&ProfileSpUtils.getInstance().getSetBean().isRedswitchone()){ + if (ChangLiang.control_status.equals("1") && ProfileSpUtils.getInstance().getSetBean().isRedswitchone()) { binding.setSwitch1.setChecked(true); - }else { + } else { binding.setSwitch1.setChecked(false); } - binding.tvVewsion.setText("v."+getVersionn()); + binding.tvVewsion.setText("v." + getVersionn()); // 添加监听 binding.setSwitch1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - if (isChecked){ + if (isChecked) { ToastUtils.showShort(isChecked + ""); SettingBean settingBean = new SettingBean(true); ProfileSpUtils.getInstance().saveSetBean(settingBean); updateControlStatus("1"); LiveEventBus.get("yunkong").post("open"); - ToastUtils.showShort("群控状态1"+ProfileSpUtils.getInstance().getSetBean().isRedswitchone()+""); - }else { + ToastUtils.showShort("群控状态1" + ProfileSpUtils.getInstance().getSetBean().isRedswitchone() + ""); + } else { ToastUtils.showShort(isChecked + ""); SettingBean settingBean = new SettingBean(false); updateControlStatus("0"); ProfileSpUtils.getInstance().saveSetBean(settingBean); LiveEventBus.get("yunkong").post("closed"); - ToastUtils.showShort("群控状态2"+ProfileSpUtils.getInstance().getSetBean().isRedswitchone()+""); + ToastUtils.showShort("群控状态2" + ProfileSpUtils.getInstance().getSetBean().isRedswitchone() + ""); } } }); @@ -117,20 +120,20 @@ public class SettingActivity extends BaseActivity { binding.rlVersion.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - // requestVersion(); + requestVersion(); } }); binding.rlAut.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ArrayList douyinBeans = douyinDao.queryAll(); - if(douyinBeans.size()!=3){ + if (douyinBeans.size() != 3) { ToastUtils.showShort("未获得3个抖音帐号"); return; } String isactivation = (String) SPUtils.getSp(SettingActivity.this, FZConfig.IS_ACTIVATION, ""); if (isactivation.equals("0")) { - ToastUtils.showShort( "设备已激活"); + ToastUtils.showShort("设备已激活"); } else { getPermissions(); } @@ -188,7 +191,7 @@ public class SettingActivity extends BaseActivity { @Override public void onClick(View view) { String s = binding.etLianxiren.getText().toString(); - if("".equals(s)){ + if ("".equals(s)) { ToastUtils.showShort("请输入导入通讯录的个数"); return; } @@ -201,27 +204,11 @@ public class SettingActivity extends BaseActivity { private void infoTv() { String isactivation = (String) SPUtils.getSp(SettingActivity.this, FZConfig.IS_ACTIVATION, ""); ArrayList douyinBeans = douyinDao.queryAll(); - if (douyinBeans.size() == 3&&isactivation.equals("0")) { + if (douyinBeans.size() == 3 && isactivation.equals("0")) { binding.tvAut.setText("激活授权(可授权)"); } } - /** - * 获取撞号账号 - */ - public static void touchTasktwo(Context ctx,String body) { - //拿到json字符串,假数据 -// String JsonData = new GetJsonDataUtil().getJson(ctx, "touchTask.json");//获取assets目录下的json文件数据 -// touchTaskBean urgentTaskBean = JsonUtils.fromJson(JsonData, touchTaskBean.class); - touchTaskBean urgentTaskBean = JsonUtils.fromJson(body, touchTaskBean.class); - int success = urgentTaskBean.getSuccess(); - if (success == 0) { - List phoneNumber = urgentTaskBean.getData(); - //phoneNumber = urgentTaskBean.getData(); - //导入通讯录 - ContactsHelp.getInstance(ctx).importContacts(phoneNumber); - } - } @Override protected void onResume() { @@ -306,7 +293,7 @@ public class SettingActivity extends BaseActivity { final HttpParams paramsPost = new HttpParams(); paramsPost.put("device_id", device_id);//扫码(设备)id paramsPost.put("douyin", s);// 抖音号 - // paramsPost.put("douyin", "[{\"short_id\":\"tangjie0501\",\"short_name\":\"软件工程师蝴蝶剑\",\"login_status\":\"1\"}]");// 抖音号[{"short_id":"tangjie0501","short_name":"软件工程师蝴蝶剑","login_status":"1"}] + // paramsPost.put("douyin", "[{\"short_id\":\"tangjie0501\",\"short_name\":\"软件工程师蝴蝶剑\",\"login_status\":\"1\"}]");// 抖音号[{"short_id":"tangjie0501","short_name":"软件工程师蝴蝶剑","login_status":"1"}] paramsPost.put("online_status", "");//阿童木在线状态 paramsPost.put("control_status", "");//控制状态 paramsPost.put("network_type", "");//网络类型 @@ -325,11 +312,11 @@ public class SettingActivity extends BaseActivity { String msg = jsonObject.getString("msg"); ToastUtils.showShort(msg); String success = jsonObject.getString("success"); - if(success.equals("0")){ + if (success.equals("0")) { SPUtils.setSP(SettingActivity.this, FZConfig.IS_ACTIVATION, "0"); LiveEventBus.get("success").post("str"); finish(); - }else { + } else { com.fisherbone.fuzhu.utils.ToastUtils.showToast(SettingActivity.this, msg); SPUtils.setSP(SettingActivity.this, FZConfig.IS_ACTIVATION, "0"); } @@ -350,7 +337,7 @@ public class SettingActivity extends BaseActivity { /** * 修改设备控制状态 -- 云端还是本地 */ - private void updateControlStatus(String control_status){ + private void updateControlStatus(String control_status) { final HttpParams paramsPost = new HttpParams(); paramsPost.put("control_status", control_status);//网络类型1:云端 0:本地 new NetApi().getPostData(paramsPost, HttpConstants.URi_device_Appoperate_updateControlStatus).subscribe(new Observer() { @@ -361,7 +348,7 @@ public class SettingActivity extends BaseActivity { JSONObject jsonObject = new JSONObject(body); String msg = jsonObject.getString("msg"); String success = jsonObject.getString("success"); - if(success.equals("0")){ + if (success.equals("0")) { LiveEventBus.get("success").post("str"); } @@ -383,70 +370,69 @@ public class SettingActivity extends BaseActivity { */ private void getPhoneNum(String s) { String device_id = (String) SPUtils.getSp(SettingActivity.this, FZConfig.KEY_DEVICE_ID, ""); - final HttpParams paramsPost = new HttpParams(); - paramsPost.put("device_id", device_id); - paramsPost.put("number", s); - new NetApi().getPostData(paramsPost, HttpConstants.URi_Device_Appoperate_getPhone).subscribe(new Observer() { - @Override - public void onNext(Response response) { - String body = (String) response.body(); - touchTasktwo(SettingActivity.this,body); - } - - @Override - public void onError(Exception e) { - e.printStackTrace(); - } - }); + TecentNetworkApi.getService(NewsApiInterface.class) + .getPhoneNum(device_id, s) + .subscribe(new BaseObserver() { + @Override + public void onSuccess(touchTaskBean urgentTaskBean) { + int success = urgentTaskBean.getSuccess(); + if (success == 0) { + List phoneNumber = urgentTaskBean.getData(); + //phoneNumber = urgentTaskBean.getData(); + //导入通讯录 + ContactsHelp.getInstance(SettingActivity.this).importContacts(phoneNumber); + } + } + @Override + public void onFailure(Throwable e) { + Log.e("Error", "Message:" + e.getMessage()); + } + }); } - - /** * 请求最新版本号 */ private void requestVersion() { - - final HttpParams paramsPost = new HttpParams(); - new NetApi().getPostDatatwo(paramsPost, HttpConstants.URi_Device_Appoperate_NowVersion).subscribe(new Observer() { - @Override - public void onNext(Response response) { - String body = (String) response.body(); - - GetVesionResponseBean groupStatisticalBean = JsonUtils.fromJson(body, GetVesionResponseBean.class); - String newVersion = groupStatisticalBean.getVersion(); - if(newVersion!=null){ - String versionn = getVersionn(); - //versionn = "1.0.2"; - int versionUpdate = VersionUtils.compareVersion(versionn, newVersion); - if(groupStatisticalBean.getSuccess().equals("0")){ - if (versionUpdate == -1) {//两个版本相同 - ADialog mShareWechatDialog = new ADialog(SettingActivity.this, 0, groupStatisticalBean); - mShareWechatDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//代码中取消标题栏 - mShareWechatDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); - Window win = mShareWechatDialog.getWindow(); - win.getDecorView().setPadding(0, 0, 0, 0); - WindowManager.LayoutParams lp = win.getAttributes(); - lp.width = WindowManager.LayoutParams.FILL_PARENT; - lp.height = WindowManager.LayoutParams.WRAP_CONTENT; - win.setAttributes(lp); - mShareWechatDialog.setCancelable(false); - mShareWechatDialog.show(); - } else {//没有最新版本 - ToastUtils.showShort("当前已是最新版本"); + TecentNetworkApi.getService(NewsApiInterface.class) + .getNowVersion() + .subscribe(new BaseObserver() { + @Override + public void onSuccess(GetVesionResponseBean newsChannelsBean) { + Log.e("MainActivity", new Gson().toJson(newsChannelsBean)); + String newVersion = newsChannelsBean.getVersion(); + if (newVersion != null) { + String versionn = getVersionn(); + int versionUpdate = VersionUtils.compareVersion(versionn, newVersion); + if (VALUE_ZERO.equals(newsChannelsBean.getSuccess() + "")) { + if (versionUpdate == -1) {//两个版本相同 + ADialog mShareWechatDialog = new ADialog(SettingActivity.this, 0, newsChannelsBean); + mShareWechatDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//代码中取消标题栏 + mShareWechatDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); + Window win = mShareWechatDialog.getWindow(); + win.getDecorView().setPadding(0, 0, 0, 0); + WindowManager.LayoutParams lp = win.getAttributes(); + lp.width = WindowManager.LayoutParams.FILL_PARENT; + lp.height = WindowManager.LayoutParams.WRAP_CONTENT; + win.setAttributes(lp); + mShareWechatDialog.setCancelable(false); + mShareWechatDialog.show(); + } else {//没有最新版本 + ToastUtils.showShort("当前已是最新版本"); + } + } } } - } - } - @Override - public void onError(Exception e) { - e.printStackTrace(); - } - }); + @Override + public void onFailure(Throwable e) { + Log.e("Error", "Message:" + e.getMessage()); + } + }); } + class ADialog extends Dialog implements View.OnClickListener { private Context context; @@ -463,12 +449,13 @@ public class SettingActivity extends BaseActivity { super.onCreate(savedInstanceState); this.setContentView(R.layout.version_dailog); - if(isHuaWei()){ + if (isHuaWei()) { launchAppDetail(SettingActivity.this, "com.fanghoo.mendian", "com.huawei.appmarket"); - }else { + } else { launchAppDetail(SettingActivity.this, "com.fanghoo.mendian", "com.tencent.android.qqdownloader"); } } + public void launchAppDetail(final Context context, final String appPkg, final String marketPkg) { String content = mGetVesionResponseBean.getContent(); @@ -501,6 +488,7 @@ public class SettingActivity extends BaseActivity { public void onClick(View v) { } } + public static boolean isHuaWei() { String manufacturer = Build.MANUFACTURER; //这个字符串可以自己定义,例如判断华为就填写huawei,魅族就填写meizu @@ -509,6 +497,7 @@ public class SettingActivity extends BaseActivity { } return false; } + private void zhuxiao() { String device_id = (String) SPUtils.getSp(SettingActivity.this, FZConfig.KEY_DEVICE_ID, ""); final HttpParams paramsPost = new HttpParams(); diff --git a/app/src/main/java/com/fisherbone/fuzhu/activity/StartTask.java b/app/src/main/java/com/fisherbone/fuzhu/activity/StartTask.java index b5c7bcf..a6f6e89 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/activity/StartTask.java +++ b/app/src/main/java/com/fisherbone/fuzhu/activity/StartTask.java @@ -660,7 +660,7 @@ public class StartTask { } private void tastJiexisix(String body) { - Log.e("TIAOSHI###", "抢红包的数据开始解析"); + Log.e("TIAOSHI###", "直播间加热的数据开始解析"); /** -- 直播间加热 { diff --git a/app/src/main/java/com/fisherbone/fuzhu/api/NewsApiInterface.java b/app/src/main/java/com/fisherbone/fuzhu/api/NewsApiInterface.java index 1681a04..e1d812e 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/api/NewsApiInterface.java +++ b/app/src/main/java/com/fisherbone/fuzhu/api/NewsApiInterface.java @@ -1,7 +1,14 @@ package com.fisherbone.fuzhu.api; +import com.fisherbone.fuzhu.entity.touchTaskBean; + import io.reactivex.Observable; +import okhttp3.Call; +import retrofit2.http.Field; +import retrofit2.http.FormUrlEncoded; import retrofit2.http.GET; +import retrofit2.http.POST; +import retrofit2.http.Query; /** * Created by Allen on 2017/7/20. @@ -10,4 +17,12 @@ import retrofit2.http.GET; public interface NewsApiInterface { @GET("app/Appoperate/NowVersion") Observable getNowVersion(); + + @POST("app/Appoperate/getPhone") + @FormUrlEncoded + Observable getPhoneNum(@Field("device_id") String device_id, + @Field("number") String number); + + + } 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 6e55fad..14bb421 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/step/HongbaoBase.java +++ b/app/src/main/java/com/fisherbone/fuzhu/step/HongbaoBase.java @@ -847,12 +847,46 @@ class HongbaoBase extends BaseAblStep implements RedEnv.RedEnvFunc, RedEnv.TimeF // 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); - if ("android.widget.TextView".equals(child1.getClassName())) { - if (child1.getText() != null) { - if (child1.getText().toString().equals("首页")) { - flag = true; + Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription()); + nodeZuobiao(child1); + + if ("android.widget.TextView".equals(child1.getClassName())) { + if (child1.getText() != null) { + if (child1.getText().toString().equals("首页")) { + flag = true; + } + } + + } + } + } + return flag; + } + + /** + * 是否有首页 + */ + public boolean ifShouyetwo() { + boolean flag = false; + 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); + + if ("android.widget.TextView".equals(child2.getClassName())) { + if (child2.getText() != null) { + if (child2.getText().toString().equals("首页")) { + flag = true; + } } } } @@ -862,7 +896,7 @@ class HongbaoBase extends BaseAblStep implements RedEnv.RedEnvFunc, RedEnv.TimeF } /** - * 首页 + * 首页会随机出现在第二层和第三层循环 */ public AccessibilityNodeInfo getShouye() { AccessibilityNodeInfo nodeInfo = null; @@ -887,6 +921,38 @@ class HongbaoBase extends BaseAblStep implements RedEnv.RedEnvFunc, RedEnv.TimeF return nodeInfo; } + + /** + * 首页 + */ + public AccessibilityNodeInfo getShouyetwo() { + AccessibilityNodeInfo nodeInfo = null; + 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); + if ("android.widget.TextView".equals(child2.getClassName())) { + if (child2.getText() != null) { + if (child2.getText().toString().equals("首页")) { + nodeInfo = child2; + } + } + } + } + } + } + return nodeInfo; + } + public void runLog(String str) { LiveEventBus.get("some_key").post(str); Log.e("TIAOSHI###", str); 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 3fc0311..d7f5331 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep0.java +++ b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep0.java @@ -29,139 +29,69 @@ public class TestAblStep0 extends BaseAblStep { break; case AblSteps.STEP_2: AblViewUtil.mySleep(5); - // getNodeInfoh(); + // getNodeInfoh(); // getNodeInfoy(); - getNodeInfohg(); + //(0,562),(1080,774) - // isContainText("关注"); - + // isContainText("关注");b +// boolean b = openTiktok(); +// Log.e("TIAOSHI###", "成功打开抖音" +b); + boolean b1 = ifShouye(); + Log.e("TIAOSHI###", "是否首页" +b1); +// if (b && b1) { +// Log.e("TIAOSHI###", "成功打开抖音" ); +// } else { +// Log.e("TIAOSHI###", "没有打开抖音抖音不在首页" ); +// } default: } } - /** - * 寻找控件 - */ - public void getNodeInfohg() { + public boolean openTiktok() { + boolean ifOpen = false; 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()); + if ("dmt.viewpager.DmtViewPager$d".equals(child.getClassName())) { + ifOpen = true; + } + } + return ifOpen; + } + public boolean ifShouye() { + boolean flag = false; + 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); + 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); - if ("androidx.recyclerview.widget.RecyclerView".equals(child2.getClassName())) { - // if (j == child1.getChildCount() - 1) { - Rect rect = new Rect(); - child2.getBoundsInScreen(rect); - if (rect.right > 0) { -// Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child2.getContentDescription()); -// nodeZuobiao(child2); + 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.FrameLayout".equals(child3.getClassName())) { - if (x == 0) { - 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); - - if ("com.lynx.tasm.behavior.ui.view.UIView".equals(child5.getClassName())) { - if ("关注".equals(child5.getContentDescription())) { - Log.e("TIAOSHI###", "----6Node:" + child5.getClassName() + ":" + child5.getText() + ":" + child5.getContentDescription()); - nodeZuobiao(child5); - clickcommontwo(child5, ""); - } - - } - } - - } - } - } - } - - } - } - } - } - } - } - - /** - * 寻找控件 - */ - public void getNodeInfoy() { - 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); -// AccessibilityNodeInfo child2 = child1.getChild(child1.getChildCount()); -// Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child1.getContentDescription()); - if (y == child.getChildCount() - 1) { - // Log.e("TIAOSHI###", "----threeNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription()); - nodeZuobiao(child1); - for (int j = 0; j < child1.getChildCount(); j++) { - AccessibilityNodeInfo child2 = child1.getChild(j); - Log.e("TIAOSHI###", "----fourNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child2.getContentDescription()); - if ("android.widget.FrameLayout".equals(child2.getClassName())) { - if (j == 0) { - for (int x = 0; x < child2.getChildCount(); x++) { - AccessibilityNodeInfo child3 = child2.getChild(x); - Log.e("TIAOSHI###", "----fiveNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription()); - for (int h = 0; h < child3.getChildCount(); h++) { - AccessibilityNodeInfo child4 = child3.getChild(h); - Log.e("TIAOSHI###", "----sixNode:" + child4.getClassName() + ":" + child4.getText() + ":" + child4.getContentDescription()); - int childCount = child4.getChildCount(); - Log.e("TIAOSHI###", "----sixNode数量:" + childCount); - 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++) { - if (p == 0) { - continue; - } - AccessibilityNodeInfo child6 = child5.getChild(p); - Log.e("TIAOSHI###", "----7Node:" + child6.getClassName() + ":" + child6.getText() + ":" + child6.getContentDescription()); - nodeZuobiao(child6); - if ("关注".equals(child6.getContentDescription())) { - clickcommontwo(child6, ""); - } - } - } - } - } + if ("android.widget.TextView".equals(child2.getClassName())) { + if (child2.getText() != null) { + if (child2.getText().toString().equals("首页")) { + flag = true; } } } } + + } } - + return flag; } - } diff --git a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep32.java b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep32.java index 678062d..7b552ca 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep32.java +++ b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep32.java @@ -38,7 +38,8 @@ public class TestAblStep32 extends NoticeBase { case AblSteps.STEP_232: AblViewUtil.mySleep(3); Log.e("TIAOSHI###", "56778"); - if (this.objects.size() == 0) { + // if (this.objects.size() == 0) { + if (0 == 0) { AblViewUtil.potgegin("停止"); return; } 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 9c24ead..c9bab4f 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep34.java +++ b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep34.java @@ -109,9 +109,9 @@ public class TestAblStep34 extends HongbaoBase implements RedEnv.RedEnvFunc, Red againStart("0"); AblViewUtil.back(); AblViewUtil.mySleep(2); - boolean b2 = ifShouye(); + boolean b2 = ifShouyetwo(); if (b2) { - AccessibilityNodeInfo shouye = getShouye(); + AccessibilityNodeInfo shouye = getShouyetwo(); clickNodeInfo(shouye, "首页"); AblStepHandler.sendMsg(AblSteps.STEP_252); } else { diff --git a/app_config.gradle b/app_config.gradle index d9f6908..0b0431e 100644 --- a/app_config.gradle +++ b/app_config.gradle @@ -12,8 +12,8 @@ ext { applicationId : "com.fisherbone.fuzhu", minSdkVersion : 24, targetSdkVersion : 29, - versionCode : 172, - versionName : "1.7.2", + versionCode : 173, + versionName : "1.7.3", testInstrumentationRunner: "androidx.test.runner.AndroidJUnitRunner" ]