mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
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:
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user