[REF] Hide Status Bar Icons

kzoodroid

Senior Member
Jun 27, 2010
1,356
264
0
Kalamazoo
I did the edit of SystemUI.apk to remove the clock in the gingerbread OTA and it worked just fine. But I can't remember exactly how I did it. Now with the latest OTA I can't seem to get this to work. Not sure if I am doing it right. I am using apkManager to decompile the file, I then put in the edits with Notepad++, I recompile the file and sign it. No problems there, everything seems to go as planned. I then copy over the file to my sdcard and use rootexplorer to paste the edited file into system/app but as soon as I paste it I get a force close and when I reboot I have no notification bar at all. Changing the permissions and rebooting, with a battery pull, doesn't fix it. Even if I copy back my old SytemUI.apk file I still have no notification bar. Only way to get it back is to restore a nandroid backup. I seem to be doing something wrong but not sure what it is. I tried to use apkTool but it doesn't work right, can't create the file after decompling so it aborts and apkManager is so much easier to use.
 

RMarkwald

Senior Member
Aug 4, 2010
1,572
304
0
Middleton
I did the edit of SystemUI.apk to remove the clock in the gingerbread OTA and it worked just fine. But I can't remember exactly how I did it. Now with the latest OTA I can't seem to get this to work. Not sure if I am doing it right. I am using apkManager to decompile the file, I then put in the edits with Notepad++, I recompile the file and sign it. No problems there, everything seems to go as planned. I then copy over the file to my sdcard and use rootexplorer to paste the edited file into system/app but as soon as I paste it I get a force close and when I reboot I have no notification bar at all. Changing the permissions and rebooting, with a battery pull, doesn't fix it. Even if I copy back my old SytemUI.apk file I still have no notification bar. Only way to get it back is to restore a nandroid backup. I seem to be doing something wrong but not sure what it is. I tried to use apkTool but it doesn't work right, can't create the file after decompling so it aborts and apkManager is so much easier to use.
Okay, I know how to get this, I'll be home in about 30 minutes and have a look. That's something I always do.

In the meantime, try putting the Meta-INF and Android Manifest from the original apk into your recompiled one.

I'll post when I get home.

Edit: I always make a backup of the original apk by renaming it with a. bak extention using adb, then I adb push the new file, so you can always revert with restoring a backup.

Sent from my ADR6300 using xda premium
 
Last edited:

kzoodroid

Senior Member
Jun 27, 2010
1,356
264
0
Kalamazoo
Okay, I know how to get this, I'll be home in about 30 minutes and have a look. That's something I always do.

In the meantime, try putting the Meta-INF and Android Manifest from the original apk into your recompiled one.

I'll post when I get home.

Sent from my ADR6300 using xda premium
I first tried moving the classes.dex file from the new into the old but got the same results, no notification bar. I then tried copying the Meta-INF and Android Manifest over to the new one. Now when I reboot I get stuck on the red eye boot screen. I think how I did this last time was I actually baked the SystemUI.apk into a ROM and didn't copy it over to my phone. Might give that a try later this weekend.
 

RMarkwald

Senior Member
Aug 4, 2010
1,572
304
0
Middleton
I modded the Clock.smali file by decompiling only the classes.dex file from the SystemUI.apk. Search for the line:

invoke-virtual {p0}, Lcom/android/systemui/statusbar/Clock;->updateClock()V​


Paste the following two lines (shown below in RED) above the line we searched for, so the finished product looks like:

const v1, 0x8

invoke-virtual {p0, v1}, Lcom/android/systemui/statusbar/Clock;->setVisibility(I)V


invoke-virtual {p0}, Lcom/android/systemui/statusbar/Clock;->updateClock()V​


The SystemUI.apk attached has the clock hidden from the status bar, as well as the location icon. Feel free to use as needed, no permission needed to use it. This is the SystemUI.apk from 4.08, so it may not work with the prior OTA of 4.06 since it was modified.

Let me know if it works.

EDIT: Attached SystemUI.apk removed as it appears to not have worked. Will test to confirm. I'll post it once I figure it out.
 
Last edited:

RMarkwald

