煩惱歲月

          付出總是有回報的 take action follow your heart , or follow your head
          posts - 40, comments - 5, trackbacks - 0, articles - 4

          Java obfuscate

          Posted on 2009-10-19 00:50 不需要解釋 閱讀(778) 評論(0)  編輯  收藏 所屬分類: tools

          there are lots tools about the java obfuscate. I know two.

          (1)proguard

          (2)yguard

          the proguard support ant, maven. I use maven as the project and build tools. so I want use the maven proguard plugin, but It is not easy to use. so I use yguard.

          in your pom.xml, you can  add:

              <plugin>
                      <groupId>net.sf.mgp</groupId>
                      <artifactId>maven-unclasses-plugin</artifactId>
                      <version>0.0.2</version>
                  </plugin>
                  <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <dependencies>
              <dependency>
                <groupId>yguard</groupId>
                <artifactId>yguard</artifactId>
                <version>2.3.0</version>
                <scope>system</scope>
                <systemPath>lib/yguard.jar</systemPath>
              </dependency>
            </dependencies>
            <executions>
              <execution>
                <phase>package</phase>
                <configuration>
                  <tasks>
                    <property refid="maven.compile.classpath"
                      name="mvn.classpath"></property>
                    <!-- <echo message="Using Maven Classpath: ${mvn.classpath}" /> -->
                    <taskdef name="yguard"
                      classname="com.yworks.yguard.YGuardTask"/>
                    <yguard>
                      <!-- Input file and output file is the same. -->
                      <inoutpair
                        in="${project.build.directory}/${project.build.finalName}.${project.packaging}"
                        out="${project.build.directory}/${project.build.finalName}.jar"/>
                      <!-- Obfuscate classes plus string references. -->
                      <rename
                        logfile="${project.build.directory}/yguard.log.xml"
                        replaceClassNameStrings="true">
                        <!-- Keep the only class to be used for easy running and its public method main(). -->
                        <keep>
                            <class classes="public" methods="public">
                            <patternset>
                              <include name=”xx.xxx.xxx.util.ConnectionUtil"/>
                            </patternset>
                          </class>
                        </keep>
                      </rename>
                      <!-- There are some external libraries used - Maven knows details. -->
                      <externalclasses>
                        <pathelement path="${mvn.classpath}"/>
                      </externalclasses>
                    </yguard>
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>


          It is very cool!!!.


          只有注冊用戶登錄后才能發(fā)表評論。


          網站導航:
          博客園   IT新聞   Chat2DB   C++博客   博問  
           
          我實話告訴你們,我可是身經百戰(zhàn)了.bbs我見的多了,哪個版我沒灌過?你們要知道, 一塌糊 涂的triangle,PIC,SEX版,那比你們不知道厲害到哪里去了,我在那談笑風聲.你 們有一好就是無論在哪個版,什么話題都灌,但是灌來灌去的問題,都too simple, sometimes naive!你 們懂不懂呀?啊?所以說灌水啊,關鍵是要提高自己的知識水平.你 們啊,不要總想著弄個大坑,然后灌上十大,再把我羞辱一番……你們啊,naive!你們這 樣灌是不行地!~那你問我支持 不支持灌水,我說支持,我常來這裡灌,你說支持不支持?
          主站蜘蛛池模板: 襄城县| 郓城县| 分宜县| 大洼县| 盘锦市| 江孜县| 宜丰县| 乌兰县| 东辽县| 德阳市| 四平市| 溧阳市| 新兴县| 神池县| 平昌县| 城固县| 加查县| 大理市| 新丰县| 始兴县| 分宜县| 新竹县| 贡觉县| 木兰县| 湖州市| 嵩明县| 肥东县| 南江县| 讷河市| 河东区| 佛山市| 丽江市| 新昌县| 太康县| 新和县| 余姚市| 修武县| 呈贡县| 师宗县| 威信县| 会泽县|