Status
Not open for further replies.
Search This thread

xak944

Senior Member
Jun 9, 2010
379
211
North Carolina
Google Pixel 7
I think it's a moot point. While you can already remove the carrier text on either CM or Sense ROMs w/ options out there, you can't (shouldn't) remove the 'clear' button, which takes up the same amount of vertical space, regardless of the presence of the carrier text or not.

Personally, I'd give up the 'Clear' button for more space for notifications (you can dismiss notifications individually). On that same note, I wouldn't remove my clock or battery, but mods exist for those so that people have options. And options are good!

I was just suggesting that this might be an easy mod to figure out by those with the know-how, and some people might find it useful.
 

JsChiSurf

Inactive Recognized Developer
Feb 5, 2010
2,416
1,396
Hacksville
I was just suggesting that this might be an easy mod to figure out by those with the know-how, and some people might find it useful.
Wasn't trying to dismiss your idea, just wanted to be sure you thought about the fact that you would likely be removing the clear button as well, since, when there is nothing to clear, it's not an issue, since it's not present.

It is an easy mod to make happen, and I'm just one person, but I'm thinking demand would be pretty low...
 

snovvman

Senior Member
Jun 6, 2008
1,700
672
Very useful thread. Thank you for sharing, SteelH, xak944, ydnandy, and others.

Going to give this a try this weekend.

It would be great if someone can find a way to get the data connection to properly display 3G/EVDO vs. 1xRTT. (I know it is not the scope of this thread).

Cheers.
 

xak944

Senior Member
Jun 9, 2010
379
211
North Carolina
Google Pixel 7
Wasn't trying to dismiss your idea, just wanted to be sure you thought about the fact that you would likely be removing the clear button as well, since, when there is nothing to clear, it's not an issue, since it's not present.

Indeed, I hadn't considered losing the 'Clear' button as thoroughly as I should have prior to reading your post. However, after thinking about it, I believe I could live without it. :)
 

JsChiSurf

Inactive Recognized Developer
Feb 5, 2010
2,416
1,396
Hacksville
Indeed, I hadn't considered losing the 'Clear' button as thoroughly as I should have prior to reading your post. However, after thinking about it, I believe I could live without it. :)
Here's a proof of concept. I played with moving the 'clear' button to the bottom, in order to keep it present, but the space is always going to be there for the button (at least if doing simple XML edits, as opposed to smali hacking), even when the button is not displayed, which I think defeats the purpose you were looking for, i.e. to obtain more space for notifications, etc.

So, the screen capture below is an example of removing the 'clear' button all together, meaning to dismiss 'Notifications' you'd have to actually visit the specific notification to clear out the ultimate reason for its presence, i.e. delete / read the text message, email, etc.

Bottom line, there's a bunch of stuff you could do, based on personal preference. And, such edits are going to be ROM specific, especially Sense vs. CM.

status_bar_expanded.png
 

snovvman

Senior Member
Jun 6, 2008
1,700
672
Feeling a bit dumb, and asking for help:

The services.jar file I pulled from the phone is 345 bytes. I confirmed the file size using Root Explorer on my phone.

When I open it with WinRAR (or the native Windows .zip extractor), all I see is a directory named META-INF. Under it it, a single file MANIFEST.MF, 71 bytes. Nothing else.

What am I doing wrong?

Thanks.
 

JsChiSurf

Inactive Recognized Developer
Feb 5, 2010
2,416
1,396
Hacksville
Feeling a bit dumb, and asking for help:

The services.jar file I pulled from the phone is 345 bytes. I confirmed the file size using Root Explorer on my phone.

When I open it with WinRAR (or the native Windows .zip extractor), all I see is a directory named META-INF. Under it it, a single file MANIFEST.MF, 71 bytes. Nothing else.

What am I doing wrong?

Thanks.
Sounds like you're running a stock, non-deodexed ROM, which means you are unable to utilize these mods.
 

nukedukem

Senior Member
Jun 23, 2010
477
54
Has anyone else lost the sync icon after removing the GPS in the lastest services.jar from 3.30.651.2?
 

xak944

Senior Member
Jun 9, 2010
379
211
North Carolina
Google Pixel 7
Here's a proof of concept. I played with moving the 'clear' button to the bottom, in order to keep it present, but the space is always going to be there for the button (at least if doing simple XML edits, as opposed to smali hacking), even when the button is not displayed, which I think defeats the purpose you were looking for, i.e. to obtain more space for notifications, etc.

Great, I'd love to give it a shot. Would you mind sharing the XML edits you did to accomplish this? Thanks!
 

pendo

Senior Member
Jun 3, 2010
1,971
759
Tulsa, OK
knock, knock...


Hi guys, hope you don't mind an N1 user popping in for a question.:)

I don't know if you could offer any help or not for what I'm trying to do. This thread consistently came up in my various searches and you're definitely making edits in the same area I'm trying to. I just checked, and it looks like miui has landed here, too so maybe you're familiar. I'm trying to hide % textView overlay for the battery. Just the text output, not the battery icon.

I'm not learned in smali (or java for that matter) so I'm starting off severely handicapped as it is...but I've been reading/searching, and I *think* this is the area where I need to edit. I'm not entirely sure, though, as their battery implementation is quite different. My thinking is to make the text transparent, that way I keep the slot it occupies as it. Do you think that's a valid approach?

As expected, the edit in the op works fine for hiding the battery, but as you know, I lose the slot. One thing I did notice was while the setIconVisibility edit hid the battery entirely, if you go into settings and switch battery types, it no longer has any effect and all battery versions return.

If you have some hints or other help, it's much appreciated. If not, that's OK and I understand. Don't know if it helps, but I've attached the StatusBarPolicy, and IconData files.

Thanks in advance.
 

Attachments

  • smali.zip
    24.2 KB · Views: 7

JsChiSurf

Inactive Recognized Developer
Feb 5, 2010
2,416
1,396
Hacksville
If you have some hints or other help, it's much appreciated. If not, that's OK and I understand. Don't know if it helps, but I've attached the StatusBarPolicy, and IconData files.

Thanks in advance.
The problem with providing any insight is that these types of edits are ROM / framework specific. For example, the stock EVO Sense ROM, that the majority of these mods are provided for doesn't include a % battery text overlay.

But, more importantly, to track down and try to apply a mod that does what you want, the attached files won't provide value outside of the context of the framework files they reference, in order to try and trace through and find the location that you are looking to impact / affect.

Also, depending on the ROM / implementation, sometimes this is pulled off in the XML, others via the Java code, it just depends. The super circle battery mod is a perfect example, where I've seen it done both ways, though when done via XML, the % is part of the graphic / image, rather than actual text.
 

pendo

Senior Member
Jun 3, 2010
1,971
759
Tulsa, OK
The problem with providing any insight is that these types of edits are ROM / framework specific. For example, the stock EVO Sense ROM, that the majority of these mods are provided for doesn't include a % battery text overlay.

But, more importantly, to track down and try to apply a mod that does what you want, the attached files won't provide value outside of the context of the framework files they reference, in order to try and trace through and find the location that you are looking to impact / affect.

Also, depending on the ROM / implementation, sometimes this is pulled off in the XML, others via the Java code, it just depends. The super circle battery mod is a perfect example, where I've seen it done both ways, though when done via XML, the % is part of the graphic / image, rather than actual text.

Correct, I understood there was no text overlay in those. And I have checked the xml's it's not there. The charging animation is froyo style, but that's it. There are only 2 battery png's and their associated xml control file calls one at max level 4% and the the other image the rest of the time. It's just a hollow outline of a battery. The images is either filled with a solid rectangle of varying size or if the % display is selected, then it shows a textView. I even dug around in Settings.apk since that's where the option is to change it. But as I said, I'm inept with smali. And I understand that you really need more than those 2 files...to be thorough, you need more than services.jar. I was simply hoping that something would stand out to your trained eye, or by long shot you were familiar with the framework.

After much trial and error, as well as reading through this entire thread I thought it was worth a shot to ask, as you all definitely understand smali better than I. And although you're specific edits weren't what I was looking for, they are close....I keep wanting to think that if I can identify where in the code the text is called, then I was hoping that I could add an additional line defining it's color or transparency. That way, it's "still there" but not seen.

This is for super circle, as I'm sure you can guess. Presently, the only way I've been able to provide them (I worked with UOT to implement this edit as well) is to do some trickery with the actual png....erase the percent numbers and move the image within and tweak the canvas size. But it's not as nice of a solution as we're used to.

Thanks for the response, though. :)
 
