Android OS Forum banner
1 - 20 of 122 Posts

·
Registered
Joined
·
1,298 Posts
Hey guys,This is a small tut for all of you askng for itFirst off you will need to have apktool setup and working for decompiling ICS apks.Another tool you will want and will make life a lot easier is notepad++Im not going to go into detail about how to do that, there are plenty forums and thread the cover that.Once you get everything set follow these steps and you will be on your way to making what every you want .Because there are already so many different roms out there u already probably know what you cannot take a systemui.apk from say DroidTh3orys rom and install it on a stock 4.0.2 base. This is for a few reasons, first the systemui and the framework-res kinda go hand and hand, So say that droidtheory has notification toggles, and u flash a stock systemui that u added a search softkey, you will likely have a systemui force close on boot, the two apks depend on each other to work properly. That said you MUST use the framework-res.apk from the rom you will be working on.So pull the framework-res.apk and the systemui.apk from the rom you are wanting to modify and place them in your folder you have setup for apktoolType apktool if framework-res.apkThis will install the framework and nextApktool d SystemUI.apkAnd this will decompile the systemuiOnce that is done it is a good idea to rebuild right away without changing anything to confirm that your apktool is working, you would rather know now that it is not working than after you edit stuff and have fail errors and send you on a ghost chase looking for bugs when it never worked in the first place.After we know that your apktool setup is working here are some places to start playing withThe common is the icons, changing icons is easy, do what u want with them, just keep in mind a few things.
  • Pngs have to be over a transparent backround
  • Do not change the size of the png, the portrait are 96x160 and 160x96 for landscape
After than comes the fun stuffFor adding buttons, there a few things that need to be added,Starting at /res/layout/navigation_bar.xmlHere is where you would add another icon to the nav bar. This is where u want to use notepad++If you read the line a few times it will start to make sense. From top to bottom on the first layout is left to right in portrait mode, then followed by the "lights out" , then landscape icons and their order, and again the "lights out"Keep in mind if you add another icon u will want to add another lights out dot so that when the softkeys time out you will have four dots for your four keys. Follow this process for both portrait and landscape.Il give an example for adding the search key seeing as how this is the most popularIn the navigation_bar.xml you will want to add this to start, add in both port and similar one to port only change the @ drawable/ic_sysbar_search to ic_sysbar_search_landThis will add the button to the bar, it's a good idea to add the invisible 0dip in between to get the spacing right if you are only going to have a total of four keys, because keep in mind there needs to be room for the menu to show up when an app calls for it.Next you need to add the values for the key u just added,So jump over the res/values and find the followingIn ids.xml you need to add the search id:falseIn the strings we need to add the @strings/accessibility_search that we added in the navigation_bar.xml:SearchNow here is where it gets trickyWe need to public also, but by adding to public we need to tell it where to get the smali info from, so we need to do a few things now, first add the public code so jump to /res/value/public.xmlAnd add :Now the "0x7f0e0095" this is where it will be identified in the nav in the smali.So we need to add a .method in the correct smaliSo jump over to SystemUIsmalicomandroidsystemuistatusbarphone.NavigationBarView.smaliAnd add the .method public as follows, but one warning, you need to make sure that the number we are adding is not already taken, a simple search of the file will verify it does not already exist, if nothing pulls up add this:.method public getSearchButton()Landroid/view/View; .locals 2 .prologue .line 73 iget-object v0, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mCurrentView:Landroid/view/View; const v1, 0x7f0e0095 invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View; move-result-object v0 return-object v0.end methodLast thing to do would be to create you actual icon for your search, remember you need two one port and one land and name ic_sysbar_search_land and ic_sysbar_search and these go in the drawable-xhdpi folder and your good to goNow, you are all done, you have just added a search key to your systemui.apk

and dont forget to check out my original thread here for over 55 different mods just for Axi0m plus links in op for 4.0.2 and 4.0.3 base roms too
http://rootzwiki.com/topic/12333-mod-axi0m-21-softkey-1-mods-55-and-counting/page__pid__337823__st__870#entry337823
 

·
Registered
Joined
·
4 Posts
I think it would be awesome to have a softkey set for the dialer. basically dedicated for phone calls. is this possible?

Sent from my Galaxy Nexus using Tapatalk
 

·
Registered
Joined
·
1,298 Posts
Discussion Starter · #6 ·
I think it would be awesome to have a softkey set for the dialer. basically dedicated for phone calls. is this possible?

With enough research any thing is possible...

Sent from my Galaxy Nexus using Tapatalk
Sent from my Galaxy Nexus using Tapatalk
 

