You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ZipFile zipFile = new ZipFile("/Users/engine/apk/test.apk");
ArrayList<File> addFiles = new ArrayList<>();
addFiles.add(new File("/Users/engine/apk/test.txt"));
ZipParameters parameters = new ZipParameters();
parameters.setCompressionMethod(CompressionMethod.DEFLATE);
parameters.setCompressionLevel(CompressionLevel.NORMAL);
// 目标路径
parameters.setRootFolderNameInZip("META-INF/");
zipFile.addFiles(addFiles, parameters);
you will get java.lang.NullPointerException and damage the apk
Stack trace:
net.lingala.zip4j.exception.ZipException: java.lang.NullPointerException
at net.lingala.zip4j.headers.HeaderWriter.writeFileHeader(HeaderWriter.java:501)
at net.lingala.zip4j.headers.HeaderWriter.writeCentralDirectory(HeaderWriter.java:382)
at net.lingala.zip4j.headers.HeaderWriter.finalizeZipFile(HeaderWriter.java:177)
Caused by: java.lang.NullPointerException
at java.io.OutputStream.write(OutputStream.java:75)
at net.lingala.zip4j.headers.HeaderWriter.writeRemainingExtraDataRecordsIfPresent(HeaderWriter.java:54
at net.lingala.zip4j.headers.HeaderWriter.writeFileHeader(HeaderWriter.java:495)
... 37 more
I have fix this Exception by modify HeaderWriter.writeRemainingExtraDataRecordsIfPresent() .at the latest code :
@srikanth-lingala @nicolabeghin
I have other problem 。when I add fille in zip ,will get NullPointException. but not All zip .
reappear it steps:
but I'm not sure I'm right
Originally posted by @lovekill in #148 (comment)
The text was updated successfully, but these errors were encountered: