导航菜单

页面标题

页面副标题

Aplazo v2.4.68 - InAppNotificationActivity.java 源代码

正在查看: Aplazo v2.4.68 应用的 InAppNotificationActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.clevertap.android.sdk;

import A2.AbstractC0007g;
import A2.y0;
import B4.h;
import F1.b;
import I3.C0342u;
import I5.A;
import I5.C0356j;
import I5.P;
import I5.Q;
import I5.T;
import android.R;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Build;
import android.os.Bundle;
import androidx.fragment.app.C1142a;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.L;
import com.clevertap.android.sdk.InAppNotificationActivity;
import com.clevertap.android.sdk.inapp.AbstractC1414d;
import com.clevertap.android.sdk.inapp.C1424n;
import com.clevertap.android.sdk.inapp.C1426p;
import com.clevertap.android.sdk.inapp.C1428s;
import com.clevertap.android.sdk.inapp.C1429t;
import com.clevertap.android.sdk.inapp.CTInAppAction;
import com.clevertap.android.sdk.inapp.CTInAppNotification;
import com.clevertap.android.sdk.inapp.CTInAppNotificationButton;
import com.clevertap.android.sdk.inapp.E;
import com.clevertap.android.sdk.inapp.G;
import com.clevertap.android.sdk.inapp.I;
import com.clevertap.android.sdk.inapp.N;
import com.clevertap.android.sdk.inapp.V;
import com.clevertap.android.sdk.inapp.W;
import com.clevertap.android.sdk.inapp.r;
import com.clevertap.android.sdk.inapp.x;
import com.google.android.libraries.barhopper.RecognitionOptions;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import kotlin.jvm.internal.l;
import n6.AbstractC2307a;

public final class InAppNotificationActivity extends L implements W, I5.L {

    public static boolean f21156G = false;

    public CleverTapInstanceConfig f21157A;

    public CTInAppNotification f21158B;

    public WeakReference f21159C;

    public WeakReference f21160D;

    public y0 f21161E;

    public boolean f21162F = false;

    @Override
    public final Bundle a(CTInAppNotification cTInAppNotification, CTInAppNotificationButton cTInAppNotificationButton, InAppNotificationActivity inAppNotificationActivity) {
        W u3 = u();
        if (u3 != null) {
            return u3.a(cTInAppNotification, cTInAppNotificationButton, this);
        }
        return null;
    }

    @Override
    public final Bundle b(CTInAppNotification cTInAppNotification, CTInAppAction cTInAppAction, String str, Bundle bundle, L l4) {
        W u3 = u();
        if (u3 != null) {
            return u3.b(cTInAppNotification, cTInAppAction, str, bundle, this);
        }
        return null;
    }

    @Override
    public final void d(CTInAppNotification cTInAppNotification) {
        t();
    }

    @Override
    public final void e(CTInAppNotification cTInAppNotification, Bundle bundle) {
        s(true, bundle);
    }

    @Override
    public final void finish() {
        super.finish();
        if (Build.VERSION.SDK_INT >= 34) {
            overrideActivityTransition(1, R.anim.fade_in, R.anim.fade_out);
        } else {
            overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
        }
    }

    @Override
    public final void g(boolean z6) {
        w(z6);
    }

