Check util_functions.sh version

This commit is contained in:
vvb2060
2021-05-26 01:48:32 +08:00
committed by John Wu
parent f89f08833e
commit 9396288ca2
2 changed files with 3 additions and 1 deletions

View File

@@ -145,7 +145,7 @@ class HomeViewModel(
) )
if (invalidStates.any { it == stateMagisk } || shownDialog) return if (invalidStates.any { it == stateMagisk } || shownDialog) return
val result = Shell.su("env_check").await() val result = Shell.su("env_check ${Info.env.magiskVersionString} ${Info.env.magiskVersionCode}").await()
if (!result.isSuccess) { if (!result.isSuccess) {
shownDialog = true shownDialog = true
EnvFixDialog().publish() EnvFixDialog().publish()

View File

@@ -10,6 +10,8 @@ env_check() {
for file in busybox magiskboot magiskinit util_functions.sh boot_patch.sh; do for file in busybox magiskboot magiskinit util_functions.sh boot_patch.sh; do
[ -f $MAGISKBIN/$file ] || return 1 [ -f $MAGISKBIN/$file ] || return 1
done done
grep -xqF "MAGISK_VER='$1'" "$MAGISKBIN/util_functions.sh" || return 1
grep -xqF "MAGISK_VER_CODE=$2" "$MAGISKBIN/util_functions.sh" || return 1
return 0 return 0
} }