导航菜单

页面标题

页面副标题

Housing v14.7.8 - PushClickDialogTracker.java 源代码

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

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


package com.moengage.pushbase.activities;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Keep;
import androidx.fragment.app.u;
import com.moengage.core.exceptions.SdkNotInitializedException;
import com.moengage.core.internal.global.IntentProcessorKt;
import com.moengage.core.internal.logger.Logger;
import com.moengage.core.internal.model.SdkInstance;
import com.moengage.core.internal.utils.CoreUtils;
import com.moengage.pushbase.internal.MoEPushReceiver;
import com.moengage.pushbase.internal.PushConstantsInternal;
import com.moengage.pushbase.internal.PushHelper;
import com.moengage.pushbase.internal.action.ClickHandler;
import com.moengage.pushbase.internal.fragments.DatePickerFragment;
import com.moengage.pushbase.internal.fragments.TimePickerFragment;
import com.moengage.pushbase.internal.listener.DateSelectionListener;
import com.moengage.pushbase.internal.listener.OptionSelectionListener;
import com.moengage.pushbase.internal.listener.TimeSelectionListener;
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 java.util.Calendar;
import kotlin.Metadata;
import kotlin.jvm.internal.r;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@Keep
@Metadata(d1 = {"\u0000>\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\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\u0002\n\u0002\u0010\b\n\u0002\b\u000b\n\u0002\u0010\t\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0002\b\u0006\b\u0007\u0018\u00002\u00020\u00012\u00020\u00022\u00020\u00032\u00020\u0004B\u0007¢\u0006\u0004\b\u0005\u0010\u0006J\u0019\u0010\n\u001a\u00020\t2\b\u0010\b\u001a\u0004\u0018\u00010\u0007H\u0014¢\u0006\u0004\b\n\u0010\u000bJ'\u0010\u0010\u001a\u00020\t2\u0006\u0010\r\u001a\u00020\f2\u0006\u0010\u000e\u001a\u00020\f2\u0006\u0010\u000f\u001a\u00020\fH\u0016¢\u0006\u0004\b\u0010\u0010\u0011J\u001f\u0010\u0014\u001a\u00020\t2\u0006\u0010\u0012\u001a\u00020\f2\u0006\u0010\u0013\u001a\u00020\fH\u0016¢\u0006\u0004\b\u0014\u0010\u0015J\u000f\u0010\u0016\u001a\u00020\tH\u0016¢\u0006\u0004\b\u0016\u0010\u0006J\u000f\u0010\u0017\u001a\u00020\tH\u0016¢\u0006\u0004\b\u0017\u0010\u0006J\u0017\u0010\u001a\u001a\u00020\t2\u0006\u0010\u0019\u001a\u00020\u0018H\u0016¢\u0006\u0004\b\u001a\u0010\u001bJ\u000f\u0010\u001c\u001a\u00020\tH\u0016¢\u0006\u0004\b\u001c\u0010\u0006R\u0014\u0010\u001e\u001a\u00020\u001d8\u0002X\u0082D¢\u0006\u0006\n\u0004\b\u001e\u0010\u001fR\u0016\u0010\r\u001a\u00020\f8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\r\u0010 R\u0016\u0010\u000e\u001a\u00020\f8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u000e\u0010 R\u0016\u0010\u000f\u001a\u00020\f8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u000f\u0010 R\u0016\u0010!\u001a\u00020\u00078\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\b!\u0010\"¨\u0006#"}, d2 = {"Lcom/moengage/pushbase/activities/PushClickDialogTracker;", "Landroidx/fragment/app/u;", "Lcom/moengage/pushbase/internal/listener/DateSelectionListener;", "Lcom/moengage/pushbase/internal/listener/TimeSelectionListener;", "Lcom/moengage/pushbase/internal/listener/OptionSelectionListener;", "<init>", "()V", "Landroid/os/Bundle;", "savedInstanceState", "Lzp/j0;", "onCreate", "(Landroid/os/Bundle;)V", "", "year", "month", "day", "onDateSelected", "(III)V", "hourOfDay", "minute", "onTimeSelected", "(II)V", "onTimeDialogCancelled", "onDateDialogCancelled", "", "time", "onItemSelected", "(J)V", "onDialogCancelled", "", "tag", "Ljava/lang/String;", "I", "extras", "Landroid/os/Bundle;", "pushbase_defaultRelease"}, k = 1, mv = {1, 9, 0}, xi = 48)
@Instrumented
public final class PushClickDialogTracker extends u implements DateSelectionListener, TimeSelectionListener, OptionSelectionListener, TraceFieldInterface {
    public Trace _nr_trace;
    private int day;
    private Bundle extras;
    private int month;

