[Samsung Galaxy Nexus] Jarmezrocks:
Here you go fellas, I saw this thread ages ago and only just stumbled across it again now. I have been using the apktool for a while now along with dsixda's kitchen as an extra add in.

Basically you will need to use the combination of tools attached in the zips.

Install the new aapt.exe in the windows directory (it comes from SDK16) and that will enable across all environment variables.

Then use the batch script called apktool to run install of framework

apktool if framework-res.apk

Once you have done that you can decompile any of the system apps with either apktool1

apktool2

or

apktool3

eg:

(and this IS only an example...I am not 100% sure what combination I DID use at the time?)

apktool1 d -f Mms.apk

then to rebuild

apktool2 b -f Mms

Use your ^ arrow or v arrow to shuffle through repeated scripts. like for example above if I didn't get a clean build I will push ^ and then try

apktool1 b -f Mms

Note: always call the -f force variable as it will induce the apktool to overwrite what is written to the directory and will not interferr with the next succession of build attempt.

if it fails again....then ^ and change 1 for the remaining number which is 3 like.. so

apktool3 b -f Mms

There is no consistency between ICS apps on the rebuild but almost all apps decompile with apktool3 in my scripts. In some instances widgets need to decompile with another one when you get a magic numbers errors, but essentially all will work with a combination of 1,2 or 3

There are 2 others in there also and they are for decompiling and recompiling the framework-res and SystemUI that people have had issues with.

it will be apktook-d-frame.bat

where "-d-" stands for Decompile

and obviously...

"-r-" stands for Recompile ;)

All of these will work from the same directory. as in no getting confused wich jar you renamed to what cause they all look the same when you rename them to apktool.jar LOL (I kept the version number suffix appended for a reason haha) - You don't want to be checking MD5 # against on the website at midnight now do you? :p

And a working example so no one is confused

cd\apktool

now at C:\apktool\

At the start I would always do this:

tip

dir *.bat for my listings

use ^ to scroll up and check for reverence

now...where was I? oh yes example....here you go

apktool if framework-res.apk

(installs)

apktool-d-frame d -f framework-res.apk

go into windows explorer and fiddle round a bit throw a few pngs here and there and everywhere, make a big mess of a theme :p.....AND

apktool-r-frame b -f framework-res

and it will rebuild perfect as!

Now we want the to reuse the META-INF from the original apks unless you want to resign, but the rule of thumb is never resign the system apps unless you want to resign all system apps with the same signature. It is much easier to open "apkoriginal" in 7zip and then open "apkthemed" in the other zip (hint this is located inside the <dist> folder in the apk folder tree from the apk you just broke down) and then drag META-INF from orig over to new.

Push with adb back to phone, or in my case I really like to see a visual of what I am doing (that and I can see an update on apk size attributes on the fly) using Android Commander or Droid Explorer (either are great tools) you can reset the permissions on the file and reboot from the interface using either of these two tools.

Pros and Cons

Pro

Droid Explorer looks more pollished and fancier.

Droid Explorer has a much better representation of symlinks in system

Con

Droid Explorer sometimes does not get root permissions even though it claims that it has? Doing the visual check on the file attributes (i.e. file size) and you will see that the push of the apk file did not happen?

Droid Explorer does not have a good gui for file permissions compared to commander.

Pro

Android Commander will usually almost everytime push the file that you want where you want it every time.

Android Commander has a great gui for permissions (makes up for where it suffers everywhere else compared to droid explorer

Con

Android Commander is hard to tell what is symlinked and what isn't visually...I have looked a systemdump just to be certain sometimes lol

Android Commander sometimes just will not initiate what so ever...it will sit pending and pending and pending and it will **** you to tears....I have no idea what is worse? A windows app like Android Commander not executing or a windows app like Droid Explorer executing and lying about what it did? haha:D

Lastly to note. Neither of these apps perform complete system locks so when you pull and push apps do not remote the app if it is a system app i.e. delete it. even if you have it pulled to your desktop ready to theme...when you are at max capacity on your system partition. You will quickly learn that apps are greedy and take up space when they are allowed to breath (like a fat chick lycra that **** is not getting back in there!) what happens is you go to push your app back and all of a sudden WTF? There is no room? How can that be?.....hmmmm ok I will remove a couple more apps seeming I think framework-res.apk is of somewhat higher priority compared to say calculator n ****......oops well 3 or 4 apps later I decided to do a system restore and flash my new framework from recovery instead :p

So hopefully this gives a comprehensive run down on what you need to do and can or cant do. Good luck. Hit thanks if this has helped....it took me a lil while to pull together for you all.

James