Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,784,939 Members 50,735 Now Online
XDA Developers Android and Mobile Development Forum

[COMPLETE GUIDE] decompiling, theming, and recompiling JB SystemUI.apk [Jelly Bean]

Tip us?
 
powerpoint45
Old
(Last edited by powerpoint45; 19th March 2013 at 07:37 PM.)
#1  
powerpoint45's Avatar
Senior Member - OP
Thanks Meter 1,889
Posts: 2,048
Join Date: Jan 2012
Location: Dallas

 
DONATE TO ME
Default [COMPLETE GUIDE] decompiling, theming, and recompiling JB SystemUI.apk [Jelly Bean]

If you are not having problems compiling SystemUI.apk with no problems then this is not for you

WARNING:
You should not attempt to do this on a device that does not have a recovery, because if something goes wrong you may have to reinstall your rom (not very likely though). You should probably back up SystemUI.apk You should also have some experience modding and some experience using Apktool and Linux.

INTRO:
If your having problems modding SystemUI.apk on JB then this thread is just for you. I recently found out how to mod the Jelly Bean SystemUI. Jelly Bean has made it very difficult to mod. Yes it is still easy to replace images, but if you want to do some major changes to the UI such as a 100 percent battery mod or changing the status bar color then you will need to know exactly how to do it. For example, if you get the UI decompiled without errors and you recompile it without errors YOUR RECOMPILED SystemUI.apk WILL NOT WORK and your status bar will disappear etc... There is a special way to get everything working and I will show you how.

STEP 1:
LINUX>>
Before we start I recommend that you have File Roller: one of the most popular archive managers for Linux (Ubuntu comes with it). If your distribution uses a Debian package manager (most popular ones do) then all you have to do is go into the terminal and type:
Code:
sudo apt-get install file-roller
Now you will have File Roller. You also will need java installed. Check if you have java by typing:
Code:
java
in the terminal. If you dont have java and your using a Debian package manager then type:
Code:
sudo apt-get install openjdk-6-jre
or download from the java website and install it.
WINDOWS>>
Before we start, you will need 7zip and java. Just search and you will find the programs to install

STEP 2:
Now we will install APKTOOL. You may already have it installed BUT your version will probably not work. I have ran around the internet for a modified apktool that wont give you errors (If you follow my directions). I came across a great thread. check it out and download all the tools their (dont forget aapt) http://forum.xda-developers.com/show....php?t=1755243. If you are in Linux rename the jar file to apktool.jar and move the the jar plus aapt to /usr/local/bin. You will need root. If you are in Windows rename the jar to apktool.jar and move it and aapt to your WINDOWS directory. You also need zipalign http://powerpoint45.webs.com/android/zipalign(<Linux)( zipalign for windows:- ZIPALIGN )move it to your WINDOWS dir/bin dir. You need one more thing. It is from the apktool websitehttp://code.google.com/p/android-apktool/. According to your os download either apktool-install-linux-r04-brut1.tar.bz2 or apktool-install-windows-r04-brut1.tar.bz2. Extract the contents. You only need one file from the archive. In linux move apktool (not apktool.jar) to /usr/local/bin. In Windows move apktool.bat to your WINDOWS directory. Dont jump ahead and say "Now that I got apktool set up, I know what to do", because it gets a lot more difficult than you are used to using apktool.

STEP 3:
Now that you have apktool set up, you need to know how to mod SystemUI.apk. Get SystemUI.apk from /system/app within your device onto the computer. Now make a backup of SystemUI.apk on your computer because we will NEED it later. So you need two SystemUI.apk files on your computer. You could name one “backup” if you'd like. So now now we need to decompile the apk. Go into the terminal/cmd and cd/chdir into the directory you have SystemUI.apk. Now type
Code:
apktool if SystemUI.apk
It will then install frameworkneeded.Then type:
Code:
apktool d SystemUI.apk
It will decompile the apk. It will take a bit of time for it to fully decompile. The decompiled code will be in a folder in your current directory called SystemUI. If It had errors decompiling, (IT WILL FOR MOST NEXTUS 7 ROMS) you will need to install framework manually. Download framework here:http://db.tt/Rpc6zskQ and place the two APK files into apktool framework folder (replace the old framework files). In Linux it is located at /home/yourusername/apktool/framework and in windows it is something like C:\\Documents And Settings\yourusername\apktool\framework. After that delete the SystemUI folder that was made by the bad decompiling proccess and repeat the decompile command.


