From 96e201d7865068776b46b30668a1aeb2d0ca746d Mon Sep 17 00:00:00 2001 From: chiteroman <98092901+chiteroman@users.noreply.github.com> Date: Mon, 27 Nov 2023 12:37:26 +0100 Subject: [PATCH] Added auto module zip! --- .gitignore | 3 +++ app/build.gradle.kts | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/.gitignore b/.gitignore index aa724b7..d8aa47a 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ .externalNativeBuild .cxx local.properties +/module/classes.dex +/module/zygisk/* +/out/* \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c6a5fc3..68bb64c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -42,4 +42,27 @@ android { 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("module") { + archiveFileName.set("PlayIntegrityFix.zip") + destinationDirectory.set(project.rootDir.resolve("out")) + + from(project.rootDir.resolve("module")) } \ No newline at end of file