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/showthread.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/stat_sys_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/BATTERY_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.
Here is something I did:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Nice guide OP! Thanks!
Josepho1997 said:
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
Click to expand...
Click to collapse
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
powerpoint45 said:
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
Click to expand...
Click to collapse
ok.
Thanks. Will try it.
midi_1996 said:
Thanks. Will try it.
Click to expand...
Click to collapse
Cool, tell me how it goes
Sent from my Amazon Kindle Fire using xda app-developers app
Updated op to work with nextus 7 roms
Sent from my Amazon Kindle Fire using xda app-developers app
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
fishingfon said:
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
Click to expand...
Click to collapse
here is the apk
fishingfon said:
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
Click to expand...
Click to collapse
Ok, did you change permissions of SystemUI.apk after you moved it to system/app. Also, sometimes it crashes due to a small misteak. Sometimes that happens to me, and when I completely redo it it works. Another thing, are you making a battery mod?
Sent from my Amazon Kindle Fire using xda app-developers app
powerpoint45 said:
Ok, did you change permissions of SystemUI.apk after you moved it to system/app. Also, sometimes it crashes due to a small misteak. Sometimes that happens to me, and when I completely redo it it works. Another thing, are you making a battery mod?
Sent from my Amazon Kindle Fire using xda app-developers app
Click to expand...
Click to collapse
Hi,
I had forgotten to reset the permissions.
The system ui now does not crash anymore.
But now I have a new problem.
The battery icons no longer appear in the status bar, the is no battery icon there at all now.
Do the icons have to be a certain resolution to work? If so, do u know what res the have to be?
I hav, attached a screen, as you can see, the icons no longer show.
Thanks again
Cheers
Corey
Sent from my Nexus 7 using xda premium
fishingfon said:
Hi,
I had forgotten to reset the permissions.
The system ui now does not crash anymore.
But now I have a new problem.
The battery icons no longer appear in the status bar, the is no battery icon there at all now.
Do the icons have to be a certain resolution to work? If so, do u know what res the have to be?
I hav, attached a screen, as you can see, the icons no longer show.
Thanks again
Cheers
Corey
Sent from my Nexus 7 using xda premium
Click to expand...
Click to collapse
Did u drag resources.arsc classes.dex and res/drawable/stat_sys_battery.xml to the origional apk after it compiled. No it doesnt realy need to be a certain resolution. Oh also did u zipalign
Sent from my Amazon Kindle Fire using xda app-developers app
powerpoint45 said:
Did u drag resources.arsc classes.dex and res/drawable/stat_sys_battery.xml to the origional apk after it compiled. No it doesnt realy need to be a certain resolution. Oh also did u zipalign
Sent from my Amazon Kindle Fire using xda app-developers app
Click to expand...
Click to collapse
Hi,
i managed to get it working.
i think you made a small mistake in your guide lol.
you said this:
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 resources.arsc and classes.dex to the root of almostdone.apk and it will replace resources.arsc that is in the apk. You are almost done. From inside almostdone.apk drag the res folder into the backup apk(file roller sometimes has problems moving a whole folder so make sure that the size is updated and the edited images are moved). 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
Where as it should have been:
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 almostdone.apk drag resources.arsc and classes.dex to the root of backup.apk and it will replace resources.arsc that is in the apk. You are almost done. From inside almostdone.apk drag the res folder into the backup apk(file roller sometimes has problems moving a whole folder so make sure that the size is updated and the edited images are moved). 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
Sorry for all my noobish qustions
Cheers
Corey
fishingfon said:
Hi,
i managed to get it working.
i think you made a small mistake in your guide lol.
you said this:
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 resources.arsc and classes.dex to the root of almostdone.apk and it will replace resources.arsc that is in the apk. You are almost done. From inside almostdone.apk drag the res folder into the backup apk(file roller sometimes has problems moving a whole folder so make sure that the size is updated and the edited images are moved). 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
Where as it should have been:
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 almostdone.apk drag resources.arsc and classes.dex to the root of backup.apk and it will replace resources.arsc that is in the apk. You are almost done. From inside almostdone.apk drag the res folder into the backup apk(file roller sometimes has problems moving a whole folder so make sure that the size is updated and the edited images are moved). 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
Sorry for all my noobish qustions
Cheers
Corey
Click to expand...
Click to collapse
Oh. God Thank you for pointing that out. Fixed op.Appreciate it. I just got mixed up wich is wich lol
Sent from my Amazon Kindle Fire using xda app-developers app
you do know you kinda have this backwards and to be fair rather confusing
i dont know why you mess around copying all classes&resources&res from your almostdone.apk
the way i used to do it when theming for the htc hero system apps was
do your mods
apktool b SystemUI almostdone.apk
then open your SystemUIbackup.apk & copy the meta-inf folder & androidmanifest.xml
inject them into your almostdone.apk
zipalign -v 4 almostdone.apk SystemUI.apk
adb remount
adb push SystemUI.apk /system/app/
adb reboot
has always worked for me
seems miles easier than copying the hundreds of files in all the other folders
bagofcrap24 said:
you do know you kinda have this backwards and to be fair rather confusing
i dont know why you mess around copying all classes&resources&res from your almostdone.apk
the way i used to do it when theming for the htc hero system apps was
do your mods
apktool b SystemUI almostdone.apk
then open your SystemUIbackup.apk & copy the meta-inf folder & androidmanifest.xml
inject them into your almostdone.apk
zipalign -v 4 almostdone.apk SystemUI.apk
adb remount
adb push SystemUI.apk /system/app/
adb reboot
has always worked for me
seems miles easier than copying the hundreds of files in all the other folders
Click to expand...
Click to collapse
I'll look into it once im back from vacation.That will probably work and make it less confusing
Sent from my Galaxy Nexus using xda app-developers app
powerpoint45 said:
I'll look into it once im back from vacation.That will probably work and make it less confusing
Sent from my Galaxy Nexus using xda app-developers app
Click to expand...
Click to collapse
The link for framework is broken. Any new link?
vaibhav palande said:
The link for framework is broken. Any new link?
Click to expand...
Click to collapse
Ok thanks. Ill fix it. Here is a link. http://db.tt/Rpc6zskQ
Sent from my Galaxy Nexus using xda app-developers app
I am getting error while recompiling theme chooser theme.. Here is the log:
PHP:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
c:\4nec2>apktool b 12345 done.apk
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
c:\4nec2\12345\res\values\styles.xml:98: error: Error retrieving parent for item
: No resource found that matches the given name '@android:style/TextAppearance.S
tatusBar'.
c:\4nec2\12345\res\values\styles.xml:99: error: Error retrieving parent for item
: No resource found that matches the given name '@android:style/TextAppearance.S
tatusBar'.
c:\4nec2\12345\res\values\styles.xml:119: error: Error retrieving parent for ite
m: No resource found that matches the given name '@android:style/TextAppearance.
StatusBar.Ticker'.
c:\4nec2\12345\res\values\styles.xml:123: error: Error retrieving parent for ite
m: No resource found that matches the given name '@android:style/TextAppearance.
StatusBar'.
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\Vaibhav\AppData\Local\Temp
\APKTOOL7356544712132047658.tmp, -x, -I, C:\Users\Vaibhav\apktool\framework\1.ap
k, -S, c:\4nec2\12345\res, -M, c:\4nec2\12345\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:251)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:325)
at brut.androlib.Androlib.buildResources(Androlib.java:270)
at brut.androlib.Androlib.build(Androlib.java:193)
at brut.androlib.Androlib.build(Androlib.java:175)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\Vaibhav\AppData\Local\Temp\APKTOOL7356544712132047658.tmp, -x, -I, C:\Users
\Vaibhav\apktool\framework\1.apk, -S, c:\4nec2\12345\res, -M, c:\4nec2\12345\And
roidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:249)
... 6 more
c:\4nec2>
While decompiling it worked perfectly but recompiling got stuck. Any solution?
---------- Post added at 11:53 PM ---------- Previous post was at 11:38 PM ----------
EDIT: IT WORKED WITH NEW FRAMEWORK FILES. THANX FOR THE NEW LINK:good::good::good:
Related
Ok this is a quick little guide. Decided not to put this in the notification text thread as that needs to be cleaned up anyway.
This is for modifying .xml's in say /values or wherever you want. This particular example is going to use /values/styles.xml
First up, decode your framework using apktool
** Make a backup! **
Code:
: adb pull /system/framework/framework-res.apk /sdcard/mytheme/backup.apk
: adb pull /system/framework/framework-res.apk C:\themes\mytheme.apk
: apktool d -f C:\themes\mytheme.apk C:\themes\mytheme\decoded\
Then open up the /res/values/styles.xml.
Find "<style name="Widget.Button" parent="@style/Widget">
Change the textcolor to #FFFF0000
This will make all buttons have a RED text color.
Click to expand...
Click to collapse
Now re-encode the file
Code:
:apktool b C:\themes\mytheme\decoded C:\themes\mytheme\encoded\mytheme-new.apk
Now, the simplest thing to do is to do the following:
- Open the original C:\themes\mytheme.apk with 7-zip
- Drag and drop the META-INF and AndroidManifest.xml File into a folder, like C:\themes\mytheme\signed
* Now you have a copy you can always use, and skip the above steps after doing it once *
- Open the new encoded mytheme-new.apk with 7-zip
- Drag and drop the META-INF and AndroidManifest.xml from the \signed directory
Click to expand...
Click to collapse
Code:
: adb push C:\themes\mytheme\encoded\mytheme-new.apk /sdcard/mytheme/framework-res.apk
: adb remount (if available for you!)
: adb shell
**Only if remount doesn't work.**
: mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
: cp /sdcard/mytheme/framework-res.apk /system/framework/framework-res.apk
**Wait for the theme to apply, no need to reboot**
**If you Bootloop and stay in shell (which you should if you don't reboot)**
Click to expand...
Click to collapse
Code:
: cp /sdcard/mytheme/backup.apk /system/framework/framework-res.apk
**After this the bootloops should stop as your last stable framework is loaded**
Click to expand...
Click to collapse
That's it!
Questions? Comments? Leave em!
So, for instance, in the Vanilla Froyo theme for 2.1, where all of the text elements that should be a dark grey or black are white, this would allow me to change them?
Yep. Just a matter of figuring out which style controls what...that's next on my list to document lol. It's a LOT easier than trying to Hex Edit everything.
I'm really surprised this thread isn't exploding with questions, but I have to say great work, man!
I'm gonna wait it out until I know my way around the SDK a little more, but I really wanna dig through this and finish the Vanilla theme I'm using.
Thanks! I should make one big guide get it stickied and be fine with it lol. You can check out my vanilla theme fire an idea of what I've done.
Sent from my DROIDX using XDA App
Great tutorial man. I especially appreciate the part about not having to reboot. I wonder why everyone always says to do that for installing themes.
If you use apkmanager (which is a frontend for apktool) -- it automates some of the steps mentioned here. Its in the G1 development section as well as apktool.
Not work...
Very sad
After complete all steps, device not boot after LG lable longer.
Any ideas?
log cmd in process:
Code:
D:\Android\SDKTools\tools>apktool d -f C:\themes\mytheme.apk C:\themes\mytheme\decoded\
I: Loading resource table...
I: Decoding resources...
I: Copying assets and libs...
D:\Android\SDKTools\tools>apktool b C:\themes\mytheme\decoded C:\themes\mytheme\encoded\mytheme-new.apk
[B][COLOR="Red"]W: Could not find sources[/COLOR][/B]
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
phimuskapsi said:
Thanks! I should make one big guide get it stickied and be fine with it lol. You can check out my vanilla theme fire an idea of what I've done.
Sent from my DROIDX using XDA App
Click to expand...
Click to collapse
Phim, you're the best! I have been searching for a simple guide like this, as I found one a while ago when theming, but lost the link. Thanks for all your contributions on here, they are greatly appreciated! If I have some questions on editing some xml files, can I shoot you a PM or two?
Sent from my DROIDX using XDA App
I am trying to edit the color of the text in the drop down notification bar for the text such as USB Connection.
Can someone please tell me which xml file and which portion needs to be edited?
The font color would most likely be in the styles.xml file (in the values folder). I don't know which line exactly but you can take too different color versions and compare the decompiled xml files with word or online and look for differences.
yawdapaah said:
The font color would most likely be in the styles.xml file (in the values folder). I don't know which line exactly but you can take too different color versions and compare the decompiled xml files with word or online and look for differences.
Click to expand...
Click to collapse
Yae, thanks for the info. I found it shortly after posting through trial and error. I think it was in one of the status_bar_latest*.xml
For some reason when I made the esit and recompiled my famework-res.apk I lost adb capabilities and usb-mode and had to revert to a nandroid.
Any ideas on what may have caused this? Only edited an xml file...
Sent from my DROIDX using XDA App
.apk on desktop (adp pull C: [??])
phimuskapsi said:
Ok this is a quick little guide. Decided not to put this in the notification text thread as that needs to be cleaned up anyway.
This is for modifying .xml's in say /values or wherever you want. This particular example is going to use /values/styles.xml
First up, decode your framework using apktool
** Make a backup! **
Code:
: adb pull /system/framework/framework-res.apk /sdcard/mytheme/backup.apk
: adb pull /system/framework/framework-res.apk C:\themes\mytheme.apk
: apktool d -f C:\themes\mytheme.apk C:\themes\mytheme\decoded\
Click to expand...
Click to collapse
Hi there, newbie here (but I've managed to decode all the java and xml, which is fully readable). Only thing I have left is this pesky "resources.arsc" file. I tried using both the xml way and java way, but neither worked, that's when I found your posting. Thanks so much for sharing btw!!
I haven't tried this yet because I'm confused about why you did not put a "C:" in the beginning of the file address to route the command to the folder on your sdcard which contains your .apk.
My .apk will be on my desktop, so, how should my command line look???
Thanks again, hope to here from you.
Ok, I managed to decode everything except resources.arsc. I imported package successfully into eclipse but I have errors. I looked through all XML, which is in English and good, except for the resources.arsc, which is not decoding by methods I'm familiar with. Your method will probably work but I need command prompt spelled out for me (sorry about that).
So, resources.arsc is located: desktop/space/resources.arsc. I'll play around with it an see what happens...
With the number of ICS ROMs that are popping out, I imagine the majority of people are spending their time on ICS rather than Gingerbread or Froyo. With that in mind, here's a little guide on how to decompile ICS .apk and .jar files (such as the troublesome SystemUI.apk) with ease so that you can mod them to your heart's content. I assume this method will work for other versions of Android as well. Just so we understand each other, this just helps you decompile the classes.dex. If you want to decompile an entire app or jar file there are other guides for that.
NOTE: We will NOT be using ApkTool, Apk Manager, or StudioAndroid to do this. Mainly because I have had trouble in the past using those applications to decompile certain files. So, here is an ALL MANUAL way.
What you need:
Deodexed .apk/.jar file
smali.jar
baksmali.jar
7zip or Betterzip (whether you are on Mac, Linux, or Windows)
terminal/cmd (depending on what you're running)
You can get the smali.jar and baksmali.jar files from here: http://code.google.com/p/smali/downloads/list
Download these files:
Code:
baksmali-1.3.3.jar
smali-1.3.3.jar
and rename them to:
Code:
baksmali.jar
smali.jar
Now that you have both files, place them somewhere you'll remember (like a folder on your Desktop). For the purposes of this guide, my files will be in .../Desktop/ICS
Ready? Okay, here we go.
Open up your desired ICS .apk or .jar file with 7zip or Betterzip and extract the classes.dex and move it into the directory where you have baksmali.jar and smali.jar (For example, I move the classes.dex file to .../Desktop/ICS)
Open up terminal or cmd
cd to your directory
Example:
Code:
cd .../Desktop/ICS
Type the following:
Code:
java -jar baksmali.jar -o classout/ classes.dex
This will decompile the classes.dex file and create a folder inside .../Desktop/ICS called classout where all of your smali files will be located.
Go into the classout folder and make your smali edits
Compile your classout folder into new-classes.dex by typing this into terminal:
Code:
java -Xmx512M -jar smali.jar classout/ -o new-classes.dex
Rename new-classes.dex to classes.dex
Take your newly compiled classes.dex and put it into your ICS .apk or .jar using 7zip or Betterzip
Profit
Have fun :highfive:
Nice to have a write up on this in the Inc forums instead of having to hunt it down all the time. I've found it best to use smali and baksmali too, the apk aps were just too flaky for me.
kzoodroid said:
Nice to have a write up on this in the Inc forums instead of having to hunt it down all the time. I've found it best to use smali and baksmali too, the apk aps were just too flaky for me.
Click to expand...
Click to collapse
Yeah I've had similar experiences as well. This method was the only one that worked flawlessly for me. Hopefully it works for you and everyone else who needs to modify ICS files.
I've used it in GB to do some of the modifications to the status bar, like hide the clock. Took the better part of a day googling to actually find a write up on how to use baksmali and smali as I couldn't get apkTool or apkManager to decompile or compile classes.dex properly. Now I know where to find the instructions when I need them again.
thank you for this nice write up. It did really help me
Man you are just awesome for posting this, I have been googling how to decompile and recompile .apk's and .jar's for a couple of days and nothing has worked. This worked great the first time around and was very simple to follow. I just hope that once I am done making my editsI do not have any troubles re compiling the .jar I am working with lol.
You know it is so ironic that I found your guide here on XDA. It seems like everytime i want to learn how to do something like this I can google all day without much success on finding something that works. But when I do find something that works around 90% to 95% of the time it is here on XDA. You have got to love XDA...
T-Macgnolia said:
Man you are just awesome for posting this, I have been googling how to decompile and recompile .apk's and .jar's for a couple of days and nothing has worked. This worked great the first time around and was very simple to follow. I just hope that once I am done making my editsI do not have any troubles re compiling the .jar I am working with lol.
You know it is so ironic that I found your guide here on XDA. It seems like everytime i want to learn how to do something like this I can google all day without much success on finding something that works. But when I do find something that works around 90% to 95% of the time it is here on XDA. You have got to love XDA...
Click to expand...
Click to collapse
Yeah XDA does seem to be the go-to place for everything lol. Glad to know it worked for you
Note that you still need apktool in order to decompile/recompile XMLs and PNGs in apk files.
kong said:
Note that you still need apktool in order to decompile/recompile XMLs and PNGs in apk files.
Click to expand...
Click to collapse
Are there no other standalone command line tools for those tasks?
SifJar said:
Are there no other standalone command line tools for those tasks?
Click to expand...
Click to collapse
I would like to know that as well...
Wow, thank you very much. I'm going to have fun with this.
Sent from my Desire HD using xda premium
Thanks for the tutorial, I have successfully extracted the classes.dex but i cant seem to find where to add this code:http://forum.xda-developers.com/showpost.php?p=16485374&postcount=15 in the NotificationManagerService.smali file. I have even opened up a file that supposedly has the patch in it but could not locate it. A point in the right direction would be appreciated.
Great tutorial awesome work
Sent from my Galaxy Nexus using Tapatalk 2
i wan to edit samsungcamera.apk...
i can not find classes.dex inside this apk....
only got META_INF,res,AndroidManifes.xml and resources.arsc....
Have you decompiled it first?
Sent from my Galaxy Nexus using Tapatalk 2
Hey I made some changes in the AssetManager.smali and now I can't recompile. Getting this error Error: Unable to access jarfile smali.jar
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Cannot find file or directory "classout/"
at org.jf.smali.main.main(main.java:184)
didi1985 said:
i wan to edit samsungcamera.apk...
i can not find classes.dex inside this apk....
only got META_INF,res,AndroidManifes.xml and resources.arsc....
Click to expand...
Click to collapse
Is your rom deodexed?
Sent from my PantechP9070 using xda premium
Great guide easy to understand.
Thank you.
Reply To Thread
This is one of the best tutorial... Keep it up bro!
Help me, i can't edit .smali, because i don't understand smali,.
have any help?
like convet to java or any langgue ?
Helo, sry for noobish thread but i can's solve my problem. This method allways work for me using Zte blade. But now on Xperia Arc it doesn't.
Im trying to change somethink in framework (values) , but first i try to re-compile framework to check. And what ? i got bootloop.
Im using
ApkMultiTool 1.0.6
ApkManager 5.0.2
apktool.jar
signapk.jar
First i decompile this clean stock framework (o errors), then i try to compile (0 errors, no changes inside framework) and i got bootloop.I sign new framework and put it in my rom zip file. Then i try to make it manualy, so i run ms command line :
java -jar apktool.jar d framework-res.apk
java -jar apktool.jar b framework-res.apk
Then Sign manualy :
java -jar signapk.jar certificate.pem key.pk8 framework-res.apk signedframewok-res.apk
AND ? BOOTLOOP :////////////////////
same prob
OmenHTX said:
Helo, sry for noobish thread but i can's solve my problem. This method allways work for me using Zte blade. But now on Xperia Arc it doesn't.
Im trying to change somethink in framework (values) , but first i try to re-compile framework to check. And what ? i got bootloop.
Im using
ApkMultiTool 1.0.6
ApkManager 5.0.2
apktool.jar
signapk.jar
First i decompile this clean stock framework (o errors), then i try to compile (0 errors, no changes inside framework) and i got bootloop.I sign new framework and put it in my rom zip file. Then i try to make it manualy, so i run ms command line :
java -jar apktool.jar d framework-res.apk
java -jar apktool.jar b framework-res.apk
Then Sign manualy :
java -jar signapk.jar certificate.pem key.pk8 framework-res.apk signedframewok-res.apk
AND ? BOOTLOOP :////////////////////
Click to expand...
Click to collapse
same prob here too happening.....i cant able to change theme....!!
Before decompiling you mmust install the .apk use this command:
Cd C:/.. navigate to your framework-res.apk
Once you in the folder where it is located use this command to 1)install:
Apktool if framework-res.apk
2)Decompile:
Apktool d framework-res.apk
3)Recompile:
Apktool b framework-res
4) new .apk is in .../framework-res/dist/
I think you forgot to install the .apk
Sent from my GT-I9001 using xda app-developers app
Diablob555 said:
Before decompiling you mmust install the .apk use this command:
Cd C:/.. navigate to your framework-res.apk
Once you in the folder where it is located use this command to 1)install:
Apktool if framework-res.apk
2)Decompile:
Apktool d framework-res.apk
3)Recompile:
Apktool b framework-res
4) new .apk is in .../framework-res/dist/
I think you forgot to install the .apk
Sent from my GT-I9001 using xda app-developers app
Click to expand...
Click to collapse
If he didn't install the apk, he wouldn't be able to not even decompile correctly.
OP: I also have this problem, but from what I read, after you recompile, you need to open the new and the old apk with WinRar or 7-Zip, copy the resources.src (or something like that) from the original framework-res.apk to the modified framework-res.apk. I read that this should do the job. I'm going to try that myself later when I get home. Good luck for you.
Sent from my LT26i with Tapatalk 2
You shouldn't sign any system apks, instead just copy over the META-INF folder and AndroidManifest.xml from original framework-res.apk to the newly compiled one.
kong said:
You shouldn't sign any system apks, instead just copy over the META-INF folder and AndroidManifest.xml from original framework-res.apk to the newly compiled one.
Click to expand...
Click to collapse
This simple comment of yours gave peace to my soul... THANK YOU SO MUCH!!!!!!
:laugh::laugh::laugh::laugh::victory::victory::good::good::good:
Great solution !!!!
kong said:
You shouldn't sign any system apks, instead just copy over the META-INF folder and AndroidManifest.xml from original framework-res.apk to the newly compiled one.
Click to expand...
Click to collapse
sorry for a 6 month later post, but i'm having the same problem and this solution isn't making sense to me..
edit: holy **** it worked
i compile first, I just drag them into the newly compiled apk
thank you!
eris72 said:
sorry for a 6 month later post, but i'm having the same problem and this solution isn't making sense to me..
edit: holy **** it worked
i compile first, I just drag them into the newly compiled apk
thank you!
Click to expand...
Click to collapse
For me it is not working. My phone keeps looping after rebooting it.
I tried with 7zip and winrar and it is not working.
1.- Decompile with apktool1.4.2
2.- Compile with apktool1.4.3 (in this step i was editing eri.xml I need to edit this file, but also without editing this file I have the same result)
3.- Drag the META-INF and AndroidManifest.xml from the original apk to the newly created one with 7zip(also tried with winrar)
4.- push the file to the phone (system/framework)
Actually right after pushing it I get an error message saying Unfortunately, C has stopped.
What am I missing?
Did you fix permissions before pushing back to system/framework
dutchmaster18 said:
Did you fix permissions before pushing back to system/framework
Click to expand...
Click to collapse
I decompiled and compiled, both processes with the latest version and that solved my problem
kong said:
You shouldn't sign any system apks, instead just copy over the META-INF folder and AndroidManifest.xml from original framework-res.apk to the newly compiled one.
Click to expand...
Click to collapse
really thank you worked for me!!!!
Helped........
kong said:
You shouldn't sign any system apks, instead just copy over the META-INF folder and AndroidManifest.xml from original framework-res.apk to the newly compiled one.
Click to expand...
Click to collapse
Thank you...it helped me to overcome a problem i was unable to solve....thank u very much...:good::good::good::good::good::good:
kong said:
You shouldn't sign any system apks, instead just copy over the META-INF folder and AndroidManifest.xml from original framework-res.apk to the newly compiled one.
Click to expand...
Click to collapse
Four years later and you're still saving frustrated XDA'ers.
Thank you!
Five hours of Googling and I finally have success.
Anyone know of a quicker workaround?
framework-res re/compile, push to phone
Hi have the problem with bootloop after overwrite framework-res.apk to /system/framework
use apktool2.2.2
phone note 3 with phronesis rom
I made
1.apktool if framework-res.apk (0 error)
2. decompile apktool d framework-res.apk (0 errors)
3. changed color.xml and styles.xml (only changed color text)
4. from orginal framework-res.apk drag resources.arsc to decompiled folder
5.make re-compile (apktool b framework-res) (0 errors) after this, program created new folder BUILD and DIST, in /build/apk/is META-INF, android manifest,RES folder and resources.arsc
Now i tried ( with tutorials ) drag from orginal framework-res.apk, folder META-INF, AndroidManifest.xml to BUILD folder and recompile second time (0 errors) then, from DIST folder i took framework-res.apk and overwrite to phone/system/framework and reboot = bootloop
Also trying after 1st re-compile, drag META-INF and androidmanifest.xml from orginal framework-res to newly recomplied framework-res.apk in DIST folder, again overwrite in phone/system/framework but still bootloop
before overwrite make permission rw-r--r- the same permisson of orginal framework-res.apk
then overwrited my apps example touchwiz, google play has stopped, reboot but unfortunately booloop
Any solution? ^^ thx
DrMalaN said:
framework-res re/compile, push to phone
Hi have the problem with bootloop after overwrite framework-res.apk to /system/framework
use apktool2.2.2
phone note 3 with phronesis rom
I made
1.apktool if framework-res.apk (0 error)
2. decompile apktool d framework-res.apk (0 errors)
3. changed color.xml and styles.xml (only changed color text)
4. from orginal framework-res.apk drag resources.arsc to decompiled folder
5.make re-compile (apktool b framework-res) (0 errors) after this, program created new folder BUILD and DIST, in /build/apk/is META-INF, android manifest,RES folder and resources.arsc
Now i tried ( with tutorials ) drag from orginal framework-res.apk, folder META-INF, AndroidManifest.xml to BUILD folder and recompile second time (0 errors) then, from DIST folder i took framework-res.apk and overwrite to phone/system/framework and reboot = bootloop
Also trying after 1st re-compile, drag META-INF and androidmanifest.xml from orginal framework-res to newly recomplied framework-res.apk in DIST folder, again overwrite in phone/system/framework but still bootloop
before overwrite make permission rw-r--r- the same permisson of orginal framework-res.apk
then overwrited my apps example touchwiz, google play has stopped, reboot but unfortunately booloop
Any solution? ^^ thx
Click to expand...
Click to collapse
1. apktool if framework-res.apk
2. decompile apktool d framework-res.apk
3. change color.xml and styles.xml
4. apktool b framework-res
5. drag from the NEW (dist folder) framework-res.apk this files (with zip editor): -res folder, -resources.arsc, -classes.dex (if you edited the smali too) to the OLD framework-res.apk
6. Now you can use the 'old' framework-res.apk with your phone, but now with your modifications.
I hope its help you. Sorry for the long time delay, but i just find now this therad
Make sure that you put the original manifest and meta folder back into the apk before pushing it. There's no need to resign unless you modify the manifest, all you should have to do is open the newly compiled app with winrar and add the contents of the originals folder. (Which is the manifest and meta folder)
Sent from my KYOCERA-C6745 using Tapatalk
kong said:
You shouldn't sign any system apks, instead just copy over the META-INF folder and AndroidManifest.xml from original framework-res.apk to the newly compiled one.
Click to expand...
Click to collapse
THANK YOU!!!
kong said:
You shouldn't sign any system apks, instead just copy over the META-INF folder and AndroidManifest.xml from original framework-res.apk to the newly compiled one.
Click to expand...
Click to collapse
Thanks... Your suggestion worked for me :good::good:
RealWelder said:
Make sure that you put the original manifest and meta folder back into the apk before pushing it. There's no need to resign unless you modify the manifest, all you should have to do is open the newly compiled app with winrar and add the contents of the originals folder. (Which is the manifest and meta folder)
Sent from my KYOCERA-C6745 using Tapatalk
Click to expand...
Click to collapse
Well that didn't work for me , im still getting bootloop
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(I think this one is only for linux so if ur on windows either test this one or get zipalign from android sdk)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.
So as in my earlier thread I have moved back to eagles blood 4.0.4 AOSP rom. One of the drawbacks is that the hdpi drawable folder in my systemui does not have 1% icons. I've read a few tuts on how to make my own....or add them from a downloadable zip.
My question to those who are more knowledgeable about development is this: will opening the drawable hdpi folder from my systemui.apk with 7-zip and replacing all my stock sys_batt PNG images with the custom 1% images and then saving those to the folder and pushing the systemui.apk back to my phone do the trick?
Sent from my LG-P999 using xda premium
Pain-N-Panic said:
So as in my earlier thread I have moved back to eagles blood 4.0.4 AOSP rom. One of the drawbacks is that the hdpi drawable folder in my systemui does not have 1% icons. I've read a few tuts on how to make my own....or add them from a downloadable zip.
My question to those who are more knowledgeable about development is this: will opening the drawable hdpi folder from my systemui.apk with 7-zip and replacing all my stock sys_batt PNG images with the custom 1% images and then saving those to the folder and pushing the systemui.apk back to my phone do the trick?
Sent from my LG-P999 using xda premium
Click to expand...
Click to collapse
Should add long as those are referenced (I think in the xml, but then, I have never done this myself). Would need a nandroid for sure .
-- The noob says:
From first-hand experience, a smartphone is incapable of making you smarter!
Nope, they're not. I have to manually reference them in the sys_bat icon XML file located in drawable folder. Then I have to swap in the images in the drawable hdpi folder once they're referenced. However, I'm having issues. Once I extract the files from the apk with 7zip, specifically the drawable folder to get to the sys_bat icon XML file, I cannot open it in notepad++ to edit it. I'm getting an error. Any ideas mansa?
Edit- LOL nandroid was the first thing I did!
Now I have to crank out this stupid paper for class so I can continue tinkering with my Android lol
Sent from my LG-P999 using xda premium
Ok, So I've come to learn that in order to edit XML files within the APK, that the APK needs to be decompiled with APK Tool, not simply extracted using 7zip. I downloaded APK tool and set everything up according to this tut----> http://forum.xda-developers.com/showthread.php?t=1989533
I have the APKTOOL folder placed on the root of my C:/ drive. Inside that folder I have placed the following aapt (the apktool exe or application file), apktool (batch file), apktool.jar, and my framework-res.apk (I know I need to use systemui.apk, I'm just using this as I follow the tutorial on how to get this program working before I try anything on my own files). When I get to the command c:\apktool>apktool if system.apk to install the APK on my system so I can decompile I get an error saying it's not a recognized command. Any ideas dev-friendly users?
So I realized I didn't have the JDK installed on my pc since I did a system wipe on it the other day. Reinstalled it but it's still not working. Very frustrating. I'm also using win 8 if that means anything.
Giving up on apktool as I cannot seem to get a way around the error. However, apk manager seems much more user friendly and have seen tuts using the program specifically for ics roms. I've only seen tuts for apktool using jelly bean roms so maybe that's the issue. I won't be home until late tonight as I have class. If anyone has any tips/suggestions please let me know.
Sent from my LG-P999 using xda premium
Not that many people are in here anyway but I figured I'd give it a shot. So I went to use apk manager instead of apk tool which seemed to be a much more "newb friendly" program. I can successfully decompile my framework-res.apk but cannot decompile my systemUI.apk afterward. I get an error....here's my log if anyone can help me with it:
EDIT- deleted log as I was able to decompile systemUI with a different apk program. That was a huge headache getting it to decompile. Now editing the XML should be no problem, along with swapping out the PNG's. Recompiling on the other hand will most likely be another headache!