2
0
mirror of https://gitlab.com/Nanolx/NanoDroid synced 2024-11-02 03:40:13 +00:00

CommonPatcher: improve DalvikVM arch detection

This commit is contained in:
Christopher Roy Bratusek 2018-10-02 23:32:20 +02:00
parent 08f27a9b30
commit c1b0abe442

View File

@ -199,20 +199,16 @@ detect_arch () {
;; ;;
esac esac
if [ "${CUSTOM_ROM}" -eq 1 ]; then DALVIKVM_BIN=$(ls -l /system/bin/dalvikvm | awk '{print $NF}')
case ${ARCH} in case ${DALVIKVM_BIN} in
arm | x86 ) dalvikvm | dalvikvm32 )
export LD_LIBRARY_PATH="/system/lib:/vendor/lib:/system/vendor/lib" export LD_LIBRARY_PATH="/system/lib:/vendor/lib:/system/vendor/lib"
;; ;;
arm64 | x86_64 ) dalvikvm64 )
export LD_LIBRARY_PATH="/system/lib64:/vendor/lib64:/system/vendor/lib64" export LD_LIBRARY_PATH="/system/lib64:/vendor/lib64:/system/vendor/lib64"
;; ;;
esac esac
else
unset LD_LIBRARY_PATH
unset LD_PRELOAD
fi
export PATH="${BASEDIR}/busybox:/system/bin:/system/xbin" export PATH="${BASEDIR}/busybox:/system/bin:/system/xbin"
@ -231,7 +227,6 @@ detect_arch () {
detect_sdk () { detect_sdk () {
SDK_VERSION=$(grep_prop ro.build.version.sdk) SDK_VERSION=$(grep_prop ro.build.version.sdk)
CUSTOM_ROM=0
[ "${SDK_VERSION}" -gt 28 ] && \ [ "${SDK_VERSION}" -gt 28 ] && \
error "Android versions beyond Pie are not yet supported" error "Android versions beyond Pie are not yet supported"
@ -259,14 +254,6 @@ detect_sdk () {
fi fi
[ "${SDK_VERSION}" -gt 21 ] && DEX_OPTS="--multi-dex-threaded" [ "${SDK_VERSION}" -gt 21 ] && DEX_OPTS="--multi-dex-threaded"
for pattern in dev-keys test-keys type=userdebug; do
grep -q "${pattern}" /system/build.prop && CUSTOM_ROM=1
done
[ "${CUSTOM_ROM}" -eq 1 ] && \
ui_print " > Custom ROM detected" \
|| ui_print " > Stock ROM detected"
} }
########################################################################################## ##########################################################################################