mirror of
https://github.com/chiteroman/PlayIntegrityFix.git
synced 2025-01-18 19:12:38 +02:00
Drop emulator support
Integrity won't pass so it's useless to compile these libs
This commit is contained in:
parent
f3c2e39438
commit
d3c6e36063
@ -1,131 +1,138 @@
|
|||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.android.application)
|
alias(libs.plugins.android.application)
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "es.chiteroman.playintegrityfix"
|
namespace = "es.chiteroman.playintegrityfix"
|
||||||
compileSdk = 35
|
compileSdk = 35
|
||||||
buildToolsVersion = "35.0.0"
|
buildToolsVersion = "35.0.0"
|
||||||
ndkVersion = "27.0.12077973"
|
ndkVersion = "27.0.12077973"
|
||||||
|
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
prefab = true
|
prefab = true
|
||||||
}
|
}
|
||||||
|
|
||||||
packaging {
|
packaging {
|
||||||
resources {
|
resources {
|
||||||
excludes += "**"
|
excludes += "**"
|
||||||
}
|
}
|
||||||
jniLibs {
|
jniLibs {
|
||||||
excludes += "**/libdobby.so"
|
excludes += "**/libdobby.so"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "es.chiteroman.playintegrityfix"
|
applicationId = "es.chiteroman.playintegrityfix"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 17300
|
versionCode = 17300
|
||||||
versionName = "v17.3"
|
versionName = "v17.3"
|
||||||
multiDexEnabled = false
|
multiDexEnabled = false
|
||||||
|
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
arguments(
|
abiFilters(
|
||||||
"-DCMAKE_BUILD_TYPE=MinSizeRel",
|
"arm64-v8a",
|
||||||
"-DANDROID_STL=none",
|
"armeabi-v7a"
|
||||||
"-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
|
)
|
||||||
)
|
|
||||||
|
arguments(
|
||||||
cFlags(
|
"-DCMAKE_BUILD_TYPE=MinSizeRel",
|
||||||
"-std=c23", "-fvisibility=hidden", "-fvisibility-inlines-hidden"
|
"-DANDROID_STL=none",
|
||||||
)
|
"-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
|
||||||
|
)
|
||||||
cppFlags(
|
|
||||||
"-std=c++23",
|
cFlags(
|
||||||
"-fno-exceptions",
|
"-std=c23",
|
||||||
"-fno-rtti",
|
"-fvisibility=hidden",
|
||||||
"-fvisibility=hidden",
|
"-fvisibility-inlines-hidden"
|
||||||
"-fvisibility-inlines-hidden"
|
)
|
||||||
)
|
|
||||||
}
|
cppFlags(
|
||||||
}
|
"-std=c++23",
|
||||||
}
|
"-fno-exceptions",
|
||||||
|
"-fno-rtti",
|
||||||
buildTypes {
|
"-fvisibility=hidden",
|
||||||
release {
|
"-fvisibility-inlines-hidden"
|
||||||
isMinifyEnabled = true
|
)
|
||||||
isShrinkResources = true
|
}
|
||||||
multiDexEnabled = false
|
}
|
||||||
proguardFiles(
|
}
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
|
|
||||||
)
|
buildTypes {
|
||||||
}
|
release {
|
||||||
}
|
isMinifyEnabled = true
|
||||||
|
isShrinkResources = true
|
||||||
compileOptions {
|
multiDexEnabled = false
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
proguardFiles(
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
|
||||||
}
|
)
|
||||||
|
}
|
||||||
externalNativeBuild {
|
}
|
||||||
cmake {
|
|
||||||
path = file("src/main/cpp/CMakeLists.txt")
|
compileOptions {
|
||||||
version = "3.22.1"
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
}
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
externalNativeBuild {
|
||||||
dependencies {
|
cmake {
|
||||||
implementation(libs.cxx)
|
path = file("src/main/cpp/CMakeLists.txt")
|
||||||
implementation(libs.hiddenapibypass)
|
version = "3.22.1"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
tasks.register("updateModuleProp") {
|
}
|
||||||
doLast {
|
|
||||||
val versionName = project.android.defaultConfig.versionName
|
dependencies {
|
||||||
val versionCode = project.android.defaultConfig.versionCode
|
implementation(libs.cxx)
|
||||||
|
implementation(libs.hiddenapibypass)
|
||||||
val modulePropFile = project.rootDir.resolve("module/module.prop")
|
}
|
||||||
|
|
||||||
var content = modulePropFile.readText()
|
tasks.register("updateModuleProp") {
|
||||||
|
doLast {
|
||||||
content = content.replace(Regex("version=.*"), "version=$versionName")
|
val versionName = project.android.defaultConfig.versionName
|
||||||
content = content.replace(Regex("versionCode=.*"), "versionCode=$versionCode")
|
val versionCode = project.android.defaultConfig.versionCode
|
||||||
|
|
||||||
modulePropFile.writeText(content)
|
val modulePropFile = project.rootDir.resolve("module/module.prop")
|
||||||
}
|
|
||||||
}
|
var content = modulePropFile.readText()
|
||||||
|
|
||||||
tasks.register("copyFiles") {
|
content = content.replace(Regex("version=.*"), "version=$versionName")
|
||||||
dependsOn("updateModuleProp")
|
content = content.replace(Regex("versionCode=.*"), "versionCode=$versionCode")
|
||||||
|
|
||||||
doLast {
|
modulePropFile.writeText(content)
|
||||||
val moduleFolder = project.rootDir.resolve("module")
|
}
|
||||||
val dexFile =
|
}
|
||||||
project.layout.buildDirectory.get().asFile.resolve("intermediates/dex/release/minifyReleaseWithR8/classes.dex")
|
|
||||||
val soDir =
|
tasks.register("copyFiles") {
|
||||||
project.layout.buildDirectory.get().asFile.resolve("intermediates/stripped_native_libs/release/stripReleaseDebugSymbols/out/lib")
|
dependsOn("updateModuleProp")
|
||||||
|
|
||||||
dexFile.copyTo(moduleFolder.resolve("classes.dex"), overwrite = true)
|
doLast {
|
||||||
|
val moduleFolder = project.rootDir.resolve("module")
|
||||||
soDir.walk().filter { it.isFile && it.extension == "so" }.forEach { soFile ->
|
val dexFile =
|
||||||
val abiFolder = soFile.parentFile.name
|
project.layout.buildDirectory.get().asFile.resolve("intermediates/dex/release/minifyReleaseWithR8/classes.dex")
|
||||||
val destination = moduleFolder.resolve("zygisk/$abiFolder.so")
|
val soDir =
|
||||||
soFile.copyTo(destination, overwrite = true)
|
project.layout.buildDirectory.get().asFile.resolve("intermediates/stripped_native_libs/release/stripReleaseDebugSymbols/out/lib")
|
||||||
}
|
|
||||||
}
|
dexFile.copyTo(moduleFolder.resolve("classes.dex"), overwrite = true)
|
||||||
}
|
|
||||||
|
soDir.walk().filter { it.isFile && it.extension == "so" }.forEach { soFile ->
|
||||||
tasks.register<Zip>("zip") {
|
val abiFolder = soFile.parentFile.name
|
||||||
dependsOn("copyFiles")
|
val destination = moduleFolder.resolve("zygisk/$abiFolder.so")
|
||||||
|
soFile.copyTo(destination, overwrite = true)
|
||||||
archiveFileName.set("PlayIntegrityFix_${project.android.defaultConfig.versionName}.zip")
|
}
|
||||||
destinationDirectory.set(project.rootDir.resolve("out"))
|
}
|
||||||
|
}
|
||||||
from(project.rootDir.resolve("module"))
|
|
||||||
}
|
tasks.register<Zip>("zip") {
|
||||||
|
dependsOn("copyFiles")
|
||||||
afterEvaluate {
|
|
||||||
tasks["assembleRelease"].finalizedBy("updateModuleProp", "copyFiles", "zip")
|
archiveFileName.set("PlayIntegrityFix_${project.android.defaultConfig.versionName}.zip")
|
||||||
}
|
destinationDirectory.set(project.rootDir.resolve("out"))
|
||||||
|
|
||||||
|
from(project.rootDir.resolve("module"))
|
||||||
|
}
|
||||||
|
|
||||||
|
afterEvaluate {
|
||||||
|
tasks["assembleRelease"].finalizedBy("updateModuleProp", "copyFiles", "zip")
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user