forked from ReVanced/revanced-cli
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlib.patch
36 lines (33 loc) · 1.36 KB
/
lib.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
diff --git a/build.gradle.kts b/build.gradle.kts
index 0de3754..43994d2 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -106,7 +106,3 @@ publishing {
}
}
-signing {
- useGpgCmd()
- sign(publishing.publications["revanced-library-publication"])
-}
diff --git a/src/main/kotlin/app/revanced/library/ApkUtils.kt b/src/main/kotlin/app/revanced/library/ApkUtils.kt
index b56c62c..6737d3f 100644
--- a/src/main/kotlin/app/revanced/library/ApkUtils.kt
+++ b/src/main/kotlin/app/revanced/library/ApkUtils.kt
@@ -50,7 +50,7 @@ object ApkUtils {
*
* @param apkFile The file to apply the patched files to.
*/
- fun PatcherResult.applyTo(apkFile: File) {
+ fun PatcherResult.applyTo(apkFile: File, ripLibs: Array<String>) {
ZFile.openReadWrite(apkFile, zFileOptions).use { targetApkZFile ->
dexFiles.forEach { dexFile ->
targetApkZFile.add(dexFile.name, dexFile.stream)
@@ -86,6 +86,10 @@ object ApkUtils {
}.forEach(StoredEntry::delete)
}
}
+ if (ripLibs.isNotEmpty()) {
+ logger.info("Ripping selected native libs")
+ targetApkZFile.entries().filter { entry -> ripLibs.any { entry.centralDirectoryHeader.name.startsWith("lib/$it/") } }.forEach(StoredEntry::delete)
+ }
logger.info("Aligning APK")