STEP 4:
This is the part where you start modding. You can make many customizations to the UI this way as you probably know. I will just show you how to make a 100 percent battery mod. You need to go into the decompile folder (SystemUI) using a file manager, Then from SystemUI, go delete res/drawable/stat_sys_battery.xml and replace it with http://powerpoint45.webs.com/android...ys_battery.xml (to download that file right click on link and click something like "save link as"). Now you need to move to a new directory: /res. In that folder you need to look through all the directories that start with the word drawable. For example drawable-mdpi. There is one directory that your device uses for images but you may not know which one. Your device might be MDPI but use drawable-sw600dp from the UI instead of drawable-mdpi. So if you dont know or you want to be safe then search through the drawable folders and if their are any battery icons then remember you will need to add 100 battery icons to each one of the folders with battery icons. The battery icons are the ones named something like stat_sys_battery_0.png. So if you need to add 100 icons they need to be named in numerical order from stat_sys_battery_0.png to stat_sys_battery_100.png. Dont worry though, you wont need to rename 100 icons. Their ar many battery mods online that you can get them from, but I have some images you can download: http://powerpoint45.webs.com/android...RY_BLUE.tar.gz. Download it, extract it and copy all the images into all the drawable folders that contain battery icons. Now your ready for compiling; The step that is different than how we have always done it before Jelly Bean existed. keep in mind that some images can not be changed or edited at all durring this step because it will result with many errors durring compiling. You would have to add images to the archive after its compiled

STEP 5:
Like I said at the end of step 4, this step will be different than you have seen before. This is also the step where you will be using File Roller/7zip. To build the apk make sure you are in the terminal in the directory where SystemUI exists and type:
Code:
apktool b SystemUI almostdone.apk
almostdone.apk is the output file. Once it is done building you need to open the backup apk you made at the beginning with File Roller /7zip. Also open almostdone.apk with File Roller/7zip. From inside the backup.apk drag meta-inf folder & androidmanifest.xml to allmostdone.apk. Now all you need to do is zipalign the apk. Lets say your backup apk is named backup.apk. Go into the terminal at the directory you are working
in and type
Code:
zipalign -v 4 allmostdone.apk done.apk
This will optimize the apk. The output is done.apk.

STEP6:
Now you install the apk. Their are many meathods of installing the apk, here are a couple. Transfer done.apk to your device and rename it to SystemUI.apk. Now use a root browser or terminal app to replace the other SystemUI.apk on your system at /system/app. And make sure you give it the same permissions as all the other apk's in the system/app directory. Then reboot. Or you could make a flashable zip to install it.


Donate by buying my launcher: Lucid Launcher Pro
The system wants you dead; be cautious!
The Following 113 Users Say Thank You to powerpoint45 For This Useful Post: [ Click to Expand ]
 
powerpoint45
Old
(Last edited by powerpoint45; 5th August 2012 at 04:09 AM.)
#2  
powerpoint45's Avatar
Senior Member - OP
Thanks Meter 1,889
Posts: 2,048
Join Date: Jan 2012
Location: Dallas

 
DONATE TO ME
Here is something I did:


Donate by buying my launcher: Lucid Launcher Pro
The system wants you dead; be cautious!
The Following 18 Users Say Thank You to powerpoint45 For This Useful Post: [ Click to Expand ]
 
