<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 謝謝啊
    謝謝啊謝謝啊謝謝啊謝謝啊謝謝啊謝謝啊謝謝啊謝謝啊  回復  更多評論
      
    主站蜘蛛池模板: 一区二区三区福利视频免费观看| 美女18一级毛片免费看| 日本免费久久久久久久网站| 亚洲一区二区三区香蕉| 男女一边摸一边做爽的免费视频| 国产成人精品久久亚洲| 国产一区二区三区免费观在线| 亚洲精品无码不卡在线播HE| 久久99热精品免费观看动漫| 少妇中文字幕乱码亚洲影视| 免费观看无遮挡www的视频| 亚洲天堂2017无码中文| 免费无码一区二区三区蜜桃大| 日本亚洲欧美色视频在线播放| 免费一级做a爰片久久毛片潮喷| 欧洲乱码伦视频免费国产| 亚洲婷婷五月综合狠狠爱| 三年片在线观看免费大全电影 | 亚洲午夜无码AV毛片久久| 成人a毛片视频免费看| 亚洲精品午夜无码电影网| 亚洲美女免费视频| 亚洲国产欧美国产综合一区 | 四虎成人免费网址在线| 日韩色日韩视频亚洲网站| 老司机亚洲精品影视www| 久久精品私人影院免费看| 亚洲国产综合第一精品小说| 青青草国产免费久久久91| 一级毛片免费在线播放| 亚洲AV午夜成人片| 免费被黄网站在观看| 抽搐一进一出gif免费视频| 亚洲男女性高爱潮网站| 免费真实播放国产乱子伦| 国产色无码精品视频免费| 亚洲AV成人噜噜无码网站| 亚洲色偷偷狠狠综合网| 最近中文字幕电影大全免费版| 羞羞视频免费网站入口| 久久久久久亚洲AV无码专区|