title: Decompile APK, modify an activity and recompile to APK
body: <p>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.</p>
  
  <p>It's been days since I started with it and I can't find any solution for it.</p>
  
  <p>I tried these approaches:</p>
  
  <ol>
  <li>Decompile it with APKtool.</li>
  <li>Open it with Android studio.</li>
  <li>Change the value you want.</li>
  <li><strong>Couldn't recompile it to APK.</strong></li>
  </ol>
  
  <hr>
  
  <ol>
  <li>Decompile it with APKtool / Open the APK with 7-Zip.</li>
  <li>Convert <code>classes.dex</code> to jar using dex2jar.</li>
  <li>Open the jar file using luyten or jadx (jd-gui had an "internal error").</li>
  <li><strong>Couldn't edit the files.</strong></li>
  </ol>
  
  <hr>
  
  <p>On a different approach I can't remember how I did it, I was able to get to the activity files, but <strong>couldn't understand how to recompile it to APK</strong> again.</p>
  
  <p>Please, if you have any idea of how do edit the <code>classes</code> 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!</p>