anestisb / vdexExtractor

Tool to decompile & extract Android Dex bytecode from Vdex files
Apache License 2.0
1k stars 214 forks source link

back to .vdex #32

Closed qianjie1990 closed 6 years ago

qianjie1990 commented 6 years ago

Thank you very much for your tools. I want to know how to restore the modified class.dex file to.Vdex file. After merging, the system will not be smooth.

anestisb commented 6 years ago

Not sure what exactly you're asking, although you can use the upstream dex2oat tool to optimize again any Dex/Apk files. This will generate the Oat file (.odex) and the matching Vdex container.

qianjie1990 commented 6 years ago

@anestisb My English is not very good. Can you tell me how to get the dex2oat tool?

anestisb commented 6 years ago

dex2oat is the ART runtime compiler and is available on every Android device as a command line tool. If you want to run dex2oat on your host computer (Linux or macOS) you need to check the AOSP source code and build the art targets. Googling should also reveal relative information from blogs/presentation explaining the ART components.

However, this is something that normally you shouldn't need to perform manually. After you've extracted the decompiled Dex files from a Vdex container, you can do your edits and repack it back to an APK file. Then simply installing the APK file on the device will revoke dex2oat behind the scenes and do the work for you.

Nappp commented 2 years ago

Hi @anestisb , I think I have the same problem here. The situation here is I extracted boot-framework.vdex from device, got 2~3 dex files, then converted to smali and modified some code. Is there a possible approach that I can pack these dex files back to vdex file so I can flash is back ? Obviously I don't have the source code for framework, and no jar or oat files found at device. Thanks a lot

Nappp commented 2 years ago

Hi @anestisb , I think I have the same problem here. The situation here is I extracted boot-framework.vdex from device, got 2~3 dex files, then converted to smali and modified some code. Is there a possible approach that I can pack these dex files back to vdex file so I can flash is back ? Obviously I don't have the source code for framework, and no jar or oat files found at device. Thanks a lot

After a long day research, I think I'm getting at it. kudos to smali-patcher