Luno v7.28.0版本的 MD5 值为:08d81b3b88ef7df48c89cb5d56dc11a2

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


package com.plaid.internal;

import andhook.lib.HookHelper;
import android.content.Context;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.facebook.internal.Utility;
import com.plaid.internal.core.plaidstyleutils.PlaidInstitutionHeaderItem;
import com.plaid.internal.core.plaidstyleutils.PlaidNavigationBar;
import com.plaid.internal.core.protos.link.workflow.nodes.panes.Challenge;
import com.plaid.internal.core.protos.link.workflow.nodes.panes.Common;
import com.plaid.internal.f8;
import com.plaid.link.R;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import kotlin.Metadata;
import mdi.sdk.c83;
import mdi.sdk.gc4;
import mdi.sdk.gn5;
import mdi.sdk.iy;
import mdi.sdk.ja5;
import mdi.sdk.k30;
import mdi.sdk.ms4;
import mdi.sdk.my2;
import mdi.sdk.nx;
import mdi.sdk.oh0;
import mdi.sdk.os4;
import mdi.sdk.rv5;
import mdi.sdk.sk4;
import mdi.sdk.t55;
import mdi.sdk.tu;
import mdi.sdk.ud2;
import mdi.sdk.w32;
import mdi.sdk.xh2;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0000\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0007¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"Lcom/plaid/internal/f0;", "Lcom/plaid/internal/ma;", "Lcom/plaid/internal/h0;", HookHelper.constructorName, "()V", "link-sdk_release"}, k = 1, mv = {1, 5, 1})
public final class f0 extends ma<h0> {
    public g6 e;
    public final CompositeDisposable f;

    public class a {
        public static final int[] a;

        static {
            int[] iArr = new int[Challenge.ChallengePane.Rendering.ChallengeCase.values().length];
            iArr[Challenge.ChallengePane.Rendering.ChallengeCase.RECAPTCHA.ordinal()] = 1;
            iArr[Challenge.ChallengePane.Rendering.ChallengeCase.JAVA_SCRIPT.ordinal()] = 2;
            iArr[Challenge.ChallengePane.Rendering.ChallengeCase.CHALLENGE_NOT_SET.ordinal()] = 3;
            a = iArr;
        }
    }

    public f0() {
        super(h0.class);
        this.f = new CompositeDisposable();
    }

    @Override
    public h0 a(sa saVar, p5 p5Var) {
        w32.h(saVar, "paneId");
        w32.h(p5Var, "component");
        return new h0(saVar, p5Var);
    }

