Skip to content

Commit d3dd565

Browse files
committed
[issue #11] Manually check system as root layout for Android 10
Android 10 devices don't set `ro.build.system_root_image` but behave like so. Since we can't reliably check the Android version through `ro.build.version.sdk` until we locate the system partition, then we only can check that the `/system/system` directory exists. To avoid easy mistakes, a more specific `/system/system/build.prop` check has been implemented.
1 parent 6d5e1e5 commit d3dd565

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

META-INF/com/google/android/update-binary

+7-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@ unzip -o "$ZIP_FILE"
3535
mount /system
3636
# A/B system-as-root devices have the actual system partition
3737
# mounted under /system/system when in the recovery.
38-
# Snippet taken from F-Droid Privileged Extension.
38+
# All Android 10 devices act as system-as-root devices.
3939
SYSTEM_AS_ROOT="$(getprop ro.build.system_root_image)"
40-
if [ "$SYSTEM_AS_ROOT" == "true" ]; then
40+
if [ "$SYSTEM_AS_ROOT" == "true" ]
41+
then # we are on an Android Pie device with A/B system-as-root layout
42+
SYSTEM_ROOT="/system/system"
43+
elif [ -f "/system/system/build.prop" ]
44+
then # we are on an Android 10 device
45+
SYSTEM_AS_ROOT="true"
4146
SYSTEM_ROOT="/system/system"
4247
fi
4348

0 commit comments

Comments
 (0)