* fix installation through Magisk Manager

* fix creating system overlays when installing through Magisk Manager
* fixed the most A-N-C-I-E-N-T NanoDroid bug (TMANB™)
  * fix installation through Magisk Manager does not reach end properly
* code revision
merge-requests/23/head
Christopher Roy Bratusek 6 years ago
parent ca009974ee
commit 5c2fa41539

@ -19,6 +19,11 @@
* fix aapt not installed
* Common Installer
* fix system environment detection bugs
* improve installation mode detection
* fix installation through Magisk Manager
* fix creating system overlays when installing through Magisk Manager
* fixed the most A-N-C-I-E-N-T NanoDroid bug (TMANB™)
* fix installation through Magisk Manager does not reach end properly
* Uninstaller
* fix that Patcher addon.d was only removed in System Mode
* remove Patcher lockfile aswell
@ -32,12 +37,12 @@
* Common Installer
* take care of getting rid of old-named module upon installation
* generalize function showing the NanoDroid banner
* minor code revision
* improve and revise several code segments
* Full, microG, F-Droid packages
* move banner displaying into Common Installer
* update Magisk module.props for name change
* improve Magisk module.props description
* more simplification
* further code simplification
* Patcher:
* remove old addon.d setups when installing new
* Configuration Files

@ -7,10 +7,14 @@ ZIP=${3}
ZIPDIR=$(dirname "${ZIP}")
MODID=NanoDroid_FDroid
unzip -o "${ZIP}" nanodroid-functions -d "/tmp" || \
error " !! failed to load Common Installer"
source "/tmp/nanodroid-functions" || \
error " !! failed to load Common Installer"
mkdir /dev/tmp
unzip -o "${ZIP}" nanodroid-functions -d "/dev/tmp"
if [ ! -f /dev/tmp/nanodroid-functions ]; then
echo " !! failed to load Common Installer"
exit 1
else
source "/dev/tmp/nanodroid-functions"
fi
detect_bootmode
detect_outfd

@ -7,10 +7,14 @@ ZIP=${3}
ZIPDIR=$(dirname "${ZIP}")
MODID=NanoDroid
unzip -o "${ZIP}" nanodroid-functions -d "/tmp" || \
error " !! failed to load Common Installer"
source "/tmp/nanodroid-functions" || \
error " !! failed to load Common Installer"
mkdir /dev/tmp
unzip -o "${ZIP}" nanodroid-functions -d "/dev/tmp"
if [ ! -f /dev/tmp/nanodroid-functions ]; then
echo " !! failed to load Common Installer"
exit 1
else
source "/dev/tmp/nanodroid-functions"
fi
detect_bootmode
detect_outfd

