简体   繁体   English

用dex2jar和jd-gui编辑后构建.APK?

[英]Build .APK after editing with dex2jar and jd-gui?

I have used dex2jar with the help of THIS tutorial to extract .class files, and used jd-gui to view the classes. 我在教程的帮助下使用dex2jar来提取.class文件,并使用jd-gui来查看类。 but I cant edit in jd-gui so, through jd-gui, I "Saved All Resources", now I have a .zip with .java classes so I edited them with a Notepad++. 但我不能在jd-gui编辑,所以,通过jd-gui,我“保存所有资源”,现在我有.zip和.java类,所以我用Notepad ++编辑它们。 So now I have a .zip with all the classes in .java and I edited what I wanted, how do I build back everything to a .apk to install to the phone? 所以现在我有.zip和.java中的所有类,我编辑了我想要的内容,如何将所有内容重建为.apk以安装到手机上? Is this the wrong way to edit a .apk? 这是编辑.apk的错误方法吗?
Thanks. 谢谢。

If the decompiler does not decompile all correctly (in fact with obfuscation you'll never get a code without errors) you can't recompile the code... 如果反编译器没有正确反编译(事实上,通过模糊处理,你将永远不会得到没有错误的代码),你无法重新编译代码......

If you edit the classes into eclipse, you'll see that there are a bunch of errors and a bunch of $NameClassNumber and other stuff. 如果你把类编辑成eclipse,你会发现有一堆错误和一堆$ NameClassNumber和其他东西。

Maybe you can edit than repackage some resources, but the code not (luckily). 也许你可以编辑比重新包装一些资源,但代码不(幸运的是)。

I have never had good results of dex2jar. 我从未有过dex2jar的好成绩。

I extract the dex file from the jar with 7-zip, then use baksmali http://code.google.com/p/smali/ to decompile the dex file to ".smali" files (not as easy to understand as class files but it's manageable), and then use smali (included with baksmali) to recompile. 我从带有7-zip的jar中提取dex文件,然后使用baksmali http://code.google.com/p/smali/将dex文件反编译为“.smali”文件(不像类文件那么容易理解)但它是可管理的),然后使用smali(包含在baksmali中)重新编译。 Use 7-zip again to put the new classes.dex file back in the jar and done. 再次使用7-zip将新的classes.dex文件放回jar中并完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM