简体   繁体   中英

Decompile APK, modify an activity and recompile to APK

I'm trying to do something simple. I have an APK file, I want to change a certain variable value in a certain activity, and then recompile it back to APK so I can use it on my android device.

It's been days since I started with it and I can't find any solution for it.

I tried these approaches:

  1. Decompile it with APKtool.
  2. Open it with Android studio.
  3. Change the value you want.
  4. Couldn't recompile it to APK.

  1. Decompile it with APKtool / Open the APK with 7-Zip.
  2. Convert classes.dex to jar using dex2jar.
  3. Open the jar file using luyten or jadx (jd-gui had an "internal error").
  4. Couldn't edit the files.

On a different approach I can't remember how I did it, I was able to get to the activity files, but couldn't understand how to recompile it to APK again.

Please, if you have any idea of how do edit the classes and the activity, let me know. I have read lots of SO questions and google it so many times but I couldn't find any solution for it. Thanks!

Using Android apk tool you can able to decompile the existing APK only. You can't recompile it. It will throw error

If you are going to convert dex file to JAR file and JAR file to dex file that also won't work most of the times.

But one solution is available.. "DexPatcher". I tried this one but got stuck in between do to lack of knowledge... You can try "Dexpatcher tool" it will be good. If u got any idea please let me know..

Have a good day

I suggest you to use APK Studio . You can decompile/recompile apk using it. However, you cannot edit the source in Java. It decompiles in language called smali . If you need to just change a value, I guess this tool can solve your problem.

Use apk-editor.

Apk-editor is app in android That decompile and recompile apk

apkeditor

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM