From 52137fd64f06156160ac67256e63b872dde5293d Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 29 Dec 2018 14:14:29 +0800 Subject: [PATCH] Remove useless service --- app/src/full/AndroidManifest.xml | 5 --- app/src/full/java/a/j.java | 4 +-- .../java/com/topjohnwu/magisk/ClassMap.java | 2 -- .../magisk/receivers/GeneralReceiver.java | 17 ++++++++-- .../magisk/services/OnBootService.java | 33 ------------------- 5 files changed, 15 insertions(+), 46 deletions(-) delete mode 100644 app/src/full/java/com/topjohnwu/magisk/services/OnBootService.java diff --git a/app/src/full/AndroidManifest.xml b/app/src/full/AndroidManifest.xml index 0c15f3eef..58fe76ab0 100644 --- a/app/src/full/AndroidManifest.xml +++ b/app/src/full/AndroidManifest.xml @@ -71,11 +71,6 @@ - - { + /* Devices with DTBO might want to patch dtbo.img. + * However, that is not possible if Magisk is installed by + * patching boot image with Magisk Manager and flashed via + * fastboot, since at that time we do not have root. + * Check for dtbo status every boot time, and prompt user + * to reboot if dtbo wasn't patched and patched by Magisk Manager. + * */ + if (Shell.rootAccess() && ShellUtils.fastCmdResult("mm_patch_dtbo")) + Notifications.dtboPatched(); + }); break; } break; diff --git a/app/src/full/java/com/topjohnwu/magisk/services/OnBootService.java b/app/src/full/java/com/topjohnwu/magisk/services/OnBootService.java deleted file mode 100644 index 4699c250c..000000000 --- a/app/src/full/java/com/topjohnwu/magisk/services/OnBootService.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.topjohnwu.magisk.services; - -import android.content.Context; -import android.content.Intent; - -import com.topjohnwu.core.Const; -import com.topjohnwu.magisk.ClassMap; -import com.topjohnwu.magisk.components.Notifications; -import com.topjohnwu.superuser.Shell; -import com.topjohnwu.superuser.ShellUtils; - -import androidx.annotation.NonNull; -import androidx.core.app.JobIntentService; - -public class OnBootService extends JobIntentService { - - public static void enqueueWork(Context context) { - enqueueWork(context, ClassMap.get(OnBootService.class), Const.ID.ONBOOT_SERVICE_ID, new Intent()); - } - - @Override - protected void onHandleWork(@NonNull Intent intent) { - /* Devices with DTBO might want to patch dtbo.img. - * However, that is not possible if Magisk is installed by - * patching boot image with Magisk Manager and flashed via - * fastboot, since at that time we do not have root. - * Check for dtbo status every boot time, and prompt user - * to reboot if dtbo wasn't patched and patched by Magisk Manager. - * */ - if (Shell.rootAccess() && ShellUtils.fastCmdResult("mm_patch_dtbo")) - Notifications.dtboPatched(); - } -}