From 373bd011453fa475d78a43c29013d381884e3e1c Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Tue, 21 Aug 2018 21:34:56 +0200 Subject: [PATCH] CommonAddon: code simplification --- ChangeLog.md | 2 ++ CommonAddon | 18 +++++++----------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 4f37cf9..438f614 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -17,6 +17,8 @@ * don't set progressbar when flashing from Magisk Manager * when migrating from Play Store to Fake Store or vice versa during new installs get rid of that store's app data, too * minor string change +* CommonAddon + * code simplifcations ### Updates diff --git a/CommonAddon b/CommonAddon index 61742ac..4538786 100644 --- a/CommonAddon +++ b/CommonAddon @@ -54,6 +54,11 @@ com.google.android.location org.microg.nlp org.microg.unifiednlp" +if [ ! -d /system/xbin ]; then + NANODROID_BINDIR=/system/bin +else NANODROID_BINDIR=/system/xbin +fi + ui_print () { echo -n -e "ui_print ${1}\n" >> /proc/self/fd/${OUTFD} echo -n -e "ui_print\n" >> /proc/self/fd/${OUTFD} @@ -61,10 +66,7 @@ ui_print () { solve_gappsconflicts () { for app in ${GOOGLE_APPS}; do - if [ -f /system/bin/nanodroid-overlay ]; then - /system/bin/nanodroid-overlay --add ${app} - else /system/xbin/nanodroid-overlay --add ${app} - fi + ${NANODROID_BINDIR}/nanodroid-overlay --add ${app} done for app in ${GOOGLE_DATA}; do @@ -116,15 +118,9 @@ case "${1}" in post-restore) 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 - + ${NANODROID_BINDIR}/nanodroid-font -s "${CUSTOM_FONT}" rm /tmp/nanodroid_font fi