    @Override
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        w32.h(layoutInflater, "inflater");
        View inflate = layoutInflater.inflate(R.layout.plaid_challenge_fragment, viewGroup, false);
        int i = R.id.challenge_webview;
        WebView webView = (WebView) rv5.a(inflate, i);
        if (webView != null) {
            i = R.id.header;
            TextView textView = (TextView) rv5.a(inflate, i);
            if (textView != null) {
                i = R.id.plaid_institution;
                PlaidInstitutionHeaderItem plaidInstitutionHeaderItem = (PlaidInstitutionHeaderItem) rv5.a(inflate, i);
                if (plaidInstitutionHeaderItem != null) {
                    i = R.id.plaid_navigation;
                    PlaidNavigationBar plaidNavigationBar = (PlaidNavigationBar) rv5.a(inflate, i);
                    if (plaidNavigationBar != null) {
                        LinearLayout linearLayout = (LinearLayout) inflate;
                        g6 g6Var = new g6(linearLayout, webView, textView, plaidInstitutionHeaderItem, plaidNavigationBar);
                        w32.g(g6Var, "inflate(inflater, container, false)");
                        this.e = g6Var;
                        return linearLayout;
                    }
                }
            }
        }
        throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i)));
    }

    @Override
    public void onDestroy() {
        this.f.d();
        super.onDestroy();
    }

    @Override
    public void onViewCreated(View view, Bundle bundle) {
        w32.h(view, "view");
        super.onViewCreated(view, bundle);
        CompositeDisposable compositeDisposable = this.f;
        Disposable subscribe = b().k.replay(1).e().hide().take(1L).subscribeOn(sk4.c()).observeOn(mdi.sdk.o7.a()).subscribe(new k30() {
            @Override
            public final void accept(Object obj) {
                com.plaid.internal.f0.a(com.plaid.internal.f0.this, (Challenge.ChallengePane.Rendering) obj);
            }
        }, new k30() {
            @Override
            public final void accept(Object obj) {
                com.plaid.internal.f0.a((Throwable) obj);
            }
        });
        w32.g(subscribe, "viewModel.challenge()\n  …ew(it) }, { Plog.e(it) })");
        oh0.a(compositeDisposable, subscribe);
    }

    public static final void a(f0 f0Var, Challenge.ChallengePane.Rendering rendering) {
        String a2;
        String G;
        int u;
        Map r;
        String G2;
        String G3;
        String G4;
        String G5;
        String str;
        w32.h(f0Var, "this$0");
        w32.g(rendering, "it");
        g6 g6Var = f0Var.e;
        g6 g6Var2 = null;
        ud2 ud2Var = null;
        if (g6Var == null) {
            w32.y("binding");
            g6Var = null;
        }
        PlaidInstitutionHeaderItem plaidInstitutionHeaderItem = g6Var.d;
        w32.g(plaidInstitutionHeaderItem, "binding.plaidInstitution");
        u6.a(plaidInstitutionHeaderItem, rendering.getInstitution());
        g6 g6Var3 = f0Var.e;
        if (g6Var3 == null) {
            w32.y("binding");
            g6Var3 = null;
        }
        TextView textView = g6Var3.c;
        w32.g(textView, "binding.header");
        Common.LocalizedString header = rendering.getHeader();
        if (header == null) {
            a2 = null;
        } else {
            Resources resources = f0Var.getResources();
            w32.g(resources, "resources");
            Context context = f0Var.getContext();
            a2 = x4.a(header, resources, context == null ? null : context.getPackageName(), 0, 4, null);
        }
        j9.a(textView, a2);
        Challenge.ChallengePane.Rendering.ChallengeCase challengeCase = rendering.getChallengeCase();
        int i = challengeCase == null ? -1 : a.a[challengeCase.ordinal()];
        if (i == 1) {
            Challenge.ChallengePane.Rendering.RecaptchaChallenge recaptcha = rendering.getRecaptcha();
            w32.g(recaptcha, "rendering.recaptcha");
            InputStream openRawResource = f0Var.getResources().openRawResource(R.raw.plaid_recaptcha);
            w32.g(openRawResource, "resources.openRawResource(R.raw.plaid_recaptcha)");
            InputStreamReader inputStreamReader = new InputStreamReader(openRawResource, tu.b);
            BufferedReader bufferedReader = inputStreamReader instanceof BufferedReader ? (BufferedReader) inputStreamReader : new BufferedReader(inputStreamReader, Utility.DEFAULT_STREAM_BUFFER_SIZE);
            try {
                String c = ja5.c(bufferedReader);
                nx.a(bufferedReader, null);
                String sitekey = recaptcha.getSitekey();
                w32.g(sitekey, "recaptcha.sitekey");
                G = t55.G(c, "<SITE_KEY>", sitekey, false, 4, null);
                g6 g6Var4 = f0Var.e;
                if (g6Var4 == null) {
                    w32.y("binding");
                } else {
                    g6Var2 = g6Var4;
                }
                WebView webView = g6Var2.b;
                webView.getSettings().setJavaScriptEnabled(true);
                webView.addJavascriptInterface(new l8(f0Var.b()), "RecaptchaJSListener");
                webView.loadDataWithBaseURL("https://cdn.plaid.com", G, "text/html", "UTF-8", null);
                webView.setWebViewClient(new g0(webView));
            } finally {
            }
        } else {
            if (i != 2) {
                if (i == 3) {
                    throw new c83(null, 1, null);
                }
                return;
            }
            Challenge.ChallengePane.Rendering.JavaScriptChallenge javaScript = rendering.getJavaScript();
            w32.g(javaScript, "rendering.javaScript");
            g6 g6Var5 = f0Var.e;
            if (g6Var5 == null) {
                w32.y("binding");
                g6Var5 = null;
            }
            g6Var5.b.getSettings().setJavaScriptEnabled(true);
            InputStream openRawResource2 = f0Var.getResources().openRawResource(R.raw.plaid_javascript_challenge);
            w32.g(openRawResource2, "resources.openRawResourc…aid_javascript_challenge)");
            InputStreamReader inputStreamReader2 = new InputStreamReader(openRawResource2, tu.b);
            BufferedReader bufferedReader2 = inputStreamReader2 instanceof BufferedReader ? (BufferedReader) inputStreamReader2 : new BufferedReader(inputStreamReader2, Utility.DEFAULT_STREAM_BUFFER_SIZE);
            try {
                String c2 = ja5.c(bufferedReader2);
                nx.a(bufferedReader2, null);
                Set<Map.Entry<String, Common.LocalizedString>> entrySet = javaScript.getLocalizedStrings().entrySet();
                u = iy.u(entrySet, 10);
                ArrayList arrayList = new ArrayList(u);
                Iterator<T> it = entrySet.iterator();
                while (it.hasNext()) {
                    Map.Entry entry = (Map.Entry) it.next();
                    Object key = entry.getKey();
                    Common.LocalizedString localizedString = (Common.LocalizedString) entry.getValue();
                    if (localizedString != null) {
                        Resources resources2 = f0Var.getResources();
                        w32.g(resources2, "resources");
                        Context context2 = f0Var.getContext();
                        str = x4.a(localizedString, resources2, context2 == null ? null : context2.getPackageName(), 0, 4, null);
                        if (str != null) {
                            arrayList.add(gn5.a(key, str));
                        }
                    }
                    str = "";
                    arrayList.add(gn5.a(key, str));
                }
                r = my2.r(arrayList);
                g6 g6Var6 = f0Var.e;
                if (g6Var6 == null) {
                    w32.y("binding");
                    g6Var6 = null;
                }
                WebView webView2 = g6Var6.b;
                h0 b = f0Var.b();
                b.getClass();
                w32.h(c2, "rawHtml");
                w32.h(r, "localizedStringMap");
                w32.h(javaScript, "javaScriptChallenge");
                String challengeHash = javaScript.getChallengeHash();
                w32.g(challengeHash, "javaScriptChallenge.challengeHash");
                G2 = t55.G("link/challenge/<HASH>", "<HASH>", challengeHash, false, 4, null);
                r6 r6Var = b.i;
                if (r6Var == null) {
                    w32.y("plaidEnvironmentStore");
                    r6Var = null;
                }
                G3 = t55.G(c2, "<CHALLENGE>", w32.q(r6Var.c(), G2), false, 4, null);
                String initializationOptionsJson = javaScript.getInitializationOptionsJson();
                w32.g(initializationOptionsJson, "javaScriptChallenge.initializationOptionsJson");
                G4 = t55.G(G3, "<INITIALIZATION_OPTIONS>", initializationOptionsJson, false, 4, null);
                ud2 ud2Var2 = b.h;
                if (ud2Var2 != null) {
                    ud2Var = ud2Var2;
                } else {
                    w32.y("json");
                }
                os4 a3 = ud2Var.a();
                xh2.a aVar = xh2.c;
                G5 = t55.G(G4, "<PROTO_TRANSLATIONS>", ud2Var.b(ms4.b(a3, gc4.k(Map.class, aVar.d(gc4.j(String.class)), aVar.d(gc4.j(String.class)))), r), false, 4, null);
                webView2.loadDataWithBaseURL("https://cdn.plaid.com", G5, "text/html", "UTF-8", null);
            } finally {
            }
        }
    }

    public static final void a(Throwable th) {
        f8.a.a(f8.a, th, false, 2, (Object) null);
    }
}