2
0
mirror of https://gitlab.com/Nanolx/NanoDroid synced 2024-10-31 09:20:23 +00:00

CommonAddon: improvements

This commit is contained in:
Christopher Roy Bratusek 2020-11-02 20:23:28 +01:00
parent 2d891c68f2
commit 2156f9355b

View File

@ -52,21 +52,6 @@ WhisperPush
EOF
}
# check for configuration files
config_locations="/data/media/0 /external_sd /sdcard1 /data"
get_config () {
config=""
config_exists=0
for path in ${config_locations}; do
if test -r "${path}/.nanodroid-${1}"; then
config="${path}/.nanodroid-${1}"
config_exists=1
return
fi
done
}
is_mounted () {
grep -q "$(readlink -f ${1})" /proc/mounts 2>/dev/null
return $?
@ -97,6 +82,10 @@ backup_action () {
echo " + backup: ${FILE}"
backup_file "${FILE}"
done
for file in .nanodroid-apps .nanodroid-overlay .nanodroid-setup; do
[ -f /system/addon.d/${file} ] && backup_file /system/addon.d/${file}
done
ui_print " ++ ${MODID} ${VERSION} addon.d: backup done"
}
@ -106,6 +95,10 @@ restore_action () {
echo " + restore: ${FILE}"
restore_file "${FILE}"
done
for file in .nanodroid-apps .nanodroid-overlay .nanodroid-setup; do
restore_file /system/addon.d/${file}
done
ui_print " ++ ${MODID} ${VERSION} addon.d: restore done"
}
@ -117,15 +110,11 @@ postrestore_action () {
ui_print " ++ ${MODID} ${VERSION} addon.d: GApps removal done"
get_config setup
if [ "${config_exists}" -eq 1 ]; then
source "${config}"
if [ "${nanodroid_overlay}" -eq 1 ]; then
if [ -f /system/addon.d/.nanodroid-overlay ]; then
ui_print " ++ ${MODID} ${VERSION} addon.d: creating Overlays"
/system/bin/nanodroid-overlay --create
ui_print " ++ ${MODID} ${VERSION} addon.d: creating Overlays done"
fi
fi
}
detect_outfd