Last edited:

JsChiSurf

Inactive Recognized Developer
Feb 5, 2010
2,416
1,396
Hacksville
This is for super circle, as I'm sure you can guess. Presently, the only way I've been able to provide them (I worked with UOT to implement this edit as well) is to do some trickery with the actual png....erase the percent numbers and move the image within and tweak the canvas size. But it's not as nice of a solution as we're used to.

Thanks for the response, though. :)
You're definitely along the correct path with the StatusBarPolicy/IconData files. Personally, I'd focus on trying to find the location where the text prints and rather than making the text transparent (certainly feasible as well), simply breaking the call to write the text in the first place, though there is more than one way to skin a cat...

Again, w/o context, meaning, for example, me downloading the full ROM, decompiling to follow the path, and testing through trial and error (by loading the specific ROM), it's just difficult to pull off, unfortunately.

EDIT: Also, FYI, you've attached StatusBarService in your zip, rather than Policy, which is likely the right file to "attack" / investigate further...
 
Last edited:

pendo

Senior Member
Jun 3, 2010
1,971
759
Tulsa, OK
You're definitely along the correct path with the StatusBarPolicy/IconData files. Personally, I'd focus on trying to find the location where the text prints and rather than making the text transparent (certainly feasible as well), simply breaking the call to write the text in the first place, though there is more than one way to skin a cat...