Senior Member
Aug 4, 2010
1,572
304
0
Middleton
For those that want to know how I safely backup the original apk so you don't have to do a full restore of a backup:

Hook up phone via USB.
Boot into recovery.
Mount /system.

Open command prompt, CD to SDK\platform-tools folder (where ever you keep it).

Type in: adb shell

Type in: cd /system/app
NOTE: Or CD to which ever directory you need to get to based on where the file is located.

Type in: cp SystemUI.apk SystemUI.bak
NOTE: This copies the original file and creates a file with the extention .bak.

Type in: rm SystemUI.apk
NOTE: This removes the file from the system.

Type in: exit
NOTE: Exits adb shell.

Now you can adb push the file to the system.
Type in: adb push SystemUI.apk /system/app/

Done, reboot phone.
 
Last edited:
  • Like
Reactions: kzoodroid

kzoodroid

Senior Member
Jun 27, 2010
1,356
264
0
Kalamazoo
I modded the Clock.smali file by decompiling only the classes.dex file from the SystemUI.apk. Search for the line:

invoke-virtual {p0}, Lcom/android/systemui/statusbar/Clock;->updateClock()V​


Paste the following two lines (shown below in RED) above the line we searched for, so the finished product looks like:

const v1, 0x8

invoke-virtual {p0, v1}, Lcom/android/systemui/statusbar/Clock;->setVisibility(I)V


invoke-virtual {p0}, Lcom/android/systemui/statusbar/Clock;->updateClock()V​


The SystemUI.apk attached has the clock hidden from the status bar, as well as the location icon. Feel free to use as needed, no permission needed to use it. This is the SystemUI.apk from 4.08, so it may not work with the prior OTA of 4.06 since it was modified.

Let me know if it works.
As a last resort I tried the SystemUI.apk file you attached and it does the same thing. As soon as I paste it in I get a force close then when I reboot there is no notification bar. I'm on 4.08 by the way so it should work though I am using Stangs ROM verison. I think the only way I will get this to work is to bake it in myself. Unfortunately I left my laptop at work and will have to wait till Monday to try. Thanks for all your help.
 

kzoodroid

Senior Member
Jun 27, 2010
1,356
264
0
Kalamazoo
Still can't get this to work. Tried pushing the file over with adb, made an update.zip ot of it and even baked it into a ROM and still when I reboot I have no status bar. I was going to check the copy you had posted to see what the differeneces where but I see you took it down saying it wasn't working?
 

RMarkwald

Senior Member
Aug 4, 2010
1,572
304
0
Middleton
Still can't get this to work. Tried pushing the file over with adb, made an update.zip ot of it and even baked it into a ROM and still when I reboot I have no status bar. I was going to check the copy you had posted to see what the differeneces where but I see you took it down saying it wasn't working?
I took it down in case it truly was an issue. I can post it back up for you.

Here you go!


EDIT: Make sure that the permissions are correct too. After you adb push the file, then adb shell back into your phone. Type in: cd /system/app
Then type in: chmod 0644 SystemUI.apk
Then type in: exit

This will set the correct permissions on this apk file.
 

Attachments

Last edited:
  • Like
Reactions: kzoodroid

kzoodroid

Senior Member
Jun 27, 2010
1,356
264
0
Kalamazoo
Okay that finally got it. Your SystemUi.apk file was 20 kb larger than mine so not sure what the difference was but it worked. The one I edited was about 20 kb larger than the original I started with too. I think the problem is that I had the notification bar quick launch mod in mine and thats whats causing the issues.

edit: I checked the quick settings mod file and it uses the old SystemUI.apk so that definetly was the problem. So I can have one or the other but not both till someone updates the quick setting mod to 4.08 and I prefer to not have the clock.
 
Last edited:

RMarkwald

Senior Member
Aug 4, 2010
1,572
304
0
Middleton
Okay that finally got it. Your SystemUi.apk file was 20 kb larger than mine so not sure what the difference was but it worked. The one I edited was about 20 kb larger than the original I started with too. I think the problem is that I had the notification bar quick launch mod in mine and thats whats causing the issues.

