Skip to content

Commit b8a9554

Browse files
check if the ViPER4Android APK exists before installing it
1 parent 26b1cac commit b8a9554

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

magiskmodule/customize.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,12 @@ for ORIGINAL_FILE in $AUDIO_EFFECTS_FILES; do
112112
done
113113

114114
ui_print "- Installing the ViPER4AndroidFX user app"
115-
APK=v4afx.apk
115+
APK="$MODPATH"/v4afx.apk
116+
[ ! -f "$APK" ] && abort "Missing ViPER4Android APK!"
116117
[ -n "$(pm list packages | grep "^package:$VIPERFXPACKAGE$")" ] && APK_UPGRADE=true || APK_UPGRADE=false
117-
APK_SIZE=$(stat -c %s "$MODPATH"/"$APK")
118+
APK_SIZE=$(stat -c %s "$APK")
118119
installAPK() {
119-
pm install --install-location 1 --pkg "$VIPERFXPACKAGE" -S $APK_SIZE < "$MODPATH"/"$APK" &>/dev/null
120+
pm install --install-location 1 --pkg "$VIPERFXPACKAGE" -S $APK_SIZE < "$APK" &>/dev/null
120121
}
121122
installAPK || {
122123
$APK_UPGRADE && pm uninstall -k "$VIPERFXPACKAGE" &>/dev/null

0 commit comments

Comments
 (0)