I must buy one ;-)
For now you need VirtualBox (free) + Ubuntu (free) + ~5GB of space (nearly free) and you will be able to use it
sry. was a very obvious solution. >.<
I must buy one ;-)
For now you need VirtualBox (free) + Ubuntu (free) + ~5GB of space (nearly free) and you will be able to use it
fede@ChampionsLeague:~/Android/sdk/tools$ ./apktool my.apk dir
Exception in thread "main" java.io.FileNotFoundException: /home/federico/Android/sdk/platforms/android-2.1/android.jar
at brut.apktool.Main.getAndroidJarPath(Main.java:55)
at brut.apktool.Main.main(Main.java:34)
I can not use it, I qeusti errors, can you help?
Code:fede@ChampionsLeague:~/Android/sdk/tools$ ./apktool my.apk dir Exception in thread "main" java.io.FileNotFoundException: /home/federico/Android/sdk/platforms/android-2.1/android.jar at brut.apktool.Main.getAndroidJarPath(Main.java:55) at brut.apktool.Main.main(Main.java:34)
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: Could not build apk for dir: /home/anthony/Desktop/DeskClockD/.
at brut.androlib.Androlib.build(Androlib.java:65)
at brut.apktool.Main.main(Main.java:42)
Caused by: brut.androlib.AndrolibException: Could not build apk for dir: /home/anthony/Desktop/DeskClockD/.
at brut.androlib.ApkFile.build(ApkFile.java:135)
at brut.androlib.ApkFile.build(ApkFile.java:96)
at brut.androlib.Androlib.build(Androlib.java:60)
... 1 more
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, /home/anthony/Desktop/DeskClockD/build/tmp.apk, -I, /home/anthony/android-sdk-linux_86/platforms/android-2.1/android.jar, -M, /h
ome/anthony/Desktop/DeskClockD/./AndroidManifest.xml, -S, /home/anthony/Desktop/DeskClockD/./res]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:131)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:100)
at brut.androlib.ApkFile.build(ApkFile.java:103)
... 3 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, /home/anthony/Desktop/DeskClockD/build/tmp.apk, -I, /home/anthony/android-sdk-linux_86/platforms/android-2.1/android.jar, -M, /home/anthony/Desktop/DeskClockD/./
AndroidManifest.xml, -S, /home/anthony/Desktop/DeskClockD/./res]
at brut.util.OS.exec(OS.java:52)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:129)
... 5 more
I was trying to change the DeskClock.apk included in the latest CM, when I try to run apktool b after making my changes I get the following error
res/layout/alarm_alert.xml:6: error: Error: Resource is not public. (at 'src' with value '@android:drawable/call_contact').
It is one of the "weird" apps:
Code:res/layout/alarm_alert.xml:6: error: Error: Resource is not public. (at 'src' with value '@android:drawable/call_contact').
android.R.drawable.call_contact should not be accessible for apps, but it is somehow referenced from DeskClock.apk . I have even seen apps referencing to non existent resources :-/
I think Google and manufacturers have some private tools for building apps. We need to write our own aapt tool to support some of the system apps.
Some AOSP bits + my mods to not compile 4000 files for just a subset of features (Android sources are all-includes-all type) + JNI interface. I will upload it here in a while.
And is there a possibility to create something like this for windows users (sometime in future ofcourse).
root@ubuntu:/storage/Downloads/apktool-0.9.1# ./apktool
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at brut.apktool.Main.main(Main.java:32)
Running apktool-0.9.1 on Ubuntu I am getting the following error message:
Code:root@ubuntu:/storage/Downloads/apktool-0.9.1# ./apktool Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at brut.apktool.Main.main(Main.java:32)
Running apktool-0.9.1 on Ubuntu I am getting the following error message:
Code:root@ubuntu:/storage/Downloads/apktool-0.9.1# ./apktool Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at brut.apktool.Main.main(Main.java:32)
You have to supply command line arguments (though that exception should probably be caught and usage text displayed.)
ALSO, OFF-TOPIC: Why are you logged in as root on an Ubuntu machine? Especially if you're trying to run apktool, which has no privilege escalation requirement?
@seaweeduk
I've modified android.jar file to make these resources public and now I am able to rebuilt working DeskClock.apk If you don't want to replace file in SDK, you may just create new dir with ./platforms/android-2.1/android.jar in it. I'm also attaching newer apktool, which you will probably need to build that app.
Brut.all said:It is a tool for reengineering 3rd party, closed, binary Android apps. It can decode resources to nearly original form and rebuild them after making some modifications; it makes possible to debug smali code step by step. Also it makes working with app easier because of project-like files structure and automation of some repetitive tasks like building apk, etc.
It is NOT intended for piracy and other non-legal uses. It could be used for localizing, adding some features or support for custom platforms and other GOOD purposes. Just try to be fair with authors of an app, that you use and probably like.
Features:
- decoding resources to nearly original form
- smali debugging: SmaliDebugging
- helping with some repetitive tasks