From 58e0be9cf4e59f3502c0ca91a5087f08e5df8372 Mon Sep 17 00:00:00 2001 From: ZhanGSKen Date: Mon, 28 Jul 2025 11:35:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BC=80=E6=9C=BA=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- timestamp/build.properties | 4 +- timestamp/src/main/AndroidManifest.xml | 17 ++++++++ .../timestamp/receivers/MainReceiver.java | 40 +++++++++++++++++++ 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 timestamp/src/main/java/cc/winboll/studio/timestamp/receivers/MainReceiver.java diff --git a/timestamp/build.properties b/timestamp/build.properties index 015e1f0d..a61d8985 100644 --- a/timestamp/build.properties +++ b/timestamp/build.properties @@ -1,8 +1,8 @@ #Created by .winboll/winboll_app_build.gradle -#Thu Jul 24 15:25:52 HKT 2025 +#Mon Jul 28 03:33:08 GMT 2025 stageCount=3 libraryProject= baseVersion=15.1 publishVersion=15.1.2 -buildCount=0 +buildCount=3 baseBetaVersion=15.1.3 diff --git a/timestamp/src/main/AndroidManifest.xml b/timestamp/src/main/AndroidManifest.xml index fe353647..b1705ab9 100644 --- a/timestamp/src/main/AndroidManifest.xml +++ b/timestamp/src/main/AndroidManifest.xml @@ -3,6 +3,9 @@ xmlns:android="http://schemas.android.com/apk/res/android" package="cc.winboll.studio.timestamp"> + + + @@ -45,6 +48,20 @@ + + + + + + + + + + diff --git a/timestamp/src/main/java/cc/winboll/studio/timestamp/receivers/MainReceiver.java b/timestamp/src/main/java/cc/winboll/studio/timestamp/receivers/MainReceiver.java new file mode 100644 index 00000000..05f0811f --- /dev/null +++ b/timestamp/src/main/java/cc/winboll/studio/timestamp/receivers/MainReceiver.java @@ -0,0 +1,40 @@ +package cc.winboll.studio.timestamp.receivers; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import cc.winboll.studio.libappbase.LogUtils; +import cc.winboll.studio.timestamp.MainService; +import cc.winboll.studio.timestamp.models.AppConfigsModel; +import cc.winboll.studio.timestamp.utils.AppConfigsUtil; + +/** + * @Author ZhanGSKen&豆包大模型 + * @Date 2025/07/28 11:15 + * @Describe MainReceiver + */ +public class MainReceiver extends BroadcastReceiver { + + public static final String TAG = "MainReceiver"; + + static final String ACTION_BOOT_COMPLETED = "android.intent.action.BOOT_COMPLETED"; + + AppConfigsUtil mAppConfigsUtil; + + @Override + public void onReceive(Context context, Intent intent) { + String szAction = intent.getAction(); + if (szAction.equals(ACTION_BOOT_COMPLETED)) { + AppConfigsModel appConfigs = AppConfigsUtil.getInstance(context).loadAppConfigs(); + boolean isEnable = appConfigs.isEnableService(); + AppConfigsUtil.getInstance(context).saveAppConfigs(); + + Intent intentMainService = new Intent(context, MainService.class); + if (isEnable) { + context.startService(intentMainService); + } + LogUtils.i(TAG, "System Boot And Start ManagerService Completed!"); + } + } + +}