    @Override
    public final void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        getOnBackPressedDispatcher().a(this, new C0342u(1, this, false));
        int i10 = getResources().getConfiguration().orientation;
        if (i10 == 2) {
            getWindow().addFlags(RecognitionOptions.UPC_E);
        }
        try {
            Bundle extras = getIntent().getExtras();
            if (extras == null) {
                throw new IllegalArgumentException();
            }
            this.f21158B = (CTInAppNotification) extras.getParcelable("inApp");
            boolean z6 = extras.getBoolean("displayHardPermissionDialog", false);
            Bundle bundle2 = extras.getBundle("configBundle");
            if (bundle2 != null) {
                this.f21157A = (CleverTapInstanceConfig) bundle2.getParcelable("config");
            }
            this.f21159C = new WeakReference(A.s(this, this.f21157A).f6341b.f6413l);
            this.f21160D = new WeakReference(A.s(this, this.f21157A).f6341b.f6413l);
            this.f21161E = new y0(this, this.f21157A);
            if (z6) {
                w(extras.getBoolean("shouldShowFallbackSettings", false));
                return;
            }
            CTInAppNotification cTInAppNotification = this.f21158B;
            if (cTInAppNotification == null) {
                finish();
                return;
            }
            if (cTInAppNotification.f21230u && !cTInAppNotification.f21229t) {
                if (i10 == 2) {
                    T.c("App in Landscape, dismissing portrait InApp Notification");
                    finish();
                    s(true, null);
                    return;
                }
                T.c("App in Portrait, displaying InApp Notification anyway");
            }
            CTInAppNotification cTInAppNotification2 = this.f21158B;
            if (!cTInAppNotification2.f21230u && cTInAppNotification2.f21229t) {
                if (i10 == 1) {
                    T.c("App in Portrait, dismissing landscape InApp Notification");
                    finish();
                    s(true, null);
                    return;
                }
                T.c("App in Landscape, displaying InApp Notification anyway");
            }
            if (bundle != null) {
                if (f21156G) {
                    r();
                    return;
                }
                return;
            }
            AbstractC1414d r4 = r();
            if (r4 != null) {
                Bundle bundle3 = new Bundle();
                bundle3.putParcelable("inApp", this.f21158B);
                bundle3.putParcelable("config", this.f21157A);
                r4.setArguments(bundle3);
                FragmentManager supportFragmentManager = getSupportFragmentManager();
                supportFragmentManager.getClass();
                C1142a c1142a = new C1142a(supportFragmentManager);
                c1142a.j(R.animator.fade_in, R.animator.fade_out, 0, 0);
                c1142a.g(R.id.content, r4, AbstractC0007g.l(new StringBuilder(), this.f21157A.f21134c, ":CT_INAPP_CONTENT_FRAGMENT"), 1);
                c1142a.o();
            }
        } catch (Throwable th) {
            T.r("Cannot find a valid notification bundle to show!", th);
            finish();
        }
    }

    @Override
    public final void onDestroy() {
        super.onDestroy();
        if (isChangingConfigurations()) {
            return;
        }
        s(false, null);
    }

    @Override
    public final void onRequestPermissionsResult(int i10, String[] strArr, int[] iArr) {
        super.onRequestPermissionsResult(i10, strArr, iArr);
        C0356j.f6538a.a(this, this.f21157A);
        C0356j.f6540c = false;
        CleverTapInstanceConfig cleverTapInstanceConfig = this.f21157A;
        l.e(cleverTapInstanceConfig, "config");
        AbstractC2307a.a(cleverTapInstanceConfig).a().u("updateCacheToDisk", new h(this, 3));
        if (i10 == 102) {
            if (iArr.length <= 0 || iArr[0] != 0) {
                ((V) ((Q) this.f21160D.get())).l(false);
            } else {
                ((V) ((Q) this.f21160D.get())).l(true);
            }
            s(true, null);
        }
    }

    @Override
    public final void onResume() {
        super.onResume();
        if (!this.f21161E.f472d || Build.VERSION.SDK_INT < 33) {
            return;
        }
        if (b.a(this, "android.permission.POST_NOTIFICATIONS") == 0) {
            ((V) ((Q) this.f21160D.get())).l(true);
        } else {
            ((V) ((Q) this.f21160D.get())).l(false);
        }
        s(true, null);
    }

    public final AbstractC1414d r() {
        I i10 = this.f21158B.f21228s;
        switch (P.f6461a[i10.ordinal()]) {
            case 1:
                return new C1424n();
            case 2:
                return new r();
            case 3:
                return new C1426p();
            case 4:
                return new C1428s();
            case 5:
                return new E();
            case 6:
                return new x();
            case 7:
                return new C1429t();
            case 8:
                return new G();
            case 9:
                return new com.clevertap.android.sdk.inapp.A();
            case 10:
                ArrayList arrayList = this.f21158B.f21217g;
                if (arrayList.isEmpty()) {
                    this.f21157A.o().getClass();
                    T.i("InAppNotificationActivity: Notification has no buttons, not showing Alert InApp");
                } else {
                    final CTInAppNotificationButton cTInAppNotificationButton = (CTInAppNotificationButton) arrayList.get(0);
                    final int i11 = 0;
                    AlertDialog create = new AlertDialog.Builder(this, R.style.Theme.Material.Light.Dialog.Alert).setCancelable(false).setTitle(this.f21158B.f21203G).setMessage(this.f21158B.f21198B).setPositiveButton(cTInAppNotificationButton.f21241h, new DialogInterface.OnClickListener(this) {

                        public final InAppNotificationActivity f6459d;

                        {
                            this.f6459d = this;
                        }

                        @Override
                        public final void onClick(DialogInterface dialogInterface, int i12) {
                            InAppNotificationActivity inAppNotificationActivity = this.f6459d;
                            CTInAppNotificationButton cTInAppNotificationButton2 = cTInAppNotificationButton;
                            switch (i11) {
                                case 0:
                                    boolean z6 = InAppNotificationActivity.f21156G;
                                    inAppNotificationActivity.v(cTInAppNotificationButton2, true);
                                    break;
                                case 1:
                                    boolean z10 = InAppNotificationActivity.f21156G;
                                    inAppNotificationActivity.v(cTInAppNotificationButton2, false);
                                    break;
                                default:
                                    boolean z11 = InAppNotificationActivity.f21156G;
                                    com.clevertap.android.sdk.inapp.W u3 = inAppNotificationActivity.u();
                                    inAppNotificationActivity.s(true, u3 != null ? u3.a(inAppNotificationActivity.f21158B, cTInAppNotificationButton2, inAppNotificationActivity) : null);
                                    break;
                            }
                        }
                    }).create();
                    if (this.f21158B.f21217g.size() == 2) {
                        final CTInAppNotificationButton cTInAppNotificationButton2 = (CTInAppNotificationButton) arrayList.get(1);
                        final int i12 = 1;
                        create.setButton(-2, cTInAppNotificationButton2.f21241h, new DialogInterface.OnClickListener(this) {

                            public final InAppNotificationActivity f6459d;

                            {
                                this.f6459d = this;
                            }

                            @Override
                            public final void onClick(DialogInterface dialogInterface, int i122) {
                                InAppNotificationActivity inAppNotificationActivity = this.f6459d;
                                CTInAppNotificationButton cTInAppNotificationButton22 = cTInAppNotificationButton2;
                                switch (i12) {
                                    case 0:
                                        boolean z6 = InAppNotificationActivity.f21156G;
                                        inAppNotificationActivity.v(cTInAppNotificationButton22, true);
                                        break;
                                    case 1:
                                        boolean z10 = InAppNotificationActivity.f21156G;
                                        inAppNotificationActivity.v(cTInAppNotificationButton22, false);
                                        break;
                                    default:
                                        boolean z11 = InAppNotificationActivity.f21156G;
                                        com.clevertap.android.sdk.inapp.W u3 = inAppNotificationActivity.u();
                                        inAppNotificationActivity.s(true, u3 != null ? u3.a(inAppNotificationActivity.f21158B, cTInAppNotificationButton22, inAppNotificationActivity) : null);
                                        break;
                                }
                            }
                        });
                    }
                    if (arrayList.size() > 2) {
                        final CTInAppNotificationButton cTInAppNotificationButton3 = (CTInAppNotificationButton) arrayList.get(2);
                        final int i13 = 2;
                        create.setButton(-3, cTInAppNotificationButton3.f21241h, new DialogInterface.OnClickListener(this) {

                            public final InAppNotificationActivity f6459d;

                            {
                                this.f6459d = this;
                            }

                            @Override
                            public final void onClick(DialogInterface dialogInterface, int i122) {
                                InAppNotificationActivity inAppNotificationActivity = this.f6459d;
                                CTInAppNotificationButton cTInAppNotificationButton22 = cTInAppNotificationButton3;
                                switch (i13) {
                                    case 0:
                                        boolean z6 = InAppNotificationActivity.f21156G;
                                        inAppNotificationActivity.v(cTInAppNotificationButton22, true);
                                        break;
                                    case 1:
                                        boolean z10 = InAppNotificationActivity.f21156G;
                                        inAppNotificationActivity.v(cTInAppNotificationButton22, false);
                                        break;
                                    default:
                                        boolean z11 = InAppNotificationActivity.f21156G;
                                        com.clevertap.android.sdk.inapp.W u3 = inAppNotificationActivity.u();
                                        inAppNotificationActivity.s(true, u3 != null ? u3.a(inAppNotificationActivity.f21158B, cTInAppNotificationButton22, inAppNotificationActivity) : null);
                                        break;
                                }
                            }
                        });
                    }
                    create.show();
                    f21156G = true;
                    t();
                }
                return null;
            default:
                this.f21157A.o().getClass();
                T.s("InAppNotificationActivity: Unhandled InApp Type: " + i10);
                return null;
        }
    }

    public final void s(boolean z6, Bundle bundle) {
        CTInAppNotification cTInAppNotification;
        if (f21156G) {
            f21156G = false;
        }
        if (!this.f21162F) {
            W u3 = u();
            if (u3 != null && (cTInAppNotification = this.f21158B) != null) {
                u3.e(cTInAppNotification, bundle);
            }
            this.f21162F = true;
        }
        if (z6) {
            finish();
        }
    }

    @Override
    public final void setTheme(int i10) {
        super.setTheme(R.style.Theme.Translucent.NoTitleBar);
    }

    public final void t() {
        W u3 = u();
        if (u3 != null) {
            u3.d(this.f21158B);
        }
    }

    public final W u() {
        W w5;
        try {
            w5 = (W) this.f21159C.get();
        } catch (Throwable unused) {
            w5 = null;
        }
        if (w5 == null) {
            T o10 = this.f21157A.o();
            String str = this.f21157A.f21134c;
            String str2 = "InAppActivityListener is null for notification: " + this.f21158B.f21233x;
            o10.getClass();
            T.u(str, str2);
        }
        return w5;
    }

    public final void v(CTInAppNotificationButton cTInAppNotificationButton, boolean z6) {
        W u3 = u();
        Bundle a2 = u3 != null ? u3.a(this.f21158B, cTInAppNotificationButton, this) : null;
        if (z6) {
            CTInAppNotification cTInAppNotification = this.f21158B;
            if (cTInAppNotification.f21210O) {
                w(cTInAppNotification.f21211P);
                return;
            }
        }
        CTInAppAction cTInAppAction = cTInAppNotificationButton.f21243j;
        if (cTInAppAction == null || N.REQUEST_FOR_PERMISSIONS != cTInAppAction.f21192c) {
            s(true, a2);
        } else {
            w(cTInAppAction.f21196g);
        }
    }

    public final void w(boolean z6) {
        this.f21161E.c(z6, (Q) this.f21160D.get());
    }
}