|
|
@@ -17,12 +17,14 @@ import com.sheep.gamegroup.model.entity.SlideshowEty;
|
|
|
import com.sheep.gamegroup.model.entity.WebParams;
|
|
|
import com.sheep.gamegroup.util.ActionUtil;
|
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
|
+import com.sheep.gamegroup.util.ConfigUtil;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.LogUtil;
|
|
|
import com.sheep.gamegroup.util.SysAppUtil;
|
|
|
import com.sheep.gamegroup.util.TestUtil;
|
|
|
import com.sheep.gamegroup.util.ViewUtil;
|
|
|
import com.sheep.jiuyan.samllsheep.BuildConfig;
|
|
|
+import com.sheep.jiuyan.samllsheep.Config;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.jiuyan.samllsheep.bean.UserCenterModule;
|
|
|
@@ -62,7 +64,7 @@ public class MiddleSchemeAct extends Activity {
|
|
|
// if (TestUtil.isTest())
|
|
|
// G.showToast(uri.toString());
|
|
|
LogUtil.println("SheepApp mActivityCount" + SheepApp.getInstance().mActivityCount);
|
|
|
- if(SheepApp.getInstance().mActivityCount == 0) {
|
|
|
+ if (SheepApp.getInstance().mActivityCount == 0 && !"game_coupon".equals(uri.getQueryParameter("type"))) {
|
|
|
ActionUtil.getInstance().addNextAction("scheme", uri);
|
|
|
tryGoSplashAct(SheepApp.getInstance(), uri);
|
|
|
} else {
|
|
|
@@ -76,7 +78,7 @@ public class MiddleSchemeAct extends Activity {
|
|
|
//解析并跳转
|
|
|
public static void parseAndJumpUri(Activity activity, Uri uri) {
|
|
|
String type = uri.getQueryParameter("type");
|
|
|
- if(type == null){
|
|
|
+ if (type == null) {
|
|
|
// 尝试获取game_id
|
|
|
//sheep://small.kfzs.com/xmy?game_id=1385&code=976873
|
|
|
tryGoSplashAct(activity, uri);
|
|
|
@@ -84,7 +86,7 @@ public class MiddleSchemeAct extends Activity {
|
|
|
}
|
|
|
//尝试解密数据
|
|
|
String json = BaseMessageConverter.decrypt(uri.getQueryParameter("data"));
|
|
|
- switch (type){
|
|
|
+ switch (type) {
|
|
|
default://尝试获取game_id
|
|
|
tryGoSplashAct(activity, uri);
|
|
|
break;
|
|
|
@@ -100,6 +102,13 @@ public class MiddleSchemeAct extends Activity {
|
|
|
case "wfa"://跳转原生福利专区
|
|
|
Jump2View.getInstance().toActWelfareSpecialArea();
|
|
|
break;
|
|
|
+ case "game_coupon":
|
|
|
+ Jump2View.getInstance().goWeb(
|
|
|
+ activity,
|
|
|
+ new WebParams(
|
|
|
+ Config.getUrlByPath(Config.PATH_MY_GAME_COUPON, "authorization", json),
|
|
|
+ "代金券中心"));
|
|
|
+ break;
|
|
|
//sheep://small.kfzs.com/xmy?type=jhl&data={"Jump":"1"}
|
|
|
case "jump_home_list"://跳转homeList
|
|
|
case "jhl":
|
|
|
@@ -108,7 +117,7 @@ public class MiddleSchemeAct extends Activity {
|
|
|
CommonUtil.getInstance().goNative(activity, item, "view");
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- if(TestUtil.isTest() && TextUtils.isEmpty(e.getMessage()))
|
|
|
+ if (TestUtil.isTest() && TextUtils.isEmpty(e.getMessage()))
|
|
|
G.showToast(e.getMessage());
|
|
|
}
|
|
|
break;
|
|
|
@@ -120,18 +129,18 @@ public class MiddleSchemeAct extends Activity {
|
|
|
CommonUtil.getInstance().goNative(activity, item, "view");
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- if(TestUtil.isTest() && TextUtils.isEmpty(e.getMessage()))
|
|
|
+ if (TestUtil.isTest() && TextUtils.isEmpty(e.getMessage()))
|
|
|
G.showToast(e.getMessage());
|
|
|
}
|
|
|
break;
|
|
|
- //跳转试玩赚钱
|
|
|
- //sheep://small.kfzs.com/xmy?type=jss&data={"Type":1}
|
|
|
- //跳转连续任务
|
|
|
- //sheep://small.kfzs.com/xmy?type=jss&data={"Type":6}
|
|
|
- //跳转办卡赚钱
|
|
|
- //sheep://small.kfzs.com/xmy?type=jss&data={"Type":3}
|
|
|
- //跳转游戏详情 "Id": 351, "name": "神都夜行录",
|
|
|
- //sheep://small.kfzs.com/xmy?type=jss&data={"Type":16,"Ext":"{\"id\":351}"}
|
|
|
+ //跳转试玩赚钱
|
|
|
+ //sheep://small.kfzs.com/xmy?type=jss&data={"Type":1}
|
|
|
+ //跳转连续任务
|
|
|
+ //sheep://small.kfzs.com/xmy?type=jss&data={"Type":6}
|
|
|
+ //跳转办卡赚钱
|
|
|
+ //sheep://small.kfzs.com/xmy?type=jss&data={"Type":3}
|
|
|
+ //跳转游戏详情 "Id": 351, "name": "神都夜行录",
|
|
|
+ //sheep://small.kfzs.com/xmy?type=jss&data={"Type":16,"Ext":"{\"id\":351}"}
|
|
|
case "jump_slide_show"://跳转banner(主页banner或者游戏banner)
|
|
|
case "jss":
|
|
|
try {
|
|
|
@@ -139,7 +148,7 @@ public class MiddleSchemeAct extends Activity {
|
|
|
CommonUtil.getInstance().clickBanner(activity, item);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- if(TestUtil.isTest() && TextUtils.isEmpty(e.getMessage()))
|
|
|
+ if (TestUtil.isTest() && TextUtils.isEmpty(e.getMessage()))
|
|
|
G.showToast(e.getMessage());
|
|
|
}
|
|
|
break;
|
|
|
@@ -154,11 +163,11 @@ public class MiddleSchemeAct extends Activity {
|
|
|
String className = uri.getQueryParameter("className");
|
|
|
boolean packageNameIsEmpty = TextUtils.isEmpty(packageName);
|
|
|
boolean classNameIsEmpty = TextUtils.isEmpty(className);
|
|
|
- if(packageNameIsEmpty && classNameIsEmpty){
|
|
|
+ if (packageNameIsEmpty && classNameIsEmpty) {
|
|
|
tryGoSplashAct(activity, uri);
|
|
|
- } else if(packageNameIsEmpty){
|
|
|
+ } else if (packageNameIsEmpty) {
|
|
|
runApp(activity, activity.getPackageName(), className);
|
|
|
- } else if(classNameIsEmpty) {
|
|
|
+ } else if (classNameIsEmpty) {
|
|
|
PackageUtil.startApp(activity, packageName);
|
|
|
} else {
|
|
|
runApp(activity, packageName, className);
|
|
|
@@ -206,14 +215,15 @@ public class MiddleSchemeAct extends Activity {
|
|
|
// finish();
|
|
|
// }
|
|
|
}
|
|
|
- public static void runApp(Activity activity, String packageName, String className){
|
|
|
+
|
|
|
+ public static void runApp(Activity activity, String packageName, String className) {
|
|
|
try {
|
|
|
Intent intent = new Intent();
|
|
|
intent.setClassName(packageName, className);
|
|
|
activity.startActivity(intent);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- if(TestUtil.isTest() && TextUtils.isEmpty(e.getMessage()))
|
|
|
+ if (TestUtil.isTest() && TextUtils.isEmpty(e.getMessage()))
|
|
|
G.showToast(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
@@ -230,7 +240,7 @@ public class MiddleSchemeAct extends Activity {
|
|
|
*/
|
|
|
public static void tryGoSplashAct(Context context, Uri uri) {
|
|
|
String game_id = uri.getQueryParameter("game_id");
|
|
|
- if(!TextUtils.isEmpty(game_id))//有game_id时设置game_id的回调到主页,用于展示会长推广弹出框
|
|
|
+ if (!TextUtils.isEmpty(game_id))//有game_id时设置game_id的回调到主页,用于展示会长推广弹出框
|
|
|
ActionUtil.getInstance().addNextAction(SHOW_DIALOG_GAME_OR_GIFT_TASK, game_id);
|
|
|
Jump2View.getInstance().newTaskTopStartAct(context, SplashAct.class, null);
|
|
|
}
|