You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Better environment status detection
This commit is contained in:
@@ -14,7 +14,6 @@ import com.topjohnwu.magisk.*
|
||||
import com.topjohnwu.magisk.extensions.getBitmap
|
||||
import com.topjohnwu.magisk.ui.SplashActivity
|
||||
import com.topjohnwu.magisk.utils.Utils
|
||||
import com.topjohnwu.superuser.Shell
|
||||
|
||||
object Shortcuts {
|
||||
|
||||
@@ -28,7 +27,6 @@ object Shortcuts {
|
||||
@RequiresApi(api = 25)
|
||||
private fun getShortCuts(context: Context): List<ShortcutInfo> {
|
||||
val shortCuts = mutableListOf<ShortcutInfo>()
|
||||
val root = Shell.rootAccess()
|
||||
val intent = context.intent<SplashActivity>()
|
||||
|
||||
fun getIcon(id: Int): Icon {
|
||||
@@ -53,7 +51,7 @@ object Shortcuts {
|
||||
.build()
|
||||
)
|
||||
}
|
||||
if (root && Info.env.magiskHide) {
|
||||
if (Info.env.magiskHide) {
|
||||
shortCuts.add(
|
||||
ShortcutInfo.Builder(context, "magiskhide")
|
||||
.setShortLabel(context.getString(R.string.magiskhide))
|
||||
@@ -68,7 +66,7 @@ object Shortcuts {
|
||||
.build()
|
||||
)
|
||||
}
|
||||
if (!Config.coreOnly && root && Info.env.magiskVersionCode >= 0) {
|
||||
if (!Config.coreOnly && Info.env.isActive) {
|
||||
shortCuts.add(
|
||||
ShortcutInfo.Builder(context, "modules")
|
||||
.setShortLabel(context.getString(R.string.modules))
|
||||
|
||||
Reference in New Issue
Block a user