导航菜单

页面标题

页面副标题

Housing v14.7.8 - PermissionActivity.java 源代码

正在查看: Housing v14.7.8 应用的 PermissionActivity.java JAVA 源代码文件

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


package com.moengage.pushbase.internal.activity;

import android.content.Context;
import android.os.Bundle;
import androidx.activity.result.c;
import androidx.appcompat.app.i;
import com.moengage.core.internal.logger.Logger;
import com.moengage.pushbase.internal.PushConstantsInternal;
import com.moengage.pushbase.internal.permission.PermissionHandlerKt;
import com.newrelic.agent.android.api.v2.TraceFieldInterface;
import com.newrelic.agent.android.background.ApplicationStateMonitor;
import com.newrelic.agent.android.instrumentation.Instrumented;
import com.newrelic.agent.android.tracing.Trace;
import com.newrelic.agent.android.tracing.TraceMachine;
import d.g;
import kotlin.Metadata;
import kotlin.jvm.internal.r;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@Metadata(d1 = {"\u0000*\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0002\u0010\u0003J\u000f\u0010\u0005\u001a\u00020\u0004H\u0002¢\u0006\u0004\b\u0005\u0010\u0003J\u0019\u0010\b\u001a\u00020\u00042\b\u0010\u0007\u001a\u0004\u0018\u00010\u0006H\u0014¢\u0006\u0004\b\b\u0010\tJ\u000f\u0010\n\u001a\u00020\u0004H\u0014¢\u0006\u0004\b\n\u0010\u0003J\u000f\u0010\u000b\u001a\u00020\u0004H\u0014¢\u0006\u0004\b\u000b\u0010\u0003J\u000f\u0010\f\u001a\u00020\u0004H\u0014¢\u0006\u0004\b\f\u0010\u0003J\u000f\u0010\r\u001a\u00020\u0004H\u0014¢\u0006\u0004\b\r\u0010\u0003R\u0014\u0010\u000f\u001a\u00020\u000e8\u0002X\u0082D¢\u0006\u0006\n\u0004\b\u000f\u0010\u0010R\"\u0010\u0013\u001a\u0010\u0012\f\u0012\n \u0012*\u0004\u0018\u00010\u000e0\u000e0\u00118\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0013\u0010\u0014¨\u0006\u0015"}, d2 = {"Lcom/moengage/pushbase/internal/activity/PermissionActivity;", "Landroidx/appcompat/app/i;", "<init>", "()V", "Lzp/j0;", "requestNotificationPermission", "Landroid/os/Bundle;", "savedInstanceState", "onCreate", "(Landroid/os/Bundle;)V", "onStart", "onStop", "onPause", "onResume", "", "tag", "Ljava/lang/String;", "Landroidx/activity/result/c;", "kotlin.jvm.PlatformType", "requestNotificationPermissionLauncher", "Landroidx/activity/result/c;", "pushbase_defaultRelease"}, k = 1, mv = {1, 9, 0}, xi = 48)
@Instrumented
public final class PermissionActivity extends i implements TraceFieldInterface {
    public Trace _nr_trace;

    @NotNull
    private final c<String> requestNotificationPermissionLauncher;

    @NotNull
    private final String tag = "PushBase_8.3.1_PermissionActivity";

    public PermissionActivity() {
        c<String> registerForActivityResult = registerForActivityResult(new g(), new com.facebook.login.c(this, 23));
        r.j(registerForActivityResult, "registerForActivityResult(...)");
        this.requestNotificationPermissionLauncher = registerForActivityResult;
    }

    private final void requestNotificationPermission() {
        try {
            Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new PermissionActivity$requestNotificationPermission$1(this), 7, null);
            this.requestNotificationPermissionLauncher.b(PushConstantsInternal.NOTIFICATION_PERMISSION);
        } catch (Throwable th) {
            Logger.Companion.print$default(Logger.INSTANCE, 1, th, null, new PermissionActivity$requestNotificationPermission$2(this), 4, null);
        }
    }

    public static final void requestNotificationPermissionLauncher$lambda$0(PermissionActivity permissionActivity, boolean z) {
        r.k(permissionActivity, "this$0");
        try {
            PermissionHandlerKt.notifyListeners(z);
            if (z) {
                Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new PermissionActivity$requestNotificationPermissionLauncher$1$1(permissionActivity), 7, null);
                Context applicationContext = permissionActivity.getApplicationContext();
                r.j(applicationContext, "getApplicationContext(...)");
                PermissionHandlerKt.onPermissionGranted(applicationContext, permissionActivity.getIntent().getExtras());
            } else {
                Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new PermissionActivity$requestNotificationPermissionLauncher$1$2(permissionActivity), 7, null);
                Context applicationContext2 = permissionActivity.getApplicationContext();
                r.j(applicationContext2, "getApplicationContext(...)");
                PermissionHandlerKt.onPermissionDenied(applicationContext2, permissionActivity.getIntent().getExtras());
            }
            Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new PermissionActivity$requestNotificationPermissionLauncher$1$3(permissionActivity), 7, null);
            permissionActivity.finish();
        } catch (Throwable th) {
            Logger.Companion.print$default(Logger.INSTANCE, 1, th, null, new PermissionActivity$requestNotificationPermissionLauncher$1$4(permissionActivity), 4, null);
        }
    }

    public void onCreate(@Nullable Bundle savedInstanceState) {
        TraceMachine.startTracing("PermissionActivity");
        try {
            TraceMachine.enterMethod(this._nr_trace, "PermissionActivity#onCreate", null);
        } catch (NoSuchFieldError unused) {
            TraceMachine.enterMethod(null, "PermissionActivity#onCreate", null);
        }
        super/*androidx.fragment.app.u*/.onCreate(savedInstanceState);
        Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new PermissionActivity$onCreate$1(this), 7, null);
        requestNotificationPermission();
        TraceMachine.exitMethod();
    }

    public void onPause() {
        super/*androidx.fragment.app.u*/.onPause();
        Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new PermissionActivity$onPause$1(this), 7, null);
    }

    public void onResume() {
        super/*androidx.fragment.app.u*/.onResume();
        Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new PermissionActivity$onResume$1(this), 7, null);
    }

    public void onStart() {
        ApplicationStateMonitor.getInstance().activityStarted();
        super.onStart();
        Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new PermissionActivity$onStart$1(this), 7, null);
    }

    public void onStop() {
        ApplicationStateMonitor.getInstance().activityStopped();
        super.onStop();
        Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new PermissionActivity$onStop$1(this), 7, null);
    }
}