0

Do you know if it possible to edit compiled code in apk package?

I tried followed steps:

  1. Unpack xapk file by command: unzip my-app.xapk (I have there multiple apk and I need to modify one of them, due to bug fixing...)
  2. Unpack one of the apk: apktool d my-component.apk
  3. Modify one of the smali files
  4. Build apk: apktool b ./my-component -o ./my-component.apk
  5. generate cert: keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-alias
  6. sign all unpacked from xapk files: find ./ -name "*.apk" -exec apksigner sign --ks my-release-key.jks --ks-pass pass:123456 --out {} {} \;
  7. install all component: adb install-multiple -r my-component.apk another-component.apk....

After all these steps my application works partially and I got some errors in logcat:

ArtManagerService: Failed to prepare profile for my-package:/data/app/~~SeVk-WOasdas3A-hIPw==/my-component-TwgvYqasd_uL4r2tgdBZ-og==/base.apk

1 Answer 1

0

An .apk is a zip file, just a bit stricter. Theoretically you could change anything in it. But if the code is actually compiled, then it is an amazing amount of effort.

There is an article on wikihow that tells you more about how to modify an apk file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .