From 7e7be3f72f8f84bdc2039605e466b76038c279dc Mon Sep 17 00:00:00 2001 From: 5ec1cff Date: Tue, 16 Jul 2024 19:30:38 +0800 Subject: [PATCH] ensure min sdk 31 --- README.md | 2 +- module/build.gradle.kts | 4 +++- module/template/customize.sh | 9 +++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b8c1900..50744c3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Tricky Store -A trick of keystore. +A trick of keystore. **Android 12 or above is required**. ## Usage diff --git a/module/build.gradle.kts b/module/build.gradle.kts index 12d3bac..dfd8973 100644 --- a/module/build.gradle.kts +++ b/module/build.gradle.kts @@ -13,6 +13,7 @@ val verCode: Int by rootProject.extra val verName: String by rootProject.extra val commitHash: String by rootProject.extra val abiList: List by rootProject.extra +val androidMinSdkVersion: Int by rootProject.extra val releaseFlags = arrayOf( "-Oz", "-flto", @@ -92,7 +93,8 @@ androidComponents.onVariants { variant -> val tokens = mapOf( "DEBUG" to if (buildTypeLowered == "debug") "true" else "false", "SONAME" to moduleId, - "SUPPORTED_ABIS" to supportedAbis + "SUPPORTED_ABIS" to supportedAbis, + "MIN_SDK" to androidMinSdkVersion.toString() ) filter("tokens" to tokens) filter("eol" to FixCrLfFilter.CrLf.newInstance("lf")) diff --git a/module/template/customize.sh b/module/template/customize.sh index efa3764..a3b8086 100644 --- a/module/template/customize.sh +++ b/module/template/customize.sh @@ -4,6 +4,7 @@ SKIPUNZIP=1 DEBUG=@DEBUG@ SONAME=@SONAME@ SUPPORTED_ABIS="@SUPPORTED_ABIS@" +MIN_SDK=@MIN_SDK@ if [ "$BOOTMODE" ] && [ "$KSU" ]; then ui_print "- Installing from KernelSU app" @@ -40,6 +41,14 @@ else ui_print "- Device platform: $ARCH" fi +# check android +if [ "$API" -lt $MIN_SDK ]; then + ui_print "! Unsupported sdk: $API" + abort "! Minimal supported sdk is $MIN_SDK" +else + ui_print "- Device sdk: $API" +fi + ui_print "- Extracting verify.sh" unzip -o "$ZIPFILE" 'verify.sh' -d "$TMPDIR" >&2 if [ ! -f "$TMPDIR/verify.sh" ]; then