煩惱歲月

          付出總是有回報(bào)的 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 不需要解釋 閱讀(775) 評(píng)論(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!!!.


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


          網(wǎng)站導(dǎo)航:
           
          我實(shí)話告訴你們,我可是身經(jīng)百戰(zhàn)了.bbs我見的多了,哪個(gè)版我沒灌過(guò)?你們要知道, 一塌糊 涂的triangle,PIC,SEX版,那比你們不知道厲害到哪里去了,我在那談笑風(fēng)聲.你 們有一好就是無(wú)論在哪個(gè)版,什么話題都灌,但是灌來(lái)灌去的問(wèn)題,都too simple, sometimes naive!你 們懂不懂呀?啊?所以說(shuō)灌水啊,關(guān)鍵是要提高自己的知識(shí)水平.你 們啊,不要總想著弄個(gè)大坑,然后灌上十大,再把我羞辱一番……你們啊,naive!你們這 樣灌是不行地!~那你問(wèn)我支持 不支持灌水,我說(shuō)支持,我常來(lái)這裡灌,你說(shuō)支持不支持?
          主站蜘蛛池模板: 广水市| 雷波县| 和林格尔县| 玉田县| 黄大仙区| 通州区| 通道| 吴堡县| 沙田区| 会昌县| 耒阳市| 平江县| 海盐县| 基隆市| 乐昌市| 镇巴县| 阳西县| 益阳市| 荃湾区| 滨海县| 牟定县| 河南省| 玉门市| 沁阳市| 卢龙县| 兴国县| 嘉义县| 安达市| 红安县| 米林县| 科技| 莱州市| 双流县| 青海省| 威宁| 邯郸市| 卢龙县| 庆城县| 黑水县| 府谷县| 北海市|