Skip to content

Commit

Permalink
Run app in root mode only if root solution is Magisk
Browse files Browse the repository at this point in the history
  • Loading branch information
aviraxp authored Dec 5, 2024
1 parent 895b5f6 commit 6ee5cc6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import com.topjohnwu.magisk.core.ktx.cachedFile
import com.topjohnwu.magisk.core.ktx.deviceProtectedContext
import com.topjohnwu.magisk.core.ktx.writeTo
import com.topjohnwu.superuser.Shell
import com.topjohnwu.superuser.ShellUtils.fastCmdResult
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
import java.io.File
import java.util.jar.JarFile

class ShellInit : Shell.Initializer() {
override fun onInit(context: Context, shell: Shell): Boolean {
if (shell.isRoot) {
if (shell.isRoot && fastCmdResult(shell, "magisk")) {
Info.isRooted = true
RootUtils.bindTask?.let { shell.execTask(it) }
RootUtils.bindTask = null
Expand Down

0 comments on commit 6ee5cc6

Please sign in to comment.