|
|
|
@ -166,27 +166,31 @@ config_locations="/sdcard /external_sd /data $(dirname ${ZIP}))"
|
|
|
|
|
config_files=".nanodroid-setup .nanodroid-apps .nanodroid-overlay"
|
|
|
|
|
|
|
|
|
|
restore_apps () {
|
|
|
|
|
for app in /sdcard/nanodroid_backups/app/*; do
|
|
|
|
|
if [ -d /system/app/${app} ]; then
|
|
|
|
|
ui_print " << removing backup: app:${app}"
|
|
|
|
|
rm -rf /sdcard/nanodroid_backups/app/${app}
|
|
|
|
|
else
|
|
|
|
|
ui_print " << restoring: app:${app}"
|
|
|
|
|
mv /sdcard/nanodroid_backups/app/${app} \
|
|
|
|
|
/system/app/ || error " failed to restore ${app}"
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
if [ -d /sdcard/nanodroid_backups/app/ ]; then
|
|
|
|
|
for app in /sdcard/nanodroid_backups/app/*; do
|
|
|
|
|
if [ -d /system/app/${app} ]; then
|
|
|
|
|
ui_print " << removing backup: app:${app}"
|
|
|
|
|
rm -rf /sdcard/nanodroid_backups/app/${app}
|
|
|
|
|
else
|
|
|
|
|
ui_print " << restoring: app:${app}"
|
|
|
|
|
mv /sdcard/nanodroid_backups/app/${app} \
|
|
|
|
|
/system/app/ || error " failed to restore ${app}"
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
for app in /sdcard/nanodroid_backups/priv-app/*; do
|
|
|
|
|
if [ -d /system/priv-app/${app} ]; then
|
|
|
|
|
ui_print " << removing backup: priv-app:${app}"
|
|
|
|
|
rm -rf /sdcard/nanodroid_backups/priv-app/${app}
|
|
|
|
|
else
|
|
|
|
|
ui_print " << restoring: priv-app:${app}"
|
|
|
|
|
mv /sdcard/nanodroid_backups/priv-app/${app} \
|
|
|
|
|
/system/priv-app/ || error " failed to restore ${app}"
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
if [ -d /sdcard/nanodroid_backups/priv-app/ ]; then
|
|
|
|
|
for app in /sdcard/nanodroid_backups/priv-app/*; do
|
|
|
|
|
if [ -d /system/priv-app/${app} ]; then
|
|
|
|
|
ui_print " << removing backup: priv-app:${app}"
|
|
|
|
|
rm -rf /sdcard/nanodroid_backups/priv-app/${app}
|
|
|
|
|
else
|
|
|
|
|
ui_print " << restoring: priv-app:${app}"
|
|
|
|
|
mv /sdcard/nanodroid_backups/priv-app/${app} \
|
|
|
|
|
/system/priv-app/ || error " failed to restore ${app}"
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
system_mode_uninstall () {
|
|
|
|
|