导航菜单

页面标题

页面副标题

imToken v3.28.8 - BfbWebView.java 源代码

正在查看: imToken v3.28.8 应用的 BfbWebView.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.pingplusplus.android.wap;

import android.app.Activity;
import android.graphics.Bitmap;
import android.text.TextUtils;
import android.webkit.WebView;
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 webView, String str) {
            Intrinsics.checkParameterIsNotNull(webView, "view");
            Intrinsics.checkParameterIsNotNull(str, "url");
            if (str.equals("file:///android_asset/pingpp_web.html") && BfbWebView.this.q) {
                BfbWebView.this.q = false;
                WebViewEx webViewEx = ((PingppWebView) BfbWebView.this).a;
                if (webViewEx == null) {
                    Intrinsics.throwNpe();
                }
                webViewEx.loadUrl(((PingppWebView) BfbWebView.this).c);
            } else if (str.equals("file:///android_asset/pingpp_web.html") && !BfbWebView.this.q) {
                ((PingppWebView) BfbWebView.this).b.a(((PingppWebView) BfbWebView.this).b.e);
            } else if (!str.equals("file:///android_asset/pingpp_web.html")) {
                BfbWebView.this.c().setVisibility(8);
            }
            if (StringsKt.endsWith$default(str, "#PayResult", false, 2, (Object) null)) {
                ((PingppWebView) BfbWebView.this).b.e = "success";
                ((PingppWebView) BfbWebView.this).j = true;
            }
            super.onPageFinished(webView, str);
        }

        @Override
        public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
            Intrinsics.checkParameterIsNotNull(webView, "view");
            Intrinsics.checkParameterIsNotNull(str, "url");
            super.onPageStarted(webView, str, bitmap);
            if (BfbWebView.this.p != null) {
                String str2 = BfbWebView.this.p;
                if (str2 == null) {
                    Intrinsics.throwNpe();
                }
                if (StringsKt.startsWith$default(str, str2, 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 webView, String str) {
            Intrinsics.checkParameterIsNotNull(webView, "view");
            Intrinsics.checkParameterIsNotNull(str, "url");
            if ("https://www.baifubao.com/wap/0/wallet/0/transaction/0".equals(str)) {
                ((PingppWebView) BfbWebView.this).b.e = "success";
            } else if ("https://m.baifubao.com/".equals(str)) {
                ((PingppWebView) BfbWebView.this).b.a(((PingppWebView) BfbWebView.this).b.e);
            } else if (StringsKt.contains$default(str, "http://wappass.baidu.com/passport/reg?", false, 2, (Object) null) || StringsKt.contains$default(str, "http://wappass.baidu.com/passport/getpass?", false, 2, (Object) null) || StringsKt.contains$default(str, "http://wappass.baidu.com/passport/agreement?", false, 2, (Object) null)) {
                BfbWebView.this.a(str);
                return true;
            }
            return super.shouldOverrideUrlLoading(webView, str);
        }
    }

    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 jSONObject) {
        Intrinsics.checkParameterIsNotNull(jSONObject, "chargeJson");
        this.p = jSONObject.getJSONObject("extra").optString("result_url");
        JSONObject jSONObject2 = jSONObject.getJSONObject("credential").getJSONObject("bfb_wap");
        String optString = jSONObject2.optString("url");
        ArrayList arrayList = new ArrayList();
        Iterator<String> keys = jSONObject2.keys();
        while (keys.hasNext()) {
            String next = keys.next();
            if (!Intrinsics.areEqual("url", next)) {
                ArrayList arrayList2 = new ArrayList();
                arrayList2.add(next);
                arrayList2.add(jSONObject2.getString(next));
                arrayList.add(TextUtils.join("=", arrayList2));
            }
        }
        if (arrayList.size() == 0) {
            this.b.a("fail", "invalid_credential");
            return;
        }
        this.c = optString + '?' + TextUtils.join("&", arrayList);
        a("file:///android_asset/pingpp_web.html", (byte[]) null);
    }

    @Override
    protected void f() {
        WebViewEx webViewEx = this.a;
        if (webViewEx == null) {
            Intrinsics.throwNpe();
        }
        webViewEx.setWebViewClient(new a());
    }
}