diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 9ba7c0f60..86d1c906b 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,29 +1,11 @@
-
-
-
@@ -36,7 +18,6 @@
tools:replace="android:appComponentFactory">
-
-
-
-
-
-
@@ -89,7 +65,6 @@
-
@@ -105,6 +80,12 @@
android:authorities="${applicationId}.workmanager-init"
tools:node="remove" />
+
+
+
diff --git a/app/src/main/java/com/topjohnwu/magisk/Const.kt b/app/src/main/java/com/topjohnwu/magisk/Const.kt
index 79738f20f..beb603d8a 100644
--- a/app/src/main/java/com/topjohnwu/magisk/Const.kt
+++ b/app/src/main/java/com/topjohnwu/magisk/Const.kt
@@ -24,7 +24,7 @@ object Const {
object Version {
const val MIN_SUPPORT = 18000
- const val CONNECT_MODE = 20002
+ const val CONNECT_MODE = 20100
}
object ID {
diff --git a/app/src/main/java/com/topjohnwu/magisk/Info.kt b/app/src/main/java/com/topjohnwu/magisk/Info.kt
index 2eec3295a..7b4820c25 100644
--- a/app/src/main/java/com/topjohnwu/magisk/Info.kt
+++ b/app/src/main/java/com/topjohnwu/magisk/Info.kt
@@ -37,13 +37,8 @@ object Info {
val code = ShellUtils.fastCmd("magisk -V").toInt()
val hide = Shell.su("magiskhide --status").exec().isSuccess
var mode = -1
- if (code >= Const.Version.CONNECT_MODE) {
+ if (code >= Const.Version.CONNECT_MODE)
mode = Shell.su("magisk --connect-mode").exec().code
- if (mode == 0) {
- // Manually trigger broadcast test
- Shell.su("magisk --broadcast-test").exec()
- }
- }
Env(code, str, hide, mode)
}.getOrElse { Env() }
diff --git a/app/src/main/java/com/topjohnwu/magisk/model/receiver/GeneralReceiver.kt b/app/src/main/java/com/topjohnwu/magisk/model/receiver/GeneralReceiver.kt
index f31fa40f1..4c72c992c 100644
--- a/app/src/main/java/com/topjohnwu/magisk/model/receiver/GeneralReceiver.kt
+++ b/app/src/main/java/com/topjohnwu/magisk/model/receiver/GeneralReceiver.kt
@@ -51,23 +51,14 @@ open class GeneralReceiver : BaseReceiver() {
}
when (intent.action ?: return) {
- Intent.ACTION_REBOOT, Intent.ACTION_BOOT_COMPLETED -> {
- val action = intent.getStringExtra("action")
- if (action == null) {
- // Actual boot completed event
- Shell.su("mm_patch_dtbo").submit {
- if (it.isSuccess)
- Notifications.dtboPatched(context)
- }
- return
- }
- when (action) {
+ Intent.ACTION_REBOOT -> {
+ when (val action = intent.getStringExtra("action") ?: return) {
REQUEST -> {
val i = context.intent()
- .setAction(action)
- .putExtra("socket", intent.getStringExtra("socket"))
- .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
- .addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
+ .setAction(action)
+ .putExtra("socket", intent.getStringExtra("socket"))
+ .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+ .addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
if (SDK_INT >= 29) {
// Android Q does not allow starting activity from background
i.startActivityWithRoot()
@@ -92,7 +83,7 @@ open class GeneralReceiver : BaseReceiver() {
Intent.ACTION_PACKAGE_FULLY_REMOVED -> {
val pkg = getPkg(intent)
policyDB.delete(pkg).blockingGet()
- "magiskhide --rm $pkg".su().blockingGet()
+ Shell.su("magiskhide --rm $pkg").submit()
}
Intent.ACTION_LOCALE_CHANGED -> Shortcuts.setup(context)
Const.Key.BROADCAST_MANAGER_UPDATE -> {
diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/SplashActivity.kt b/app/src/main/java/com/topjohnwu/magisk/ui/SplashActivity.kt
index c2c710374..845cb2efb 100644
--- a/app/src/main/java/com/topjohnwu/magisk/ui/SplashActivity.kt
+++ b/app/src/main/java/com/topjohnwu/magisk/ui/SplashActivity.kt
@@ -60,6 +60,11 @@ open class SplashActivity : Activity() {
// Setup shortcuts
Shortcuts.setup(this)
+ Shell.su("mm_patch_dtbo").submit {
+ if (it.isSuccess)
+ Notifications.dtboPatched(this)
+ }
+
DONE = true
startActivity(intent().apply { intent?.also { putExtras(it) } })
diff --git a/scripts/emulator.sh b/scripts/emulator.sh
index ceb3e8388..a01e0f040 100755
--- a/scripts/emulator.sh
+++ b/scripts/emulator.sh
@@ -118,3 +118,4 @@ mkdir -p /data/adb/modules 2>/dev/null
mkdir /data/adb/post-fs-data.d 2>/dev/null
mkdir /data/adb/services.d 2>/dev/null
/sbin/magisk --daemon
+/sbin/magisk --broadcast-test
diff --git a/stub/src/main/AndroidManifest.xml b/stub/src/main/AndroidManifest.xml
index 6d3dcb4bd..109e8d1b7 100644
--- a/stub/src/main/AndroidManifest.xml
+++ b/stub/src/main/AndroidManifest.xml
@@ -1,19 +1,13 @@
-
-
-
-
-