|
@@ -9,6 +9,7 @@ import android.content.Intent;
|
|
|
import android.net.Uri;
|
|
import android.net.Uri;
|
|
|
import android.provider.Settings;
|
|
import android.provider.Settings;
|
|
|
import android.support.v7.app.AlertDialog;
|
|
import android.support.v7.app.AlertDialog;
|
|
|
|
|
+import android.text.TextUtils;
|
|
|
import android.util.Log;
|
|
import android.util.Log;
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
|
import android.view.accessibility.AccessibilityManager;
|
|
import android.view.accessibility.AccessibilityManager;
|
|
@@ -20,12 +21,14 @@ import com.kfzs.duanduan.ActMain;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.CreditCard;
|
|
import com.sheep.gamegroup.model.entity.CreditCard;
|
|
|
import com.sheep.gamegroup.model.entity.DialogConfig;
|
|
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.LoginEntity;
|
|
|
import com.sheep.gamegroup.model.entity.LoginUser;
|
|
import com.sheep.gamegroup.model.entity.LoginUser;
|
|
|
import com.sheep.gamegroup.model.entity.TaskEty;
|
|
import com.sheep.gamegroup.model.entity.TaskEty;
|
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
import com.sheep.gamegroup.model.entity.UserEntity;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.view.activity.ActInstallApkList;
|
|
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.BuildConfig;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
@@ -185,7 +188,7 @@ public class TestUtil {
|
|
|
if (isTest()) {
|
|
if (isTest()) {
|
|
|
final List<LoginUser> loginUserList = MyDbManager.getInstance().getAllLoginUser();
|
|
final List<LoginUser> loginUserList = MyDbManager.getInstance().getAllLoginUser();
|
|
|
if(ListUtil.isEmpty(loginUserList)){
|
|
if(ListUtil.isEmpty(loginUserList)){
|
|
|
- G.showToast("无用户");
|
|
|
|
|
|
|
+// G.showToast("无用户");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
final List<Object> list = ListUtil.emptyList();
|
|
final List<Object> list = ListUtil.emptyList();
|
|
@@ -270,7 +273,7 @@ public class TestUtil {
|
|
|
* @param activity
|
|
* @param activity
|
|
|
*/
|
|
*/
|
|
|
public static void test(final Activity activity) {
|
|
public static void test(final Activity activity) {
|
|
|
- final String[] items = {"显示已经安装应用列表","启动辅助","任务游戏列表","世界杯活动","交通银行信用卡测试", "浦发银行信用卡测试", "测试游戏模块","打卡成功提示","定向货币详情","提交身份认证时的提示", "检查标签", "友盟分享"};
|
|
|
|
|
|
|
+ final String[] items = {"显示已经安装应用列表","复制token","复制faq地址","复制代理地址","复制世界杯地址","任务游戏列表","世界杯活动","交通银行信用卡测试", "浦发银行信用卡测试", "测试游戏模块","打卡成功提示","定向货币详情","提交身份认证时的提示", "检查标签", "友盟分享"};
|
|
|
AlertDialog dialog = new AlertDialog.Builder(activity).setTitle("请选择测试项目")
|
|
AlertDialog dialog = new AlertDialog.Builder(activity).setTitle("请选择测试项目")
|
|
|
.setItems(items, new DialogInterface.OnClickListener() {
|
|
.setItems(items, new DialogInterface.OnClickListener() {
|
|
|
|
|
|
|
@@ -280,10 +283,17 @@ public class TestUtil {
|
|
|
case "显示已经安装应用列表":
|
|
case "显示已经安装应用列表":
|
|
|
showHasInstallApkList(activity);
|
|
showHasInstallApkList(activity);
|
|
|
break;
|
|
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;
|
|
break;
|
|
|
case "任务游戏列表":
|
|
case "任务游戏列表":
|
|
|
Jump2View.getInstance().goGameMakeMoney(activity);
|
|
Jump2View.getInstance().goGameMakeMoney(activity);
|
|
@@ -348,6 +358,32 @@ public class TestUtil {
|
|
|
dialog.show();
|
|
dialog.show();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private static void copyUrl(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())) {
|
|
|
|
|
+ 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) {
|
|
private static void showHasInstallApkList(Activity activity) {
|
|
|
Intent intent = new Intent(activity, ActInstallApkList.class);
|
|
Intent intent = new Intent(activity, ActInstallApkList.class);
|
|
|
activity.startActivity(intent);
|
|
activity.startActivity(intent);
|