Skip to content

Commit

Permalink
log apk install issues into stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
programminghoch10 committed Feb 26, 2024
1 parent a4865fc commit 0f6a257
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions magiskmodule/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ APK="$MODPATH"/v4afx.apk
pm list packages | grep -q "^package:$VIPERFXPACKAGE$" && APK_UPGRADE=true || APK_UPGRADE=false
APK_SIZE=$(stat -c %s "$APK")
installAPK() {
pm install --install-location 1 --pkg "$VIPERFXPACKAGE" -S "$APK_SIZE" < "$APK" &>/dev/null
pm install --install-location 1 --pkg "$VIPERFXPACKAGE" -S "$APK_SIZE" < "$APK" >&2
}
installAPK || {
$APK_UPGRADE && pm uninstall -k "$VIPERFXPACKAGE" &>/dev/null
$APK_UPGRADE && pm uninstall -k "$VIPERFXPACKAGE" >&2
APK_UPGRADE=false
installAPK
} || abort "Failed to install V4AFX!"
! $APK_UPGRADE && pm disable "$VIPERFXPACKAGE" &>/dev/null
! $APK_UPGRADE && pm disable "$VIPERFXPACKAGE" >&2

ui_print "- Configuring ViPER4Android"
VIPERFXPREFS="$(pm dump "$VIPERFXPACKAGE" | grep dataDir | head -n 1 | cut -d'=' -f2)"
Expand All @@ -189,7 +189,7 @@ set_perm_recursive "$FOLDER" "$VIPERFXPREFSOWNER" sdcard_rw 771 660 u:object_r:s
pm set-permission-flags "$VIPERFXPACKAGE" android.permission.POST_NOTIFICATIONS user-fixed
}
# this disables battery optimization
[ "$API" -ge 30 ] && dumpsys deviceidle whitelist +"$VIPERFXPACKAGE" >/dev/null
[ "$API" -ge 30 ] && dumpsys deviceidle whitelist +"$VIPERFXPACKAGE" >&2
# this disables automatic permissions revoke if unused
[ "$API" -ge 30 ] && appops set --uid "$VIPERFXPACKAGE" AUTO_REVOKE_PERMISSIONS_IF_UNUSED ignore

Expand Down

0 comments on commit 0f6a257

Please sign in to comment.