|
@@ -57,44 +57,40 @@ public class MiddleSchemeAct extends Activity {
|
|
|
return;
|
|
return;
|
|
|
switch (action) {
|
|
switch (action) {
|
|
|
case Intent.ACTION_VIEW:
|
|
case Intent.ACTION_VIEW:
|
|
|
- finish();
|
|
|
|
|
Uri uri = intent.getData();
|
|
Uri uri = intent.getData();
|
|
|
if (uri != null) {
|
|
if (uri != null) {
|
|
|
- // 完整的url信息
|
|
|
|
|
-// if (TestUtil.isTest())
|
|
|
|
|
-// G.showToast(uri.toString());
|
|
|
|
|
- LogUtil.println("SheepApp mActivityCount" + SheepApp.getInstance().mActivityCount);
|
|
|
|
|
if (SheepApp.getInstance().mActivityCount == 0 && !"game_coupon".equals(uri.getQueryParameter("type"))) {
|
|
if (SheepApp.getInstance().mActivityCount == 0 && !"game_coupon".equals(uri.getQueryParameter("type"))) {
|
|
|
ActionUtil.getInstance().addNextAction("scheme", uri);
|
|
ActionUtil.getInstance().addNextAction("scheme", uri);
|
|
|
tryGoSplashAct(SheepApp.getInstance(), uri);
|
|
tryGoSplashAct(SheepApp.getInstance(), uri);
|
|
|
} else {
|
|
} else {
|
|
|
- parseAndJumpUri(SheepApp.getInstance().getCurrentActivity(), uri);
|
|
|
|
|
|
|
+ parseAndJumpUri(SheepApp.getInstance(), uri);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ finish();
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//解析并跳转
|
|
//解析并跳转
|
|
|
- public static void parseAndJumpUri(Activity activity, Uri uri) {
|
|
|
|
|
|
|
+ public static void parseAndJumpUri(Context context, Uri uri) {
|
|
|
String type = uri.getQueryParameter("type");
|
|
String type = uri.getQueryParameter("type");
|
|
|
if (type == null) {
|
|
if (type == null) {
|
|
|
// 尝试获取game_id
|
|
// 尝试获取game_id
|
|
|
//sheep://small.kfzs.com/xmy?game_id=1385&code=976873
|
|
//sheep://small.kfzs.com/xmy?game_id=1385&code=976873
|
|
|
- tryGoSplashAct(activity, uri);
|
|
|
|
|
|
|
+ tryGoSplashAct(context, uri);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
//尝试解密数据
|
|
//尝试解密数据
|
|
|
String json = BaseMessageConverter.decrypt(uri.getQueryParameter("data"));
|
|
String json = BaseMessageConverter.decrypt(uri.getQueryParameter("data"));
|
|
|
switch (type) {
|
|
switch (type) {
|
|
|
default://尝试获取game_id
|
|
default://尝试获取game_id
|
|
|
- tryGoSplashAct(activity, uri);
|
|
|
|
|
|
|
+ tryGoSplashAct(context, uri);
|
|
|
break;
|
|
break;
|
|
|
//sheep://small.kfzs.com/xmy?type=bind_mobile
|
|
//sheep://small.kfzs.com/xmy?type=bind_mobile
|
|
|
//sheep://small.kfzs.com/xmy?type=bm
|
|
//sheep://small.kfzs.com/xmy?type=bm
|
|
|
case "bm"://跳转绑定手机
|
|
case "bm"://跳转绑定手机
|
|
|
case "bind_mobile"://跳转绑定手机
|
|
case "bind_mobile"://跳转绑定手机
|
|
|
- Jump2View.getInstance().goBindPhone(activity, null);
|
|
|
|
|
|
|
+ Jump2View.getInstance().goBindPhone(context, null);
|
|
|
break;
|
|
break;
|
|
|
//sheep://small.kfzs.com/xmy?type=welfare
|
|
//sheep://small.kfzs.com/xmy?type=welfare
|
|
|
//sheep://small.kfzs.com/xmy?type=wfa
|
|
//sheep://small.kfzs.com/xmy?type=wfa
|
|
@@ -104,17 +100,18 @@ public class MiddleSchemeAct extends Activity {
|
|
|
break;
|
|
break;
|
|
|
case "game_coupon":
|
|
case "game_coupon":
|
|
|
Jump2View.getInstance().goWeb(
|
|
Jump2View.getInstance().goWeb(
|
|
|
- activity,
|
|
|
|
|
|
|
+ context,
|
|
|
new WebParams(
|
|
new WebParams(
|
|
|
Config.getUrlByPath(Config.PATH_MY_GAME_COUPON, "authorization", json),
|
|
Config.getUrlByPath(Config.PATH_MY_GAME_COUPON, "authorization", json),
|
|
|
- "代金券中心"));
|
|
|
|
|
|
|
+ "代金券中心"),
|
|
|
|
|
+ true);
|
|
|
break;
|
|
break;
|
|
|
//sheep://small.kfzs.com/xmy?type=jhl&data={"Jump":"1"}
|
|
//sheep://small.kfzs.com/xmy?type=jhl&data={"Jump":"1"}
|
|
|
case "jump_home_list"://跳转homeList
|
|
case "jump_home_list"://跳转homeList
|
|
|
case "jhl":
|
|
case "jhl":
|
|
|
try {
|
|
try {
|
|
|
HomeListEntity item = JSONObject.parseObject(json, HomeListEntity.class);
|
|
HomeListEntity item = JSONObject.parseObject(json, HomeListEntity.class);
|
|
|
- CommonUtil.getInstance().goNative(activity, item, "view");
|
|
|
|
|
|
|
+ CommonUtil.getInstance().goNative(context, item, "view");
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
if (TestUtil.isTest() && TextUtils.isEmpty(e.getMessage()))
|
|
if (TestUtil.isTest() && TextUtils.isEmpty(e.getMessage()))
|
|
@@ -126,7 +123,7 @@ public class MiddleSchemeAct extends Activity {
|
|
|
case "jum":
|
|
case "jum":
|
|
|
try {
|
|
try {
|
|
|
UserCenterModule item = JSONObject.parseObject(json, UserCenterModule.class);
|
|
UserCenterModule item = JSONObject.parseObject(json, UserCenterModule.class);
|
|
|
- CommonUtil.getInstance().goNative(activity, item, "view");
|
|
|
|
|
|
|
+ CommonUtil.getInstance().goNative(context, item, "view");
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
if (TestUtil.isTest() && TextUtils.isEmpty(e.getMessage()))
|
|
if (TestUtil.isTest() && TextUtils.isEmpty(e.getMessage()))
|
|
@@ -145,7 +142,7 @@ public class MiddleSchemeAct extends Activity {
|
|
|
case "jss":
|
|
case "jss":
|
|
|
try {
|
|
try {
|
|
|
SlideshowEty item = JSONObject.parseObject(json, SlideshowEty.class);
|
|
SlideshowEty item = JSONObject.parseObject(json, SlideshowEty.class);
|
|
|
- CommonUtil.getInstance().clickBanner(activity, item);
|
|
|
|
|
|
|
+ CommonUtil.getInstance().clickBanner(context, item);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
if (TestUtil.isTest() && TextUtils.isEmpty(e.getMessage()))
|
|
if (TestUtil.isTest() && TextUtils.isEmpty(e.getMessage()))
|
|
@@ -164,13 +161,13 @@ public class MiddleSchemeAct extends Activity {
|
|
|
boolean packageNameIsEmpty = TextUtils.isEmpty(packageName);
|
|
boolean packageNameIsEmpty = TextUtils.isEmpty(packageName);
|
|
|
boolean classNameIsEmpty = TextUtils.isEmpty(className);
|
|
boolean classNameIsEmpty = TextUtils.isEmpty(className);
|
|
|
if (packageNameIsEmpty && classNameIsEmpty) {
|
|
if (packageNameIsEmpty && classNameIsEmpty) {
|
|
|
- tryGoSplashAct(activity, uri);
|
|
|
|
|
|
|
+ tryGoSplashAct(context, uri);
|
|
|
} else if (packageNameIsEmpty) {
|
|
} else if (packageNameIsEmpty) {
|
|
|
- runApp(activity, activity.getPackageName(), className);
|
|
|
|
|
|
|
+ runApp(context, context.getPackageName(), className);
|
|
|
} else if (classNameIsEmpty) {
|
|
} else if (classNameIsEmpty) {
|
|
|
- PackageUtil.startApp(activity, packageName);
|
|
|
|
|
|
|
+ PackageUtil.startApp(context, packageName);
|
|
|
} else {
|
|
} else {
|
|
|
- runApp(activity, packageName, className);
|
|
|
|
|
|
|
+ runApp(context, packageName, className);
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
//sheep://small.kfzs.com/xmy?type=po&a=6506346179440152576&b=1
|
|
//sheep://small.kfzs.com/xmy?type=po&a=6506346179440152576&b=1
|
|
@@ -179,7 +176,7 @@ public class MiddleSchemeAct extends Activity {
|
|
|
String order_no = uri.getQueryParameter("a");
|
|
String order_no = uri.getQueryParameter("a");
|
|
|
String merchandise_id = uri.getQueryParameter("b");
|
|
String merchandise_id = uri.getQueryParameter("b");
|
|
|
String url = String.format(Locale.CHINA, "http://%s/#/placing-orders/%s?merchandise_id=%s", TextUtils.equals("sheep", BuildConfig.FLAVOR) ? "smallstation.kfzs.com/iqiyi_vip_member" : "10.8.220.248:8080", order_no, merchandise_id);
|
|
String url = String.format(Locale.CHINA, "http://%s/#/placing-orders/%s?merchandise_id=%s", TextUtils.equals("sheep", BuildConfig.FLAVOR) ? "smallstation.kfzs.com/iqiyi_vip_member" : "10.8.220.248:8080", order_no, merchandise_id);
|
|
|
- ViewUtil.showMsgDialog(activity, new DialogConfig().setMsg("你有一个拼单邀请,是否立即前往?")
|
|
|
|
|
|
|
+ ViewUtil.showMsgDialog(context, new DialogConfig().setMsg("你有一个拼单邀请,是否立即前往?")
|
|
|
.setBtnLeftText("取消").setBtnRightText("前往")
|
|
.setBtnLeftText("取消").setBtnRightText("前往")
|
|
|
.setBtnRightOnClickListener(view -> Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), new WebParams(url).setTitle("爱奇艺会员VIP"))));
|
|
.setBtnRightOnClickListener(view -> Jump2View.getInstance().goWeb(SheepApp.getInstance().getCurrentActivity(), new WebParams(url).setTitle("爱奇艺会员VIP"))));
|
|
|
break;
|
|
break;
|
|
@@ -187,7 +184,7 @@ public class MiddleSchemeAct extends Activity {
|
|
|
case "startAlermApp":
|
|
case "startAlermApp":
|
|
|
int hour = NumberFormatUtils.parseInteger(uri.getQueryParameter("hour"), 7);
|
|
int hour = NumberFormatUtils.parseInteger(uri.getQueryParameter("hour"), 7);
|
|
|
int min = NumberFormatUtils.parseInteger(uri.getQueryParameter("min"), 5);
|
|
int min = NumberFormatUtils.parseInteger(uri.getQueryParameter("min"), 5);
|
|
|
- SysAppUtil.startAlermApp(activity, activity.getString(R.string.smallsheep_checkin_task), hour, min);
|
|
|
|
|
|
|
+ SysAppUtil.startAlermApp(context, context.getString(R.string.smallsheep_checkin_task), hour, min);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
// LogUtil.println("ActMain", "checkScheme","url: " + url);
|
|
// LogUtil.println("ActMain", "checkScheme","url: " + url);
|
|
@@ -216,11 +213,11 @@ public class MiddleSchemeAct extends Activity {
|
|
|
// }
|
|
// }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static void runApp(Activity activity, String packageName, String className) {
|
|
|
|
|
|
|
+ public static void runApp(Context context, String packageName, String className) {
|
|
|
try {
|
|
try {
|
|
|
Intent intent = new Intent();
|
|
Intent intent = new Intent();
|
|
|
intent.setClassName(packageName, className);
|
|
intent.setClassName(packageName, className);
|
|
|
- activity.startActivity(intent);
|
|
|
|
|
|
|
+ context.startActivity(intent);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
if (TestUtil.isTest() && TextUtils.isEmpty(e.getMessage()))
|
|
if (TestUtil.isTest() && TextUtils.isEmpty(e.getMessage()))
|