imToken v2.9.3版本的 MD5 值为:42af1a08a3f01f69d2f3782d81007b3c
以下内容为反编译后的 BfbWebView.java 源代码,内容仅作参考
package com.pingplusplus.android.wap;
import android.app.Activity;
import android.graphics.Bitmap;
import android.text.TextUtils;
import android.webkit.WebView;
import com.brentvatne.react.ReactVideoView;
import com.google.android.gms.common.internal.ImagesContract;
import com.pingplusplus.android.PingppWebView;
import com.pingplusplus.android.WebViewEx;
import java.util.ArrayList;
import java.util.Iterator;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
import org.json.JSONObject;
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\u0018\u00002\u00020\u0001:\u0001\u000eB\u0019\u0012\b\u0010\u0002\u001a\u0004\u0018\u00010\u0003\u0012\b\u0010\u0004\u001a\u0004\u0018\u00010\u0005¢\u0006\u0002\u0010\u0006J\u0010\u0010\u000b\u001a\u00020\f2\u0006\u0010\u0004\u001a\u00020\u0005H\u0014J\b\u0010\r\u001a\u00020\fH\u0014R\u0010\u0010\u0007\u001a\u0004\u0018\u00010\bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\nX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u000f"}, d2 = {"Lcom/pingplusplus/android/wap/BfbWebView;", "Lcom/pingplusplus/android/PingppWebView;", "activity", "Landroid/app/Activity;", "chargeJson", "Lorg/json/JSONObject;", "(Landroid/app/Activity;Lorg/json/JSONObject;)V", "bfbResultUrl", "", "isFirstLoad", "", "initData", "", "initWebView", "WebViewClientExInner", "pingpp-android_release"}, k = 1, mv = {1, 1, 16})
public final class BfbWebView extends PingppWebView {
private String p;
private boolean q;
public final class a extends WebViewEx.c {
public a() {
}
@Override
public void onPageFinished(WebView view, String url) {
Intrinsics.checkParameterIsNotNull(view, "view");
Intrinsics.checkParameterIsNotNull(url, "url");
if (url.equals("file:///android_asset/pingpp_web.html") && BfbWebView.this.q) {
BfbWebView.this.q = false;
WebViewEx webViewEx = ((PingppWebView) BfbWebView.this).f1588a;
if (webViewEx == null) {
Intrinsics.throwNpe();
}
webViewEx.loadUrl(((PingppWebView) BfbWebView.this).c);
} else if (url.equals("file:///android_asset/pingpp_web.html") && !BfbWebView.this.q) {
((PingppWebView) BfbWebView.this).b.a(((PingppWebView) BfbWebView.this).b.e);
} else if (!url.equals("file:///android_asset/pingpp_web.html")) {
BfbWebView.this.c().setVisibility(8);
}
if (StringsKt.endsWith$default(url, "#PayResult", false, 2, (Object) null)) {
((PingppWebView) BfbWebView.this).b.e = "success";
((PingppWebView) BfbWebView.this).j = true;
}
super.onPageFinished(view, url);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap bitmap) {
Intrinsics.checkParameterIsNotNull(view, "view");
Intrinsics.checkParameterIsNotNull(url, "url");
super.onPageStarted(view, url, bitmap);
if (BfbWebView.this.p != null) {
String str = BfbWebView.this.p;
if (str == null) {
Intrinsics.throwNpe();
}
if (StringsKt.startsWith$default(url, str, false, 2, (Object) null)) {
if (((PingppWebView) BfbWebView.this).h) {
((PingppWebView) BfbWebView.this).b.a("success");
} else {
((PingppWebView) BfbWebView.this).b.e = "success";
((PingppWebView) BfbWebView.this).j = true;
}
}
}
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Intrinsics.checkParameterIsNotNull(view, "view");
Intrinsics.checkParameterIsNotNull(url, "url");
if ("https://www.baifubao.com/wap/0/wallet/0/transaction/0".equals(url)) {
((PingppWebView) BfbWebView.this).b.e = "success";
} else if ("https://m.baifubao.com/".equals(url)) {
((PingppWebView) BfbWebView.this).b.a(((PingppWebView) BfbWebView.this).b.e);
} else if (StringsKt.contains$default((CharSequence) url, (CharSequence) "http://wappass.baidu.com/passport/reg?", false, 2, (Object) null) || StringsKt.contains$default((CharSequence) url, (CharSequence) "http://wappass.baidu.com/passport/getpass?", false, 2, (Object) null) || StringsKt.contains$default((CharSequence) url, (CharSequence) "http://wappass.baidu.com/passport/agreement?", false, 2, (Object) null)) {
BfbWebView.this.a(url);
return true;
}
return super.shouldOverrideUrlLoading(view, url);
}
}
public BfbWebView(Activity activity, JSONObject jSONObject) {
super(activity, jSONObject);
if (activity == null) {
Intrinsics.throwNpe();
}
if (jSONObject == null) {
Intrinsics.throwNpe();
}
this.q = true;
}
@Override
protected void a(JSONObject chargeJson) {
Intrinsics.checkParameterIsNotNull(chargeJson, "chargeJson");
this.p = chargeJson.getJSONObject(ReactVideoView.EVENT_PROP_EXTRA).optString("result_url");
JSONObject jSONObject = chargeJson.getJSONObject("credential").getJSONObject("bfb_wap");
String optString = jSONObject.optString(ImagesContract.URL);
ArrayList arrayList = new ArrayList();
Iterator<String> keys = jSONObject.keys();
while (keys.hasNext()) {
String next = keys.next();
if (!Intrinsics.areEqual(ImagesContract.URL, next)) {
ArrayList arrayList2 = new ArrayList();
arrayList2.add(next);
arrayList2.add(jSONObject.getString(next));
arrayList.add(TextUtils.join("=", arrayList2));
}
}
if (arrayList.size() == 0) {
this.b.a("fail", "invalid_credential");
return;
}
this.c = optString + '?' + TextUtils.join(com.alipay.sdk.sys.a.b, arrayList);
a("file:///android_asset/pingpp_web.html", (byte[]) null);
}
@Override
protected void f() {
WebViewEx webViewEx = this.f1588a;
if (webViewEx == null) {
Intrinsics.throwNpe();
}
webViewEx.setWebViewClient(new a());
}
}