atom
This commit is contained in:
Binary file not shown.
@@ -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":{}}]
|
[{"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":{}}]
|
||||||
@@ -714,8 +714,6 @@ public class MainActivity extends BaseActivity implements InfoMessage {
|
|||||||
mdDisposable.dispose();
|
mdDisposable.dispose();
|
||||||
}
|
}
|
||||||
AblStepHandler.getInstance().setStop(true);
|
AblStepHandler.getInstance().setStop(true);
|
||||||
controlWindow.stutas(true);
|
|
||||||
controlWindow.closedWin();
|
|
||||||
FinishTask();
|
FinishTask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import com.fisherbone.fuzhu.abllib.AblStepHandler;
|
|||||||
import com.fisherbone.fuzhu.abllib.AblSteps;
|
import com.fisherbone.fuzhu.abllib.AblSteps;
|
||||||
import com.fisherbone.fuzhu.abllib.utils.AblUtil;
|
import com.fisherbone.fuzhu.abllib.utils.AblUtil;
|
||||||
import com.fisherbone.fuzhu.api.GetVesionResponseBean;
|
import com.fisherbone.fuzhu.api.GetVesionResponseBean;
|
||||||
|
import com.fisherbone.fuzhu.api.NewsApiInterface;
|
||||||
import com.fisherbone.fuzhu.databinding.ActivitySettingBinding;
|
import com.fisherbone.fuzhu.databinding.ActivitySettingBinding;
|
||||||
import com.fisherbone.fuzhu.db.DouyinBean;
|
import com.fisherbone.fuzhu.db.DouyinBean;
|
||||||
import com.fisherbone.fuzhu.db.dao.DouyinDao;
|
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.HttpParams;
|
||||||
import com.lzy.okgo.model.Response;
|
import com.lzy.okgo.model.Response;
|
||||||
import com.tbruyelle.rxpermissions2.RxPermissions;
|
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.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@@ -86,30 +89,30 @@ public class SettingActivity extends BaseActivity {
|
|||||||
initNormalBack();
|
initNormalBack();
|
||||||
douyinDao = new DouyinDao(SettingActivity.this);
|
douyinDao = new DouyinDao(SettingActivity.this);
|
||||||
InjectUtils.injectEvent(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);
|
binding.setSwitch1.setChecked(true);
|
||||||
}else {
|
} else {
|
||||||
binding.setSwitch1.setChecked(false);
|
binding.setSwitch1.setChecked(false);
|
||||||
}
|
}
|
||||||
binding.tvVewsion.setText("v."+getVersionn());
|
binding.tvVewsion.setText("v." + getVersionn());
|
||||||
// 添加监听
|
// 添加监听
|
||||||
binding.setSwitch1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
binding.setSwitch1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
if (isChecked){
|
if (isChecked) {
|
||||||
ToastUtils.showShort(isChecked + "");
|
ToastUtils.showShort(isChecked + "");
|
||||||
SettingBean settingBean = new SettingBean(true);
|
SettingBean settingBean = new SettingBean(true);
|
||||||
ProfileSpUtils.getInstance().saveSetBean(settingBean);
|
ProfileSpUtils.getInstance().saveSetBean(settingBean);
|
||||||
updateControlStatus("1");
|
updateControlStatus("1");
|
||||||
LiveEventBus.get("yunkong").post("open");
|
LiveEventBus.get("yunkong").post("open");
|
||||||
ToastUtils.showShort("群控状态1"+ProfileSpUtils.getInstance().getSetBean().isRedswitchone()+"");
|
ToastUtils.showShort("群控状态1" + ProfileSpUtils.getInstance().getSetBean().isRedswitchone() + "");
|
||||||
}else {
|
} else {
|
||||||
ToastUtils.showShort(isChecked + "");
|
ToastUtils.showShort(isChecked + "");
|
||||||
SettingBean settingBean = new SettingBean(false);
|
SettingBean settingBean = new SettingBean(false);
|
||||||
updateControlStatus("0");
|
updateControlStatus("0");
|
||||||
ProfileSpUtils.getInstance().saveSetBean(settingBean);
|
ProfileSpUtils.getInstance().saveSetBean(settingBean);
|
||||||
LiveEventBus.get("yunkong").post("closed");
|
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() {
|
binding.rlVersion.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
// requestVersion();
|
requestVersion();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
binding.rlAut.setOnClickListener(new View.OnClickListener() {
|
binding.rlAut.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
ArrayList<DouyinBean> douyinBeans = douyinDao.queryAll();
|
ArrayList<DouyinBean> douyinBeans = douyinDao.queryAll();
|
||||||
if(douyinBeans.size()!=3){
|
if (douyinBeans.size() != 3) {
|
||||||
ToastUtils.showShort("未获得3个抖音帐号");
|
ToastUtils.showShort("未获得3个抖音帐号");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String isactivation = (String) SPUtils.getSp(SettingActivity.this, FZConfig.IS_ACTIVATION, "");
|
String isactivation = (String) SPUtils.getSp(SettingActivity.this, FZConfig.IS_ACTIVATION, "");
|
||||||
if (isactivation.equals("0")) {
|
if (isactivation.equals("0")) {
|
||||||
ToastUtils.showShort( "设备已激活");
|
ToastUtils.showShort("设备已激活");
|
||||||
} else {
|
} else {
|
||||||
getPermissions();
|
getPermissions();
|
||||||
}
|
}
|
||||||
@@ -188,7 +191,7 @@ public class SettingActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
String s = binding.etLianxiren.getText().toString();
|
String s = binding.etLianxiren.getText().toString();
|
||||||
if("".equals(s)){
|
if ("".equals(s)) {
|
||||||
ToastUtils.showShort("请输入导入通讯录的个数");
|
ToastUtils.showShort("请输入导入通讯录的个数");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -201,27 +204,11 @@ public class SettingActivity extends BaseActivity {
|
|||||||
private void infoTv() {
|
private void infoTv() {
|
||||||
String isactivation = (String) SPUtils.getSp(SettingActivity.this, FZConfig.IS_ACTIVATION, "");
|
String isactivation = (String) SPUtils.getSp(SettingActivity.this, FZConfig.IS_ACTIVATION, "");
|
||||||
ArrayList<DouyinBean> douyinBeans = douyinDao.queryAll();
|
ArrayList<DouyinBean> douyinBeans = douyinDao.queryAll();
|
||||||
if (douyinBeans.size() == 3&&isactivation.equals("0")) {
|
if (douyinBeans.size() == 3 && isactivation.equals("0")) {
|
||||||
binding.tvAut.setText("激活授权(可授权)");
|
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<zhuanghaoBeanData> phoneNumber = urgentTaskBean.getData();
|
|
||||||
//phoneNumber = urgentTaskBean.getData();
|
|
||||||
//导入通讯录
|
|
||||||
ContactsHelp.getInstance(ctx).importContacts(phoneNumber);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
@@ -306,7 +293,7 @@ public class SettingActivity extends BaseActivity {
|
|||||||
final HttpParams paramsPost = new HttpParams();
|
final HttpParams paramsPost = new HttpParams();
|
||||||
paramsPost.put("device_id", device_id);//扫码(设备)id
|
paramsPost.put("device_id", device_id);//扫码(设备)id
|
||||||
paramsPost.put("douyin", s);// 抖音号
|
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("online_status", "");//阿童木在线状态
|
||||||
paramsPost.put("control_status", "");//控制状态
|
paramsPost.put("control_status", "");//控制状态
|
||||||
paramsPost.put("network_type", "");//网络类型
|
paramsPost.put("network_type", "");//网络类型
|
||||||
@@ -325,11 +312,11 @@ public class SettingActivity extends BaseActivity {
|
|||||||
String msg = jsonObject.getString("msg");
|
String msg = jsonObject.getString("msg");
|
||||||
ToastUtils.showShort(msg);
|
ToastUtils.showShort(msg);
|
||||||
String success = jsonObject.getString("success");
|
String success = jsonObject.getString("success");
|
||||||
if(success.equals("0")){
|
if (success.equals("0")) {
|
||||||
SPUtils.setSP(SettingActivity.this, FZConfig.IS_ACTIVATION, "0");
|
SPUtils.setSP(SettingActivity.this, FZConfig.IS_ACTIVATION, "0");
|
||||||
LiveEventBus.get("success").post("str");
|
LiveEventBus.get("success").post("str");
|
||||||
finish();
|
finish();
|
||||||
}else {
|
} else {
|
||||||
com.fisherbone.fuzhu.utils.ToastUtils.showToast(SettingActivity.this, msg);
|
com.fisherbone.fuzhu.utils.ToastUtils.showToast(SettingActivity.this, msg);
|
||||||
SPUtils.setSP(SettingActivity.this, FZConfig.IS_ACTIVATION, "0");
|
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();
|
final HttpParams paramsPost = new HttpParams();
|
||||||
paramsPost.put("control_status", control_status);//网络类型1:云端 0:本地
|
paramsPost.put("control_status", control_status);//网络类型1:云端 0:本地
|
||||||
new NetApi().getPostData(paramsPost, HttpConstants.URi_device_Appoperate_updateControlStatus).subscribe(new Observer<Response>() {
|
new NetApi().getPostData(paramsPost, HttpConstants.URi_device_Appoperate_updateControlStatus).subscribe(new Observer<Response>() {
|
||||||
@@ -361,7 +348,7 @@ public class SettingActivity extends BaseActivity {
|
|||||||
JSONObject jsonObject = new JSONObject(body);
|
JSONObject jsonObject = new JSONObject(body);
|
||||||
String msg = jsonObject.getString("msg");
|
String msg = jsonObject.getString("msg");
|
||||||
String success = jsonObject.getString("success");
|
String success = jsonObject.getString("success");
|
||||||
if(success.equals("0")){
|
if (success.equals("0")) {
|
||||||
LiveEventBus.get("success").post("str");
|
LiveEventBus.get("success").post("str");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -383,70 +370,69 @@ public class SettingActivity extends BaseActivity {
|
|||||||
*/
|
*/
|
||||||
private void getPhoneNum(String s) {
|
private void getPhoneNum(String s) {
|
||||||
String device_id = (String) SPUtils.getSp(SettingActivity.this, FZConfig.KEY_DEVICE_ID, "");
|
String device_id = (String) SPUtils.getSp(SettingActivity.this, FZConfig.KEY_DEVICE_ID, "");
|
||||||
final HttpParams paramsPost = new HttpParams();
|
TecentNetworkApi.getService(NewsApiInterface.class)
|
||||||
paramsPost.put("device_id", device_id);
|
.getPhoneNum(device_id, s)
|
||||||
paramsPost.put("number", s);
|
.subscribe(new BaseObserver<touchTaskBean>() {
|
||||||
new NetApi().getPostData(paramsPost, HttpConstants.URi_Device_Appoperate_getPhone).subscribe(new Observer<Response>() {
|
@Override
|
||||||
@Override
|
public void onSuccess(touchTaskBean urgentTaskBean) {
|
||||||
public void onNext(Response response) {
|
int success = urgentTaskBean.getSuccess();
|
||||||
String body = (String) response.body();
|
if (success == 0) {
|
||||||
touchTasktwo(SettingActivity.this,body);
|
List<zhuanghaoBeanData> phoneNumber = urgentTaskBean.getData();
|
||||||
}
|
//phoneNumber = urgentTaskBean.getData();
|
||||||
|
//导入通讯录
|
||||||
@Override
|
ContactsHelp.getInstance(SettingActivity.this).importContacts(phoneNumber);
|
||||||
public void onError(Exception e) {
|
}
|
||||||
e.printStackTrace();
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable e) {
|
||||||
|
Log.e("Error", "Message:" + e.getMessage());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求最新版本号
|
* 请求最新版本号
|
||||||
*/
|
*/
|
||||||
private void requestVersion() {
|
private void requestVersion() {
|
||||||
|
TecentNetworkApi.getService(NewsApiInterface.class)
|
||||||
final HttpParams paramsPost = new HttpParams();
|
.getNowVersion()
|
||||||
new NetApi().getPostDatatwo(paramsPost, HttpConstants.URi_Device_Appoperate_NowVersion).subscribe(new Observer<Response>() {
|
.subscribe(new BaseObserver<GetVesionResponseBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onNext(Response response) {
|
public void onSuccess(GetVesionResponseBean newsChannelsBean) {
|
||||||
String body = (String) response.body();
|
Log.e("MainActivity", new Gson().toJson(newsChannelsBean));
|
||||||
|
String newVersion = newsChannelsBean.getVersion();
|
||||||
GetVesionResponseBean groupStatisticalBean = JsonUtils.fromJson(body, GetVesionResponseBean.class);
|
if (newVersion != null) {
|
||||||
String newVersion = groupStatisticalBean.getVersion();
|
String versionn = getVersionn();
|
||||||
if(newVersion!=null){
|
int versionUpdate = VersionUtils.compareVersion(versionn, newVersion);
|
||||||
String versionn = getVersionn();
|
if (VALUE_ZERO.equals(newsChannelsBean.getSuccess() + "")) {
|
||||||
//versionn = "1.0.2";
|
if (versionUpdate == -1) {//两个版本相同
|
||||||
int versionUpdate = VersionUtils.compareVersion(versionn, newVersion);
|
ADialog mShareWechatDialog = new ADialog(SettingActivity.this, 0, newsChannelsBean);
|
||||||
if(groupStatisticalBean.getSuccess().equals("0")){
|
mShareWechatDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//代码中取消标题栏
|
||||||
if (versionUpdate == -1) {//两个版本相同
|
mShareWechatDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
ADialog mShareWechatDialog = new ADialog(SettingActivity.this, 0, groupStatisticalBean);
|
Window win = mShareWechatDialog.getWindow();
|
||||||
mShareWechatDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//代码中取消标题栏
|
win.getDecorView().setPadding(0, 0, 0, 0);
|
||||||
mShareWechatDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
WindowManager.LayoutParams lp = win.getAttributes();
|
||||||
Window win = mShareWechatDialog.getWindow();
|
lp.width = WindowManager.LayoutParams.FILL_PARENT;
|
||||||
win.getDecorView().setPadding(0, 0, 0, 0);
|
lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||||
WindowManager.LayoutParams lp = win.getAttributes();
|
win.setAttributes(lp);
|
||||||
lp.width = WindowManager.LayoutParams.FILL_PARENT;
|
mShareWechatDialog.setCancelable(false);
|
||||||
lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
mShareWechatDialog.show();
|
||||||
win.setAttributes(lp);
|
} else {//没有最新版本
|
||||||
mShareWechatDialog.setCancelable(false);
|
ToastUtils.showShort("当前已是最新版本");
|
||||||
mShareWechatDialog.show();
|
}
|
||||||
} else {//没有最新版本
|
}
|
||||||
ToastUtils.showShort("当前已是最新版本");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception e) {
|
public void onFailure(Throwable e) {
|
||||||
e.printStackTrace();
|
Log.e("Error", "Message:" + e.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ADialog extends Dialog implements View.OnClickListener {
|
class ADialog extends Dialog implements View.OnClickListener {
|
||||||
|
|
||||||
private Context context;
|
private Context context;
|
||||||
@@ -463,12 +449,13 @@ public class SettingActivity extends BaseActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
this.setContentView(R.layout.version_dailog);
|
this.setContentView(R.layout.version_dailog);
|
||||||
|
|
||||||
if(isHuaWei()){
|
if (isHuaWei()) {
|
||||||
launchAppDetail(SettingActivity.this, "com.fanghoo.mendian", "com.huawei.appmarket");
|
launchAppDetail(SettingActivity.this, "com.fanghoo.mendian", "com.huawei.appmarket");
|
||||||
}else {
|
} else {
|
||||||
launchAppDetail(SettingActivity.this, "com.fanghoo.mendian", "com.tencent.android.qqdownloader");
|
launchAppDetail(SettingActivity.this, "com.fanghoo.mendian", "com.tencent.android.qqdownloader");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void launchAppDetail(final Context context, final String appPkg, final String marketPkg) {
|
public void launchAppDetail(final Context context, final String appPkg, final String marketPkg) {
|
||||||
|
|
||||||
String content = mGetVesionResponseBean.getContent();
|
String content = mGetVesionResponseBean.getContent();
|
||||||
@@ -501,6 +488,7 @@ public class SettingActivity extends BaseActivity {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isHuaWei() {
|
public static boolean isHuaWei() {
|
||||||
String manufacturer = Build.MANUFACTURER;
|
String manufacturer = Build.MANUFACTURER;
|
||||||
//这个字符串可以自己定义,例如判断华为就填写huawei,魅族就填写meizu
|
//这个字符串可以自己定义,例如判断华为就填写huawei,魅族就填写meizu
|
||||||
@@ -509,6 +497,7 @@ public class SettingActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void zhuxiao() {
|
private void zhuxiao() {
|
||||||
String device_id = (String) SPUtils.getSp(SettingActivity.this, FZConfig.KEY_DEVICE_ID, "");
|
String device_id = (String) SPUtils.getSp(SettingActivity.this, FZConfig.KEY_DEVICE_ID, "");
|
||||||
final HttpParams paramsPost = new HttpParams();
|
final HttpParams paramsPost = new HttpParams();
|
||||||
|
|||||||
@@ -660,7 +660,7 @@ public class StartTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void tastJiexisix(String body) {
|
private void tastJiexisix(String body) {
|
||||||
Log.e("TIAOSHI###", "抢红包的数据开始解析");
|
Log.e("TIAOSHI###", "直播间加热的数据开始解析");
|
||||||
/**
|
/**
|
||||||
-- 直播间加热
|
-- 直播间加热
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
package com.fisherbone.fuzhu.api;
|
package com.fisherbone.fuzhu.api;
|
||||||
|
|
||||||
|
import com.fisherbone.fuzhu.entity.touchTaskBean;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
|
import okhttp3.Call;
|
||||||
|
import retrofit2.http.Field;
|
||||||
|
import retrofit2.http.FormUrlEncoded;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Allen on 2017/7/20.
|
* Created by Allen on 2017/7/20.
|
||||||
@@ -10,4 +17,12 @@ import retrofit2.http.GET;
|
|||||||
public interface NewsApiInterface {
|
public interface NewsApiInterface {
|
||||||
@GET("app/Appoperate/NowVersion")
|
@GET("app/Appoperate/NowVersion")
|
||||||
Observable<GetVesionResponseBean> getNowVersion();
|
Observable<GetVesionResponseBean> getNowVersion();
|
||||||
|
|
||||||
|
@POST("app/Appoperate/getPhone")
|
||||||
|
@FormUrlEncoded
|
||||||
|
Observable<touchTaskBean> getPhoneNum(@Field("device_id") String device_id,
|
||||||
|
@Field("number") String number);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -847,12 +847,46 @@ class HongbaoBase extends BaseAblStep implements RedEnv.RedEnvFunc, RedEnv.TimeF
|
|||||||
// nodeZuobiao(child);
|
// nodeZuobiao(child);
|
||||||
for (int y = 0; y < child.getChildCount(); y++) {
|
for (int y = 0; y < child.getChildCount(); y++) {
|
||||||
AccessibilityNodeInfo child1 = child.getChild(y);
|
AccessibilityNodeInfo child1 = child.getChild(y);
|
||||||
// Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
||||||
// nodeZuobiao(child1);
|
nodeZuobiao(child1);
|
||||||
if ("android.widget.TextView".equals(child1.getClassName())) {
|
|
||||||
if (child1.getText() != null) {
|
if ("android.widget.TextView".equals(child1.getClassName())) {
|
||||||
if (child1.getText().toString().equals("首页")) {
|
if (child1.getText() != null) {
|
||||||
flag = true;
|
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() {
|
public AccessibilityNodeInfo getShouye() {
|
||||||
AccessibilityNodeInfo nodeInfo = null;
|
AccessibilityNodeInfo nodeInfo = null;
|
||||||
@@ -887,6 +921,38 @@ class HongbaoBase extends BaseAblStep implements RedEnv.RedEnvFunc, RedEnv.TimeF
|
|||||||
return nodeInfo;
|
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) {
|
public void runLog(String str) {
|
||||||
LiveEventBus.get("some_key").post(str);
|
LiveEventBus.get("some_key").post(str);
|
||||||
Log.e("TIAOSHI###", str);
|
Log.e("TIAOSHI###", str);
|
||||||
|
|||||||
@@ -29,139 +29,69 @@ public class TestAblStep0 extends BaseAblStep {
|
|||||||
break;
|
break;
|
||||||
case AblSteps.STEP_2:
|
case AblSteps.STEP_2:
|
||||||
AblViewUtil.mySleep(5);
|
AblViewUtil.mySleep(5);
|
||||||
// getNodeInfoh();
|
// getNodeInfoh();
|
||||||
// getNodeInfoy();
|
// getNodeInfoy();
|
||||||
getNodeInfohg();
|
|
||||||
//(0,562),(1080,774)
|
//(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:
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public boolean openTiktok() {
|
||||||
* 寻找控件
|
boolean ifOpen = false;
|
||||||
*/
|
|
||||||
public void getNodeInfohg() {
|
|
||||||
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
|
AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow();
|
||||||
for (int i = 0; i < root.getChildCount(); i++) {
|
for (int i = 0; i < root.getChildCount(); i++) {
|
||||||
AccessibilityNodeInfo child = root.getChild(i);
|
AccessibilityNodeInfo child = root.getChild(i);
|
||||||
// Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
||||||
// nodeZuobiao(child);
|
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++) {
|
for (int y = 0; y < child.getChildCount(); y++) {
|
||||||
AccessibilityNodeInfo child1 = child.getChild(y);
|
AccessibilityNodeInfo child1 = child.getChild(y);
|
||||||
// Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription());
|
||||||
// nodeZuobiao(child1);
|
nodeZuobiao(child1);
|
||||||
|
|
||||||
for (int j = 0; j < child1.getChildCount(); j++) {
|
for (int j = 0; j < child1.getChildCount(); j++) {
|
||||||
AccessibilityNodeInfo child2 = child1.getChild(j);
|
AccessibilityNodeInfo child2 = child1.getChild(j);
|
||||||
if ("androidx.recyclerview.widget.RecyclerView".equals(child2.getClassName())) {
|
Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child2.getContentDescription());
|
||||||
// if (j == child1.getChildCount() - 1) {
|
nodeZuobiao(child2);
|
||||||
Rect rect = new Rect();
|
|
||||||
child2.getBoundsInScreen(rect);
|
|
||||||
if (rect.right > 0) {
|
|
||||||
// Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child2.getContentDescription());
|
|
||||||
// nodeZuobiao(child2);
|
|
||||||
|
|
||||||
for (int x = 0; x < child2.getChildCount(); x++) {
|
if ("android.widget.TextView".equals(child2.getClassName())) {
|
||||||
AccessibilityNodeInfo child3 = child2.getChild(x);
|
if (child2.getText() != null) {
|
||||||
// Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription());
|
if (child2.getText().toString().equals("首页")) {
|
||||||
// nodeZuobiao(child3);
|
flag = true;
|
||||||
|
|
||||||
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, "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,8 @@ public class TestAblStep32 extends NoticeBase {
|
|||||||
case AblSteps.STEP_232:
|
case AblSteps.STEP_232:
|
||||||
AblViewUtil.mySleep(3);
|
AblViewUtil.mySleep(3);
|
||||||
Log.e("TIAOSHI###", "56778");
|
Log.e("TIAOSHI###", "56778");
|
||||||
if (this.objects.size() == 0) {
|
// if (this.objects.size() == 0) {
|
||||||
|
if (0 == 0) {
|
||||||
AblViewUtil.potgegin("停止");
|
AblViewUtil.potgegin("停止");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,9 +109,9 @@ public class TestAblStep34 extends HongbaoBase implements RedEnv.RedEnvFunc, Red
|
|||||||
againStart("0");
|
againStart("0");
|
||||||
AblViewUtil.back();
|
AblViewUtil.back();
|
||||||
AblViewUtil.mySleep(2);
|
AblViewUtil.mySleep(2);
|
||||||
boolean b2 = ifShouye();
|
boolean b2 = ifShouyetwo();
|
||||||
if (b2) {
|
if (b2) {
|
||||||
AccessibilityNodeInfo shouye = getShouye();
|
AccessibilityNodeInfo shouye = getShouyetwo();
|
||||||
clickNodeInfo(shouye, "首页");
|
clickNodeInfo(shouye, "首页");
|
||||||
AblStepHandler.sendMsg(AblSteps.STEP_252);
|
AblStepHandler.sendMsg(AblSteps.STEP_252);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ ext {
|
|||||||
applicationId : "com.fisherbone.fuzhu",
|
applicationId : "com.fisherbone.fuzhu",
|
||||||
minSdkVersion : 24,
|
minSdkVersion : 24,
|
||||||
targetSdkVersion : 29,
|
targetSdkVersion : 29,
|
||||||
versionCode : 172,
|
versionCode : 173,
|
||||||
versionName : "1.7.2",
|
versionName : "1.7.3",
|
||||||
testInstrumentationRunner: "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner: "androidx.test.runner.AndroidJUnitRunner"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user