yguard没有更新jar中的属性文件

时间:2014-01-23 18:39:45

标签: ant yguard

我的jar文件中包含一些属性文件,如log4j.properties和config.properties。以下是我对yguard的蚂蚁脚本。其他一切都在工作,但属性文件更新。

<target name="yguard">
    <taskdef name="yguard" classname="com.yworks.yguard.YGuardTask" classpath="lib/yguard.jar" />
    <yguard>
        <inoutpairs resources="none">
            <fileset dir="${basedir}">
                <include name="MyApp.jar" />
            </fileset>
            <mapper type="glob" from="MyApp.jar" to="MyAppObs.jar" />
        </inoutpairs>
        <externalclasses>
            <pathelement location="lib/log4j-1.2.17.jar" />
        </externalclasses>
        <rename conservemanifest="true" mainclass="com.amit.Application" >
            <adjust replaceContent="true" >
                <include name="**/*.properties" />
            </adjust>
        </rename>
    </yguard>
</target>

config.properties文件

com.amit.Application.param1 = something

我在stackoverflow中发现了一些问题,但是他们没有帮助。有人提到过,文件(如jsp,xml,属性)应该在我已经拥有的jar文件中。但我的yguard模糊文件只是按原样复制文件。

我尝试了多次重命名&amp;组合调整标签,但没有任何作用。

以下帖子我已经访问过

Is it possible to manage logs through Obfuscation with yGuard?

How to include obfuscated jar file into a war file

1 个答案:

答案 0 :(得分:0)

显然,您希望yGuard对字段param1的名称进行模糊处理,因为com.amit.Application显然是您的入口点,yGuard会自动排除给定的主类。所以基本上你希望结果像是

com.amit.Application.AÖÜF = something

这是不可能的,因为yGuard只能调整属性文件中的类名,如下所示:yGuard Manual

相关问题