Status
Not open for further replies.
Search This thread

ShadowDrake

Senior Member
Sep 22, 2008
238
22
Muskegon, MI
You're my hero for this, steel.

Just saying.

This is something that has driven me straight up the wall. Having so many useless icons means that when I finally do get some notifications, they get pushed right off the edge. I really can only seem to fit ~4 notifications most of the time before I get the arrow.
 

mrcharlesiv

Senior Member
Jan 15, 2010
556
5
Music City, TN
Uh... I've never signed a .jar before. Anyone???


EDIT: I attached the services.jar I edited. It has to be signed for the phone to even boot up. Hopefully someone can sign this.
 

Attachments

  • servicesjar.zip
    711.5 KB · Views: 229
Last edited:

webby_s

Senior Member
Aug 3, 2010
161
11
MN
This is hot... I like it a lot. I have been looking for something like this for quiet awhile. Now to read up on smali/baksmali. I know how to edit a .jar file but there are "files" within that file.... Great... But I have to learn at least one thing a day right. If anyone has insight for me feel free to enlighten us but google search will suffice for now.
 

mrcharlesiv

Senior Member
Jan 15, 2010
556
5
Music City, TN
This is hot... I like it a lot. I have been looking for something like this for quiet awhile. Now to read up on smali/baksmali. I know how to edit a .jar file but there are "files" within that file.... Great... But I have to learn at least one thing a day right. If anyone has insight for me feel free to enlighten us but google search will suffice for now.

Start here: http://code.google.com/p/smali/.
 

xak944

Senior Member
Jun 9, 2010
379
211
North Carolina
Google Pixel 7
Thank you very much for posting this. This has been something bothering me since I got the device.

I have no idea how to use these tools, but I will figure them out. ;)

EDIT: Figured it out. The steps worked! My taskbar is so clean and beautiful now! :D

Here are some VERY BASIC directions. Use at your own risk. They worked for me.

  1. Make a backup of your services.jar on your device (or alternatively make a nandroid backup): adb shell cp /system/framework/services.jar /system/framework/services.jar.bak
  2. Get services.jar from your device: adb pull /system/framework/services.jar .
  3. Extract classes.dex from services.jar
  4. Decompile the .dex file: java -jar baksmali.jar classes.dex -o outputdir
  5. Make desired edits to the files now in outputdir/
  6. Recompile the .dex file: java -Xmx512M -jar smali.jar outputdir/ -o classes.dex
  7. Add the new (modified) classes.dex file to the existing services.jar file (which is actually a zip file)
  8. Cross your fingers and push services.jar back to your device: adb push services.jar /system/framework/services.jar
  9. Reboot device: adb reboot
 
Last edited:

EVOme

Senior Member
Jun 3, 2010
2,287
328
How about someone post two edited and signed files to share with everyone else...?
 

xak944

Senior Member
Jun 9, 2010
379
211
North Carolina
Google Pixel 7
How about someone post two edited and signed files to share with everyone else...?

I believe (please correct me if I'm wrong) the services.jar could be different in certain ROMs or themes. It's better to make the edits yourself on the file that came off your device to preserve the integrity of the rest of your system.

EDIT: What we need is an app that makes the edits on the device for us... ;)
 

mrcharlesiv

Senior Member
Jan 15, 2010
556
5
Music City, TN
So, as usual, I made this a lot more complicated than it needs to be. Somehow I was un-signing services.jar. I don't know. I got it to work now though. WORD!
 

lazyboy0172

Senior Member
Jun 3, 2007
159
4
many thanks to xak and the OP. with your help i was easily able to get rid of that pesky gps on/off icon! i appreciate the tips
 

SteelH

Senior Member
Jun 12, 2010
3,120
2,965
This is hot... I like it a lot. I have been looking for something like this for quiet awhile. Now to read up on smali/baksmali. I know how to edit a .jar file but there are "files" within that file.... Great... But I have to learn at least one thing a day right. If anyone has insight for me feel free to enlighten us but google search will suffice for now.

Very useful information about services.jar, smali/baksmali, classes.dex can be found HERE

As someone else mentioned, they learned how to use smali/baksmali and do customizations themselves. My OP along with the link posted here gives you all the info you need to perform these mods yourself, and at the same time you will learn a great deal on customizing your evo; The benefits of which are endless!

One final note, you need to use the services.jar from the ROM you are running, THEY ARE NOT interchangeable due to the fact that almost all ROM devs add some customizations into their roms.
 
Last edited:

ydnandy

Senior Member
Jun 9, 2010
222
63
Charlotte, NC
SteelH - thanks for posting this! I love learning new things, so this was interesting... wasn't exactly sure where to start though, so these steps from xak were a great help.

Thank you very much for posting this. This has been something bothering me since I got the device.

I have no idea how to use these tools, but I will figure them out. ;)

EDIT: Figured it out. The steps worked! My taskbar is so clean and beautiful now! :D

Here are some VERY BASIC directions. Use at your own risk. They worked for me.

  1. Make a backup of your services.jar on your device (or alternatively make a nandroid backup): adb shell cp /system/framework/services.jar /system/framework/services.jar.bak
  2. Get services.jar from your device: adb pull /system/framework/services.jar .
  3. Extract classes.dex from services.jar
  4. Decompile the .dex file: java -jar baksmali.jar classes.dex -o outputdir
  5. Make desired edits to the files now in outputdir/
  6. Recompile the .dex file: java -Xmx512M -jar smali.jar outputdir/ -o classes.dex
  7. Add the new (modified) classes.dex file to the existing services.jar file (which is actually a zip file)
  8. Cross your fingers and push services.jar back to your device: adb push services.jar /system/framework/services.jar
  9. Reboot device: adb reboot


In addition to these steps, I wanted to mention a few things... these might be obvious to most, but hopefully they help someone.

- to extract and re-add classes.dex from/to services.jar, use winzip
- to modify the .smali files that Steel mentions, use notepad
- you will need to mount /system as read/write before you can push services.jar back to the phone
- it took a long time for my phone to reboot... i got pretty nervous :)

thanks again, I love not having the alarm and gps icons taking up space
 
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.