Skip to content

Commit 0820352

Browse files
fix: check if magisk is available before trying to set MIRROR
1 parent 89dada7 commit 0820352

File tree

1 file changed

+7
-4
lines changed
  • src/commonMain/kotlin/app/revanced/library/installation/installer

1 file changed

+7
-4
lines changed

src/commonMain/kotlin/app/revanced/library/installation/installer/Constants.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,14 @@ internal object Constants {
5555
chcon u:object_r:apk_data_file:s0 ${'$'}base_path
5656
5757
# Mount using Magisk mirror, if available.
58-
MAGISKTMP="$( magisk --path )" || MAGISKTMP=/sbin
59-
MIRROR="${'$'}MAGISKTMP/.magisk/mirror"
60-
if [ -z "$(ls -A "${'$'}MIRROR" 2>/dev/null)" ]; then
61-
MIRROR=""
58+
if command -v magisk &> /dev/null; then
59+
MAGISKTMP="${'$'}(magisk --path)" || MAGISKTMP=/sbin
60+
MIRROR="${'$'}MAGISKTMP/.magisk/mirror"
61+
if [ -z "$(ls -A "${'$'}MIRROR" 2>/dev/null)" ]; then
62+
MIRROR=""
63+
fi
6264
fi
65+
6366
mount -o bind ${'$'}MIRROR${'$'}base_path ${'$'}stock_path
6467
6568
# Kill the app to force it to restart the mounted APK in case it's currently running.

0 commit comments

Comments
 (0)