@ -9,6 +9,7 @@ VERSION=15.91.99999999
detect_bootmode () {
ps | grep zygote | grep -v grep >/dev/null && BOOTMODE=true || BOOTMODE=false
${BOOTMODE} || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true
${BOOTMODE} || id | grep -q 'uid=0' || BOOTMODE=true
}
ui_print() {
@ -180,7 +181,7 @@ backup_nlpconflicts () {
case ${MODE} in
SYSTEM )
if [ -d "/system/priv-app/${app}" ]; then
mv /system/priv-app/com.qualcomm.location /sdcard/
mv /system/priv-app/${app} /sdcard/
ui_print " "
ui_print " ++ Moving ${app} to /sdcard"
@ -190,9 +191,16 @@ backup_nlpconflicts () {
;;
MAGISK )
${MODPATH}/system/xbin/bash \
${MODPATH}/system/xbin/nanodroid-overlay \
--add com.qualcomm.location
if [ -d "/system/priv-app/${app}" ]; then
ui_print " "
ui_print " ++ Creating overlay for ${app}"
ui_print " ++ it conflicts with microG location backends"
ui_print " "
${MODPATH}/system/xbin/bash \
${MODPATH}/system/xbin/nanodroid-overlay \
--add ${app}
fi
;;
esac
done
@ -213,25 +221,16 @@ unpack_zip () {
}
nanodroid_finalize () {
if [ "${MODE}" = "MAGISK" ]; then
magisk_install_finish
else
case ${MODID} in
NanoDroid | NanoDroid_microG )
backup_nlpconflicts
;;
esac
fi
case ${MODID} in
NanoDroid | NanoDroid_microG )
backup_nlpconflicts
;;
esac
nanodroid_storelogs
[ "${MODE}" = "MAGISK" ] && magisk_install_finish
rm -rf ${INSTALLER}
if [ "${MODE}" = "MAGISK" ]; then
magisk_install_cleanup
elif ! ${BOOTMODE}; then
umount /system 2>/dev/null
fi
${BOOTMODE} || umount /system 2>/dev/null
ui_print " "
ui_print " Thanks for using NanoDroid "
@ -307,7 +306,7 @@ magisk_install_setup () {
ui_print " > setup Magisk environment"
MAGISKBIN=/data/adb/magisk
MOUNTPATH=${TMPDIR}/magisk_img
${BOOTMODE} && MOUNTPATH=${TMPDIR}/magisk_merge_img || MOUNTPATH=${TMPDIR}/magisk_img
[ -d ${MAGISKBIN} -a -f ${MAGISKBIN}/magisk -a -f ${MAGISKBIN}/util_functions.sh ] || \
error " !! Magisk version 15.0 or newer is required"
@ -334,7 +333,7 @@ magisk_install_setup () {
# not supposed to be installed alongside
for dir in NanoMod NanoModmicroG NanoDroid_microG \
NanoModfdroid NanoDroid_FDroid; do
if [[ -d ${MOUNTPATH}/${dir} ]]; then
if [ -d ${MOUNTPATH}/${dir} ]; then
ui_print " !! ${dir} module detected - uninstalling!"
rm -rf ${MOUNTPATH}/${dir}
fi
@ -343,12 +342,12 @@ magisk_install_setup () {
NanoDroid_microG )
# check for Full package and abort if found
if [[ -d ${MOUNTPATH}/NanoMod -o -d ${MOUNTPATH}/NanoDroid ]]; then
if [ -d ${MOUNTPATH}/NanoMod -o -d ${MOUNTPATH}/NanoDroid ]; then
error " !! ${MODID} can't be installed along side the Full package"
fi
# check for old-named module
if [[ -d ${MOUNTPATH}/NanoModmicroG ]]; then
if [ -d ${MOUNTPATH}/NanoModmicroG ]; then
ui_print " !! old version module detected - uninstalling!"
rm -rf ${MOUNTPATH}/NanoModmicroG
fi
@ -356,12 +355,12 @@ magisk_install_setup () {
NanoDroid_FDroid )
# check for Full package and abort if found
if [[ -d ${MOUNTPATH}/NanoMod -o -d ${MOUNTPATH}/NanoDroid ]]; then
if [ -d ${MOUNTPATH}/NanoMod -o -d ${MOUNTPATH}/NanoDroid ]; then
error " !! ${MODID} can't be installed along side the Full package"
fi
# check for old-named module
if [[ -d ${MOUNTPATH}/NanoModfdroid ]]; then
if [ -d ${MOUNTPATH}/NanoModfdroid ]; then
ui_print " !! old version module detected - uninstalling!"
rm -rf ${MOUNTPATH}/NanoModfdroid
fi
@ -410,7 +409,7 @@ magisk_install_postinst () {
if [ "${nanodroid_overlay}" -eq 1 ]; then
ui_print " << with /system applications override"
${MODPATH}/system/xbin/bash \
${MODPATH}/system/xbin/bash.bin -e \
${MODPATH}/system/xbin/nanodroid-overlay --create
else
ui_print " << without /system applications override"
@ -449,10 +448,6 @@ magisk_install_finish () {
;;
esac
magisk_install_cleanup
}
magisk_install_cleanup () {
unmount_magisk_img
${BOOTMODE} || recovery_cleanup
}

@ -12,8 +12,8 @@ export PATH="${PATH}:${MODPATH}/system/bin"
if [[ -d /dev/tmp/magisk_img/$(basename ${MODPATH}) ]]; then
OVERLAY_PATH=/dev/tmp/magisk_img/$(basename ${MODPATH})
elif [[ -d /dev/magisk_merge/$(basename ${MODPATH}) ]]; then
OVERLAY_PATH=/dev/magisk_merge/$(basename ${MODPATH})
elif [[ -d /dev/tmp/magisk_merge_img/$(basename ${MODPATH}) ]]; then
OVERLAY_PATH=/dev/tmp/magisk_merge_img/$(basename ${MODPATH})
else
OVERLAY_PATH=${MODPATH}
[[ "${MODPATH}" != "/sbin/.core/"* ]] && NO_MAGISK=1

@ -5,7 +5,7 @@ Versions until 15.1 were called **NanoMod**, starting with 16.0 the're called **
## Current Release
* Stable: 15.1.20180119
* Beta: 16.0~beta1.20180125 [15.90]
* Beta: 16.0~beta2.20180128 [15.91]
## Downloads

@ -7,10 +7,14 @@ ZIP=${3}
ZIPDIR=$(dirname "${ZIP}")
MODID=NanoDroid_microG
unzip -o "${ZIP}" nanodroid-functions -d "/tmp" || \
error " !! failed to load Common Installer"
source "/tmp/nanodroid-functions" || \
error " !! failed to load Common Installer"
mkdir /dev/tmp
unzip -o "${ZIP}" nanodroid-functions -d "/dev/tmp"
if [ ! -f /dev/tmp/nanodroid-functions ]; then
echo " !! failed to load Common Installer"
exit 1
else
source "/dev/tmp/nanodroid-functions"
fi
detect_bootmode
detect_outfd

Loading…
Cancel
Save