从 APK 文件到项目的逆向工程 [英] Reverse engineering from an APK file to a project

查看:52
本文介绍了从 APK 文件到项目的逆向工程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不小心从

然后您可以使用其他工具从 APK 文件中检索 AndroidManifest.xml 和资源文件(如图像、翻译等...).

  • Apktool

     $ java -jar apktool.jar -q decode -f demo.apk -o outputDir

  • AXMLParser

     $ apkinfo demo.apk

  • NinjaDroid

     $ ninjadroid demo.apk --all --extract

I accidently erased my project from Eclipse, and all I have left is the APK file which I transferred to my phone. Is there a way to reverse the process of exporting an application to the .apk file, so I can get my project back?

解决方案

There are two useful tools which will generate Java code (rough but good enough) from an unknown APK file.

  1. Download dex2jar tool from dex2jar.

  2. Use the tool to convert the APK file to JAR: Windows:

     $ d2j-dex2jar.bat demo.apk
     dex2jar demo.apk -> ./demo-dex2jar.jar
    

    MacOS / Linux:

     $ d2j-dex2jar.sh -f demo.apk -o demo.jar
    

  3. Once the JAR file is generated, use JD-GUI to open the JAR file. You will see the Java files.

The output will be similar to:

Then you can use other tools to retrieve the AndroidManifest.xml and resource files (like images, translations, etc...) from the APK file.

  • Apktool

     $ java -jar apktool.jar -q decode -f demo.apk -o outputDir
    

  • AXMLParser

     $ apkinfo demo.apk
    

  • NinjaDroid

     $ ninjadroid demo.apk --all --extract
    

这篇关于从 APK 文件到项目的逆向工程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