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
This commit is contained in:
topjohnwu
2026-10-08 06:04:45 +00:00
parent f25a6aa81f
commit 35fd230938
2 changed files with 0 additions and 6 deletions
@@ -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))
}
}
@@ -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))
}
}