From 5512917ec123e815dec1e3af871357f760acc1f3 Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Thu, 24 Mar 2022 00:10:54 +0800 Subject: [PATCH] Hide incorrect "Factory data reset" message --- app/src/main/java/com/topjohnwu/magisk/ktx/XSU.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/com/topjohnwu/magisk/ktx/XSU.kt b/app/src/main/java/com/topjohnwu/magisk/ktx/XSU.kt index c1496167f..e051c65a1 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ktx/XSU.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ktx/XSU.kt @@ -8,6 +8,10 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext fun reboot(reason: String = if (Config.recovery) "recovery" else "") { + if (reason == "recovery") { + // KEYCODE_POWER = 26, hide incorrect "Factory data reset" message + Shell.cmd("/system/bin/input keyevent 26").submit() + } Shell.cmd("/system/bin/svc power reboot $reason || /system/bin/reboot $reason").submit() }