uninstaller: remove patcher addon.d in Magisk mode, too / code improvements

merge-requests/23/head
Christopher Roy Bratusek 6 years ago
parent 3bd56f6f83
commit f1f9962aa1

@ -93,6 +93,8 @@ system_mode_uninstall () {
fi
ui_print " << uninstalling: NanoDroid (System)"
ui_print " << using: ${1}"
system_list=${1}
# services.jar needs special treament
if grep -q /system/framework/services.jar ${system_list}; then
@ -137,23 +139,18 @@ system_mode_uninstall () {
done
rm -f "${system_list}"
}
if [ -f /data/adb/.nanodroid-patcher ]; then
rm -rf /data/adb/.nanodroid-patcher \
/system/addon.d/75-nanodroidpatcher.sh \
/data/adb/nanodroid_patcher
ui_print " << uninstalling: NanoDroid-Patcher artifacts"
elif [ -f /data/adb/.nanomod-patcher ]; then
rm -rf /data/adb/.nanomod-pacher \
/system/addon.d/75-nanomodpatcher.sh \
/data/adb/nanomod_patcher
ui_print " << uninstalling: NanoMod-Patcher artifacts"
elif [ -f /system/.nanomod-patcher ]; then
rm -rf /system/.nanomod-patcher \
/data/nanomod.patcher \
/system/addon.d/75-nanomodpatcher.sh
ui_print " << uninstalling: NanoMod-Patcher artifacts"
fi
addond_uninstall () {
for addond in /data/nanomod.patcher /data/adb/nanomod_patcher \
/data/adb/nanodroid_patcher; do
[ -d ${addond} ] && rm -rf ${addond}
done
for addonsh in /system/addon.d/75-nanomodpatcher.sh \
/system/addon.d/75-nanodroidpatcher.sh; do
[ -f ${addonsh} ] && rm -f ${addonsh}
done
}
ui_print " "
@ -185,16 +182,14 @@ for path in ${config_locations}; do
done
# System Mode uninstallation
if [ -f /system/.nanomod-list ]
system_list=/system/.nanomod-list
system_mode_uninstall
elif [ -f /data/adb/.nanomod-list ]; then
system_list=/data/adb/.nanomod-list
system_mode_uninstall
elif [ -f /data/adb/.nanodroid-list ]; then
system_list=/data/adb/.nanodroid-list
system_mode_uninstall
fi
for install_info in /system/.nanomod-list /data/adb/.nanomod-list \
/data/adb/.nanodroid-list; do
if [ -f ${install_info} ]; then
system_mode_uninstall ${install_info}
fi
done
addond_uninstall
if [ -f /data/adb/magisk.img ]; then
mkdir -p /magisk

Loading…
Cancel
Save