简体   繁体   中英

Proguard Obfuscation + getJarEntry

I have a jar file that has a package called "kaza". Inside this jar there is code that says:

JarFile jfile = new JarFile(fileName);
jfile.getJarEntry("kaza/");

When running from my jar, this line returns the jarEntry. When I obfuscate this jar using Proguard, this line is returning null although when I open the obfuscated jar, I find the "kaza" folder there!

I have tried changing it to:

jfile.getJarEntry("kaza\\");

or

jfile.getJarEntry("kaza");

But nothing worked!

What could be the problem? Thanks,

By default, ProGuard removes directory entries from jars. You should double-check that you have specified -keepdirectories and that the directory entries are present in the processed jar. Make sure that it's not the zip archive viewer that is showing such entries, even when they aren't there. If this still doesn't work, you could try manually unzipping the jar and zipping it again, to see if it makes a difference.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM