APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:Cuto
版本号:2.6.10
包名称:com.sspai.cuto.android

MD5 校验值:9a3607a8b6a643c932183399cb0ea25c

反编译源代码说明

StripeActivity.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package net.dchdc.cuto.iap.view;

import B5.Q;
import G5.t;
import a6.AbstractActivityC0808b;
import a6.C0809c;
import a6.C0810d;
import android.annotation.SuppressLint;
import android.app.DownloadManager;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Message;
import android.view.MenuItem;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.lifecycle.C0826n;
import androidx.lifecycle.InterfaceC0837z;
import androidx.lifecycle.U;
import androidx.lifecycle.V;
import androidx.lifecycle.W;
import androidx.lifecycle.X;
import b.ActivityC0859k;
import c6.C0930a;
import c6.C0932c;
import com.sspai.cuto.android.R;
import e.C1065g;
import e5.C1102y;
import e5.InterfaceC1081d;
import f.AbstractC1108a;
import g1.C1195a;
import h.AbstractC1219a;
import j0.y;
import kotlin.jvm.internal.l;
import kotlin.jvm.internal.m;
import net.dchdc.cuto.iap.view.b;
import r5.InterfaceC1714a;
import r5.InterfaceC1725l;
import y0.C2171s;
import z5.C2306k;

public final class StripeActivity extends AbstractActivityC0808b {

    public static final int f17742V = 0;

    public C0930a f17744N;

    public C0932c f17745O;

    public Uri f17746P;

    public WebView f17750T;

    public Z5.d f17751U;

    public final V6.b f17743M = V6.c.b("StripeActivity");

    public final C1065g f17747Q = (C1065g) x(new y(12, this), new AbstractC1108a());

    public final g f17748R = new g();

    public final V f17749S = new V(kotlin.jvm.internal.y.a(net.dchdc.cuto.iap.view.b.class), new e(this), new d(this), new f(this));

    public static final class a extends WebChromeClient {
        public a() {
        }

        @Override
        public final boolean onCreateWindow(WebView view, boolean z7, boolean z8, Message message) {
            l.f(view, "view");
            WebView.HitTestResult hitTestResult = view.getHitTestResult();
            l.e(hitTestResult, "getHitTestResult(...)");
            Uri parse = Uri.parse(hitTestResult.getExtra());
            if (parse == null || !l.a(parse.getHost(), "qr.stripe.com")) {
                return false;
            }
            StripeActivity stripeActivity = StripeActivity.this;
            stripeActivity.f17746P = parse;
            StringBuilder sb = new StringBuilder("QR code url: ");
            Uri uri = stripeActivity.f17746P;
            if (uri == null) {
                l.i("qrUri");
                throw null;
            }
            sb.append(uri);
            stripeActivity.f17743M.f(sb.toString());
            if (Build.VERSION.SDK_INT >= 29) {
                stripeActivity.E();
                return false;
            }
            if (C1195a.a(stripeActivity, "android.permission.WRITE_EXTERNAL_STORAGE") == 0) {
                stripeActivity.E();
                return false;
            }
            stripeActivity.f17747Q.a("android.permission.WRITE_EXTERNAL_STORAGE");
            return false;
        }
    }

    public static final class b extends m implements InterfaceC1725l<b.a, C1102y> {

        public final W5.a f17753h;

        public final StripeActivity f17754i;

        public b(W5.a aVar, StripeActivity stripeActivity) {
            super(1);
            this.f17753h = aVar;
            this.f17754i = stripeActivity;
        }

        @Override
        public final C1102y invoke(b.a aVar) {
            b.a aVar2 = aVar;
            if (aVar2 instanceof b.a.c) {
                this.f17753h.f8935c.loadUrl(((b.a.c) aVar2).f17767a.getUrl());
            } else {
                boolean z7 = aVar2 instanceof b.a.C0246a;
                StripeActivity stripeActivity = this.f17754i;
                if (z7) {
                    int i8 = StripeActivity.f17742V;
                    stripeActivity.getClass();
                    C0826n i9 = C2171s.i(stripeActivity);
                    I5.c cVar = Q.f789a;
                    A5.e.I(i9, t.f3552a, null, new net.dchdc.cuto.iap.view.a(stripeActivity, null), 2);
                } else if (aVar2 instanceof b.a.C0247b) {
                    int i10 = StripeActivity.f17742V;
                    stripeActivity.getClass();
                    C0826n i11 = C2171s.i(stripeActivity);
                    I5.c cVar2 = Q.f789a;
                    A5.e.I(i11, t.f3552a, null, new C0810d(stripeActivity, null), 2);
                }
            }
            return C1102y.f14898a;
        }
    }

    public static final class c implements InterfaceC0837z, kotlin.jvm.internal.g {

        public final InterfaceC1725l f17755h;

        public c(b bVar) {
            this.f17755h = bVar;
        }

        @Override
        public final InterfaceC1081d<?> a() {
            return this.f17755h;
        }

        @Override
        public final void b(Object obj) {
            this.f17755h.invoke(obj);
        }

        public final boolean equals(Object obj) {
            if (!(obj instanceof InterfaceC0837z) || !(obj instanceof kotlin.jvm.internal.g)) {
                return false;
            }
            return l.a(this.f17755h, ((kotlin.jvm.internal.g) obj).a());
        }

        public final int hashCode() {
            return this.f17755h.hashCode();
        }
    }

