From 7c27b7744bf446137fbcab565375472530b95ac5 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Fri, 23 Jul 2021 19:11:16 -0700 Subject: [PATCH] Update Android 12 support for stable SDK 31 Android 12's SDK is now versioned as 31, so it no longer needs to be special-cased. --- customize.sh | 4 ---- post-fs-data.sh | 4 ---- service.sh | 3 ++- {system_sdk31-b2 => system_sdk31}/bin/keystore2 | Bin .../lib64/libkeystore-attestation-application-id.so | Bin 5 files changed, 2 insertions(+), 9 deletions(-) rename {system_sdk31-b2 => system_sdk31}/bin/keystore2 (100%) rename {system_sdk31-b2 => system_sdk31}/lib64/libkeystore-attestation-application-id.so (100%) diff --git a/customize.sh b/customize.sh index ec72e64..4e3a898 100755 --- a/customize.sh +++ b/customize.sh @@ -11,10 +11,6 @@ fi sdk="$(getprop ro.build.version.sdk)" version="$(getprop ro.vendor.build.version.release)" -if getprop ro.build.id | grep -q SPB2; then - sdk=31-b2 - version="12 Beta 2" -fi # Initial version check; version can be changed later. if [[ ! -d "$MODPATH/system_sdk$sdk" ]]; then diff --git a/post-fs-data.sh b/post-fs-data.sh index 7dbca9c..83692e1 100755 --- a/post-fs-data.sh +++ b/post-fs-data.sh @@ -5,10 +5,6 @@ MODPATH="/data/adb/modules/safetynet-fix" # Get runtime version sdk="$(getprop ro.build.version.sdk)" version="$(getprop ro.vendor.build.version.release)" -if getprop ro.build.id | grep -q SPB2; then - sdk=31-b2 - version="12 Beta 2" -fi # Prepare to update version rm -fr "$MODPATH/system" diff --git a/service.sh b/service.sh index 3cf87dc..5f5d95f 100755 --- a/service.sh +++ b/service.sh @@ -2,7 +2,8 @@ # Keystore v2 starts before Magisk on Android 12, so it needs to be restarted. # Do this in service.sh to make sure that files have been mounted already. -if getprop ro.build.id | grep -q SPB2; then +sdk="$(getprop ro.build.version.sdk)" +if [[ "$sdk" -ge 31 ]]; then stop keystore2 start keystore2 fi diff --git a/system_sdk31-b2/bin/keystore2 b/system_sdk31/bin/keystore2 similarity index 100% rename from system_sdk31-b2/bin/keystore2 rename to system_sdk31/bin/keystore2 diff --git a/system_sdk31-b2/lib64/libkeystore-attestation-application-id.so b/system_sdk31/lib64/libkeystore-attestation-application-id.so similarity index 100% rename from system_sdk31-b2/lib64/libkeystore-attestation-application-id.so rename to system_sdk31/lib64/libkeystore-attestation-application-id.so