Closed Yehh22 closed 11 months ago
This issue is similar to #44
Oh I see. If it's not possible to fix, could it be possible to recompress APK to maximum to reduce size, just like ordinary zip and 7z?
I already fixed the problem and i will push it soon
Archive still broken and unable to zipalign and sign the apk file
Also it is still unable to read split zip files directly even tho APK files exists
00.000 I: [MERGE] Merging ...
Input: E:\Romancing SaGa -Minstrel Song-\romancing-saga-minstrel-song-1.0.0.zip
Output: E:\Romancing SaGa -Minstrel Song-\romancing-saga-minstrel-song-1.0.0_merged.apk
----------------------------
00.028 I: [MERGE] Extracting to: E:\Romancing SaGa -Minstrel Song-\tmp_b6fb23c3
ERROR:
No *.apk files found on: E:\Romancing SaGa -Minstrel Song-\romancing-saga-minstrel-song-1.0.0.zip
java.io.IOException: No *.apk files found on: E:\Romancing SaGa -Minstrel Song-\romancing-saga-minstrel-song-1.0.0.zip
at com.reandroid.apkeditor.merge.Merger.extractFile(Merger.java:115)
at com.reandroid.apkeditor.merge.Merger.run(Merger.java:54)
at com.reandroid.apkeditor.merge.Merger.execute(Merger.java:228)
at com.reandroid.apkeditor.Main.execute(Main.java:72)
at com.reandroid.apkeditor.Main.main(Main.java:41)
Archive still broken and unable to zipalign and sign the apk file
It is already zip aligned , just try to sign it
Also it is still unable to read split zip files directly even tho APK files exists
Your zip compression is not supported by java, extract to directory manually and pass the path
Ok. Here is what happen when signing APK
Exception in thread "main" com.android.apksig.apk.ApkFormatException: Malformed ZIP Central Directory record #1 at file offset 606531584
at com.android.apksig.ApkSigner.parseZipCentralDirectory(ApkSigner.java:879)
at com.android.apksig.ApkSigner.sign(ApkSigner.java:268)
at com.android.apksig.ApkSigner.sign(ApkSigner.java:223)
at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:395)
at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:92)
Caused by: com.android.apksig.zip.ZipFormatException: Not a Central Directory record. Signature: 0x71748920
at com.android.apksig.internal.zip.CentralDirectoryRecord.getRecord(CentralDirectoryRecord.java:143)
at com.android.apksig.ApkSigner.parseZipCentralDirectory(ApkSigner.java:877)
... 4 more
Oh I confirm this, i am investigating the cause
Android do not support Zip64, anyways we have fixed to support huge files including merging from large zip files. Check the latest
Oh, that explains why signing didn't work
Describe the bug It merges apk just fine without errors but apk is broken. Trying to modify apk via Winrar causes "archive is broken" and signing error causes
"Exception in thread "main" com.android.apksig.apk.ApkFormatException: Malformed ZIP Central Directory record #1 at file offset 606531584"
I'm using Java 20.0.1 on Windows 11To Reproduce Steps to reproduce the behavior:
java -jar APKEditor.jar m -i (apk folder)
Log/Stacktrace:
Used apk file https://mega.nz/file/3UwCRKjI#MnrptonVXIrg3IEZTc9YI4n50uNs7hiqR6Eic7-R4CA
Additional context There is an error when choosing zip file as input instead directory
java -jar APKEditor.jar m -i (zip file)