Mr.Mefisto
Old
#3  
Mr.Mefisto's Avatar
Recognized Contributor
Thanks Meter 3,053
Posts: 683
Join Date: Jan 2012
Location: rskmania

 
DONATE TO ME
Nice guide OP! Thanks!
The Following 2 Users Say Thank You to Mr.Mefisto For This Useful Post: [ Click to Expand ]
 
Gohan
Old
(Last edited by Gohan; 22nd January 2013 at 06:27 AM.)
#4  
Gohan's Avatar
Senior Member
Thanks Meter 959
Posts: 9,982
Join Date: May 2012
Location: Nowhere
How long until somebody realizes I edited this? (1/22)
The Following User Says Thank You to Gohan For This Useful Post: [ Click to Expand ]
 
powerpoint45
Old
#5  
powerpoint45's Avatar
Senior Member - OP
Thanks Meter 1,889
Posts: 2,048
Join Date: Jan 2012
Location: Dallas

 
DONATE TO ME
Quote:
Originally Posted by Josepho1997 View Post
Thanks. Even though I've known this for weeks because of you(thanks for helping me, btw). Just one thing. Why is it
Code:
 sudo apt-get install openjdk-6-jre
Instead of
Code:
 sudo apt-get install openjdk-7-jre
Just because a lot of distros including debian do not have jdk7 in their repository. But if its in your repository you can get jdk 7

Sent from my Amazon Kindle Fire using xda app-developers app


Donate by buying my launcher: Lucid Launcher Pro
The system wants you dead; be cautious!
The Following User Says Thank You to powerpoint45 For This Useful Post: [ Click to Expand ]
 
Gohan
Old
#6  
Gohan's Avatar
Senior Member
Thanks Meter 959
Posts: 9,982
Join Date: May 2012
Location: Nowhere
Quote:
Originally Posted by powerpoint45 View Post
Just because a lot of distros including debian do not have jdk7 in their repository. But if its in your repository you can get jdk 7

Sent from my Amazon Kindle Fire using xda app-developers app
ok.
 
midi_1996
Old
#7  
midi_1996's Avatar
Senior Member
Thanks Meter 37
Posts: 190
Join Date: Aug 2011
Location: Rabat
Thanks. Will try it.
My GOD! I lost all my Android Phones :'( Need A New One

Sorry for my bad English, Help me if you want to improve my grammar.
 
powerpoint45
Old
#8  
powerpoint45's Avatar
Senior Member - OP
Thanks Meter 1,889
Posts: 2,048
Join Date: Jan 2012
Location: Dallas

 
DONATE TO ME
Quote:
Originally Posted by midi_1996 View Post
Thanks. Will try it.
Cool, tell me how it goes

Sent from my Amazon Kindle Fire using xda app-developers app


Donate by buying my launcher: Lucid Launcher Pro
The system wants you dead; be cautious!
 
powerpoint45
Old
#9  
powerpoint45's Avatar
Senior Member - OP
Thanks Meter 1,889
Posts: 2,048
Join Date: Jan 2012
Location: Dallas

 
DONATE TO ME
Updated op to work with nextus 7 roms

Sent from my Amazon Kindle Fire using xda app-developers app


Donate by buying my launcher: Lucid Launcher Pro
The system wants you dead; be cautious!
 
fishingfon
Old
#10  
fishingfon's Avatar
Senior Member
Thanks Meter 253
Posts: 712
Join Date: Feb 2012
Location: Brisbane, QLD, Australia
Hi,
I tried doing exactly as you said, but when I copy the apk to system/app, the the is no jelly bean icon as on the stock systemui.apk, and my system ui crashed.
I followed your guide exactly.
Can someone please tell me what I have done wrong.
I was making a circle battery mod for the first n7.

I will upload the apk I made in a second when I go on my pc.

Thanks in advance


Cheers
Corey

Sent from my Nexus 7 using xda premium
My Current Devices:
Galaxy Note II N7100
HTC 8x Windows Phone 8
Samsung Galaxy S2 I9100
Nexus 7



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes