Added auto module zip!

This commit is contained in:
chiteroman 2023-11-27 12:37:26 +01:00
parent 34b2550bba
commit 96e201d786
No known key found for this signature in database
GPG Key ID: 15FF53015D426D8E
2 changed files with 26 additions and 0 deletions

3
.gitignore vendored
View File

@ -13,3 +13,6 @@
.externalNativeBuild .externalNativeBuild
.cxx .cxx
local.properties local.properties
/module/classes.dex
/module/zygisk/*
/out/*

View File

@ -42,4 +42,27 @@ android {
path = file("src/main/cpp/Android.mk") path = file("src/main/cpp/Android.mk")
} }
} }
}
afterEvaluate {
val moduleFolder = project.rootDir.resolve("module")
val dexFile = project.buildDir.resolve("intermediates/dex/release/minifyReleaseWithR8/classes.dex")
val soDir = project.buildDir.resolve("intermediates/stripped_native_libs/release/out/lib")
dexFile.copyTo(moduleFolder.resolve("classes.dex"), overwrite = true)
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)
}
tasks["assembleRelease"].dependsOn("module")
}
tasks.register<Zip>("module") {
archiveFileName.set("PlayIntegrityFix.zip")
destinationDirectory.set(project.rootDir.resolve("out"))
from(project.rootDir.resolve("module"))
} }