如何將Android 的反編譯譯成可讀源碼

來源:互聯網
上載者:User

 

閱讀源碼是最好的學習方法,下面我們以憤怒的小鳥為例,看看如何把一個android遊戲反編譯成可讀的源碼。

 (中國軟體網訊) 閱讀源碼是最好的學習方法,下面我們以憤怒的小鳥為例,看看如何把一個android遊戲反編譯成可讀的源碼。

工具介紹:

1、apktool   這個工具用來解壓xml檔案

到http://code.google.com/p/android-apktool/downloads/list 下載前兩個檔案,並解壓到Android SDK的platform tools 目錄。

在命令列裡的用法: 

apktool d 你的apk.apk 解壓到指定檔案夾,例如:

apktool d F:\學習\android\反編譯\憤怒的小鳥.apk F:\學習\android\反編譯\憤怒的小鳥

 

<?xml version="1.0" encoding="utf-8"?>
<manifest android:versionCode="1620" android:versionName="1.6.2" android:installLocation="auto" package="com.rovio.angrybirds"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <application android:label="@string/app_name" android:icon="@drawable/icon" android:debuggable="false">
        <activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:label="@string/app_name" android:name="com.rovio.ka3d.App" android:launchMode="singleTask" android:screenOrientation="landscape" android:configChanges="keyboardHidden|orientation">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:name="com.burstly.lib.component.networkcomponent.burstly.VideoPlayerActivity" android:configChanges="keyboard|keyboardHidden|orientation" />
        <activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:name="com.burstly.lib.component.networkcomponent.burstly.BurstlyFullscreenActivity" android:configChanges="keyboard|keyboardHidden|orientation" />
        <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation" />
        <provider android:name="com.greystripe.android.sdk.AdContentProvider" android:exported="false" android:multiprocess="true" android:authorities="com.rovio.ka3d.AdContentProvider" />
        <activity android:name="com.greystripe.android.sdk.AdView" android:configChanges="keyboard|keyboardHidden|orientation">
            <intent-filter>
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="com.millennialmedia.android.MMAdViewOverlayActivity" />
        <activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:name="com.millennialmedia.android.VideoPlayer" android:configChanges="keyboard|keyboardHidden|orientation" />
        <supports-screens android:anyDensity="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" />
        <activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:name="com.burstly.lib.component.networkcomponent.jumptap.JumptapActivity" android:configChanges="keyboard|keyboardHidden|orientation" />
    </application>
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="8" />
</manifest>

 

這就是我們加壓後的AndroidManifest檔案,我們看到憤怒的小鳥總共有8個activity 

 

 

2、dex2jar  這個工具是將dex檔案反編譯成jar檔案

 到http://code.google.com/p/dex2jar/downloads/list下載這個工具,並將所有檔案和檔案夾加壓到並Android SDK的platform tools 目錄。

用法:

dex2jar F:\學習\android\反編譯\classes.dex    這裡是把dex檔案反編譯成jar檔案,預設會在該目錄產生一個classes_dex2jar.jar檔案。

 

3、xjad 這個工具是將jar檔案反編譯成java檔案

 這是一個可視化的將jar檔案反編譯成java檔案的工具,直接反編譯jar會自動產生一個包含java檔案的檔案夾。 

 

 憤怒的小鳥源碼下載:

http://dl.dbank.com/c0olagap0k

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.