九游游戏中心HD v4.6.8.1版本的 MD5 值为:78c397802cc5ffdcc7f5502ede90502e
以下内容为反编译后的 TBDetailParam.java 源代码,内容仅作参考
package com.tmall.applink.param;
import android.content.Context;
import android.util.Log;
import com.tmall.applink.exception.TBAppLinkException;
import com.tmall.applink.exception.TBAppLinkExceptionCode;
import com.tmall.applink.util.TBAppLinkStringUtil;
import com.tmall.applink.util.TBAppLinkUtil;
import org.json.JSONException;
import org.json.JSONObject;
public class TBDetailParam extends TBNavParam {
private static final String MODEL_NAME = "detail";
private String mItemID;
private TBDetailParam() {
}
public TBDetailParam(String str) {
this.mParams.put("module", MODEL_NAME);
this.mItemID = str;
}
@Override
public String getJumpUrl(Context context) {
if (!TBAppLinkStringUtil.isNumeric(this.mItemID)) {
throw new TBAppLinkException(TBAppLinkExceptionCode.ITEMID_ILLEGAL);
}
this.mExtraParams.put("itemId", this.mItemID);
return super.getJumpUrl(context);
}
@Override
public String getH5URL() {
if (!TBAppLinkStringUtil.isNumeric(this.mItemID)) {
throw new TBAppLinkException(TBAppLinkExceptionCode.ITEMID_ILLEGAL);
}
return super.getH5URL(String.format("http://detail.m.tmall.com/item.htm?id=%s", this.mItemID));
}
@Override
public String getURL() {
return String.format("http://detail.m.tmall.com/item.htm?id=%s", this.mItemID);
}
@Override
public boolean checkParams(JSONObject jSONObject) {
try {
String string = jSONObject.getString("itemId");
if (TBAppLinkStringUtil.isNumeric(string)) {
this.mParams.put("module", MODEL_NAME);
this.mItemID = string;
return true;
}
return false;
} catch (JSONException e) {
Log.d(TBAppLinkUtil.TAG, e.toString());
return false;
}
}
}