CommonPatcher: try to detect whether we are on a Custom or Stock ROM

merge-requests/23/head
Christopher Roy Bratusek 6 years ago
parent 1a0c2e29e1
commit 012669f2ec

@ -1,5 +1,21 @@
# ChangeLog
## 18.0.2.20180908
### Bug Fixes
* Full, microG packages
* improve microg-permissions.xml to fix bootloops on some Pie ROMs
* CommonPatcher
* try to detect whether we are on a Custom or Stock ROM
* should fix linking issues on Stock ROMs
### Updates
* manual
* Play Store (11.6.18)
## 18.0.1.20180907
### Bug Fixes
@ -8,9 +24,6 @@
* fix microG GmsCore, PlayStore and microG Services Framework Proxy loosing data and permissions after upgrade
* if System Mode installation is detected, exit the installer if run from Magisk Manager
* Full, microG packages
* improve microg-permissions.xml to fix bootloops on some Pie ROMs
### General Changes
* CommonInstaller

@ -380,6 +380,7 @@ nanodroid_finalize () {
detect_arch () {
SDK_VERSION=$(grep_prop ro.build.version.sdk)
CUSTOM_ROM=0
ABI=$(grep_prop ro.product.cpu.abi | cut -c-3)
ABI2=$(grep_prop ro.product.cpu.abi2 | cut -c-3)
@ -437,6 +438,13 @@ detect_arch () {
else ROM_NO_XBIN=0
fi
grep -q dev-keys /system/build.prop && CUSTOM_ROM=1
grep -q test-keys /system/build.prop && CUSTOM_ROM=1
[ "${CUSTOM_ROM}" -eq 1 ] && \
ui_print " > Custom ROM detected" \
|| ui_print " > Stock ROM detected"
[ ! -d /data/adb ] && mkdir /data/adb
}
@ -1200,6 +1208,7 @@ ROM_NO_XBIN=${ROM_NO_XBIN}
RESTORE_PATH=${RESTORE_PATH}
NANODROID_UPGRADE=${NANODROID_UPGRADE}
NANODROID_BINDIR=${NANODROID_BINDIR}
CUSTOM_ROM=${CUSTOM_ROM}
### SETUP ###
" > ${nanodroid_logfile}

@ -207,15 +207,20 @@ detect_arch () {
;;
esac
case ${ARCH} in
arm | x86 )
export LD_LIBRARY_PATH="/system/lib:/vendor/lib:/system/vendor/lib"
;;
arm64 | x86_64 )
export LD_LIBRARY_PATH="/system/lib64:/vendor/lib64:/system/vendor/lib64"
;;
esac
if [ "${CUSTOM_ROM}" -eq 1 ]; then
case ${ARCH} in
arm | x86 )
export LD_LIBRARY_PATH="/system/lib:/vendor/lib:/system/vendor/lib"
;;
arm64 | x86_64 )
export LD_LIBRARY_PATH="/system/lib64:/vendor/lib64:/system/vendor/lib64"
;;
esac
else
unset LD_LIBRARY_PATH
unset LD_PRELOAD
fi
export PATH="${BASEDIR}/busybox:/system/bin:/system/xbin"
@ -232,6 +237,7 @@ detect_arch () {
detect_sdk () {
SDK_VERSION=$(grep_prop ro.build.version.sdk)
CUSTOM_ROM=0
[ "${SDK_VERSION}" -gt 28 ] && \
error "Android versions beyond Pie are not yet supported"
@ -257,6 +263,13 @@ detect_sdk () {
fi
[ "${SDK_VERSION}" -gt 21 ] && DEX_OPTS="--multi-dex-threaded"
grep -q dev-keys /system/build.prop && CUSTOM_ROM=1
grep -q test-keys /system/build.prop && CUSTOM_ROM=1
[ "${CUSTOM_ROM}" -eq 1 ] && \
ui_print " > Custom ROM detected" \
|| ui_print " > Stock ROM detected"
}
##########################################################################################

Loading…
Cancel
Save