使用dex2Jar和JD-GUI反编译Android Apk
标签搜索

使用dex2Jar和JD-GUI反编译Android Apk

Pop.Kite
2023-08-09 / 0 评论 / 109 阅读 / 正在检测是否收录...

Mac下使用dex2Jar和JD-GUI反编译Android Apk

安装使用

  1. 首先安装dex2Jar和jd-gui
  • 下载dex2jar安装包,解压到本地文件夹。
  • 使用homebrew安装jd-gui

    brew install --cask jd-gui
  1. 将apk改为zip格式,解压apk,将classes.dex文件复制到dex2Jar文件夹下。
  2. 在dex2jar文件夹下,使用命令反编译dex文件到jar

    ./d2j-dex2jar.sh  classes.dex(xxx.dex是文件名)
  3. 右键生成的jar包,选择以JD-GUI打开。

问题解决

  • dex2jar报权限错误,将报错的文件给予可执行权限即可,如

    sudo chmod +x d2j_invoke.sh
  • dex2jar报错com.googlecode.d2j.DexException: not support version.,由于应用的sdk version太高导致,右键报错的jar包,然后修改dex下面一行的03x036即可,使用delete删除x,不要用backspace
  • jd-gui报错找到不java,在Finder中右键jd-gui显示包内容,然后修改Content-MacOs-universalJavaApplicationStub.sh文件,找到下述代码

    else
            # display error message with applescript
            osascript -e "tell application \"System Events\" to display dialog \"ERROR launching '${CFBundleName}'\n\nNo suitable Java version found on your system!\nThis program requires Java ${JVMVersion}\nMake sure you install the required Java version.\" with title \"${CFBundleName}\" buttons {\" OK \"} default button 1 with icon path to resource \"${CFBundleIconFile}\" in bundle (path to me)"
            # exit with error
            exit 3
        fi

    修改为下述内容后保存

    else
            JAVACMD="你的java路径"
            # display error message with applescript
            #osascript -e "tell application \"System Events\" to display dialog \"ERROR launching '${CFBundleName}'\n\nNo suitable Java version found on your system!\nThis program requires Java ${JVMVersion}\nMake sure you install the required Java version.\" with title \"${CFBundleName}\" buttons {\" OK \"} default button 1 with icon path to resource \"${CFBundleIconFile}\" in bundle (path to me)"
            # exit with error
            #exit 3
        fi

    不知道java路径可以使用which java查看。

0

评论 (0)

取消