    @NotNull
    private final String tag = "PushBase_8.3.1_PushClickDialogTracker";
    private int year;

    public void onCreate(@Nullable Bundle savedInstanceState) {
        Intent intent;
        TraceMachine.startTracing("PushClickDialogTracker");
        try {
            TraceMachine.enterMethod(this._nr_trace, "PushClickDialogTracker#onCreate", null);
        } catch (NoSuchFieldError unused) {
            TraceMachine.enterMethod(null, "PushClickDialogTracker#onCreate", null);
        }
        try {
            super.onCreate(savedInstanceState);
            Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new PushClickDialogTracker$onCreate$1(this), 7, null);
            intent = getIntent();
        } catch (Exception e) {
            Logger.Companion.print$default(Logger.INSTANCE, 1, e, null, new PushClickDialogTracker$onCreate$2(this), 4, null);
            finish();
        }
        if (intent == null) {
            IllegalStateException illegalStateException = new IllegalStateException("Intent cannot be null");
            TraceMachine.exitMethod();
            throw illegalStateException;
        }
        Bundle extras = intent.getExtras();
        if (extras == null) {
            IllegalStateException illegalStateException2 = new IllegalStateException("Intent extras cannot be empty");
            TraceMachine.exitMethod();
            throw illegalStateException2;
        }
        this.extras = extras;
        IntentProcessorKt.notifyPreProcessListenerIfRequired(extras);
        PushHelper companion = PushHelper.INSTANCE.getInstance();
        Bundle bundle = this.extras;
        if (bundle == null) {
            r.o("extras");
            throw null;
        }
        SdkInstance sdkInstanceForPayload = companion.getSdkInstanceForPayload(bundle);
        if (sdkInstanceForPayload == null) {
            SdkNotInitializedException sdkNotInitializedException = new SdkNotInitializedException("Instance not initialised.");
            TraceMachine.exitMethod();
            throw sdkNotInitializedException;
        }
        ClickHandler clickHandler = new ClickHandler(sdkInstanceForPayload);
        clickHandler.postClickProcessing(this);
        Bundle bundle2 = this.extras;
        if (bundle2 == null) {
            r.o("extras");
            throw null;
        }
        bundle2.putBoolean(PushConstantsInternal.KEY_RE_NOTIFY, true);
        Bundle bundle3 = this.extras;
        if (bundle3 == null) {
            r.o("extras");
            throw null;
        }
        bundle3.putString(PushConstantsInternal.NOTIFICATION_REPOSTING_SOURCE, PushConstantsInternal.NOTIFICATION_REPOSTING_SOURCE_REMIND_LATER_OR_SNOOZE);
        Bundle bundle4 = this.extras;
        if (bundle4 == null) {
            r.o("extras");
            throw null;
        }
        if (!bundle4.containsKey(PushConstantsInternal.ACTION)) {
            finish();
        }
        Bundle bundle5 = this.extras;
        if (bundle5 == null) {
            r.o("extras");
            throw null;
        }
        clickHandler.onClick(this, bundle5);
        TraceMachine.exitMethod();
    }

    @Override
    public void onDateDialogCancelled() {
        Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new PushClickDialogTracker$onDateDialogCancelled$1(this), 7, null);
        finish();
    }

    @Override
    public void onDateSelected(int year, int month, int day) {
        try {
            Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new PushClickDialogTracker$onDateSelected$1(this, year, month, day), 7, null);
            this.year = year;
            this.day = day;
            this.month = month;
            TimePickerFragment timePickerFragment = new TimePickerFragment();
            timePickerFragment.setTimeSelectedListener(this);
            timePickerFragment.show(getSupportFragmentManager(), "timePicker");
        } catch (Exception e) {
            Logger.Companion.print$default(Logger.INSTANCE, 1, e, null, new PushClickDialogTracker$onDateSelected$2(this), 4, null);
            finish();
        }
    }

    @Override
    public void onDialogCancelled() {
        finish();
    }

    @Override
    public void onItemSelected(long time) {
        try {
            Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new PushClickDialogTracker$onItemSelected$1(this, time), 7, null);
            if (time == -1) {
                DatePickerFragment datePickerFragment = new DatePickerFragment();
                Bundle bundle = this.extras;
                if (bundle == null) {
                    r.o("extras");
                    throw null;
                }
                datePickerFragment.setArguments(bundle);
                datePickerFragment.setDateSelectedListener(this);
                datePickerFragment.show(getSupportFragmentManager(), "datePicker");
                return;
            }
            Intent intent = new Intent(getApplicationContext(), (Class<?>) MoEPushReceiver.class);
            Bundle bundle2 = this.extras;
            if (bundle2 == null) {
                r.o("extras");
                throw null;
            }
            intent.putExtras(CoreUtils.deepCopy(bundle2));
            intent.setAction(PushConstantsInternal.ACTION_SHOW_NOTIFICATION);
            Context applicationContext = getApplicationContext();
            r.j(applicationContext, "getApplicationContext(...)");
            PendingIntent pendingIntentBroadcast$default = CoreUtils.getPendingIntentBroadcast$default(applicationContext, 123, intent, 0, 8, null);
            Object systemService = getApplication().getSystemService("alarm");
            r.i(systemService, "null cannot be cast to non-null type android.app.AlarmManager");
            ((AlarmManager) systemService).set(0, time, pendingIntentBroadcast$default);
            finish();
        } catch (Exception e) {
            Logger.Companion.print$default(Logger.INSTANCE, 1, e, null, new PushClickDialogTracker$onItemSelected$2(this), 4, null);
            finish();
        }
    }

    public void onStart() {
        super.onStart();
        ApplicationStateMonitor.getInstance().activityStarted();
    }

    public void onStop() {
        super.onStop();
        ApplicationStateMonitor.getInstance().activityStopped();
    }

    @Override
    public void onTimeDialogCancelled() {
        Logger.Companion.print$default(Logger.INSTANCE, 0, null, null, new PushClickDialogTracker$onTimeDialogCancelled$1(this), 7, null);
        finish();
    }

    @Override
    public void onTimeSelected(int hourOfDay, int minute) {
        try {
            Logger.Companion companion = Logger.INSTANCE;
            Logger.Companion.print$default(companion, 0, null, null, new PushClickDialogTracker$onTimeSelected$1(this, hourOfDay, minute), 7, null);
            Calendar calendar = Calendar.getInstance();
            calendar.set(this.year, this.month, this.day, hourOfDay, minute, 0);
            long timeInMillis = calendar.getTimeInMillis();
            Logger.Companion.print$default(companion, 0, null, null, new PushClickDialogTracker$onTimeSelected$2(this, timeInMillis), 7, null);
            Intent intent = new Intent((Context) this, (Class<?>) MoEPushReceiver.class);
            Bundle bundle = this.extras;
            if (bundle == null) {
                r.o("extras");
                throw null;
            }
            Bundle deepCopy = CoreUtils.deepCopy(bundle);
            deepCopy.remove(PushConstantsInternal.KEY_ACTION_ID);
            deepCopy.remove(PushConstantsInternal.ACTION);
            intent.putExtras(deepCopy);
            intent.setAction(PushConstantsInternal.ACTION_SHOW_NOTIFICATION);
            Context applicationContext = getApplicationContext();
            r.j(applicationContext, "getApplicationContext(...)");
            PendingIntent pendingIntentBroadcast$default = CoreUtils.getPendingIntentBroadcast$default(applicationContext, CoreUtils.getUniqueNumber(), intent, 0, 8, null);
            Object systemService = getSystemService("alarm");
            r.i(systemService, "null cannot be cast to non-null type android.app.AlarmManager");
            ((AlarmManager) systemService).set(0, timeInMillis, pendingIntentBroadcast$default);
            finish();
        } catch (Exception e) {
            Logger.Companion.print$default(Logger.INSTANCE, 1, e, null, new PushClickDialogTracker$onTimeSelected$4(this), 4, null);
            finish();
        }
    }
}