Saturday, March 22, 2014

Troubleshooting tips for xdaAutoTool and APK-Multi-Tool

Preface

Yesterday I was about to patch an Android App. Classical way to do this is using apktool, but there are other, more convenient tools to do the "decompile to smali --> modify smali code --> recompile modified code --> build APK --> sign APK" task list.

One of these tools is xdaAutoTool, the other popular one is APK-Multi-Tool (the updated version of APK Manager). I personally prefer xdaAutoTool cause it has a nice GUI interface, and you can browse the decompiled smali code from the tool itself. APK-Multi-Tool has a command line interface, but it seems to be less buggy and more stable so it is also quite useful.

If you are like me and you do not take a Java stack trace for an answer, I have collected a few tips how can you get xdaAutoTool up and running (and once you do these steps, APK-Multi-Tool also works perfectly), so you do not have to dig in the xda developpers forum for answers.

Troubleshooting

  1. Make sure INSTALLDIR does not contain white spaces, special characters, etc. Best is to copy it under the root directory, so something like this: C:\xdaAutoTool_V4.0.3
  2. Run the INSTALLDIR\xdaAutoTool_V4.0.3\Res\AAA_register_ocx.bat batch file as Administrator and make sure you are in the Res directory when you execute AAA_register_ocx.bat
  3. The current version of xdaAutoTool ships with old apktool JAR files, so copy latest apktool and apktool framework to INSTALLDIR\xdaAutoTool_V4.0.3\bin
  4. The apktool.jar you have just copied must be renamed to apktool_VERSION.jar (so like apktool_1.5.2.jar), otherwise xdaAutoTool will not find it, and you will not be able to select it for decompiling / recompiling.
  5. If you have already tried to execute xdaAutoTool before, also make sure that you delete USERDIR\apktool directory.
  6. For the error: "Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, ..." you have to either copy aapt.exe out from the INSTALLDIR\xdaAutoTool_V4.0.3\bin to INSTALLDIR\xdaAutoTool_V4.0.3\ either specify the location of aapt.exe in your PATH environment variable (so put INSTALLDIR\xdaAutoTool_V4.0.3\bin in the PATH variable).
That's it! Let me know in the comments if there are other errors + solutions so we can have the most common ones in one place.

Happy hacking!

No comments :

Post a Comment