Again, w/o context, meaning, for example, me downloading the full ROM, decompiling to follow the path, and testing through trial and error (by loading the specific ROM), it's just difficult to pull off, unfortunately.

EDIT: Also, FYI, you've attached StatusBarService in your zip, rather than Policy, which is likely the right file to "attack" / investigate further...

Oops, sorry about that. Yeah, that file has some tracks in it, too. I just thought I was seeing more reference of the text view in policy...which refers to IconData. The thinking with making it transparent was so that I didn't lose the slot, and that it would be likely less susceptible to cause other anomalies rather than editing it out.

Heres a different question then. I'm totally new to all of this, and pretty much green all around. (Well, I could perform the occasional red-eye edit before..) I've been soaking as much as I can in via self study, and that's worked well....except for smali. I understand it's similar in syntax to java....do you have a good recommendation as far as a crash course to start picking up on this? I have no problem chasing down all the little branches when looking at this code....I just don't know what it's saying.
 

SteelH

Senior Member
Jun 12, 2010
3,120
2,965
JsChiSurf: I have found another challenge for you...

In a different thread, a user asked how
iz9j43.png
and/or
99mf50.png
could be disabled. I figured I'd ask in this thread since it seems the most appropriate place. Also, if you ever get around to posting instructions for the gps off off but gps on on (great choice of words eh?) that would be great also.

Thanks
 

JsChiSurf

Inactive Recognized Developer
Feb 5, 2010
2,416
1,396
Hacksville
JsChiSurf: I have found another challenge for you..
Thought you said you had a challenge :D.

Another relatively easy one. Funny thing is, I tried a bit more eloquent of a method (less brute force), and ended up removing EVERY status bar icon on the right hand side. So, if anyone wants everything removed, lol, let me know. I'm still not sure how/why that happened...

When HTC gives us nice methods for controlling various status bar updates, it makes these kinds of mods pretty straight forward, so, to remove the mute/vibrate status icon, open:

'com\android\server\status\StatusBarPolicy.smali'

Search for the method:

.method private final updateVolume()V

And short circuit the method by adding:

return-void

Just below .locals 8, resulting in:

Code:
.method private final updateVolume()V
    .locals 8

    return-void
    .prologue
    const/4 v6, 0x1
    ...
    ...

That's it. Easy Peasy :).
 

SteelH

