imToken v2.9.3版本的 MD5 值为:42af1a08a3f01f69d2f3782d81007b3c

以下内容为反编译后的 YeepayWebView.java 源代码,内容仅作参考


package com.pingplusplus.android.wap;

import android.app.Activity;
import android.graphics.Bitmap;
import android.webkit.WebView;
import com.brentvatne.react.ReactVideoView;
import com.pingplusplus.android.PingppLog;
import com.pingplusplus.android.PingppWebView;
import com.pingplusplus.android.WebViewEx;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Arrays;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.StringCompanionObject;
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\u0002\n\u0002\b\u0004\u0018\u0000 \f2\u00020\u0001:\u0002\f\rB\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\t\u001a\u00020\n2\u0006\u0010\u0004\u001a\u00020\u0005H\u0014J\b\u0010\u000b\u001a\u00020\nH\u0014R\u0010\u0010\u0007\u001a\u0004\u0018\u00010\bX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u000e"}, d2 = {"Lcom/pingplusplus/android/wap/YeepayWebView;", "Lcom/pingplusplus/android/PingppWebView;", "activity", "Landroid/app/Activity;", "chargeJson", "Lorg/json/JSONObject;", "(Landroid/app/Activity;Lorg/json/JSONObject;)V", "yeepayResultUrl", "", "initData", "", "initWebView", "Companion", "WebViewClientInner", "pingpp-android_release"}, k = 1, mv = {1, 1, 16})
public final class YeepayWebView extends PingppWebView {
    private String p;

    public static final class a {
        private a() {
        }

        public a(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }
    }

    public final class b extends WebViewEx.c {
        public b() {
        }

        @Override
        public void onPageFinished(WebView view, String url) {
            Intrinsics.checkParameterIsNotNull(view, "view");
            Intrinsics.checkParameterIsNotNull(url, "url");
            super.onPageFinished(view, url);
            YeepayWebView.this.c().setVisibility(8);
        }

        @Override
        public void onPageStarted(WebView view, String url, Bitmap bitmap) {
            Intrinsics.checkParameterIsNotNull(view, "view");
            Intrinsics.checkParameterIsNotNull(url, "url");
            super.onPageStarted(view, url, bitmap);
            if (YeepayWebView.this.p != null) {
                String str = YeepayWebView.this.p;
                if (str == null) {
                    Intrinsics.throwNpe();
                }
                if (StringsKt.startsWith$default(url, str, false, 2, (Object) null)) {
                    if (((PingppWebView) YeepayWebView.this).h) {
                        ((PingppWebView) YeepayWebView.this).b.a("success");
                    } else {
                        ((PingppWebView) YeepayWebView.this).j = true;
                        ((PingppWebView) YeepayWebView.this).b.e = "success";
                    }
                }
            }
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            Intrinsics.checkParameterIsNotNull(view, "view");
            Intrinsics.checkParameterIsNotNull(url, "url");
            if (StringsKt.startsWith$default(url, "http://shouyin.yeepay.com/nc-cashier-wap/wap/query/result", false, 2, (Object) null)) {
                ((PingppWebView) YeepayWebView.this).b.e = "success";
                ((PingppWebView) YeepayWebView.this).j = true;
            }
            if (StringsKt.contains$default((CharSequence) url, (CharSequence) "https://ok.yeepay.com/paymobile/query/pay/success?", false, 2, (Object) null) || StringsKt.contains$default((CharSequence) url, (CharSequence) "http://mobiletest.yeepay.com/paymobile/query/pay/success?", false, 2, (Object) null)) {
                ((PingppWebView) YeepayWebView.this).b.e = "success";
            }
            return super.shouldOverrideUrlLoading(view, url);
        }
    }

    static {
        new a(null);
    }

    public YeepayWebView(Activity activity, JSONObject jSONObject) {
        super(activity, jSONObject);
        if (activity == null) {
            Intrinsics.throwNpe();
        }
        if (jSONObject == null) {
            Intrinsics.throwNpe();
        }
    }

    @Override
    protected void a(JSONObject chargeJson) {
        String str;
        String str2;
        Intrinsics.checkParameterIsNotNull(chargeJson, "chargeJson");
        this.p = chargeJson.getJSONObject(ReactVideoView.EVENT_PROP_EXTRA).getString("result_url");
        JSONObject jSONObject = chargeJson.getJSONObject("credential");
        JSONObject jSONObject2 = jSONObject.getJSONObject("yeepay_wap");
        PingppLog.d("PaymentActivity start yeepay_wap credential : " + jSONObject);
        String string = jSONObject2.getString("merchantaccount");
        try {
            str = URLEncoder.encode(jSONObject2.getString("encryptkey"), "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e = e;
            str = null;
        }
        try {
            str2 = URLEncoder.encode(jSONObject2.getString("data"), "UTF-8");
        } catch (UnsupportedEncodingException e2) {
            e = e2;
            e.printStackTrace();
            str2 = null;
            if (!Intrinsics.areEqual("live", jSONObject2.getString("mode"))) {
            }
            StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
            String format = String.format(r1, Arrays.copyOf(new Object[]{string, str, str2}, 3));
            Intrinsics.checkExpressionValueIsNotNull(format, "java.lang.String.format(format, *args)");
            a(format, (byte[]) null);
        }
        String str3 = !Intrinsics.areEqual("live", jSONObject2.getString("mode")) ? "https://ok.yeepay.com/paymobile/api/pay/request?merchantaccount=%s&encryptkey=%s&data=%s" : "http://mobiletest.yeepay.com/paymobile/api/pay/request?merchantaccount=%s&encryptkey=%s&data=%s";
        StringCompanionObject stringCompanionObject2 = StringCompanionObject.INSTANCE;
        String format2 = String.format(str3, Arrays.copyOf(new Object[]{string, str, str2}, 3));
        Intrinsics.checkExpressionValueIsNotNull(format2, "java.lang.String.format(format, *args)");
        a(format2, (byte[]) null);
    }

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