From 35fd230938444cdff4d581d7d026872fa247e3b5 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Thu, 8 Oct 2026 06:01:41 +0000 Subject: [PATCH] app: do not show toast on in-app superuser grant Toggling or granting superuser privileges within the Magisk app (such as in SuperuserViewModel or SuperuserGrantViewModel) displayed a toast message confirming the grant or denial. Because the user is already interacting directly with the UI where the state is visible, these toast messages are redundant. Toast messages should only be displayed when a process actually requests superuser access via the su daemon. Remove the toast notifications shown during in-app superuser policy changes. Assisted-by: Gemini 3.8 Flash --- .../topjohnwu/magisk/ui/superuser/SuperuserGrantViewModel.kt | 4 ---- .../com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt | 2 -- 2 files changed, 6 deletions(-) diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserGrantViewModel.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserGrantViewModel.kt index 526185050..0efeadc2f 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserGrantViewModel.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserGrantViewModel.kt @@ -10,7 +10,6 @@ import com.topjohnwu.magisk.arch.AsyncLoadViewModel import com.topjohnwu.magisk.core.AppContext import com.topjohnwu.magisk.core.BuildConfig import com.topjohnwu.magisk.core.Config -import com.topjohnwu.magisk.core.R as CoreR import com.topjohnwu.magisk.core.data.magiskdb.PolicyDao import com.topjohnwu.magisk.core.ktx.concurrentMap import com.topjohnwu.magisk.core.ktx.getLabel @@ -177,9 +176,6 @@ class SuperuserGrantViewModel( } SuEvents.notifyPolicyChanged() - - val res = if (willGrant) CoreR.string.su_snack_grant else CoreR.string.su_snack_deny - showSnackbar(AppContext.getString(res, app.info.label)) } } diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt index e4534df12..b11f0d19f 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt @@ -176,8 +176,6 @@ class SuperuserViewModel( } ) } - val res = if (newPolicy >= SuPolicy.ALLOW) R.string.su_snack_grant else R.string.su_snack_deny - showSnackbar(AppContext.getString(res, item.appName)) } }