Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update-binary: Explicitly remount as writable; Ignore cleanup failures due to ENOENT #139

Merged
merged 2 commits into from
Oct 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/magisk/update-binary
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ if [ -f /sbin/recovery ] || [ -f /system/bin/recovery ]; then

ui_print 'Mounting system'
if mount /system_root; then
mount -o remount,rw /system_root
root_dir=/system_root
else
mount /system
mount -o remount,rw /system
root_dir=/
fi

Expand All @@ -26,7 +28,9 @@ if [ -f /sbin/recovery ] || [ -f /system/bin/recovery ]; then
# Just overwriting isn't sufficient because the apk filenames are different
# between debug and release builds
app_id=$(unzip -p "${ZIPFILE}" module.prop | grep '^id=' | cut -d= -f2)
rm -rf "${root_dir}/system/priv-app/${app_id}"

# rm on some custom recoveries doesn't exit with 0 on ENOENT, even with -f
rm -rf "${root_dir}/system/priv-app/${app_id}" || :

unzip -o "${ZIPFILE}" 'system/*' -d "${root_dir}"

Expand Down