首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

yguard代码搅混例子(原创)

2012-08-27 
yguard代码混淆例子(原创)?xml version1.0 encodingUTF-8?project nameproject defaultygua

yguard代码混淆例子(原创)
<?xml version="1.0" encoding="UTF-8"?>
  <project name="project" default="yguard" basedir=".">
    <target name="init">
    <property name="project_name" value="3D"/>
    <property name="srcDir" value="src"/>
    <property name="classDir" value="classes"/>
    <property name="libDir" value="lib"/>
    <property name="jar" value="${project_name}.jar"/>
    <property name="obfjar" value="${project_name}_obf.jar"/>
    <property name="mainclass" value="cs.Main"/>
    <mkdir dir="${classDir}"/>
    </target>


    <target depends="jar" name="yguard">
          <taskdef name="yguard"
       classname="com.yworks.yguard.YGuardTask"
               classpath="yguard.jar"/>
          <yguard>
  <externalclasses>
<pathelement location="lib/1.jar"/>
<pathelement location="lib/2.jar"/>
<pathelement location="lib/3.jar"/>
  </externalclasses>
          <inoutpair in="${jar}" out="${obfjar}"/>
          <rename mainvalue="pedantic"/>
  <map>
<package name="cs.A" map="1"/>
<package name="cs.B" map="2"/>
<package name="cs.C" map="3"/>
<package name="cs.D" map="4"/>
<package name="cs.E" map="5"/>
<package name="cs.F" map="6"/>
<package name="cs.G" map="7"/>
<package name="cs.H" map="8"/>
<package name="cs.I" map="9"/>
<package name="cs.J" map="10"/>
  </map>
</rename>
      </yguard>
    </target>


    <target name="compile" depends="init">
      <javac srcdir="${srcDir}"
     includes="**/*.java"
             destdir="${classDir}"
     extdirs="${libDir}">
      </javac>
    </target>


    <target name="jar" depends="compile">
    <manifest file="MANIFEST.MF">
        <attribute name="Main-Class"
   value="cs.Main"/>
<attribute name="Class-Path"
                   value="lib/ABCD.jar"/>
    </manifest>
      <jar jarfile="${jar}"
        basedir="${classDir}"
        includes="**/*.class"
manifest="MANIFEST.MF">
<fileset dir="${srcDir}">
<include name="cs/ABC/*.png"/>
        </fileset>
      </jar>
    </target>


    <target name="run" depends="yguard">
      <java classname="${mainclass}" fork="true">
      <classpath>
        <pathelement location="${obfjar}"/>
      </classpath>
    </java>
  </target>
</project>

热点排行