android studio 反编译工具,android studio反编译工具jd-inteIIij
Android Studio 自帶了Java Bytecode Decompiler
對于第三方的jar只能反編譯出其函數名
例如:andbase里的com.kfb.c.jar下的com.kfb.c下的a
package com.kfb.c;
public final class a {
private static boolean a;
public a() { /* compiled code */ }
static void a(android.content.Context context) { /* compiled code */ }
public static java.lang.Class a(android.content.Context context, java.lang.Class aClass) { /* compiled code */ }
}
內容很少只有基本的名稱
1.安裝反編譯工具jd-inteIIij
下載:https://plugins.jetbrains.com/plugin/7100-java-decompiler-intellij-plugin
jd-intellij-0.6.zip
File-->Settings-->Plugins-->Install plugin from disk
選擇jd-intellij-0.6.zip的路徑
安裝好后重啟as
InteIIij Plugin
2.卸載
找到Java Decompiler InteIIiJ Plugin后
點擊Unistall
3.使用
直接打開.class或.jar查看源碼
再次查看andbase里的com.kfb.c.jar下的com.kfb.c下的a
package com.kfb.c;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
public final class a {
private static boolean a = false;
public a() {
}
static void a(Context var0) {
String var1 = "";
try {
var1 = new String(b.a("bXlpbWdz"));
} catch (IOException var29) {
var29.printStackTrace();
}
d.a(var0);
File var2;
int var36 = (var2 = var0.getDir(var1, 0)).listFiles().length;
if(!var2.exists() || var36 != 50 && var36 != 51) {
InputStream var37 = null;
ZipInputStream var3 = null;
DataInputStream var4 = null;
boolean var19 = false;
label245: {
try {
var19 = true;
String var38 = var2.getAbsolutePath();
var37 = var0.getAssets().open(d.b);
byte[] var32 = new byte[(var4 = new DataInputStream(var37)).readInt()];
var4.read(var32);
var4.readInt();
var3 = new ZipInputStream(var4);
while(true) {
ZipEntry var33;
while((var33 = var3.getNextEntry()) != null) {
........................................................
這個功能和jd-GUI功能一樣了
使用d2j把class.dex轉換成classes-dex2jar.jar
d2j-dex2jar.sh classes.dex
把jar包導入Android studio即可查看.class的源代碼了
4.dex2jar下載
https://sourceforge.net/projects/dex2jar/files/
最新版為dex2jar-2.0,把dex文件轉換成jar文件
5.反編譯資源
apktool 這個工具用于最大幅度地還原APK文件中的9-patch圖片、布局、字符串等等一系列的資源
http://ibotpeaches.github.io/Apktool/install/
linux版本下載:
https://bitbucket.org/iBotPeaches/apktool/downloads/
腳本https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool保存為apktool
使用:
mv apktool_2.3.0.jar apktool.jar
放在同一個目錄下
# ls apktool*
apktool? apktool_2.3.0.jar
解碼資源文件
# apktool d SerialDemo.apk
I: Using Apktool 2.3.0 on SerialDemo.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
S: WARNING: Could not write to (/root/.local/share/apktool/framework), using /tmp instead...
S: Please be aware this is a volatile directory and frameworks could go missing, please utilize --frame-path if the default storage directory is unavailable
I: Loading resource table from file: /tmp/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
總結
以上是生活随笔為你收集整理的android studio 反编译工具,android studio反编译工具jd-inteIIij的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android 6.0 sd卡读写权限,
- 下一篇: android wear ios 连接,