|
|
@@ -2,34 +2,34 @@ package com.sheep.gamegroup.util;
|
|
|
|
|
|
import android.app.Activity;
|
|
|
import android.app.DownloadManager;
|
|
|
-import android.content.ComponentName;
|
|
|
import android.content.Context;
|
|
|
import android.content.DialogInterface;
|
|
|
import android.content.Intent;
|
|
|
import android.net.Uri;
|
|
|
-import android.provider.Settings;
|
|
|
import android.support.v7.app.AlertDialog;
|
|
|
+import android.text.TextUtils;
|
|
|
import android.util.Log;
|
|
|
import android.view.View;
|
|
|
-import android.view.accessibility.AccessibilityManager;
|
|
|
import android.widget.ArrayAdapter;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.kfzs.duanduan.ActMain;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.CreditCard;
|
|
|
import com.sheep.gamegroup.model.entity.DialogConfig;
|
|
|
+import com.sheep.gamegroup.model.entity.Ext;
|
|
|
import com.sheep.gamegroup.model.entity.LoginEntity;
|
|
|
import com.sheep.gamegroup.model.entity.LoginUser;
|
|
|
import com.sheep.gamegroup.model.entity.TaskEty;
|
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.view.activity.ActInstallApkList;
|
|
|
+import com.sheep.gamegroup.view.activity.ActWeb;
|
|
|
import com.sheep.jiuyan.samllsheep.BuildConfig;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
-import com.sheep.jiuyan.samllsheep.service.MonitorAppService;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.SpUtils;
|
|
|
import com.umeng.socialize.ShareAction;
|
|
|
@@ -38,8 +38,6 @@ import com.umeng.socialize.bean.SHARE_MEDIA;
|
|
|
import com.umeng.socialize.media.UMImage;
|
|
|
|
|
|
import java.io.File;
|
|
|
-import java.lang.reflect.InvocationTargetException;
|
|
|
-import java.lang.reflect.Method;
|
|
|
import java.util.List;
|
|
|
import java.util.Locale;
|
|
|
|
|
|
@@ -185,7 +183,7 @@ public class TestUtil {
|
|
|
if (isTest()) {
|
|
|
final List<LoginUser> loginUserList = MyDbManager.getInstance().getAllLoginUser();
|
|
|
if(ListUtil.isEmpty(loginUserList)){
|
|
|
- G.showToast("无用户");
|
|
|
+// G.showToast("无用户");
|
|
|
return;
|
|
|
}
|
|
|
final List<Object> list = ListUtil.emptyList();
|
|
|
@@ -270,7 +268,7 @@ public class TestUtil {
|
|
|
* @param activity
|
|
|
*/
|
|
|
public static void test(final Activity activity) {
|
|
|
- final String[] items = {"显示已经安装应用列表","启动辅助","任务游戏列表","世界杯活动","交通银行信用卡测试", "浦发银行信用卡测试", "测试游戏模块","打卡成功提示","定向货币详情","提交身份认证时的提示", "检查标签", "友盟分享"};
|
|
|
+ final String[] items = {"显示已经安装应用列表","复制token","复制faq地址","复制代理地址","复制世界杯地址","任务游戏列表","世界杯活动","交通银行信用卡测试", "浦发银行信用卡测试", "测试游戏模块","打卡成功提示","定向货币详情","提交身份认证时的提示", "检查标签", "友盟分享"};
|
|
|
AlertDialog dialog = new AlertDialog.Builder(activity).setTitle("请选择测试项目")
|
|
|
.setItems(items, new DialogInterface.OnClickListener() {
|
|
|
|
|
|
@@ -280,10 +278,17 @@ public class TestUtil {
|
|
|
case "显示已经安装应用列表":
|
|
|
showHasInstallApkList(activity);
|
|
|
break;
|
|
|
- case "启动辅助":
|
|
|
- Intent intent2 = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
|
|
|
- intent2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
|
- SheepApp.getInstance().startActivity(intent2);
|
|
|
+ case "复制token":
|
|
|
+ StringUtils.CopyText(activity, SpUtils.getOpenId(activity));
|
|
|
+ break;
|
|
|
+ case "复制faq地址":
|
|
|
+ copyUrl("faqurl");
|
|
|
+ break;
|
|
|
+ case "复制代理地址":
|
|
|
+ copyUrl("agenturl");
|
|
|
+ break;
|
|
|
+ case "复制世界杯地址":
|
|
|
+ copyUrl("world_cup_url");
|
|
|
break;
|
|
|
case "任务游戏列表":
|
|
|
Jump2View.getInstance().goGameMakeMoney(activity);
|
|
|
@@ -348,6 +353,41 @@ public class TestUtil {
|
|
|
dialog.show();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private static void copyUrl(final String name) {
|
|
|
+ SheepApp.getInstance().getNetComponent().getApiService().getNameUrl(name)
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
+ @Override
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
+ LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
|
|
|
+ Ext ext = baseMessage.getData(Ext.class);
|
|
|
+ if (ext == null){
|
|
|
+ G.showToast("data数据为null");
|
|
|
+ } else if(TextUtils.isEmpty(ext.getUrl())) {
|
|
|
+ JSONObject data = JSONObject.parseObject(baseMessage.getData().toString());
|
|
|
+ if(data.containsKey(name)){
|
|
|
+ String url = data.getString(name);
|
|
|
+ if(!TextUtils.isEmpty(url)) {
|
|
|
+ StringUtils.CopyText(SheepApp.getInstance(), ActWeb.addUrlToken(url));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ G.showToast("data格式不正确");
|
|
|
+ } else {
|
|
|
+ StringUtils.CopyText(SheepApp.getInstance(), ActWeb.addUrlToken(ext.getUrl()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
+ LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
|
|
|
+ G.showToast(baseMessage);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
private static void showHasInstallApkList(Activity activity) {
|
|
|
Intent intent = new Intent(activity, ActInstallApkList.class);
|
|
|
activity.startActivity(intent);
|