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...



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值