2021-01-13 09:58:45 +00:00
|
|
|
#!/sbin/sh
|
|
|
|
|
2021-01-14 08:11:37 +00:00
|
|
|
# We check the native ABI instead of all supported ABIs because this is a system
|
|
|
|
# service, and underlying AIDL/HIDL ABIs may not match. We also link against other
|
|
|
|
# system libraries.
|
|
|
|
arch="$(getprop ro.product.cpu.abi)"
|
|
|
|
if [[ "$arch" != "arm64-v8a" ]]; then
|
|
|
|
ui_print "Unsupported CPU architecture: $arch"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-01-14 00:22:00 +00:00
|
|
|
sdk="$(getprop ro.build.version.sdk)"
|
2021-01-14 00:24:27 +00:00
|
|
|
version="$(getprop ro.vendor.build.version.release)"
|
2021-06-27 01:54:36 +00:00
|
|
|
if getprop ro.build.id | grep -q SPB2; then
|
|
|
|
sdk=31-b2
|
|
|
|
version="12 Beta 2"
|
|
|
|
fi
|
2021-01-14 00:22:00 +00:00
|
|
|
|
2021-01-14 00:24:27 +00:00
|
|
|
if mv "$MODPATH/system_sdk$sdk" $MODPATH/system; then
|
|
|
|
ui_print "Installing for Android $version"
|
2021-01-14 00:22:00 +00:00
|
|
|
else
|
2021-01-14 00:24:27 +00:00
|
|
|
ui_print "Android $version (SDK $sdk) is not supported!"
|
2021-01-14 00:22:00 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-01-14 03:08:15 +00:00
|
|
|
# Remove unused SDKs
|
|
|
|
rm -fr $MODPATH/system_sdk*
|
|
|
|
|
2021-01-13 09:58:45 +00:00
|
|
|
# Set executable permissions
|
|
|
|
set_perm_recursive $MODPATH/system/bin 0 0 0755 0755
|