Skip to content

Commit c710f2b

Browse files
committed
fix(obf): fix #50 nested jar issue
1 parent 568bf7c commit c710f2b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

dev.skidfuscator.obfuscator/src/main/java/dev/skidfuscator/obfuscator/phantom/jphantom/PhantomResolvingJarDumper.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.*;
2323
import java.util.jar.JarEntry;
2424
import java.util.jar.JarOutputStream;
25+
import java.util.zip.CRC32;
2526
import java.util.zip.ZipException;
2627

2728
/**
@@ -264,6 +265,13 @@ protected String getCommonSuperClass(String type1, String type2) {
264265
@Override
265266
public int dumpResource(JarOutputStream out, String name, byte[] file) throws IOException {
266267
JarEntry entry = new JarEntry(name);
268+
if (name.endsWith(".jar")){
269+
entry.setMethod(JarEntry.STORED);
270+
entry.setSize(file.length);
271+
CRC32 crc = new CRC32();
272+
crc.update(file, 0, file.length);
273+
entry.setCrc(crc.getValue());
274+
}
267275
out.putNextEntry(entry);
268276
out.write(file);
269277
return 1;

0 commit comments

Comments
 (0)