imToken v2.9.3版本的 MD5 值为:42af1a08a3f01f69d2f3782d81007b3c
以下内容为反编译后的 b.java 源代码,内容仅作参考
package com.pingplusplus.android;
import android.content.Intent;
import cmbapi.CMBApi;
import cmbapi.CMBApiFactory;
import cmbapi.CMBEventHandler;
import cmbapi.CMBRequest;
import cmbapi.CMBResponse;
import com.pingplusplus.android.Pingpp;
import com.tencent.mobileqq.openpay.constants.OpenConstants;
import java.net.URLEncoder;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONException;
import org.json.JSONObject;
public final class b implements c, CMBEventHandler {
private PaymentActivity f1581a;
private CMBApi b;
public b(PaymentActivity payActivity) {
Intrinsics.checkParameterIsNotNull(payActivity, "payActivity");
this.f1581a = payActivity;
}
@Override
public void a() {
CMBApiFactory.destroyCMBAPI();
}
@Override
public void a(JSONObject credentialData) {
Intrinsics.checkParameterIsNotNull(credentialData, "credentialData");
if (credentialData.optString("channelVersion") == null) {
this.f1581a.a("fail", "invalid_credential", "字段 channelVersion 不存在");
return;
}
if (!Intrinsics.areEqual(r0, "2.0")) {
this.f1581a.a("fail", "invalid_credential", "仅支持招行 2.0 版本");
return;
}
String string = credentialData.getString("jsonRequestData");
try {
JSONObject jSONObject = new JSONObject(string);
if (!jSONObject.has("reqData") || !(jSONObject.get("reqData") instanceof JSONObject)) {
this.f1581a.a("fail", "invalid_credential", "jsonRequestData[reqData] 不存在或不是 key-value 键值对");
return;
}
JSONObject jSONObject2 = jSONObject.getJSONObject("reqData");
if (!jSONObject2.has("branchNo") || !jSONObject2.has("merchantNo")) {
this.f1581a.a("fail", "invalid_credential", "jsonRequestData[reqData] 不包含 branchNo 或 merchantNo 字段");
return;
}
this.b = CMBApiFactory.createCMBAPI(this.f1581a, jSONObject2.getString("branchNo") + jSONObject2.getString("merchantNo"));
CMBRequest cMBRequest = new CMBRequest();
cMBRequest.requestData = "charset=utf-8&jsonRequestData=" + URLEncoder.encode(string, "utf-8");
PingppLog.d("Pingpp.cmbPayMethod: " + Pingpp.cmbPayMethod + "; .method: " + Pingpp.cmbPayMethod.getMethod());
if ((Pingpp.cmbPayMethod.getMethod() & Pingpp.CmbPayMethod.APP_ONLY.getMethod()) == Pingpp.CmbPayMethod.APP_ONLY.getMethod()) {
cMBRequest.CMBJumpAppUrl = "cmbmobilebank://CMBLS/FunctionJump?action=gofuncid&funcid=200013&serverid=CMBEUserPay&requesttype=post&cmb_app_trans_parms_start=here";
}
if ((Pingpp.cmbPayMethod.getMethod() & Pingpp.CmbPayMethod.H5_ONLY.getMethod()) == Pingpp.CmbPayMethod.H5_ONLY.getMethod()) {
cMBRequest.CMBH5Url = !Pingpp.INSTANCE.getCmbEnvTest() ? "https://netpay.cmbchina.com/netpayment/BaseHttp.dll?H5PayJsonSDK" : Pingpp.INSTANCE.getCmbEnvTestUrl() == null ? "http://121.15.180.66:801/netpayment/BaseHttp.dll?H5PayJsonSDK" : Pingpp.INSTANCE.getCmbEnvTestUrl();
cMBRequest.isShowNavigationBar = true;
}
cMBRequest.method = OpenConstants.API_NAME_PAY;
CMBApi cMBApi = this.b;
if (cMBApi == null) {
Intrinsics.throwNpe();
}
PingppLog.d("CMBApi.sendReq: " + cMBApi.sendReq(cMBRequest));
} catch (JSONException unused) {
this.f1581a.a("fail", "invalid_credential", "jsonRequestData 不是 JSON 字符串");
}
}
@Override
public boolean a(Intent intent) {
CMBApi cMBApi;
if (intent == null || (cMBApi = this.b) == null) {
return false;
}
if (cMBApi == null) {
Intrinsics.throwNpe();
}
return cMBApi.handleIntent(intent, this);
}
public void onResp(CMBResponse resp) {
PaymentActivity paymentActivity;
String str;
String str2;
Intrinsics.checkParameterIsNotNull(resp, "resp");
JSONObject jSONObject = new JSONObject();
jSONObject.put("respCode", resp.respCode);
jSONObject.put("respMsg", resp.respMsg);
String jSONObject2 = jSONObject.toString();
Intrinsics.checkExpressionValueIsNotNull(jSONObject2, "extraMsgObj.toString()");
int i = resp.respCode;
if (i != 8) {
if (i != 9) {
if (i == -2 || i == -1) {
paymentActivity = this.f1581a;
str = "fail";
str2 = "channel_returns_fail";
} else if (i == 0) {
paymentActivity = this.f1581a;
str = "success";
str2 = "";
}
}
this.f1581a.a("unknown", "unknown", jSONObject2);
return;
}
paymentActivity = this.f1581a;
str = "cancel";
str2 = "user_cancelled";
paymentActivity.a(str, str2, jSONObject2);
}
}