BuzzCast Porno v1.0.0.0版本的 MD5 值为:74d6ef6b6062f3b4dab5598ca2751841

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


package com.amazon.apay.hardened.activity;

import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.widget.TextView;
import androidx.appcompat.app.e;
import androidx.lifecycle.ViewModelProvider;
import b.c;
import ch;
import com.amazon.apay.hardened.external.model.APayAuthResponse$Status;
import com.amazon.apay.hardened.external.model.APayError;
import com.amazon.apay.hardened.worker.RecordPublishWorker;
import com.amazon.identity.auth.device.AuthError;
import com.amazon.identity.auth.device.api.authorization.AuthCancellation;
import com.amazon.identity.auth.device.api.authorization.AuthorizeRequest;
import com.amazon.identity.auth.device.api.authorization.Region;
import com.google.android.gms.security.ProviderInstaller;
import com.til.colombia.dmp.android.Utils;
import e96;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import org.json.JSONException;
import org.json.JSONObject;
public class APayBrowserActivity extends e implements ProviderInstaller.a {
    public static final int f684d = 0;
    public oj9 f685b;
    public g67 f686c;

    public class a implements Runnable {
        public final String f687b;

        public class RunnableC0074a implements Runnable {
            public RunnableC0074a() {
            }

            @Override
            public void run() {
                APayBrowserActivity aPayBrowserActivity = APayBrowserActivity.this;
                int i = APayBrowserActivity.f684d;
                if (aPayBrowserActivity.g5()) {
                    a aVar = a.this;
                    APayBrowserActivity.this.d5(APayError.ErrorType.AUTH_ERROR, aVar.f687b, "Operation cancelled", null);
                } else {
                    a aVar2 = a.this;
                    APayBrowserActivity.this.d5(APayError.ErrorType.PAYMENT_ERROR, aVar2.f687b, "Operation cancelled", null);
                }
                APayBrowserActivity.this.finish();
            }
        }

        public a(String str) {
            this.f687b = str;
        }

        @Override
        public void run() {
            APayBrowserActivity aPayBrowserActivity = APayBrowserActivity.this;
            int i = APayBrowserActivity.f684d;
            if (aPayBrowserActivity.g5()) {
                ((TextView) aPayBrowserActivity.findViewById(2131365142)).setText("Canceling your Amazon Pay authorization");
            } else {
                ((TextView) aPayBrowserActivity.findViewById(2131365142)).setText("Canceling your Amazon Pay transaction");
            }
            new Handler().postDelayed(new RunnableC0074a(), 1000L);
        }
    }

    public final class b extends ws {
        public b() {
        }

        public void a(AuthError authError) {
            yi8.d(authError, "LWAAuthorizeListener:onError invoked", new Object[0]);
            am9.a("AuthError");
            APayBrowserActivity aPayBrowserActivity = APayBrowserActivity.this;
            APayError.ErrorType errorType = APayError.ErrorType.AUTH_ERROR;
            String message = authError.getMessage();
            int i = APayBrowserActivity.f684d;
            aPayBrowserActivity.d5(errorType, "START_BROWSING_ERROR", message, authError);
        }

        public void f(AuthCancellation authCancellation) {
            yi8.e("LWAAuthorizeListener: onCancel called %s", new Object[]{authCancellation.toString()});
            am9.a("AuthCancelled");
            if (authCancellation.f864a == AuthCancellation.Cause.FAILED_AUTHENTICATION) {
                Intent intent = new Intent();
                Bundle bundle = new Bundle();
                bundle.putSerializable("AUTH_STATUS", APayAuthResponse$Status.DENIED);
                intent.putExtras(bundle);
                APayBrowserActivity aPayBrowserActivity = APayBrowserActivity.this;
                int i = APayBrowserActivity.f684d;
                aPayBrowserActivity.Z4(intent, -1);
                return;
            }
            APayBrowserActivity aPayBrowserActivity2 = APayBrowserActivity.this;
            int i2 = APayBrowserActivity.f684d;
            aPayBrowserActivity2.a("OPERATION_CANCELLED");
        }

