JesusFreke / smali

smali/baksmali
6.29k stars 1.07k forks source link

Regenerate odex from smali file? #547

Open peacherwu opened 7 years ago

peacherwu commented 7 years ago

I get it the baksmali can convert odex to smali, yet is it possible to recover the exact original "odex" file backward? I did a "baksmali.jar x" and then a "smali.jar a", but the final .dex file is very different from the initial .odex file.

Lanchon commented 6 years ago

you probably asked baksmali to deodex the odex file, which is why it is very different. baksmali/smali might work on an odex file without deodex if you give smali the exact api level/art version and you don't pass in the deodex command line option. (JF knows this for certain. i never use the smali tools.)

but why do you want that? do you realize that odexed smali would include for example offsets into vtables not included in the file where you would hope to find the names of virtual methods at their call site? i doubt you would be able to make sense of anything in an odex disassembly.