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

CommonAddon: restore NanoDroid-Font after OTA update

This commit is contained in:
Christopher Roy Bratusek 2018-04-10 21:54:34 +02:00
parent 499b2655e1
commit f39538fa79
2 changed files with 15 additions and 3 deletions

View File

@ -21,6 +21,7 @@
* CommonAddon
* System Mode
* Addon for OTA survival
* restore NanoDroid-Font settings after OTA update
* shares file list with Uninstaller
* Full package
* switch to QKSMS 3

View File

@ -27,6 +27,14 @@ case "${1}" in
echo " + backup: ${FILE}"
backup_file "${FILE}"
done
if test -h /system/fonts/Roboto-Regular.ttf; then
CUSTOM_FONT="$(basename $(readlink /system/fonts/Roboto-Regular.ttf) .ttf)"
ui_print " ${MODID} addon.d: detected NanoDroid-Font (${CUSTOM_FONT})"
echo CUSTOM_FONT=${CUSTOM_FONT} > /tmp/nanodroid_font
fi
ui_print "${MODID} addon.d: backup done"
fi
;;
@ -50,15 +58,18 @@ case "${1}" in
# Stub
;;
post-restore)
if test -h /system/fonts/Roboto-Regular.ttf; then
CUSTOM_FONT="$(basename $(readlink /system/fonts/Roboto-Regular.ttf) .ttf)"
ui_print " << ${MODID} addon.d: detected NanoDroid-Font (${CUSTOM_FONT})"
if [ -f /tmp/nanodroid_font ]; then
. /tmp/nanodroid_font
ui_print " ${MODID} addon.d: restoring NanoDroid-Font (${CUSTOM_FONT})"
if [ -f /system/xbin/nanodroid-font ]; then
/system/xbin/nanodroid-font -s "${CUSTOM_FONT}"
elif [ -f /system/bin/nanodroid-font ]; then
/system/bin/nanodroid-font -s "${CUSTOM_FONT}"
fi
rm /tmp/nanodroid_font
fi
;;
esac