    public static final class d extends m implements InterfaceC1714a<W.b> {

        public final ActivityC0859k f17756h;

        public d(ActivityC0859k activityC0859k) {
            super(0);
            this.f17756h = activityC0859k;
        }

        @Override
        public final W.b invoke() {
            return this.f17756h.h();
        }
    }

    public static final class e extends m implements InterfaceC1714a<X> {

        public final ActivityC0859k f17757h;

        public e(ActivityC0859k activityC0859k) {
            super(0);
            this.f17757h = activityC0859k;
        }

        @Override
        public final X invoke() {
            return this.f17757h.t();
        }
    }

    public static final class f extends m implements InterfaceC1714a<K1.a> {

        public final ActivityC0859k f17758h;

        public f(ActivityC0859k activityC0859k) {
            super(0);
            this.f17758h = activityC0859k;
        }

        @Override
        public final K1.a invoke() {
            return this.f17758h.j();
        }
    }

    public static final class g extends WebViewClient {
        public g() {
        }

        @Override
        public final void onPageFinished(WebView view, String url) {
            l.f(view, "view");
            l.f(url, "url");
            WebView webView = StripeActivity.this.f17750T;
            if (webView != null) {
                webView.loadUrl("                javascript:(function() {\n                    document.querySelector('.Tabs-TabPanelContainer').addEventListener(\"DOMSubtreeModified\", function() {\n    document.querySelector(\"option[value='TW']\").remove()\n});\n                })()");
            } else {
                l.i("webView");
                throw null;
            }
        }

        @Override
        public final boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
            Uri url;
            String uri;
            if (webResourceRequest == null || (url = webResourceRequest.getUrl()) == null || (uri = url.toString()) == null) {
                return false;
            }
            boolean N7 = C2306k.N(uri, "alipay:", false);
            StripeActivity stripeActivity = StripeActivity.this;
            if (N7 || C2306k.N(uri, "alipays:", false)) {
                try {
                    stripeActivity.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(uri)));
                } catch (Exception unused) {
                }
            } else if (l.a(uri, "http://cuto/stripe/success")) {
                int i8 = StripeActivity.f17742V;
                stripeActivity.getClass();
                C0826n i9 = C2171s.i(stripeActivity);
                I5.c cVar = Q.f789a;
                A5.e.I(i9, t.f3552a, null, new net.dchdc.cuto.iap.view.a(stripeActivity, null), 2);
            } else {
                if (!l.a(uri, "http://cuto/stripe/cancel")) {
                    return false;
                }
                int i10 = StripeActivity.f17742V;
                stripeActivity.getClass();
                C0826n i11 = C2171s.i(stripeActivity);
                I5.c cVar2 = Q.f789a;
                A5.e.I(i11, t.f3552a, null, new C0809c(stripeActivity, null), 2);
            }
            return true;
        }
    }

    public final void E() {
        Object systemService = getSystemService("download");
        l.d(systemService, "null cannot be cast to non-null type android.app.DownloadManager");
        DownloadManager downloadManager = (DownloadManager) systemService;
        Uri uri = this.f17746P;
        if (uri == null) {
            l.i("qrUri");
            throw null;
        }
        DownloadManager.Request request = new DownloadManager.Request(uri);
        request.setVisibleInDownloadsUi(true);
        request.setNotificationVisibility(1);
        String str = Environment.DIRECTORY_DOWNLOADS;
        Uri uri2 = this.f17746P;
        if (uri2 == null) {
            l.i("qrUri");
            throw null;
        }
        request.setDestinationInExternalPublicDir(str, uri2.getLastPathSegment());
        downloadManager.enqueue(request);
    }

    @Override
    public final void onBackPressed() {
        super.onBackPressed();
        finish();
    }

    @Override
    @SuppressLint({"SetJavaScriptEnabled"})
    public final void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        W5.a a8 = W5.a.a(getLayoutInflater());
        setContentView(a8.f8933a);
        A().x(a8.f8934b);
        AbstractC1219a B7 = B();
        if (B7 != null) {
            B7.m(true);
        }
        AbstractC1219a B8 = B();
        if (B8 != null) {
            B8.n(R.drawable.ic_close);
        }
        setTitle(R.string.unlock_pro);
        WebView webView = a8.f8935c;
        l.e(webView, "webView");
        webView.setWebViewClient(this.f17748R);
        webView.setWebChromeClient(new a());
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setSupportMultipleWindows(true);
        this.f17750T = webView;
        V v7 = this.f17749S;
        ((net.dchdc.cuto.iap.view.b) v7.getValue()).f17764d.e(this, new c(new b(a8, this)));
        net.dchdc.cuto.iap.view.b bVar = (net.dchdc.cuto.iap.view.b) v7.getValue();
        A5.e.I(U.a(bVar), null, null, new net.dchdc.cuto.iap.view.c(bVar, "http://cuto/stripe/success", "http://cuto/stripe/cancel", null), 3);
    }

    @Override
    public final void onDestroy() {
        super.onDestroy();
        WebView webView = this.f17750T;
        if (webView != null) {
            webView.clearCache(true);
        } else {
            l.i("webView");
            throw null;
        }
    }

    @Override
    public final boolean onOptionsItemSelected(MenuItem item) {
        l.f(item, "item");
        if (item.getItemId() != 16908332) {
            return super.onOptionsItemSelected(item);
        }
        finish();
        return true;
    }
}