        public void onSuccess(ys ysVar) {
            yi8.e("LWAAuthorizeListener:onSuccess invoked: %s", new Object[]{ysVar});
            am9.a("AuthSuccess");
            Intent intent = new Intent();
            Bundle bundle = new Bundle();
            bundle.putSerializable("AUTH_STATUS", APayAuthResponse$Status.GRANTED);
            bundle.putSerializable("authCode", ysVar.b);
            bundle.putSerializable("lwaClientId", ysVar.d);
            bundle.putSerializable("redirectUri", ysVar.e);
            intent.putExtras(bundle);
            intent.putExtras(bundle);
            APayBrowserActivity aPayBrowserActivity = APayBrowserActivity.this;
            int i = APayBrowserActivity.f684d;
            aPayBrowserActivity.Z4(intent, -1);
            APayBrowserActivity.this.finish();
        }
    }

    public final void Z4(Intent intent, int i) {
        yi8.e("ApayBrowserActivity:handleOperationComplete invoked with data : %s", new Object[]{intent.toString()});
        oj9 oj9Var = this.f685b;
        PendingIntent pendingIntent = oj9Var.b;
        if (i == 0) {
            PendingIntent pendingIntent2 = oj9Var.c;
            if (pendingIntent2 != null) {
                pendingIntent = pendingIntent2;
            }
            am9.a("OperationCancelled");
        } else {
            am9.a("OperationCompleted");
        }
        try {
            if (pendingIntent != null) {
                yi8.a("Sending data through PendingIntent: %s", new Object[]{Integer.valueOf(i)});
                pendingIntent.send((Context) this, i, intent);
            } else {
                yi8.a("Sending data through onActivityResult: %s", new Object[]{Integer.valueOf(i)});
                setResult(i, intent);
            }
        } catch (PendingIntent.CanceledException e2) {
            yi8.d(e2, "Error sending results through PendingIntent", new Object[0]);
        }
        finish();
    }

    public final void a(String str) {
        runOnUiThread(new a(str));
    }

    public final void a5(Bundle bundle) {
        if (bundle == null) {
            return;
        }
        am9.a("ExtractStateSuccess");
        yi8.e("APayBrowserActivity:extractState invoked for operation: %s", new Object[]{this.f685b.a});
        this.f685b.a = bundle.getSerializable("operation");
        this.f685b.b = (PendingIntent) bundle.getParcelable("COMPLETION_INTENT");
        this.f685b.c = (PendingIntent) bundle.getParcelable("CANCEL_INTENT");
        this.f685b.f = bundle.getBoolean("HAS_BROWSER_LAUNCHED", false);
        this.f685b.g = bundle.getBoolean("HAS_ON_NEW_INTENT_CALLED", false);
        this.f685b.e = bundle.getString("codeChallenge");
        if (bundle.containsKey("PAY_URL")) {
            this.f685b.d = bundle.getString("PAY_URL");
            yi8.e("extractState: with payUrl : %s", new Object[]{this.f685b.d});
        }
    }

