You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
Check correct KernelSU version
This commit is contained in:
@@ -11,6 +11,9 @@ val moduleId: String by rootProject.extra
|
||||
val moduleName: String by rootProject.extra
|
||||
val verCode: Int by rootProject.extra
|
||||
val verName: String by rootProject.extra
|
||||
val minKsuVersion: Int by rootProject.extra
|
||||
val maxKsuVersion: Int by rootProject.extra
|
||||
val minMagiskVersion: Int by rootProject.extra
|
||||
|
||||
android.buildFeatures {
|
||||
androidResources = false
|
||||
@@ -49,7 +52,10 @@ androidComponents.onVariants { variant ->
|
||||
from("$projectDir/src") {
|
||||
include("customize.sh", "daemon.sh")
|
||||
val tokens = mapOf(
|
||||
"DEBUG" to if (buildTypeLowered == "debug") "true" else "false"
|
||||
"DEBUG" to if (buildTypeLowered == "debug") "true" else "false",
|
||||
"MIN_KSU_VERSION" to "$minKsuVersion",
|
||||
"MAX_KSU_VERSION" to "$maxKsuVersion",
|
||||
"MIN_MAGISK_VERSION" to "$minMagiskVersion",
|
||||
)
|
||||
filter<ReplaceTokens>("tokens" to tokens)
|
||||
filter<FixCrLfFilter>("eol" to FixCrLfFilter.CrLf.newInstance("lf"))
|
||||
|
||||
@@ -2,19 +2,28 @@
|
||||
SKIPUNZIP=1
|
||||
|
||||
DEBUG=@DEBUG@
|
||||
MIN_KSU_VERSION=@MIN_KSU_VERSION@
|
||||
MAX_KSU_VERSION=@MAX_KSU_VERSION@
|
||||
MIN_MAGISK_VERSION=@MIN_MAGISK_VERSION@
|
||||
|
||||
if [ "$BOOTMODE" ] && [ "$KSU" ]; then
|
||||
ui_print "- Installing from KernelSU app"
|
||||
ui_print "- KernelSU version: $KSU_KERNEL_VER_CODE (kernel) + $KSU_VER_CODE (ksud)"
|
||||
if [ "$KSU_KERNEL_VER_CODE" ] && [ "$KSU_KERNEL_VER_CODE" -lt 10575 ]; then
|
||||
if [ "$KSU_KERNEL_VER_CODE" ] && [ "$KSU_KERNEL_VER_CODE" -lt "$MIN_KSU_VERSION" ]; then
|
||||
ui_print "*********************************************************"
|
||||
ui_print "! KernelSU version is too old!"
|
||||
ui_print "! Please update KernelSU to latest version"
|
||||
abort "*********************************************************"
|
||||
elif [ "$KSU_KERNEL_VER_CODE" -ge "$MAX_KSU_VERSION" ]; then
|
||||
ui_print "*********************************************************"
|
||||
ui_print "! KernelSU version abnormal!"
|
||||
ui_print "! Please integrate KernelSU into your kernel"
|
||||
ui_print " as submodule instead of copying the source code"
|
||||
abort "*********************************************************"
|
||||
fi
|
||||
elif [ "$BOOTMODE" ] && [ "$MAGISK_VER_CODE" ]; then
|
||||
ui_print "- Installing from Magisk app"
|
||||
if [ "$MAGISK_VER_CODE" -lt 25000 ]; then
|
||||
if [ "$MAGISK_VER_CODE" -lt "$MIN_MAGISK_VERSION" ]; then
|
||||
ui_print "*********************************************************"
|
||||
ui_print "! Magisk version is too old!"
|
||||
ui_print "! Please update Magisk to latest version"
|
||||
|
||||
Reference in New Issue
Block a user