导航菜单

页面标题

页面副标题

Moneyman v2.316.0.0 - AppUpdateReceiver.java 源代码

正在查看: Moneyman v2.316.0.0 应用的 AppUpdateReceiver.java JAVA 源代码文件

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


package com.exponea.sdk.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.exponea.sdk.preferences.ExponeaPreferencesImpl;
import com.exponea.sdk.repository.PushTokenRepositoryImpl;
import com.exponea.sdk.repository.PushTokenRepositoryProvider;
import com.exponea.sdk.util.Logger;
import kotlin.Metadata;
import kotlin.jvm.internal.i;

@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\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0002\u0010\u0003J\u0017\u0010\u0007\u001a\u00020\u00062\u0006\u0010\u0005\u001a\u00020\u0004H\u0002¢\u0006\u0004\b\u0007\u0010\bJ#\u0010\u000b\u001a\u00020\u00062\b\u0010\u0005\u001a\u0004\u0018\u00010\u00042\b\u0010\n\u001a\u0004\u0018\u00010\tH\u0016¢\u0006\u0004\b\u000b\u0010\f¨\u0006\r"}, d2 = {"Lcom/exponea/sdk/receiver/AppUpdateReceiver;", "Landroid/content/BroadcastReceiver;", "<init>", "()V", "Landroid/content/Context;", "context", "LVf/A;", "migrateFcmToken", "(Landroid/content/Context;)V", "Landroid/content/Intent;", "intent", "onReceive", "(Landroid/content/Context;Landroid/content/Intent;)V", "sdk_release"}, k = 1, mv = {1, 9, 0}, xi = 48)
public final class AppUpdateReceiver extends BroadcastReceiver {
    private final void migrateFcmToken(Context context) {
        PushTokenRepositoryImpl pushTokenRepositoryImpl = new PushTokenRepositoryImpl(new ExponeaPreferencesImpl(context, null, 2, null));
        String str = pushTokenRepositoryImpl.get();
        if (str == null || str.length() == 0) {
            Logger.INSTANCE.d(this, "FCM token migration not needed");
            return;
        }
        PushTokenRepositoryImpl pushTokenRepositoryImpl2 = PushTokenRepositoryProvider.INSTANCE.get(context);
        String str2 = pushTokenRepositoryImpl2.get();
        if (str2 != null && str2.length() != 0) {
            Logger.INSTANCE.d(this, "FCM token migration already done");
            pushTokenRepositoryImpl.clear();
            return;
        }
        String str3 = pushTokenRepositoryImpl.get();
        i.d(str3);
        Long lastTrackDateInMilliseconds = pushTokenRepositoryImpl.getLastTrackDateInMilliseconds();
        pushTokenRepositoryImpl2.setTrackedToken(str3, lastTrackDateInMilliseconds != null ? lastTrackDateInMilliseconds.longValue() : 0L, pushTokenRepositoryImpl.getLastTokenType(), pushTokenRepositoryImpl.getLastPermissionFlag());
        pushTokenRepositoryImpl.clear();
        Logger.INSTANCE.d(this, "FCM migration has been done");
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        if ("android.intent.action.MY_PACKAGE_REPLACED".equalsIgnoreCase(intent != null ? intent.getAction() : null)) {
            if (context == null) {
                Logger.INSTANCE.e(this, "Application update event received but with no context");
                return;
            } else {
                migrateFcmToken(context);
                return;
            }
        }
        Logger.INSTANCE.e(this, "Application update event received but with different action " + (intent != null ? intent.getAction() : null));
    }
}