0

After decompiling an Android application, I am able to view its source code/Java classes by opening the classes.dex file using jd-gui. I need to add a few lines of code to the application before recompiling it and installing the modified app onto a phone. The problem is that even though I can view the source code, I am unable to add code to it. Is there anyway I can add code to the application instead of only being able to view it? I have tried importing into Eclipse, but I cannot obviously import the classes.dex file, and need a way to do that.

2
  • 1
    You can't change the APK directly like this. You need to go all the way through the pipeline: Java source -> Java bytecode -> Dex bytecode -> package the APK -> sign the APK. By the way, what are you trying to achieve? To hack a someone else's app? Commented Jul 8, 2014 at 15:54
  • maybe ask for someone's code and then add your few lines if you get the source Commented Jul 8, 2014 at 15:57

1 Answer 1

1

You have to use APKTool. Also check out this Smali coding guide. Not easy as you think.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.