I am looking for a proper and simple method to odex an apk file. I have an upgraded apk file from a ROM with which I want to replace the older one and it is located in the /system-priv
directory. The older apk has the .odex
file, but I figured out I can't directly overwrite the it, since I can't use the old .odex
(hence I need to odex first), lest I'ill be stuck with app crashes or bootloops.
I have tried searching for methods online but are not satisfactory in one of the ways:
This one which involves the use of a
dexopt-wrapper.bin
seems to be way outdated as binary is not supported, I have this error poping up:
error: dexopt-wrapper error: only position independent executables (PIE) are supported.
The second one which is lengthy and links to other required resources are no longer there, and is somewhat not compatible with my system.
The only promising one which uses Auto Odexer Script, but currently I'm running issues adb and also seems it uses the same dexopt-wrapper binary which was giving me errors in terminal.
There are tools/methods for doing the entire system at once, but I do not need the entire system re-odexed. I want to personally create an odexed "upgraded" .apk
from the extracted ROM.
Update
I upgraded the wrapper binary (now PIE) and should be compatible however still encountering this error:
--- BEGIN '/sdcard/app/A.apk' (bootstrap=0) ---
--- waiting for verify+opt, pid=17200
--- would reduce privs here
execl(/bin/dexopt) failed: No such file or directory
--- END '/sdcard/app/A.apk' --- status=0x4300, process failed
1|mido:/ #
and the result is an empty .odex
file in the dir. Someone to point out where I am going wrong here?