2
0
mirror of https://gitlab.com/Nanolx/NanoDroid synced 2024-10-31 09:20:23 +00:00

full Android Q compat by mounting android runtime APEX

This commit is contained in:
Christopher Roy Bratusek 2019-10-07 22:11:35 +02:00
parent f9c1394bab
commit 71dde71828

View File

@ -234,6 +234,9 @@ mount_partitions () {
SYSTEM_AS_ROOT=$(getprop ro.build.system_root_image) SYSTEM_AS_ROOT=$(getprop ro.build.system_root_image)
SYSTEM_BLOCK=/dev/block/bootdevice/by-name/system SYSTEM_BLOCK=/dev/block/bootdevice/by-name/system
RUNTIME_APEX=""
APEX_LOOP=""
if [ "${SYSTEM_AS_ROOT}" == "true" ]; then if [ "${SYSTEM_AS_ROOT}" == "true" ]; then
SLOT=$(grep_cmdline androidboot.slot_suffix) SLOT=$(grep_cmdline androidboot.slot_suffix)
if [ -n "${SLOT}" ]; then if [ -n "${SLOT}" ]; then
@ -259,6 +262,23 @@ mount_partitions () {
[ ! -f /system/build.prop ] && error "failed to mount /system (unsupported A/B device?)" [ ! -f /system/build.prop ] && error "failed to mount /system (unsupported A/B device?)"
if [ -f /system/apex/com.android.runtime.apex ]; then
RUNTIME_APEX="/system/apex/com.android.runtime.apex"
elif [ -f /system/apex/com.android.runtime.release.apex ]; then
RUNTIME_APEX="/system/apex/com.android.runtime.release.apex"
fi
if [ -n "${RUNTIME_APEX}" ]; then
mkdir -p /dev/tmp/apex
unzip "${RUNTIME_APEX}" -d /dev/tmp/apex
mkdir -p /apex/com.android.runtime
mount -oloop,ro /dev/tmp/apex/apex_payload.img /apex/com.android.runtime
APEX_LOOP=$(mount | awk '/com.android.runtime/{print $1}')
fi
! is_mounted /vendor && mount /vendor ! is_mounted /vendor && mount /vendor
if [ -L /system/vendor ]; then if [ -L /system/vendor ]; then
@ -405,6 +425,8 @@ nanodroid_finalize () {
umount -l /system 2>/dev/null umount -l /system 2>/dev/null
umount -l /vendor 2>/dev/null umount -l /vendor 2>/dev/null
umount -l /dev/random 2>/dev/null umount -l /dev/random 2>/dev/null
umount -l /apex/com.android.runtime 2>/dev/null
losetup -d ${APEX_LOOP} 2>/dev/null
} }
########################################################################################## ##########################################################################################