edit: I checked the quick settings mod file and it uses the old SystemUI.apk so that definetly was the problem. So I can have one or the other but not both till someone updates the quick setting mod to 4.08 and I prefer to not have the clock.
Cool, glad to hear it worked! I took a look at the Quick Settings thing, and just too complicated for my level of knowledge. I know someone will get it at some point, and I did hear that the 4.06 SystemUI.apk will work in 4.08, but I haven't tried it. I didn't use the Quick Settings too much, for the main things like Wifi / Brightness / GPS toggles, I just use Elixir 2. Puts them in the pull down, and it's free.
 

kzoodroid

Senior Member
Jun 27, 2010
1,356
264
0
Kalamazoo
Cool, glad to hear it worked! I took a look at the Quick Settings thing, and just too complicated for my level of knowledge. I know someone will get it at some point, and I did hear that the 4.06 SystemUI.apk will work in 4.08, but I haven't tried it. I didn't use the Quick Settings too much, for the main things like Wifi / Brightness / GPS toggles, I just use Elixir 2. Puts them in the pull down, and it's free.
Yeah the Quick Settings Mod based off the 4.06 SystemUI.apk worked on my phone just fine but as soon as I go to edit it to hide the clock the whole notification bar disappears. Not sure what is going on there. I may try and take the SystemUI.apk out of one of the custom ROMs based off 4.08 that has the quick settings mod in it already and see if I can edit the clock settings from it. Of course they may just be using the 4.06 SystemUI.apk and I'd be in the same boat.
 

kzoodroid

Senior Member
Jun 27, 2010
1,356
264
0
Kalamazoo
Was back revisiting this issue as I reformated my phone and wanted to start from scratch. I found my problem was that apkManager does not do a good job of recompiling the SystemUI.apk. The best way to do this is:

1. open SystemUI.apk with 7zip and remove the classes.dex file
2. decompile classes.dex with baksmali
3. do the edits to the clock.smali with Notepad++
4. compile classes.dex with smali
5. insert the new classes.dex back into SystemUI.apk with 7zip
6. push the new SystemUI.apk back to the phone and set permissions

You have to download baksmali.jre and smali.jre from google and place them in the platform-tools folder and you also need the java jre installed which you get from Java. Fire up a cmd window and change your prompt to the platform-tools directory, in my instance I changed the prompt to C:\sdk\android-sdk-windows\platform-tools. From this prompt run the following commands.

Baksmali command:

java -jar baksmali.jar -o classout/ classes.dex

Smali command:

java -Xmx512M -jar smali.jar classout/ -o new-classes.dex

With baksmali the classes.dex file to edit is in a folder called classout in the platform-tools directory. The completed complied file using smali will be called new-classes.dex in the same folder.
 

kschwarz88

Senior Member
Dec 29, 2010
120
18
0
Desire HD based rom loc hiding (for 2.3.5)

Posting here cause I Google'd around but could only get this through diff'ing another Desire HD ported rom.
Smali found in the same place as other loc hide hacks (com\android\systemui\statusbar\policy\HtcCdmaStatusBar.smali)

From
Code:
    .line 279
    iget-object v0, p0, Lcom/android/systemui/statusbar/policy/HtcCdmaStatusBar;->mService:Landroid/app/StatusBarManager;

    const-string v1, "gpsone"

    const/4 v2, 0x[COLOR="Red"]1[/COLOR]
To
Code:
    .line 279
    iget-object v0, p0, Lcom/android/systemui/statusbar/policy/HtcCdmaStatusBar;->mService:Landroid/app/StatusBarManager;

    const-string v1, "gpsone"

    const/4 v2, 0x[COLOR="Red"]0[/COLOR]
and

From
Code:
.method private updateMtGpsIcon()V
    .locals 7

    .prologue
    const/4 v5, 0x3

    const/4 v4, 0x[COLOR="Red"]1[/COLOR]
To
Code:
.method private updateMtGpsIcon()V
    .locals 7

    .prologue
    const/4 v5, 0x3

    const/4 v4, 0x[COLOR="Red"]0[/COLOR]
 

Attachments