问题描述
我需要修改现有的APK,修改源代码,然后重新编译它。
I need to modify an existing APK, modify the sources and then recompile it.
- 我可以使用dex2jar或apktool反编译它,它的工作很大
- 从jar文件,我可以得到Java源代码(使用JD-GUI)
- 然后我可以修改java文件
但现在我想知道如何重新编译java文件并把它们放回一个jar文件! (罐子部分应该很容易,主要问题似乎是如何重新编译java文件对于Android)
But now I would like to know how to recompile the java files and put them back into a jar file! (the jar part should be easy, the main problem seems to be how to recompile the java files for android)
我知道一个其他的解决办法是使用apktool,然后修改smali文件,但它似乎是非常复杂的时候,我们要添加大量的code!
I know that an other solution is to use apktool and then modify the smali files, but it seems to be really complicated when we want to add a lot of code!
我的应用程序是一个基本的一个HelloWorld whitout混淆。
My application is a basic a HelloWorld whitout obfuscation.
推荐答案
感谢Chris小丑,年轻的我设法使它工作!
Thanks to Chris Jester-Young I managed to make it work!
我想我能够做到的方式,将只在非常简单的项目:
I think the way I managed to do it will work only on really simple projects:
- 随着Dex2jar我得到的罐子。
- 与JD-GUI转换我的瓶子回Java文件。
-
通过apktool我得到了Android清单和ressources文件
- With Dex2jar I obtained the Jar.
- With jd-gui I convert my Jar back to Java files.
With apktool i got the android manifest and the ressources files
在Eclipse中创建具有相同设置为旧的(检查清单文件中的所有信息)的新项目
In Eclipse I create a new project with the same settings as the old one (checking all the information in the manifest file)
/!\请确保您删除了旧的apk从设备的错误会被抛出,说明该APK签名是不一样的旧人!
/!\ be sure you removed the old apk from the device an error will be thrown stating that the apk signature is not the same as the old one!
这篇关于反编译的APK,修改,然后重新编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!