简体   繁体   English

Proguard混淆+ getJarEntry

[英]Proguard Obfuscation + getJarEntry

I have a jar file that has a package called "kaza". 我有一个jar文件,其中包含一个名为“ 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. 从我的jar运行时,此行返回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! 当我使用Proguard对瓶子进行模糊处理时,此行返回null,尽管当我打开经过模糊处理的jar时,却在其中找到了“ kaza”文件夹!

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. 默认情况下,ProGuard从jar中删除目录条目。 You should double-check that you have specified -keepdirectories and that the directory entries are present in the processed jar. 您应该仔细检查是否已指定-keepdirectories以及已处理的jar中是否存在目录条目。 Make sure that it's not the zip archive viewer that is showing such entries, even when they aren't there. 确保不是zip存档查看器显示此类条目,即使它们不在那里也是如此。 If this still doesn't work, you could try manually unzipping the jar and zipping it again, to see if it makes a difference. 如果仍然无法解决问题,您可以尝试手动解压缩jar并再次将其压缩,以查看它是否有所作为。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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