From 41ab998a938c353cfbce0425d264ad0a862738b4 Mon Sep 17 00:00:00 2001 From: Vladimir Filatov Date: Sun, 30 Jun 2019 05:01:23 +0000 Subject: [PATCH] Make NanoDroid compatible with recoveries which has /sdcard1 mount path for SD Card. For example OrangeFox recovery. --- CommonAddon | 2 +- CommonInstaller | 4 ++-- Full/system/xbin/nanodroid-overlay | 2 +- setup-wizard/nanodroid-setup | 3 +++ uninstaller/META-INF/com/google/android/update-binary | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CommonAddon b/CommonAddon index cd1f9f6..fd8f190 100644 --- a/CommonAddon +++ b/CommonAddon @@ -62,7 +62,7 @@ EOF } # check for configuration files -config_locations="/data/media/0 /external_sd /data" +config_locations="/data/media/0 /external_sd /sdcard1 /data" get_config () { config="" diff --git a/CommonInstaller b/CommonInstaller index 1706e74..d85cf88 100644 --- a/CommonInstaller +++ b/CommonInstaller @@ -1418,7 +1418,7 @@ nanodroid_substitute () { [ ! -f "${target}" ] && error "file: ${file} not found" if grep -q @ZIPDIR@ "${target}"; then - if [[ "${ZIPDIR}" == "/external_sd" ]]; then + if [[ "${ZIPDIR}" == "/external_sd" ]] || [[ "${ZIPDIR}" == "/sdcard1" ]]; then # /external_sd is already known by `nanodroid-overlay` # no need to add it a second time sed -e 's|@ZIPDIR@||' -i ${target} @@ -1528,7 +1528,7 @@ ui_print " " ########################################################################################## # check for configuration files -config_locations="${STORAGE} /external_sd ${ZIPDIR} /data" +config_locations="${STORAGE} /external_sd /sdcard1 ${ZIPDIR} /data" get_config () { config="" diff --git a/Full/system/xbin/nanodroid-overlay b/Full/system/xbin/nanodroid-overlay index 965ae49..d51115f 100755 --- a/Full/system/xbin/nanodroid-overlay +++ b/Full/system/xbin/nanodroid-overlay @@ -247,7 +247,7 @@ overrides_genconfig () { } # check for configuration files -config_locations="/data/media/0 /external_sd /data @ZIPDIR@ /dev/tmp/install" +config_locations="/data/media/0 /external_sd /sdcard1 /data @ZIPDIR@ /dev/tmp/install" get_config .nanodroid-overlay [[ -f ${config} ]] && export config || config=${STORAGE}/.nanodroid-overlay diff --git a/setup-wizard/nanodroid-setup b/setup-wizard/nanodroid-setup index f3a5e2c..b54be37 100644 --- a/setup-wizard/nanodroid-setup +++ b/setup-wizard/nanodroid-setup @@ -74,6 +74,9 @@ elif grep -q "selected.1=2" "${location_prop}"; then if -d /external_sd; then ui_print " > saving configuration in: /external_sd" configpath="/external_sd" + elif -d /sdcard1; then + ui_print " > saving configuration in: /sdcard1" + configpath="/sdcard1" else ui_print " > saving configuration in: /data/media/0" configpath="/data/media/0" diff --git a/uninstaller/META-INF/com/google/android/update-binary b/uninstaller/META-INF/com/google/android/update-binary index 9379526..6de83c9 100644 --- a/uninstaller/META-INF/com/google/android/update-binary +++ b/uninstaller/META-INF/com/google/android/update-binary @@ -161,7 +161,7 @@ mount_partitions () { } # check for configuration files -config_locations="/data/media/0 /external_sd /data $(dirname ${ZIP}))" +config_locations="/data/media/0 /external_sd /sdcard1 /data $(dirname ${ZIP}))" config_files=".nanodroid-setup .nanodroid-apps .nanodroid-overlay" restore_apps () {