|
|
@@ -264,7 +264,7 @@ public class TestUtil {
|
|
|
*/
|
|
|
public static void test(final Activity activity) {
|
|
|
final String[] items = {"复制token", "添加token", "复制打点数据", "从jenkins下载小绵羊安装包", "测试表情包",
|
|
|
- "判断是否添加商城快捷入口",
|
|
|
+ "测试跳转","判断是否添加商城快捷入口",
|
|
|
"跳转QQ", "跳转QQ群", "尝试获取通讯录", "测试有范","测试有范6.0","测试有范7.0","测试有范8.0", "测试设备信息", "下载视频测试", "爱奇艺VIP会员", "分享我的签名的小绵羊apk", "分享当前小绵羊apk",
|
|
|
"测试升级对话框", "少数民族姓名", "开启皮肤", "不开启皮肤", "我的游戏", "优惠券弹窗", "填写收件地址弹窗",
|
|
|
"朗读文字", "游戏搜索", "测试插件", "测试bitmap", "剪切视频", "我的关注", "足迹",
|
|
|
@@ -290,6 +290,9 @@ public class TestUtil {
|
|
|
return;
|
|
|
}
|
|
|
switch (item) {
|
|
|
+ case "测试跳转":
|
|
|
+ testSkip(activity);
|
|
|
+ break;
|
|
|
case "判断是否添加商城快捷入口":
|
|
|
boolean hasShortcut = SysAppUtil.hasShortcut(SheepApp.getInstance(), Config.YF_SHOP_NAME);
|
|
|
G.showToast((hasShortcut ? "已经": "还未") + Config.YF_SHOP_NAME + "桌面快捷入口");
|
|
|
@@ -725,6 +728,59 @@ public class TestUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private static void testSkip(Activity activity) {
|
|
|
+ CharSequence charSequence = StringUtils.getCopyText();
|
|
|
+ if(charSequence == null){
|
|
|
+ G.showToast("请在粘贴板中复现内容,格式如下:com.miui.securitycenter;com.miui.permcenter.permissions.AppPermissionsTabActivity");
|
|
|
+ } else {
|
|
|
+ String copyText = charSequence.toString();
|
|
|
+ String[] items = copyText.split(";");
|
|
|
+ int length = items.length;
|
|
|
+ switch (length){
|
|
|
+ case 1:
|
|
|
+ PackageUtil.startApp(activity, items[0]);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ startActivity(activity, items[0], items[1], null, null);
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ startActivity(activity, items[0], items[1], items[2], null);
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ startActivity(activity, items[0], items[1], items[3], items[4]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
+ private static boolean startActivity(Context context, String packageName, String className, String action, String extraPkgName){
|
|
|
+ Intent intent;
|
|
|
+ if(TextUtils.isEmpty(action))
|
|
|
+ intent = new Intent();
|
|
|
+ else
|
|
|
+ intent = new Intent(action);
|
|
|
+// intent.setClassName("com.miui.securitycenter", "com.miui.permcenter.permissions.PermissionAppsEditorActivity");//快捷方式权限设置界面
|
|
|
+// intent.setClassName("com.miui.securitycenter", "com.miui.permcenter.permissions.AppPermissionsTabActivity");
|
|
|
+ if(!TextUtils.isEmpty(extraPkgName)) {
|
|
|
+ intent.putExtra("extra_pkgname", extraPkgName);
|
|
|
+ }
|
|
|
+ intent.setClassName(packageName, className);
|
|
|
+ if(QQUtil.isValidIntent(context, intent)){
|
|
|
+ try{
|
|
|
+ context.startActivity(intent);
|
|
|
+ G.showToast("启动成功");
|
|
|
+ return true;
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ G.showToast(e);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ G.showToast("启动失败");
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 测试设备信息
|