九游游戏中心HD v4.6.8.1版本的 MD5 值为:78c397802cc5ffdcc7f5502ede90502e
以下内容为反编译后的 TBAppLinkDistribution.java 源代码,内容仅作参考
package com.tmall.applink.distribution;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import com.UCMobile.Apollo.Global;
import com.tmall.applink.TMAppLinkSDK;
import com.tmall.applink.api.TBAPIType;
import com.tmall.applink.api.TBBaseAPI;
import com.tmall.applink.api.TBJumpAPI;
import com.tmall.applink.jsbridge.adapter.TBBridgeCallBackFunction;
import com.tmall.applink.param.TBBaseParam;
import com.tmall.applink.service.TBAppLinkServiceProxy;
import com.tmall.applink.util.TBAppLinkStringUtil;
import com.tmall.applink.util.TBAppLinkUtil;
public class TBAppLinkDistribution {
public static boolean invoke(Context context, TBBaseParam tBBaseParam, TBBridgeCallBackFunction tBBridgeCallBackFunction) {
if (context != null && tBBaseParam != null) {
TBBaseAPI api = getAPI(tBBaseParam);
api.execute(context, tBBridgeCallBackFunction);
TMAppLinkSDK.JumpFailedMode jumpFailedMode = TMAppLinkSDK.getInstance().mJumpFailedMode;
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse(tBBaseParam.getURL() + "&ut_sk=" + ("6." + System.currentTimeMillis() + ".jiuyou.third-download-0")));
intent.setFlags(805339136);
intent.setPackage("com.tmall.wireless");
return TBAppLinkUtil.isSupportAppLinkSDK(context) ? invokeNativeWithTaoPhoneSupport(context, intent, api) : invokeH5WithOutTaoPhoneSupport(context, tBBaseParam, api, jumpFailedMode);
}
return false;
}
private static boolean invokeNativeWithTaoPhoneSupport(Context context, Intent intent, TBBaseAPI tBBaseAPI) {
if (TBAppLinkServiceProxy.getTBMiniUserTrack() != null) {
TBAppLinkServiceProxy.getTBMiniUserTrack().commitEventAndFlush("3");
}
return startActivity(context, intent, tBBaseAPI);
}
private static boolean invokeH5WithOutTaoPhoneSupport(Context context, TBBaseParam tBBaseParam, TBBaseAPI tBBaseAPI, TMAppLinkSDK.JumpFailedMode jumpFailedMode) {
Intent intent = new Intent("android.intent.action.VIEW");
switch (jumpFailedMode.ordinal() + 1) {
case 1:
String str = "https://pages.tmall.com/wow/portal/act/app-download?iframe=1&mmstat=bcsdk";
if (TMAppLinkSDK.getInstance().sOpenParam != null && !TBAppLinkStringUtil.isBlank(TMAppLinkSDK.getInstance().sOpenParam.mAppkey)) {
str = "https://pages.tmall.com/wow/portal/act/app-download?iframe=1&mmstat=bcsdk" + String.format("&src=%s", TMAppLinkSDK.getInstance().sOpenParam.mAppkey);
}
intent.setData(Uri.parse(str));
if (TBAppLinkServiceProxy.getTBMiniUserTrack() != null) {
TBAppLinkServiceProxy.getTBMiniUserTrack().commitEventAndFlush("0");
break;
}
break;
case 2:
if (TBAppLinkServiceProxy.getTBMiniUserTrack() != null) {
TBAppLinkServiceProxy.getTBMiniUserTrack().commitEventAndFlush("1");
}
if (!TBAppLinkStringUtil.isBlank(tBBaseParam.getH5URL())) {
intent.setData(Uri.parse(tBBaseParam.getH5URL()));
break;
} else {
return false;
}
case 3:
if (TBAppLinkServiceProxy.getTBMiniUserTrack() != null) {
TBAppLinkServiceProxy.getTBMiniUserTrack().commitEventAndFlush(Global.APOLLO_SERIES);
}
return false;
}
return startActivity(context, intent, tBBaseAPI);
}
private static TBBaseAPI getAPI(TBBaseParam tBBaseParam) {
if (tBBaseParam == null || tBBaseParam.mTBAPIType != TBAPIType.JUMP) {
return null;
}
return new TBJumpAPI();
}
private static boolean startActivity(Context context, Intent intent, TBBaseAPI tBBaseAPI) {
if (context == null || intent == null || tBBaseAPI == null) {
return false;
}
try {
context.startActivity(intent);
tBBaseAPI.onSuccess();
return true;
} catch (Exception e) {
tBBaseAPI.onFailure(e);
return false;
}
}
}