    public final void d5(APayError.ErrorType errorType, String str, String str2, Exception exc) {
        yi8.d(exc, "ApayBrowserActivity:handleError invoked with error: %s", new Object[]{str});
        am9.a(str);
        APayError aPayError = new APayError(errorType, str, str2, exc);
        Intent intent = new Intent();
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("errorType", aPayError.f693b);
            jSONObject.put("code", aPayError.f694c);
            jSONObject.put(Utils.MESSAGE, aPayError.getMessage());
            intent.putExtra("error", jSONObject.toString());
        } catch (JSONException e2) {
            yi8.c(e2);
            intent = new Intent();
        }
        Z4(intent, 0);
    }

    @Override
    public void e(int i, Intent intent) {
    }

    public final boolean g5() {
        c cVar = this.f685b.a;
        return cVar != null && (cVar.equals(c.a) || this.f685b.a.equals(c.b));
    }

    public void onCreate(Bundle bundle) {
        super/*androidx.fragment.app.FragmentActivity*/.onCreate(bundle);
        yi8.a("ApayBrowserActivity:onCreate invoked", new Object[0]);
        Thread.setDefaultUncaughtExceptionHandler(new qj9(this));
        setContentView(2131558438);
        this.f685b = new ViewModelProvider(this).a(oj9.class);
        if (bundle == null) {
            a5(getIntent().getExtras());
        } else {
            a5(bundle);
        }
        ProviderInstaller.installIfNeededAsync(this, this);
        am9.a("APayBrowserOnCreateSuccess");
    }

    public void onDestroy() {
        yi8.e("ApayBrowserActivity:onDestroy invoked", new Object[0]);
        oj9 oj9Var = this.f685b;
        oj9Var.f = false;
        oj9Var.g = false;
        if (!am9.a) {
            am9.c.g1(new e96.a(RecordPublishWorker.class).a());
        }
        super.onDestroy();
    }

    public void onNewIntent(Intent intent) {
        super/*androidx.fragment.app.FragmentActivity*/.onNewIntent(intent);
        yi8.a("ApayBrowserActivity:onNewIntent invoked", new Object[0]);
        setIntent(intent);
        this.f685b.g = true;
    }

    @Override
    public void onProviderInstalled() {
    }

    public void onResume() {
        String sb;
        StringBuilder sb2;
        Region region;
        super/*androidx.fragment.app.FragmentActivity*/.onResume();
        yi8.a("ApayBrowserActivity:onResume invoked", new Object[0]);
        if (!this.f685b.f) {
            if (g5()) {
                yi8.e("ApayBrowserActivity:initAuthorize invoked", new Object[0]);
                am9.a("AuthInitialize");
                Intent intent = getIntent();
                tb1 tb1Var = xg.a;
                int i = g67.f;
                fn9 fn9Var = new fn9(this);
                Object b2 = fn9Var.b();
                g67 g67Var = (g67) wm9.a().a.get(b2);
                if (g67Var == null) {
                    g67Var = new g67(fn9Var, intent, tb1Var);
                    wm9.a().a.put(b2, g67Var);
                    sb = "Created RequestContext " + g67Var.a;
                    sb2 = new StringBuilder();
                } else {
                    StringBuilder c2 = md0.c("Reusing RequestContext ");
                    c2.append(g67Var.a);
                    sb = c2.toString();
                    sb2 = new StringBuilder();
                }
                sb2.append("requestSource=");
                sb2.append(fn9Var.b());
                to9.a("g67", sb, sb2.toString());
                this.f686c = g67Var;
                b bVar = new b();
                StringBuilder c3 = md0.c("RequestContext ");
                c3.append(g67Var.a);
                c3.append(": registerListener for of request type ");
                c3.append("com.amazon.identity.auth.device.authorization.request.authorize");
                to9.a("g67", c3.toString(), "listener=" + bVar);
                synchronized (g67Var.c) {
                    Set set = (Set) g67Var.c.get("com.amazon.identity.auth.device.authorization.request.authorize");
                    if (set == null) {
                        set = new HashSet();
                        g67Var.c.put("com.amazon.identity.auth.device.authorization.request.authorize", set);
                    }
                    set.add(bVar);
                }
                g67 g67Var2 = this.f686c;
                if (g67Var2 != null) {
                    AuthorizeRequest authorizeRequest = new AuthorizeRequest(g67Var2);
                    Collections.addAll(authorizeRequest.f867c, rj9.b);
                    authorizeRequest.g = false;
                    authorizeRequest.f868d = AuthorizeRequest.GrantType.AUTHORIZATION_CODE;
                    authorizeRequest.f869e = this.f685b.e;
                    authorizeRequest.f = "S256";
                    Region region2 = rj9.a;
                    Boolean bool = com.amazon.identity.auth.device.api.authorization.a.f878a;
                    Objects.requireNonNull(gt9.b(this));
                    Region region3 = eo9.a;
                    synchronized (eo9.class) {
                        region = eo9.a;
                    }
                    if (region != region2) {
                        getSharedPreferences("com.amazon.lwa.LWASharedPreferences", 0).edit().putString("com.amazon.lwa.regionMode", region2.toString()).commit();
                        synchronized (eo9.class) {
                            eo9.a = region2;
                            boolean z = to9.a;
                            Log.i("eo9", "App Region overwritten : " + eo9.a.toString());
                        }
                    }
                    Context b3 = ((rf4) authorizeRequest).b.b();
                    String b4 = x1.b(b3, new StringBuilder(), " calling authorize");
                    boolean z2 = to9.a;
                    Log.i("com.amazon.identity.auth.device.api.authorization.a", b4);
                    List<md7> list = authorizeRequest.f867c;
                    int size = list.size();
                    String[] strArr = new String[size];
                    JSONObject jSONObject = new JSONObject();
                    for (int i2 = 0; i2 < size; i2++) {
                        md7 md7Var = list.get(i2);
                        String name = md7Var.getName();
                        strArr[i2] = name;
                        if (md7Var.a() != null) {
                            try {
                                jSONObject.put(name, md7Var.a());
                            } catch (JSONException e2) {
                                to9.b("com.amazon.identity.auth.device.api.authorization.a", ih5.a("Unable to serialize scope data for scope \"", name, "\""), md7Var.a().toString(), e2);
                            }
                        }
                    }
                    Bundle bundle = new Bundle();
                    if (jSONObject.length() > 0) {
                        bundle.putString(ch.b.q.a, jSONObject.toString());
                    }
                    if (authorizeRequest.f868d == AuthorizeRequest.GrantType.AUTHORIZATION_CODE) {
                        bundle.putBoolean(ch.b.t.a, true);
                    }
                    String str = authorizeRequest.f869e;
                    if (str != null) {
                        bundle.putString(ch.b.r.a, str);
                    }
                    String str2 = authorizeRequest.f;
                    if (str2 != null) {
                        bundle.putString(ch.b.s.a, str2);
                    }
                    bundle.putBoolean(ch.a.b.a, true);
                    gt9 b5 = gt9.b(b3);
                    vs vsVar = new vs(b3, authorizeRequest);
                    Objects.requireNonNull(b5);
                    if (size == 0) {
                        throw new IllegalArgumentException("scopes must not be null or empty!");
                    }
                    boolean z3 = to9.a;
                    Log.i("gt9", b3.getPackageName() + " calling authorize: scopes=" + Arrays.toString(strArr));
                    xn9.a.execute(new ct9(b5, b3, vsVar, bundle, authorizeRequest, strArr));
                } else {
                    throw new IllegalArgumentException("A RequestContext is necessary for making interactive requests");
                }
            } else {
                new Handler().postDelayed(new g0(this), 200L);
            }
            this.f685b.f = true;
            return;
        }
        Intent intent2 = getIntent();
        if (intent2.getData() != null) {
            am9.a("BrowserRedirectSuccess");
            yi8.e("ApayBrowserActivity:onResume with data:%s", new Object[]{intent2.getData().toString()});
            intent2.putExtra("success", getIntent().getData());
            Z4(intent2, -1);
        } else if (!this.f685b.g) {
            yi8.e("onResume: operation cancelled", new Object[0]);
            a("OPERATION_CANCELLED");
        } else if (this.f686c != null) {
            yi8.e("In onResume: requestContext not null, sending redirect info to auth sdk", new Object[0]);
            g67 g67Var3 = this.f686c;
            Objects.requireNonNull(g67Var3);
            boolean z4 = to9.a;
            Log.d("g67", "RequestContext " + g67Var3.a + ": onResume");
            xm9 a2 = g67Var3.b.a();
            if (a2 != null) {
                a2.a(g67Var3);
                return;
            }
            StringBuilder c4 = md0.c("RequestContext ");
            c4.append(g67Var3.a);
            c4.append(": could not retrieve interactive state to process pending responses");
            Log.e("g67", c4.toString());
        } else {
            yi8.b("onResume: Unable to continue with operation. Returning.", new Object[0]);
            a("LowMemory");
            finish();
        }
    }

    public void onSaveInstanceState(Bundle bundle) {
        super/*androidx.activity.ComponentActivity*/.onSaveInstanceState(bundle);
        am9.a("SaveStateSuccess");
        yi8.e("APayBrowserActivity:onSaveInstanceState invoked for operation: %s", new Object[]{this.f685b.a});
        bundle.putBoolean("HAS_BROWSER_LAUNCHED", this.f685b.f);
        bundle.putBoolean("HAS_ON_NEW_INTENT_CALLED", this.f685b.g);
        bundle.putParcelable("COMPLETION_INTENT", this.f685b.b);
        bundle.putParcelable("CANCEL_INTENT", this.f685b.c);
        bundle.putSerializable("operation", this.f685b.a);
        bundle.putSerializable("PAY_URL", this.f685b.d);
        bundle.putSerializable("codeChallenge", this.f685b.e);
    }
}