导航菜单

页面标题

页面副标题

xDrip+ v04633772025.07.16 - AutoStart.java 源代码

正在查看: xDrip+ v04633772025.07.16 应用的 AutoStart.java JAVA 源代码文件

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


package com.eveningoutpost.dexdrip;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.eveningoutpost.dexdrip.models.UserError;
import com.eveningoutpost.dexdrip.services.PlusSyncService;
import com.eveningoutpost.dexdrip.utilitymodels.CollectionServiceStarter;
import com.eveningoutpost.dexdrip.utilitymodels.Inevitable;
import com.eveningoutpost.dexdrip.utilitymodels.Pref;

public class AutoStart extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent == null) {
            return;
        }
        try {
            UserError.Log.ueh("AutoStart", "Device Rebooted - Auto Start: " + intent.getAction());
        } catch (Exception unused) {
        }
        try {
            CollectionServiceStarter.restartCollectionServiceBackground();
        } catch (Exception e) {
            UserError.Log.wtf("AutoStart", "Failed to start collector: " + e);
        }
        try {
            PlusSyncService.startSyncService(context, "AutoStart");
        } catch (Exception e2) {
            UserError.Log.wtf("AutoStart", "Failed to start sync service: " + e2);
        }
        try {
            if (Pref.getBooleanDefaultFalse("show_home_on_boot")) {
                Inevitable.task("show_home_on_boot", 5000L, new Runnable() {
                    @Override
                    public void run() {
                        Home.startHomeWithExtra(xdrip.getAppContext(), "auto-start", "start");
                    }
                });
            }
        } catch (Exception e3) {
            UserError.Log.wtf("AutoStart", "Failed to start home: " + e3);
        }
    }
}