File tree 3 files changed +9
-6
lines changed
revanced-cli/src/main/kotlin/app/revanced/cli/command
src/main/kotlin/app/revanced/lib
3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -208,10 +208,10 @@ internal object PatchCommand : Runnable {
208
208
209
209
// region Save
210
210
211
- val aligned = resourceCachePath.resolve(apk.name)
212
- ApkUtils .align (apk, aligned , patcherResult)
211
+ val tempFile = resourceCachePath.resolve(apk.name)
212
+ ApkUtils .copyAligned (apk, tempFile , patcherResult)
213
213
if (! mount) ApkUtils .sign(
214
- aligned ,
214
+ tempFile ,
215
215
outputFilePath,
216
216
SigningOptions (
217
217
commonName,
Original file line number Diff line number Diff line change 1
1
public final class app/revanced/lib/ApkUtils {
2
2
public static final field INSTANCE Lapp/revanced/lib/ApkUtils;
3
- public final fun align (Ljava/io/File;Ljava/io/File;Lapp/revanced/patcher/PatcherResult;)V
3
+ public final fun copyAligned (Ljava/io/File;Ljava/io/File;Lapp/revanced/patcher/PatcherResult;)V
4
4
public final fun sign (Ljava/io/File;Ljava/io/File;Lapp/revanced/lib/signing/SigningOptions;)V
5
5
}
6
6
@@ -98,7 +98,7 @@ public final class app/revanced/lib/signing/SigningOptions {
98
98
99
99
public final class app/revanced/lib/zip/ZipAligner {
100
100
public static final field INSTANCE Lapp/revanced/lib/zip/ZipAligner;
101
- public final fun getEntryAlignment (Lapp/revanced/lib/zip/structures/ZipEntry;)Ljava/lang/Integer ;
101
+ public final fun getApkZipEntryAlignment ()Lkotlin/jvm/functions/Function1 ;
102
102
}
103
103
104
104
public final class app/revanced/lib/zip/ZipFile : java/io/Closeable {
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import app.revanced.lib.zip.structures.ZipEntry
8
8
import app.revanced.patcher.PatcherResult
9
9
import java.io.File
10
10
import java.util.logging.Logger
11
+ import kotlin.io.path.deleteIfExists
11
12
12
13
@Suppress(" MemberVisibilityCanBePrivate" , " unused" )
13
14
object ApkUtils {
@@ -20,9 +21,11 @@ object ApkUtils {
20
21
* @param outputFile The apk to write the new entries to.
21
22
* @param patchedEntriesSource The result of the patcher to add the patched dex files and resources.
22
23
*/
23
- fun align (apkFile : File , outputFile : File , patchedEntriesSource : PatcherResult ) {
24
+ fun copyAligned (apkFile : File , outputFile : File , patchedEntriesSource : PatcherResult ) {
24
25
logger.info(" Aligning ${apkFile.name} " )
25
26
27
+ outputFile.toPath().deleteIfExists()
28
+
26
29
ZipFile (outputFile).use { file ->
27
30
patchedEntriesSource.dexFiles.forEach {
28
31
file.addEntryCompressData(
You can’t perform that action at this time.
0 commit comments