From e82c3d0674e6452938e49bc6ee6848aa2a603c27 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Thu, 14 Jan 2021 00:11:37 -0800 Subject: [PATCH] customize: Validate CPU architecture before installing --- customize.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/customize.sh b/customize.sh index 4efd873..d8921a7 100755 --- a/customize.sh +++ b/customize.sh @@ -1,5 +1,14 @@ #!/sbin/sh +# 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 + sdk="$(getprop ro.build.version.sdk)" version="$(getprop ro.vendor.build.version.release)"