如何让 Proguard 混淆 jar 文件中的 jar [英] How to make Proguard to obfuscate jars within a jar file

查看:47
本文介绍了如何让 Proguard 混淆 jar 文件中的 jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可运行的 java jar 文件,我们称之为 masterProgram.jar.在这个 masterProgram.jar 中,如果我使用 7Zip 或 WinRAR 提取它,还有其他 jars,我们称之为 lib1.jar, lib2.jar.

I have a run-able java jar file let's call it masterProgram.jar. Inside this masterProgram.jar if I extract it using 7Zip or WinRAR there are other jars, lets call it lib1.jar, lib2.jar.

Proguard 设法混淆了 master jar,但是当我查看 lib jar 时却没有.正因为如此,程序 (masterProgram.jar) 在某个时刻中断.我也已经在我的配置中设置了 overloadaggressively 选项.

Proguard managed to obfuscated the master jar, but when I look-inside the lib jars are not. and because of this the program (masterProgram.jar) breaks at a certain point. I also already set overloadaggressively option in my condig.

我通过 ant build.xml 调用 proguard.jar.这是我的配置文件 config.proguard

I'm calling the proguard.jar through an ant build.xml. and here is my config file config.proguard

-injars 'masterProgram.jar'

-target 1.7
-dontshrink

-dontoptimize
-allowaccessmodification
-printmapping dataprintmap.txt
-overloadaggressively
-useuniqueclassmembernames
-repackageclasses ''
-keepattributes Exceptions,Innerclasses,Signature,Deprecated,*Annotation*,Synthetic
-renamesourcefileattribute SourceFile
-dontnote
-printseeds dataseed.txt
-dontskipnonpubliclibraryclasses

推荐答案

罐子里的罐子并不是罐子应该如何工作.你需要重新安排事情,让 ProGuard 能够处理事情.ProGuard 无法处理 jars 中的 jars,因为这不是 jars 的用途.

Jars inside jars are not really how jars are supposed to work. You'll need to rearrange things to make ProGuard able to deal with things. ProGuard has no way to deal with jars in jars because that's not how jars are intended to be used.

这篇关于如何让 Proguard 混淆 jar 文件中的 jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