<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 147  文章 - 71  trackbacks - 0
    <2009年11月>
    25262728293031
    1234567
    891011121314
    15161718192021
    22232425262728
    293012345

    常用鏈接

    留言簿(1)

    隨筆分類(146)

    隨筆檔案(147)

    文章分類(28)

    文章檔案(28)

    喜歡的Blog

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    下載地址:http://proguard.sourceforge.net
    以下面的Test.java文件為例:
    import java.util.*;
    import java.io.*;

    public class Test {
        
    public static void main(String[] args) throws Exception 
            BufferedReader stdin 
    = new BufferedReader(new InputStreamReader(System.in));
               String s 
    = stdin.readLine();        
            
    if(s.length()%2==0)
                System.out.println(showMsg1()); 
            
    else
                System.out.println(showMsg2());
            Flight a 
    = new Flight();
            a.setName(s);
            System.out.println(a.output());
            Bomber b 
    = new Bomber();
            b.setName(s);
            System.out.println(b.output());
            s 
    = stdin.readLine();
            StringTokenizer st 
    = new StringTokenizer(s);
            
    int n = Integer.parseInt(st.nextToken()); 
            System.out.println(compute(n));
        }

        
        
    public static String showMsg1() 
            
    return "You are my sun1"
        }

        
        
    public static String showMsg2() 
            
    return "You are my sun2"
        }

        
        
    public static int compute(int n) 
            
    if(n>1)
                
    return n*compute(n-1); 
            
    else
                
    return 1;
        }

        
        
    public static class Flight{
            
    public Flight(){
            }

            
            
    public String output(){
                
    return this.name;
            }

            
            
    public void setName(String name){
                
    this.name="Flight:"+name;
            }

            
            
    private String name;
        }

        
        
    public static class Bomber{
            
    public Bomber(){
            }

            
            
    public String output(){
                
    return this.name;
            }

            
            
    public void setName(String name){
                
    this.name="Bomber:"+name;
            }

            
            
    private String name;
        }

    }

    首先jar cvf a.jar *.class打包程序,然后jad -d d:\ -r -s java d:\*.class反編譯程序,生成Test.java文件,通過對比可以發現,它和原來文件的內容基本是相同的。

    // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
    // Jad home page: http://www.kpdus.com/jad.html
    // Decompiler options: packimports(3) 
    // Source File Name:   Test.java

    import java.io.*;
    import java.util.StringTokenizer;

    public class Test
    {
        
    public static class Bomber
        
    {

            
    public String output()
            
    {
                
    return name;
            }


            
    public void setName(String s)
            
    {
                name 
    = (new StringBuilder()).append("Bomber:").append(s).toString();
            }


            
    private String name;

            
    public Bomber()
            
    {
            }

        }


        
    public static class Flight
        
    {

            
    public String output()
            
    {
                
    return name;
            }


            
    public void setName(String s)
            
    {
                name 
    = (new StringBuilder()).append("Flight:").append(s).toString();
            }


            
    private String name;

            
    public Flight()
            
    {
            }

        }



        
    public Test()
        
    {
        }


        
    public static void main(String args[])
            
    throws Exception
        
    {
            BufferedReader bufferedreader 
    = new BufferedReader(new InputStreamReader(System.in));
            String s 
    = bufferedreader.readLine();
            
    if(s.length() % 2 == 0)
                System.out.println(showMsg1());
            
    else
                System.out.println(showMsg2());
            Flight flight 
    = new Flight();
            flight.setName(s);
            System.out.println(flight.output());
            Bomber bomber 
    = new Bomber();
            bomber.setName(s);
            System.out.println(bomber.output());
            s 
    = bufferedreader.readLine();
            StringTokenizer stringtokenizer 
    = new StringTokenizer(s);
            
    int i = Integer.parseInt(stringtokenizer.nextToken());
            System.out.println(compute(i));
        }


        
    public static String showMsg1()
        
    {
            
    return "You are my sun1";
        }


        
    public static String showMsg2()
        
    {
            
    return "You are my sun2";
        }


        
    public static int compute(int i)
        
    {
            
    if(i > 1)
                
    return i * compute(i - 1);
            
    else
                
    return 1;
        }

    }

    進入Proguard的lib目錄,用JDK打開proguardgui.jar,點選Input/Output標簽,選擇要混淆的JAR包(注意是JAR包),輸出JAR包,以及用到的所有類庫。
    點選Obfuscation標簽,選中不需要混淆的類(要被反射的類絕對不能被混淆),一般是1,4,5,9,10,11

    ,12這幾個選項。
    a.txt的文件內容為:(混淆函數名)
    Gcd
    b.txt的文件內容為:(混淆類名)
    A
    B

    點選Process標簽,Process按鈕,生產b.jar

    解壓b.jar后,這時的3個class文件分別為A.class、B.class、Test.class;
    重新反編譯程序jad -d d:\b\ -r -s java d:\b\*.class,生成3個java文件:A.java、B.java、Test.java,具體內容如下:

    A.java
    // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
    // Jad home page: http://www.kpdus.com/jad.html
    // Decompiler options: packimports(3) 


    public final class A
    {

        
    public A()
        
    {
        }


        
    public final String Gcd()
        
    {
            
    return Gcd;
        }


        
    public final void Gcd(String s)
        
    {
            Gcd 
    = (new StringBuilder()).append("Bomber:").append(s).toString();
        }


        
    private String Gcd;
    }
    B.java
    // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
    // Jad home page: http://www.kpdus.com/jad.html
    // Decompiler options: packimports(3) 


    public final class B
    {

        
    public B()
        
    {
        }


        
    public final String Gcd()
        
    {
            
    return Gcd;
        }


        
    public final void Gcd(String s)
        
    {
            Gcd 
    = (new StringBuilder()).append("Flight:").append(s).toString();
        }


        
    private String Gcd;
    }
    Test.java
    // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
    // Jad home page: http://www.kpdus.com/jad.html
    // Decompiler options: packimports(3) 

    import java.io.*;
    import java.util.StringTokenizer;

    public class Test
    {

        
    public Test()
        
    {
        }


        
    public static void main(String args[])
        
    {
            String s;
            
    if((s = (args = new BufferedReader(new InputStreamReader(System.in))).readLine()).length() % 2 == 0)
                System.out.println(
    "You are my sun1");
            
    else
                System.out.println(
    "You are my sun2");
            Object obj;
            ((B) (obj 
    = new B())).Gcd(s);
            System.out.println(((B) (obj)).Gcd());
            ((A) (obj 
    = new A())).Gcd(s);
            System.out.println(((A) (obj)).Gcd());
            s 
    = args.readLine();
            args 
    = Integer.parseInt((args = new StringTokenizer(s)).nextToken());
            System.out.println(Gcd(args));
        }


        
    private static int Gcd(int i)
        
    {
            
    if(i > 1)
                
    return i * Gcd(i - 1);
            
    else
                
    return 1;
        }

    }
    通過對比可以發現,它和原來文件的內容有許多出入。
    posted on 2009-11-23 20:40 飛翔天使 閱讀(12605) 評論(1)  編輯  收藏 所屬分類: java

    FeedBack:
    # re: Proguard使用教程 2012-06-09 15:39 謝謝啊
    謝謝啊謝謝啊謝謝啊謝謝啊謝謝啊謝謝啊謝謝啊謝謝啊  回復  更多評論
      
    主站蜘蛛池模板: 人成免费在线视频| 亚洲人成精品久久久久| 久久免费观看国产精品88av| jzzijzzij在线观看亚洲熟妇| 久久精品国产亚洲精品2020| 亚洲精品无码久久毛片| 成年女性特黄午夜视频免费看 | 无人影院手机版在线观看免费| 国产一级在线免费观看| 色一情一乱一伦一视频免费看| 亚洲av无码一区二区三区天堂古代| 久热综合在线亚洲精品| 亚洲色图综合在线| 免费v片在线观看| 永久免费无码网站在线观看| 日韩免费a级毛片无码a∨| 中文字幕免费在线| 久久国产免费观看精品3| 在线观看片免费人成视频播放| 色哟哟国产精品免费观看| 国产亚洲欧美在线观看| 亚洲日韩一中文字暮| 亚洲一区二区三区亚瑟| 亚洲成年人电影在线观看| 亚洲人成网站影音先锋播放| 亚洲AV天天做在线观看| 亚洲av永久无码精品秋霞电影影院 | 日韩免费一区二区三区在线| 最近中文字幕mv免费高清视频8| 久久99毛片免费观看不卡| 今天免费中文字幕视频| 成在人线av无码免费高潮喷水| 国产在线精品观看免费观看| 国产精品免费看久久久香蕉| 精品人妻系列无码人妻免费视频| 黄网站色成年片大免费高清| 瑟瑟网站免费网站入口| 一个人免费观看在线视频www| 24小时日本电影免费看| 2021在线观看视频精品免费| 久久久久成人精品免费播放动漫|