ensure min sdk 31

This commit is contained in:
5ec1cff
2024-07-16 19:30:38 +08:00
parent 1a5a95af23
commit 7e7be3f72f
3 changed files with 13 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
# Tricky Store
A trick of keystore.
A trick of keystore. **Android 12 or above is required**.
## Usage

View File

@@ -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<String> 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<ReplaceTokens>("tokens" to tokens)
filter<FixCrLfFilter>("eol" to FixCrLfFilter.CrLf.newInstance("lf"))

View File

@@ -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