Senior Member
Jun 12, 2010
3,120
2,965
JsChiSurf, nice work as always, I've added your latest tricks to the OP so it's easy for people to find them.
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    Does anyone know where the notification smali file is located in Gingerbread?

    com/android/server/status no longer exists in the classes.dex. There are only folders for "am", "connectivity", and "location".

    I am running Droid X with the leaked gingerbread.

    Hide battery on 2.3.3
    File SystemUI/smali/com/android/systemui/statusbar/policy/StatusBarPolicy.smali
    After code(line 2720 - metod updateBattery)
    Code:
    	iget-object v6, p0, Lcom/android/systemui/statusbar/policy/StatusBarPolicy;->mService:Landroid/app/StatusBarManager;
    
    	const-string v7, "battery"
    
    	invoke-virtual {v6, v7, v2, v3}, Landroid/app/StatusBarManager;->setIcon(Ljava/lang/String;II)V
    add code
    Code:
    	iget-object v6, p0, Lcom/android/systemui/statusbar/policy/StatusBarPolicy;->mService:Landroid/app/StatusBarManager;
    
    	const-string v7, "battery"
    
    	invoke-virtual {v6, v7, v9}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V

    -------------------------------------------------

    Hide clock on 2.3.3
    File SystemUI/smali/com/android/systemui/statusbar/Clock.smali
    After code(line 298 - metod onAttachedToWindow)
    Code:
        .line 106
        const v1, -0x414142
    
        invoke-virtual {p0, v1}, Lcom/android/systemui/statusbar/Clock;->setTextColor(I)V
    add code
    Code:
        const v1, 0x8
    
        invoke-virtual {p0, v1}, Lcom/android/systemui/statusbar/Clock;->setVisibility(I)V

    This files from Samsung GT-i9000 Galaxy S - JVB
    Screen from MIUI-1.4.15 Desire
    6
    5
    4
    3
    Remove AM/PM from 12 hour clock

    Okay guys, at the prodding of SteelH, who has taken me out of semi-retirement, I took a look at this VERY quickly, as this is not something I use, since I remove the clock all together.

    However, since this has already been done by someone else on Samsung phone, probably using a technique different than what I would have pursued (not that there is anything wrong with it), it prevents me from having to figure it out, and rather, just "apply" the principle to our Sense tweaked services.jar instead.

    So, if you want to manually modify your services.jar file to remove am/pm from your clock (note, this may break 24 hour display all together, not sure, I didn't bother testing), decompile and open /com/android/server/status/StatusBarPolicy.smali, and wholesale replace the updateClock() method in your existing file with the following tweaked version I've provided:

    Code:
    .method private final updateClock()V
        .locals 6
    
        .prologue
        .line 940
        iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mCalendar:Ljava/util/Calendar;
    
        invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
    
        move-result-wide v1
    
        invoke-virtual {v0, v1, v2}, Ljava/util/Calendar;->setTimeInMillis(J)V
    
        .line 941
        iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mClockData:Lcom/android/server/status/IconData;
        
        iget-object v1, p0, Lcom/android/server/status/StatusBarPolicy;->mContext:Landroid/content/Context;
    
        invoke-static {v1}, Landroid/text/format/DateFormat;->getTimeFormat(Landroid/content/Context;)Ljava/text/DateFormat;
    
        move-result-object v1
        
        iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mCalendar:Ljava/util/Calendar;
    
        invoke-virtual {v2}, Ljava/util/Calendar;->getTime()Ljava/util/Date;
    
        move-result-object v2
    
        invoke-virtual {v1, v2}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
    
        move-result-object v1    
        
        const-string v4, " PM"
    
        const-string v5, ""
    
        invoke-virtual {v1, v4, v5}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
    
        move-result-object v1     
    
        const-string v4, " AM"
    
        const-string v5, ""
    
        invoke-virtual {v1, v4, v5}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
    
        move-result-object v1     
    
        iput-object v1, v0, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;
    
        .line 942
        iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mService:Lcom/android/server/status/StatusBarService;
    
        iget-object v1, p0, Lcom/android/server/status/StatusBarPolicy;->mClockIcon:Landroid/os/IBinder;
    
        iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mClockData:Lcom/android/server/status/IconData;
    
        const/4 v3, 0x0
    
        invoke-virtual {v0, v1, v2, v3}, Lcom/android/server/status/StatusBarService;->updateIcon(Landroid/os/IBinder;Lcom/android/server/status/IconData;Lcom/android/server/status/NotificationData;)V
    
        .line 943
        return-void
        
    .end method

    Reference:
    no_am_pm.png


    Credit to s0niqu3 for the original mod concpet. I opened it up and pulled what was needed to manually apply the same to our version, which was not a 1-to-1 copy / paste, unfortunately, but rather, took a little massaging due do framework differences.