2023-11-20 07:42:21 +08:00
|
|
|
plugins {
|
|
|
|
id("com.android.application")
|
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
namespace = "es.chiteroman.playintegrityfix"
|
2024-07-18 19:40:26 +08:00
|
|
|
compileSdk = 35
|
|
|
|
ndkVersion = "27.0.12077973"
|
2023-11-20 07:42:21 +08:00
|
|
|
buildToolsVersion = "34.0.0"
|
|
|
|
|
2024-04-23 22:32:22 +08:00
|
|
|
buildFeatures {
|
|
|
|
prefab = true
|
|
|
|
}
|
|
|
|
|
2023-11-20 07:42:21 +08:00
|
|
|
defaultConfig {
|
|
|
|
applicationId = "es.chiteroman.playintegrityfix"
|
|
|
|
minSdk = 26
|
2024-07-18 19:40:26 +08:00
|
|
|
targetSdk = 35
|
2024-07-21 07:05:59 +08:00
|
|
|
versionCode = 16600
|
2024-07-09 07:18:29 +08:00
|
|
|
versionName = "v16.6"
|
2024-02-07 18:48:47 +08:00
|
|
|
multiDexEnabled = false
|
2024-01-23 11:12:52 +08:00
|
|
|
|
2024-01-23 07:18:30 +08:00
|
|
|
packaging {
|
2024-06-27 08:07:05 +08:00
|
|
|
resources {
|
2024-07-18 19:40:26 +08:00
|
|
|
excludes += "**"
|
2024-06-27 08:07:05 +08:00
|
|
|
}
|
2024-01-23 07:18:30 +08:00
|
|
|
jniLibs {
|
|
|
|
excludes += "**/libdobby.so"
|
|
|
|
}
|
|
|
|
}
|
2023-11-20 07:42:21 +08:00
|
|
|
|
|
|
|
externalNativeBuild {
|
2024-02-08 01:03:56 +08:00
|
|
|
cmake {
|
2024-07-21 07:05:59 +08:00
|
|
|
arguments += arrayOf(
|
|
|
|
"-DANDROID_STL=none",
|
|
|
|
"-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON",
|
|
|
|
"-DANDROID_CPP_FEATURES=no-rtti no-exceptions",
|
|
|
|
"-DCMAKE_BUILD_TYPE=MinSizeRel",
|
|
|
|
"-DCMAKE_CXX_STANDARD=23",
|
|
|
|
"-DCMAKE_C_STANDARD=23",
|
|
|
|
"-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON",
|
|
|
|
"-DCMAKE_CXX_VISIBILITY_PRESET=hidden",
|
|
|
|
"-DCMAKE_C_VISIBILITY_PRESET=hidden",
|
|
|
|
)
|
2023-11-20 07:42:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
isMinifyEnabled = true
|
|
|
|
isShrinkResources = true
|
2024-02-07 18:48:47 +08:00
|
|
|
multiDexEnabled = false
|
2024-06-27 08:07:05 +08:00
|
|
|
proguardFiles(
|
|
|
|
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
|
|
|
|
)
|
2023-11-20 07:42:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
compileOptions {
|
2023-12-06 01:43:17 +08:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
2023-11-20 07:42:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
externalNativeBuild {
|
2024-02-08 01:03:56 +08:00
|
|
|
cmake {
|
|
|
|
path = file("src/main/cpp/CMakeLists.txt")
|
|
|
|
version = "3.22.1"
|
2023-11-20 07:42:21 +08:00
|
|
|
}
|
|
|
|
}
|
2023-11-27 19:37:26 +08:00
|
|
|
}
|
|
|
|
|
2024-03-18 07:34:07 +08:00
|
|
|
dependencies {
|
2024-07-18 19:40:26 +08:00
|
|
|
implementation("org.lsposed.libcxx:libcxx:27.0.12077973")
|
2024-03-18 07:34:07 +08:00
|
|
|
}
|
|
|
|
|
2024-01-05 05:01:38 +08:00
|
|
|
tasks.register("updateModuleProp") {
|
|
|
|
doLast {
|
|
|
|
val versionName = project.android.defaultConfig.versionName
|
|
|
|
val versionCode = project.android.defaultConfig.versionCode
|
|
|
|
|
|
|
|
val modulePropFile = project.rootDir.resolve("module/module.prop")
|
|
|
|
|
|
|
|
var content = modulePropFile.readText()
|
|
|
|
|
|
|
|
content = content.replace(Regex("version=.*"), "version=$versionName")
|
|
|
|
content = content.replace(Regex("versionCode=.*"), "versionCode=$versionCode")
|
|
|
|
|
|
|
|
modulePropFile.writeText(content)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-11-27 21:18:58 +08:00
|
|
|
tasks.register("copyFiles") {
|
2024-01-05 05:01:38 +08:00
|
|
|
dependsOn("updateModuleProp")
|
|
|
|
|
2023-11-28 00:25:34 +08:00
|
|
|
doLast {
|
|
|
|
val moduleFolder = project.rootDir.resolve("module")
|
2024-06-27 08:07:05 +08:00
|
|
|
val dexFile =
|
|
|
|
project.layout.buildDirectory.get().asFile.resolve("intermediates/dex/release/minifyReleaseWithR8/classes.dex")
|
|
|
|
val soDir =
|
|
|
|
project.layout.buildDirectory.get().asFile.resolve("intermediates/stripped_native_libs/release/stripReleaseDebugSymbols/out/lib")
|
2023-11-27 19:37:26 +08:00
|
|
|
|
2024-06-21 05:59:48 +08:00
|
|
|
dexFile.copyTo(moduleFolder.resolve("classes.dex"), overwrite = true)
|
2023-11-27 19:37:26 +08:00
|
|
|
|
2023-11-28 00:25:34 +08:00
|
|
|
soDir.walk().filter { it.isFile && it.extension == "so" }.forEach { soFile ->
|
|
|
|
val abiFolder = soFile.parentFile.name
|
|
|
|
val destination = moduleFolder.resolve("zygisk/$abiFolder.so")
|
|
|
|
soFile.copyTo(destination, overwrite = true)
|
|
|
|
}
|
2023-11-27 19:37:26 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-27 21:18:58 +08:00
|
|
|
tasks.register<Zip>("zip") {
|
2023-11-28 00:25:34 +08:00
|
|
|
dependsOn("copyFiles")
|
|
|
|
|
2024-01-05 05:01:38 +08:00
|
|
|
archiveFileName.set("PlayIntegrityFix_${project.android.defaultConfig.versionName}.zip")
|
2023-11-27 19:37:26 +08:00
|
|
|
destinationDirectory.set(project.rootDir.resolve("out"))
|
|
|
|
|
|
|
|
from(project.rootDir.resolve("module"))
|
2023-11-27 21:18:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
afterEvaluate {
|
2024-01-05 05:01:38 +08:00
|
|
|
tasks["assembleRelease"].finalizedBy("updateModuleProp", "copyFiles", "zip")
|
2024-02-03 22:24:43 +08:00
|
|
|
}
|