File tree 4 files changed +18
-22
lines changed
src/main/kotlin/app/revanced/lib
4 files changed +18
-22
lines changed Original file line number Diff line number Diff line change @@ -96,18 +96,18 @@ public final class app/revanced/lib/signing/SigningOptions {
96
96
public fun toString ()Ljava/lang/String;
97
97
}
98
98
99
- public final class app/revanced/lib/zip/ZipAligner {
100
- public static final field INSTANCE Lapp/revanced/lib/zip/ZipAligner;
101
- public final fun getApkZipEntryAlignment ()Lkotlin/jvm/functions/Function1;
102
- }
103
-
104
99
public final class app/revanced/lib/zip/ZipFile : java/io/Closeable {
100
+ public static final field ApkZipFile Lapp/revanced/lib/zip/ZipFile$ApkZipFile;
105
101
public fun <init> (Ljava/io/File;)V
106
102
public final fun addEntryCompressData (Lapp/revanced/lib/zip/structures/ZipEntry;[B)V
107
103
public fun close ()V
108
104
public final fun copyEntriesFromFileAligned (Lapp/revanced/lib/zip/ZipFile;Lkotlin/jvm/functions/Function1;)V
109
105
}
110
106
107
+ public final class app/revanced/lib/zip/ZipFile$ApkZipFile {
108
+ public final fun getApkZipEntryAlignment ()Lkotlin/jvm/functions/Function1;
109
+ }
110
+
111
111
public final class app/revanced/lib/zip/structures/ZipEntry {
112
112
public static final field Companion Lapp/revanced/lib/zip/structures/ZipEntry$Companion;
113
113
public fun <init> (Ljava/lang/String;)V
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package app.revanced.lib
2
2
3
3
import app.revanced.lib.signing.ApkSigner
4
4
import app.revanced.lib.signing.SigningOptions
5
- import app.revanced.lib.zip.ZipAligner
6
5
import app.revanced.lib.zip.ZipFile
7
6
import app.revanced.lib.zip.structures.ZipEntry
8
7
import app.revanced.patcher.PatcherResult
@@ -35,15 +34,15 @@ object ApkUtils {
35
34
36
35
patchedEntriesSource.resourceFile?.let {
37
36
file.copyEntriesFromFileAligned(
38
- ZipFile (it), ZipAligner .apkZipEntryAlignment
37
+ ZipFile (it), ZipFile .apkZipEntryAlignment
39
38
)
40
39
}
41
40
42
41
// TODO: Do not compress result.doNotCompress
43
42
44
43
// TODO: Fix copying resources that are not needed anymore.
45
44
file.copyEntriesFromFileAligned(
46
- ZipFile (apkFile), ZipAligner .apkZipEntryAlignment
45
+ ZipFile (apkFile), ZipFile .apkZipEntryAlignment
47
46
)
48
47
}
49
48
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -178,4 +178,15 @@ class ZipFile(file: File) : Closeable {
178
178
if (centralDirectoryNeedsRewrite) writeCD()
179
179
filePointer.close()
180
180
}
181
+
182
+ companion object ApkZipFile {
183
+ private const val DEFAULT_ALIGNMENT = 4
184
+ private const val LIBRARY_ALIGNMENT = 4096
185
+
186
+ val apkZipEntryAlignment = { entry: ZipEntry ->
187
+ if (entry.compression.toUInt() != 0u ) null
188
+ else if (entry.fileName.endsWith(" .so" )) LIBRARY_ALIGNMENT
189
+ else DEFAULT_ALIGNMENT
190
+ }
191
+ }
181
192
}
You can’t perform that action at this time.
0 commit comments