Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modify classes.dex and repack .apk file

I want to modify classes.dex file in .apk file of my Android application and make a new .apk file. I already know how to decompile .apk file using tools such as apktool and then recompile it. My issue is to modify classes.dex file exactly, not a .smali code.

I tried to make a .zip archive with modified classes.dex file and to change it's extension to .apk, but I failed to install this .apk on my Android gadget.

like image 387
floyd Avatar asked Oct 19 '22 14:10

floyd


1 Answers

Sounds like you want to decode an application without disassembling the classes.dex file to smali. In Apktool you can utilize the -s / --skip-sources parameter to avoid this. Apktool will simply pass on the classes.dex instead of disassembling it.

Then you can modify it directly however you are. Then recompile with (apktool b) and it will copy the classes.dex into final built apk.

like image 84
Connor Tumbleson Avatar answered Oct 22 '22 04:10

Connor Tumbleson