package com.android.billingclient.api; import android.app.Activity; import android.app.PendingIntent; import android.content.Intent; import android.content.IntentSender; import android.os.Bundle; import android.os.ResultReceiver; import com.firemonkeys.cloudcellapi.Consts; import com.google.android.apps.common.proguard.UsedByReflection; @UsedByReflection("PlatformActivityProxy") /* loaded from: classes.dex */ public class ProxyBillingActivity extends Activity { public ResultReceiver inAppMessageResultReceiver; public boolean isFlowFromFirstPartyClient; public ResultReceiver priceChangeResultReceiver; public boolean sendCancelledBroadcastIfFinished; public final Intent makeAlternativeBillingIntent(String str) { Intent intent = new Intent("com.android.vending.billing.ALTERNATIVE_BILLING"); intent.setPackage(getApplicationContext().getPackageName()); intent.putExtra("ALTERNATIVE_BILLING_USER_CHOICE_DATA", str); return intent; } public final Intent makePurchasesUpdatedIntent() { Intent intent = new Intent("com.android.vending.billing.PURCHASES_UPDATED"); intent.setPackage(getApplicationContext().getPackageName()); return intent; } /* JADX WARN: Removed duplicated region for block: B:22:0x0074 */ /* JADX WARN: Removed duplicated region for block: B:25:0x0080 */ @Override // android.app.Activity /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public void onActivityResult(int r8, int r9, android.content.Intent r10) { /* Method dump skipped, instructions count: 252 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.android.billingclient.api.ProxyBillingActivity.onActivityResult(int, int, android.content.Intent):void"); } @Override // android.app.Activity public void onCreate(Bundle bundle) { int i; PendingIntent pendingIntent; int i2; super.onCreate(bundle); if (bundle != null) { com.google.android.gms.internal.play_billing.zzb.zzi("ProxyBillingActivity", "Launching Play Store billing flow from savedInstanceState"); this.sendCancelledBroadcastIfFinished = bundle.getBoolean("send_cancelled_broadcast_if_finished", false); if (bundle.containsKey("result_receiver")) { this.priceChangeResultReceiver = (ResultReceiver) bundle.getParcelable("result_receiver"); } else if (bundle.containsKey("in_app_message_result_receiver")) { this.inAppMessageResultReceiver = (ResultReceiver) bundle.getParcelable("in_app_message_result_receiver"); } this.isFlowFromFirstPartyClient = bundle.getBoolean("IS_FLOW_FROM_FIRST_PARTY_CLIENT", false); return; } com.google.android.gms.internal.play_billing.zzb.zzi("ProxyBillingActivity", "Launching Play Store billing flow"); if (getIntent().hasExtra(Consts.RESPONSE_BUY_INTENT)) { pendingIntent = (PendingIntent) getIntent().getParcelableExtra(Consts.RESPONSE_BUY_INTENT); if (getIntent().hasExtra("IS_FLOW_FROM_FIRST_PARTY_CLIENT") && getIntent().getBooleanExtra("IS_FLOW_FROM_FIRST_PARTY_CLIENT", false)) { this.isFlowFromFirstPartyClient = true; i2 = 110; i = i2; } i = 100; } else if (getIntent().hasExtra("SUBS_MANAGEMENT_INTENT")) { pendingIntent = (PendingIntent) getIntent().getParcelableExtra("SUBS_MANAGEMENT_INTENT"); this.priceChangeResultReceiver = (ResultReceiver) getIntent().getParcelableExtra("result_receiver"); i = 100; } else if (getIntent().hasExtra("IN_APP_MESSAGE_INTENT")) { pendingIntent = (PendingIntent) getIntent().getParcelableExtra("IN_APP_MESSAGE_INTENT"); this.inAppMessageResultReceiver = (ResultReceiver) getIntent().getParcelableExtra("in_app_message_result_receiver"); i2 = 101; i = i2; } else { i = 100; pendingIntent = null; } try { this.sendCancelledBroadcastIfFinished = true; startIntentSenderForResult(pendingIntent.getIntentSender(), i, new Intent(), 0, 0, 0); } catch (IntentSender.SendIntentException e) { com.google.android.gms.internal.play_billing.zzb.zzk("ProxyBillingActivity", "Got exception while trying to start a purchase flow.", e); ResultReceiver resultReceiver = this.priceChangeResultReceiver; if (resultReceiver != null) { resultReceiver.send(6, null); } else { ResultReceiver resultReceiver2 = this.inAppMessageResultReceiver; if (resultReceiver2 != null) { resultReceiver2.send(0, null); } else { Intent makePurchasesUpdatedIntent = makePurchasesUpdatedIntent(); if (this.isFlowFromFirstPartyClient) { makePurchasesUpdatedIntent.putExtra("IS_FIRST_PARTY_PURCHASE", true); } makePurchasesUpdatedIntent.putExtra("RESPONSE_CODE", 6); makePurchasesUpdatedIntent.putExtra("DEBUG_MESSAGE", "An internal error occurred."); sendBroadcast(makePurchasesUpdatedIntent); } } this.sendCancelledBroadcastIfFinished = false; finish(); } } @Override // android.app.Activity public void onDestroy() { super.onDestroy(); if (isFinishing() && this.sendCancelledBroadcastIfFinished) { Intent makePurchasesUpdatedIntent = makePurchasesUpdatedIntent(); makePurchasesUpdatedIntent.putExtra("RESPONSE_CODE", 1); makePurchasesUpdatedIntent.putExtra("DEBUG_MESSAGE", "Billing dialog closed."); sendBroadcast(makePurchasesUpdatedIntent); } } @Override // android.app.Activity public void onSaveInstanceState(Bundle bundle) { ResultReceiver resultReceiver = this.priceChangeResultReceiver; if (resultReceiver != null) { bundle.putParcelable("result_receiver", resultReceiver); } ResultReceiver resultReceiver2 = this.inAppMessageResultReceiver; if (resultReceiver2 != null) { bundle.putParcelable("in_app_message_result_receiver", resultReceiver2); } bundle.putBoolean("send_cancelled_broadcast_if_finished", this.sendCancelledBroadcastIfFinished); bundle.putBoolean("IS_FLOW_FROM_FIRST_PARTY_CLIENT", this.isFlowFromFirstPartyClient); } }