·
Android Beginner
Joined
·
86 Posts
OK, I tried doing this, but I'm still running into a problem. When I copy the SystemUI.apk back into /system/app and reboot the phone, the navbar at the bottom completely disappears, and the wallpaper goes black. Just to make sure that I wasn't screwing something up, I decompiled SystemUI.apk, then immediately recompiled it without making any changes, and pushed it back to the phone. But I lost the navbar anyway, so it looks like something isn't comiling/decompiling properly. I'm using P3Droid's Tanquil Ice v5.1, and here is what I did to decompile / recompile:

1. Pull framework-res.apk from the phone
2. run "apktool if framework-res.apk"
3. run "apktool d SystemUI.apk"
4. after it decompiles, run "apktool b"
5. then push SystemUI.apk back to /system/app
6. chmod 644 /system/app/SystemUI.apk

And then I reboot the phone, but the navbar disappears. Am I doing something wrong?
 

·
Registered
Joined
·
1,298 Posts
dont push it back,
starting and stoppping systemui.apk while the phone is running will cause it to fc
u need to put it in a flashable zip

edit: also if you are not resigning the apk pushing it will not work either,
 

·
Android Beginner
Joined
·
86 Posts
dont push it back,
starting and stoppping systemui.apk while the phone is running will cause it to fc
u need to put it in a flashable zip

edit: also if you are not resigning the apk pushing it will not work either,
I was definitely not re-signing it, but I was pushing it in recovery mode, not normal mode, so that shouldn't have been a problem. To re-sign it, what signature should I use? Shouldn't it be the same as the rest of the ROM? And in that case how can I get that signature? Or can I just use testsign.jar?
 

·
Registered
Joined
·
1,298 Posts
Discussion Starter · #11 ·
I was definitely not re-signing it, but I was pushing it in recovery mode, not normal mode, so that shouldn't have been a problem. To re-sign it, what signature should I use? Shouldn't it be the same as the rest of the ROM? And in that case how can I get that signature? Or can I just use testsign.jar?
I honestly would just put it in a zip, and not worry about signing it
Sent from my Galaxy Nexus using Tapatalk
 

·
Premium Member
Joined
·
638 Posts
Nice tutorial but it is hard to read. Maybe you could reformat it to make it easier to read?
 

·
Android Beginner
Joined
·
86 Posts
I honestly would just put it in a zip, and not worry about signing it
Sent from my Galaxy Nexus using Tapatalk
I'll try putting in a zip, byt why would it matter? all the zip does is load it int /system/app while in recovery, so how would that be different from me just manually rebooting into recovery, mounting /System, and pushing the file there?
 

·
Registered
Joined
·
1,298 Posts
Discussion Starter · #14 ·
I'll try putting in a zip, byt why would it matter? all the zip does is load it int /system/app while in recovery, so how would that be different from me just manually rebooting into recovery, mounting /System, and pushing the file there?
I only say that because I had issues with doing that process with system apps in the past

Swyped from my GNEX
 

·
Android Lover
Joined
·
1,260 Posts
I'll try putting in a zip, byt why would it matter? all the zip does is load it int /system/app while in recovery, so how would that be different from me just manually rebooting into recovery, mounting /System, and pushing the file there?
Which one are you pushing? The one you just built? Uh uh. It doesn't have a signature (those files in the meta-inf folder). Therefore, it will not run. Just open the new one, pull out what you changed, overwrite those files in the original, and push that to your phone.

Make sense?
 

·
Registered
Joined
·
1,298 Posts
Which one are you pushing? The one you just built? Uh uh. It doesn't have a signature (those files in the meta-inf folder). Therefore, it will not run. Just open the new one, pull out what you changed, overwrite those files in the original, and push that to your phone.

Make sense?
you cant do that if you are wanting to edit the smalis

ive made a few hundreds of these, if you just put it in a zip and flash it if you made it right, ei not chaning anything that would cause it to fc it will work

after you apktool b
use win7 open archive delete the systemui out of this http://dl.dropbox.com/u/25886627/systemuis/zygot3_/zygot3__restore.zip
and drag and drop new systemui in this zip and flash away
 

·
Android Junkie
Joined
·
529 Posts
Great write up!

You can push the files over as well though

Code:
<br />
adb shell stop<br />
adb remount<br />
adb push SystemUI.apk /system/app/SystemUI,apk<br />
adb remount<br />
adb shell start<br />
** if the phone doesnt hot-reboot on its own<br />
adb reboot<br />
 
1 - 20 of 122 Posts
Top