[HELP] [THEME] Need help with services.jar - Nexus One Themes and Apps

Hi,
for cyanogen5Beta4 I have a services.jar with white text at notification bar.
Now I have the new MoDaCo release and there is the text black.
I want white text.
this text is in the services.jar
Could anybody help me and explain, how to configure this services.jar to get white text instead of black text.
Thank you!

You need to run the colorchanger on it. Every rom is different pretty much. You need to do that every time you change the colors of the text.

This is how enomther (so all credit goes to him) explained to me on how to change it.
You can get smali/baksmali here.
I use PSPad to edit the files in windows. I right click and select open with PSPad.
Once you crack open services.jar/classes.dex with baksmali ....there are (2) files of concern, the first is com/android/server/status/StatusBarIcon.smali ... locate this file and open it up and search for ...
Code:
invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTextColor(I)V
Above that line (2 lines up) ... you'll see ...
Code:
const/high16 v6, -0x100
That's black .. change to ...
Code:
const v6, -0x1
That's white ... this is a simply color change and easier since invoke-virtual is going to give us color out right ... we just have to change the color.
Then locate file ... com/android/server/status/com/android/server/status/StatusBarService.smali
There are (3) lines you need to search for here ... now they don't have inherent color change properties anymore ... which is why colorChange.jar is jacked up for you.
The threes lines to search for (and yes they are each in different places of the file) ... are ...
Code:
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mDateView:Lcom/android/server/status/DateView;
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mSpnLabel:Landroid/widget/TextView
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mPlmnLabel:Landroid/widget/TextView;
Again, since these are iput-object calls ... there's no inherent color changing properties ....
You must add the (2) color change lines above each of these lines ... the first lines set a variable for the color value (which in the example) ... the second line forces the text to that color with a call to setTextColor(). So when you're done ... those three lines will be 9 lines (3 lines in 3 seperate places in the file) ... as such ...
Code:
const v8, -0x1
invoke-virtual {v7, v8}, Landroid/widget/TextView;->setTextColor(I)V
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mDateView:Lcom/android/server/status/DateView;
Code:
const v8, -0x1
invoke-virtual {v7, v8}, Landroid/widget/TextView;->setTextColor(I)V
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mSpnLabel:Landroid/widget/TextView;
Code:
const v8, -0x1
invoke-virtual {v7, v8}, Landroid/widget/TextView;->setTextColor(I)V
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mPlmnLabel:Landroid/widget/TextView;
See how we're now setting a color variable and calling invoke-virtual prior to iput-object? ... that's the magic.
Save all that up and then run smali ... reinsert your classes.dex ... and you should be all set.
~enom~
Click to expand...
Click to collapse

Oh holy....
Wow, okay. Thank you both for reply.
Now I've been looking for an english teacher who can help me....
OK, it looks awesome. I wanna look to do what I can!
Thank you again!

Hah, I can't get it.
I've downloaded this three programms, but nothing works really.
Baksmali.jar doesn't start.
I've got an windows machine....

OK, some things I did now.
Thanks for your help.
But the clock on the upper right corner is black anymore.
If somebody could give me a tipp please.
I now have checked it twice, but can't find my failure.
The other things are quite white. They work, only the clock...

david1171 said:
This is how enomther (so all credit goes to him) explained to me on how to change it.
You can get smali/baksmali here.
I use PSPad to edit the files in windows. I right click and select open with PSPad.
Click to expand...
Click to collapse
Isn't that what the colorchanger does automatically? Not arguing or anything, but holy **** that looks complicated! I just use the colorchanger on my morphs...

Colorchanger?
You make me smile... Any Link to this?

Formel-LMS said:
Colorchanger?
You make me smile... Any Link to this?
Click to expand...
Click to collapse
File available here
Rename the file to just colorchangev3.jar (or something shorter if you prefer. I use cc3.jar personally)
You will need the java jdk set up on your computer. I made a pretty in-depth thread on this subject over on AOD
If you have any questions on it, hit me up. Preferably over there since I check it more often than here.

Thank you for your reply. I'm coming over to you. Now, I've take my first look.

im trying to do this on a galaxy s... is there something I am doing wrong... I did the first change... changing anything with the other three lines throws a forceclose loop upon reboot
any thoughts?

Related

[SOLVED] Text notification on BlackBar in black.

Anyone know how to modify it?
I have made this change on my services.jar but I have notification in bakc and I have black bar.
Any chance to have it in white?
Once you crack open services.jar/classes.dex with baksmali ....there are (2) files of concern, the first is com/android/server/status/StatusBarIcon.smali ... locate this file and open it up and search for ...
Code:
invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTextColor(I)V
Above that line (2 lines up) ... you'll see ...
Code:
const/high16 v6, -0x100
That's black .. change to ...
Code:
const v6, -0x1
That's white ... this is a simply color change and easier since invoke-virtual is going to give us color out right ... we just have to change the color.
Then locate file ... com/android/server/status/com/android/server/status/StatusBarService.smali
There are (3) lines you need to search for here ... now they don't have inherent color change properties anymore ... which is why colorChange.jar is jacked up for you.
The threes lines to search for (and yes they are each in different places of the file) ... are ...
Code:
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mDateView:Lcom/android/server/status/DateView;
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mSpnLabel:Landroid/widget/TextView
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mPlmnLabel:Landroid/widget/TextView;
Again, since these are iput-object calls ... there's no inherent color changing properties ....
You must add the (2) color change lines above each of these lines ... the first lines set a variable for the color value (which in the example) ... the second line forces the text to that color with a call to setTextColor(). So when you're done ... those three lines will be 9 lines (3 lines in 3 seperate places in the file) ... as such ...
Code:
const v8, -0x1
invoke-virtual {v7, v8}, Landroid/widget/TextView;->setTextColor(I)V
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mDateView:Lcom/android/server/status/DateView;
Code:
const v8, -0x1
invoke-virtual {v7, v8}, Landroid/widget/TextView;->setTextColor(I)V
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mSpnLabel:Landroid/widget/TextView;
Code:
const v8, -0x1
invoke-virtual {v7, v8}, Landroid/widget/TextView;->setTextColor(I)V
iput-object v7, p0, Lcom/android/server/status/StatusBarService;->mPlmnLabel:Landroid/widget/TextView;
See how we're now setting a color variable and calling invoke-virtual prior to iput-object? ... that's the magic.
Save all that up and then run smali ... reinsert your classes.dex ... and you should be all set.
Click to expand...
Click to collapse
Re: [HELP] Text notification on BlackBar in black.
look back through the posts for one named services.jar it explains it, Ithink it is back pretty far
Sent from my Nexus One using the XDA mobile application powered by Tapatalk
psylink said:
look back through the posts for one named services.jar it explains it, Ithink it is back pretty far
Sent from my Nexus One using the XDA mobile application powered by Tapatalk
Click to expand...
Click to collapse
All are in white but text notification in black.
I have made all modify in previous post.
framework-res.apk/res/layout/status_bar.xml
david1171 said:
framework-res.apk/res/layout/status_bar.xml
Click to expand...
Click to collapse
Thanks
Now It's work
www1 said:
Thanks
Now It's work
Click to expand...
Click to collapse
anyway you can make a zip file to install with the recovery or install with metamorph? i have the black status bar with black text clock and cant see it that well white would be better

[Q] Anyone Know Which .Smali and Entry to Remove Headset Icon?

I'm trying to get rid of the headset icon in my notification bar and I can't find the .smali and entry I need to edit on the forums or Google. I have no idea how to go about finding it and I don't want to just start messing around in the services.jar. Does anyone know it off hand and can point me where to go? Thanks.
If anyone doesn't know the specific thing needing editing, can you point me in the direction I need to go to figure out what I need?
brandontowey said:
If anyone doesn't know the specific thing needing editing, can you point me in the direction I need to go to figure out what I need?
Click to expand...
Click to collapse
Open framework-res.apk and find drawable with this icon. Then search for it in XMLs or smali files.
Brut.all said:
Open framework-res.apk and find drawable with this icon. Then search for it in XMLs or smali files.
Click to expand...
Click to collapse
Sweet. Thanks.
I'm pretty sure I found the entry in StatusBarPolicy.smali:
.line 848
iget-object v6, p0, Lcom/android/server/status/ StatusBarPolicy;mHeadsetIcon:Lcom/android/server/status/IconData;
const v7, 0x1080363
iput v7, v6, Lcom/android/server/status/IconData;->iconId:I
goto :goto_43
Click to expand...
Click to collapse
I'm not sure how to edit it to get the icon to be hidden. I checked out the how-to on the GPS, Battery, Clock and Alarm and there's not discernible pattern to the different edits. Can anyone help a brotha out?
bump. I don't know computer code, no idea how to go about figuring this out.
Above lines are just to initialize some variables. Find where Lcom/android/server/status/IconData;->iconId:I is used.
Brut.all said:
Above lines are just to initialize some variables. Find where Lcom/android/server/status/IconData;->iconId:I is used.
Click to expand...
Click to collapse
In HTCCdmaStatusBar.smali, there are 4 instances of that:
Code:
.line 342
:pswitch_4
iget-object v0, p0, Lcom/android/server/status/HtcCdmaStatusBar;->mMtGpsIconData:Lcom/android/server/status/IconData;
const v1, 0x20205e2
iput v1, v0, Lcom/android/server/status/IconData;->iconId:I
goto :goto_3
Code:
.line 348
:pswitch_c
iget-object v0, p0, Lcom/android/server/status/HtcCdmaStatusBar;->mMtGpsIconData:Lcom/android/server/status/IconData;
const v1, 0x20205dc
iput v1, v0, Lcom/android/server/status/IconData;->iconId:I
goto :goto_3
Code:
.line 355
:pswitch_14
iget-object v0, p0, Lcom/android/server/status/HtcCdmaStatusBar;->mMtGpsIconData:Lcom/android/server/status/IconData;
const v1, 0x20205de
iput v1, v0, Lcom/android/server/status/IconData;->iconId:I
goto :goto_3
Code:
.line 362
:pswitch_1c
iget-object v0, p0, Lcom/android/server/status/HtcCdmaStatusBar;->mMtGpsIconData:Lcom/android/server/status/IconData;
const v1, 0x20205e0
iput v1, v0, Lcom/android/server/status/IconData;->iconId:I
Am I getting warmer?
bump. I'd love some help with this, I don't think I have it in me to learn how to write whatever code this is so I can figure out how to edit these. Thanks.
Can't copy the link from the xda app but search for (How-To) Remove GPS Reticle on XDA and the read will come up. JsChiSurf posted the needed edit on the second page. Props to him.
Sent from my Evo, who commented on what a purty mouth you have, uh-huh.

[MOD][HOW TO] remove am/pm from statusbar clock by modding services.jar

Since there is somewhat of a lack of how to's in these forums, I decided to post one for this mod. Linked to me by mysteryemotionz, the thread i pulled it from is here:
http://forum.xda-developers.com/showthread.php?t=946647
I winmerged the edited files and replicated it on the Epic. I'm going to assume you have somewhat of an idea of what you are doing, so please read up and search if you have noob questions, the answers are out there. Other than that I'm happy to help.
This was written for DK28 but the same steps work on EB13.
Flashable zip.
Must have java runtime environment installed and have smali.jar and baksmali.jar.
1.) Pull classes.dex out of /system/framework/services.jar with 7zip
2.) Decompile classes.dex (java -jar baksmali.jar -o classout/ classes.dex)
3.) Edit C:\smali\classout\com\android\server\status\StatusBarIcon.smali with Notepad++
4.) Make the following changes and save the file:
At line 48 change:
Code:
.line 51
iget v6, p2, Lcom/android/server/status/IconData;->type:I
packed-switch v6, :pswitch_data_9a
TO:
Code:
.line 51
iget v6, p2, Lcom/android/server/status/IconData;->type:I
packed-switch v6, :pswitch_data_9c
---------------------------------
At line 93 change:
Code:
.line 63
const/4 v6, 0x6
invoke-virtual {v4, v6, v8, v8, v8}, Landroid/widget/TextView;->setPadding(IIII)V
.line 64
invoke-virtual {v4, v2}, Landroid/widget/TextView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V
.line 65
iget-object v6, p2, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;
invoke-virtual {v4, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
.line 66
iput-object v4, p0, Lcom/android/server/status/StatusBarIcon;->view:Landroid/view/View;
goto :goto_10
.line 72
.end local v2 #layoutParams:Landroid/widget/LinearLayout$LayoutParams;
.end local v4 #t:Landroid/widget/TextView;
:pswitch_3f
const-string v6, "layout_inflater"
invoke-virtual {p1, v6}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/view/LayoutInflater;
TO:
Code:
.line 63
const/4 v6, 0x6
const/16 v7, -0x26
invoke-virtual {v4, v6, v8, v7, v8}, Landroid/widget/TextView;->setPadding(IIII)V
.line 64
invoke-virtual {v4, v2}, Landroid/widget/TextView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V
.line 65
iget-object v6, p2, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;
invoke-virtual {v4, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
.line 66
iput-object v4, p0, Lcom/android/server/status/StatusBarIcon;->view:Landroid/view/View;
goto :goto_10
.line 72
.end local v2 #layoutParams:Landroid/widget/LinearLayout$LayoutParams;
.end local v4 #t:Landroid/widget/TextView;
:pswitch_41
const-string v6, "layout_inflater"
invoke-virtual {p1, v6}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/view/LayoutInflater;
-----------------------------------
At line 175 change:
Code:
.line 86
iget v6, p2, Lcom/android/server/status/IconData;->number:I
if-lez v6, :cond_93
TO:
Code:
.line 86
iget v6, p2, Lcom/android/server/status/IconData;->number:I
if-lez v6, :cond_95
------------------------------------
At line 208 change:
Code:
.line 90
:cond_93
const/16 v6, 0x8
invoke-virtual {v3, v6}, Landroid/widget/TextView;->setVisibility(I)V
goto/16 :goto_10
.line 51
:pswitch_data_9a
.packed-switch 0x1
:pswitch_11
:pswitch_3f
.end packed-switch
.end method
.method static getIcon(Landroid/content/Context;Lcom/android/server/status/IconData;)Landroid/graphics/drawable/Drawable;
.registers 9
.parameter "context"
.parameter "data"
.prologue
const/4 v5, 0x0
const-string v6, "StatusBar"
TO:
Code:
.line 90
:cond_95
const/16 v6, 0x8
invoke-virtual {v3, v6}, Landroid/widget/TextView;->setVisibility(I)V
goto/16 :goto_10
.line 51
:pswitch_data_9c
.packed-switch 0x1
:pswitch_11
:pswitch_41
.end packed-switch
.end method
.method static getIcon(Landroid/content/Context;Lcom/android/server/status/IconData;)Landroid/graphics/drawable/Drawable;
.registers 9
.parameter "context"
.parameter "data"
.prologue
const/4 v5, 0x0
const-string v6, "StatusBar"
5.) Recompile to new-classes.dex. (java -Xmx512M -jar smali.jar classout/ -o new-classes.dex)
6.) With 7zip, replace classes.dex with your new-classes.dex in services.jar, but be sure to rename it back to classes.dex.
7.) Place in a flashable zip and flash away.
Oooooo yeaaaaaaaaaaaaa
yeah i just updated OP mentioning the addon section of the theme in my sig has a flashable zip already posted fyi.
I'm glad it worked
Android Creative Syndicate- From spontaneous ingenuity, comes creative brilliance
Ok so just for clarification, do I just need to flash the zip or do I need to do the instructions?
Thanks for this info also
Just what I was looking for! Time to reflash
Thanks everyone!
Nice!
...is it possible to change just the AM/PM size? I've been trying to figure that one out.. I just like the looks of it being smaller like in CM
Edit:
StatusBarIcon.smali is identical in CM and our Framework.. must be someplace else lol such a battle to change a font size.
mysteryemotionz mentioned in framework-res.apk, i think in res/layout there is timepicker.xml and maybe one other xml related to time. i havent checked but it might be in there where the font size is.
amosher13 said:
mysteryemotionz mentioned in framework-res.apk, i think in res/layout there is timepicker.xml and maybe one other xml related to time. i havent checked but it might be in there where the font size is.
Click to expand...
Click to collapse
Unfortintly I was wrong with the xml. Thedub already pointed it ot to me.
Android Creative Syndicate- From spontaneous ingenuity, comes creative brilliance
so for clarification, is it actually possible to change the font size throughout the system?
yogi2010 said:
so for clarification, is it actually possible to change the font size throughout the system?
Click to expand...
Click to collapse
its got to be at least for some items. a lot of it will be in framework-res.apk in res/values/styles i think. a lot of the text parameters are here. others are in res/layout etc.... depends on what you want to change. and i'm only familiar with a very small number of them tbh. but check out dreams theme guides in the themes and apps section if you wanna read up on how to decompile an apk and get into this stuff.
amosher13, does this move the clock over or does it actually remove am & pm?
birgertime said:
amosher13, does this move the clock over or does it actually remove am & pm?
Click to expand...
Click to collapse
It removes the am pm and pushes the clock over
Android Creative Syndicate- From spontaneous ingenuity, comes creative brilliance
Same question
konaman said:
Ok so just for clarification, do I just need to flash the zip or do I need to do the instructions?
Thanks for this info also
Click to expand...
Click to collapse
Just flash it
Android Creative Syndicate- From spontaneous ingenuity, comes creative brilliance
Hi sorry to bump this old thread but I've been experimenting with the code snippets in OP's post.
Code:
.line 63
const/4 v6, 0x6
const/16 v7, -0x26
invoke-virtual {v4, v6, v8, v7, v8}, Landroid/widget/TextView;->setPadding(IIII)V
is the only part that really matters apparently. The rest of the code is just shuffling around some resource names for some reason. As I dont actually own an epic 4g (I did this on a dell streak with a rom based on 2.2.2/FRG83G) I dont know what's going on with the mass renaming.
the code works as is: register v7 is loaded to c in setpadding( a, b, c, d) (i dont know what the final variable is in the actual smali code)
which is
Code:
setPadding(int left, int top, int right, int bottom)
Sets the padding.
hence loading a negative value will push it farther to the right.
At least on my rom 0x1 != 1 pixel. It's closer to 0x1 = ~1.5-2.5 pixels as -0x20 leaves 1 visible pixel of AM but -0x21 cuts off the last time digit by approx 1-2 pixels. For mine i'd need like -0x20.5 but as this is hex that's nonsensical.
A better way would be to find where the AM and PM strings get loaded and to NOP that or to change it to a blank/null string, but I have no idea where that is.
TheManii said:
Hi sorry to bump this old thread but I've been experimenting with the code snippets in OP's post.
Code:
.line 63
const/4 v6, 0x6
const/16 v7, -0x26
invoke-virtual {v4, v6, v8, v7, v8}, Landroid/widget/TextView;->setPadding(IIII)V
is the only part that really matters apparently. The rest of the code is just shuffling around some resource names for some reason. As I dont actually own an epic 4g (I did this on a dell streak with a rom based on 2.2.2/FRG83G) I dont know what's going on with the mass renaming.
the code works as is: register v7 is loaded to c in setpadding( a, b, c, d) (i dont know what the final variable is in the actual smali code)
Click to expand...
Click to collapse
+1 -- It would seem TheManii is quite correct with the code snippet he posted above.
It does represent the only change which is necessary to move the clock over to hide the AM/PM.
@amosher13
It appears when you used WinMerge to get a diff between the files you received a handful insignifigant deviations in the resource names probably caused by the difference in source device of the files.
Thank you both for your efforts!
TheManii said:
Code:
setPadding(int left, int top, int right, int bottom)
Sets the padding.
hence loading a negative value will push it farther to the right.
At least on my rom 0x1 != 1 pixel. It's closer to 0x1 = ~1.5-2.5 pixels as -0x20 leaves 1 visible pixel of AM but -0x21 cuts off the last time digit by approx 1-2 pixels. For mine i'd need like -0x20.5 but as this is hex that's nonsensical.
A better way would be to find where the AM and PM strings get loaded and to NOP that or to change it to a blank/null string, but I have no idea where that is.
Click to expand...
Click to collapse
@TheManii
Based on the related XML, it certainly looks like the values here are in the dp unit, so, for the screen size of our devices, the values would indeed be multiplied by about 1.5.
Also, I'm fairly certain the time gets loaded with the AM/PM attached, as with the dateformat class, which would require additional formatting to get rid of it.
I have sort of thought about possibly using the simpledateformat class to change the am/pm to a/p, but now I moved my clock next to the date in the pulldown.
Check this out
How funny is this?...I'm looking around XDA for info on date formatting, and I stumble across this post JsChiSurf over in the EVO 4G forums.
http://forum.xda-developers.com/showpost.php?p=11753928&postcount=187
It's so simple...I'm far to new to this smali stuff, so I had no idea this method of manipulating the string would work.
Anyhow, I manually merge the appropriate changes into our StatusBarPolicy.smali, then created a diff for ya'll to see the changes.
Code:
--- StatusBarPolicy.smali.orig 2011-08-14 15:19:35.000000000 -0500
+++ StatusBarPolicy.smali 2011-08-14 15:29:04.000000000 -0500
@@ -4919,7 +4919,7 @@
.end method
.method private final updateClock()V
- .registers 5
+ .locals 6
.prologue
.line 889
@@ -4948,6 +4948,22 @@
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;
This is certainly the most direct way to do it by totally removing the am/pm indicator....Thanks, JsChiSurf!!!
Code diff seems to work perfectly, i'll do a code analysis in psuedocode soon and explain what the code does, but basically it does (one of the two ways) what i expected needed to get done;
Basically it:
get formatted date from java/text/dateformat and shove it into string1
shove it into a tempory string2
make temporary string2 with " AM" and temporary string 3 with ""
calls the replacecharsequence(string1, string2, string3)
which does "for every time it sees string2 inside string one, replace it with string3"
and does the entire thing again for PM
it seems to work perfectly with 12/24h clock just like on GB, no messy moving the entire statusbar rightwards

[MOD][How To][EB13][3/1/11] AOSP Lockscreen! with/out haptic / uninstallers / mods!!

I know a bunch of people have been waiting on this so here you go, I bring you the AOSP lockscreen for EB13!
MUST BE ON A DEODEXED EB13 ROM!!! I wouldnt flash any of these over SyndicateROM as they wont be compatible until we can get compatible versions posted.
EB13 AOSP Lockscreen - Download (android.policy.jar)
With Haptic Feedback Removed - Download (android.policy.jar AND framework.jar)
Replace Haptic Feedback - Download (only replaces framework.jar, will still have AOSP lockscreen!)
TW lockscreen - Download (replaces to stock only android.policy.jar)
Remove Haptic Feedback for Bonsai 3.0.1 - Download (does NOT flash AOSP lockscreen, only framework.jar compatible with Bonsai which removes haptic feedback from AOSP lockscreen if you already have it installed. try a theme with AOSP lock.
Replace haptic feedback for Bonsai 3.0.1 - Download
Remove haptic feedback for SRF 1.0.1 - Download (same deal as Bonsai, framework.jar only)
Replace haptic feedback for SRF 1.0.1 - Download
credit to raiderep for getting us the aosp lockscreen for DK28 AND for removing haptic feedback, i basically just winmerged his changes against stock to figure out the mod.
as he did, i should post the files to revert, i'll get those up soon.
How To Create AOSP Lockscreen from stock android.policy.jar:
1.) Pull classes.dex out of android.policy.jar with 7zip
2.) java -jar baksmali.jar -o classout/ classes.dex
3.) Open com\android\internal\policy\impl\LockPatternKeyguardView.smali
4.) Change:
Code:
.line 1344
sget-object v0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;->PuzzleLock:Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;
.line 1347
:goto_8
return-object v0
:cond_9
sget-object v0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;->GlassLock:Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;
to this:
Code:
.line 1344
sget-object v0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;->TapLock:Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;
.line 1347
:goto_8
return-object v0
:cond_9
sget-object v0, Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;->TapLock:Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;
basically, you are just changing "PuzzleLock" and "GlassLock" both to "TapLock"
5.) In the same directory, open LockScreen.smali
6.) Find (not quite half way down):
Code:
.line 172
.local v1, fileOverride:Z
if-eqz v0, :cond_23
if-nez v2, :cond_23
if-eqz v1, :cond_25
:cond_23
const/4 v4, 0x1
:goto_24
return v4
:cond_25
move v4, v6
goto :goto_24
.end method
in the above, change:
Code:
:goto_24
return v4
to:
Code:
:goto_24
return v6
7.) Recompile: java -Xmx512M -jar smali.jar classout/ -o new-classes.dex
8.) Rename new-classes.dex to classes.dex and replace inside android.policy.jar with 7zip
----
To mod framework.jar to remove haptic feedback from AOSP lockscreen:
1.) Pull classes.dex out of framework.jar with 7zip
2.) java -jar baksmali.jar -o classout/ classes.dex
3.) Open com\android\internal\widget\SlidingTab.smali
4.) Change:
Code:
.method private declared-synchronized vibrate(J)V
.registers 5
.parameter "duration"
.prologue
.line 808
monitor-enter p0
:try_start_1
iget-object v0, p0, Lcom/android/internal/widget/SlidingTab;->mVibrator:Landroid/os/Vibrator;
if-nez v0, :cond_14
.line 809
invoke-virtual {p0}, Lcom/android/internal/widget/SlidingTab;->getContext()Landroid/content/Context;
move-result-object v0
const-string/jumbo v1, "vibrator"
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/Vibrator;
iput-object v0, p0, Lcom/android/internal/widget/SlidingTab;->mVibrator:Landroid/os/Vibrator;
.line 812
:cond_14
iget-object v0, p0, Lcom/android/internal/widget/SlidingTab;->mVibrator:Landroid/os/Vibrator;
invoke-virtual {v0, p1, p2}, Landroid/os/Vibrator;->vibrate(J)V
:try_end_19
.catchall {:try_start_1 .. :try_end_19} :catchall_1b
.line 813
monitor-exit p0
return-void
.line 808
:catchall_1b
move-exception v0
monitor-exit p0
throw v0
.end method
to this:
Code:
.method private declared-synchronized vibrate(J)V
.registers 5
.parameter "duration"
return-void
.prologue
.line 808
monitor-enter p0
:try_start_2
iget-object v0, p0, Lcom/android/internal/widget/SlidingTab;->mVibrator:Landroid/os/Vibrator;
if-nez v0, :cond_15
.line 809
invoke-virtual {p0}, Lcom/android/internal/widget/SlidingTab;->getContext()Landroid/content/Context;
move-result-object v0
const-string/jumbo v1, "vibrator"
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/Vibrator;
iput-object v0, p0, Lcom/android/internal/widget/SlidingTab;->mVibrator:Landroid/os/Vibrator;
.line 812
:cond_15
iget-object v0, p0, Lcom/android/internal/widget/SlidingTab;->mVibrator:Landroid/os/Vibrator;
invoke-virtual {v0, p1, p2}, Landroid/os/Vibrator;->vibrate(J)V
:try_end_1a
.catchall {:try_start_2 .. :try_end_1a} :catchall_1c
.line 813
monitor-exit p0
return-void
.line 808
:catchall_1c
move-exception v0
monitor-exit p0
throw v0
.end method
5.) Recompile: java -Xmx512M -jar smali.jar classout/ -o new-classes.dex
6.) Rename new-classes.dex to classes.dex and replace inside framework.jar with 7zip
----------------------------------------------
From raiderep, dont forget to thank him for this:
raiderep said:
Ok here is another mod for aosp lockscreen, might as well keep all this in one thread. Maybe add it to the OP if you'd like. Credit goes to chibucks over at SDX, I just used a mod he posted for the moment and with a small change it worked on my epic. This will give you a custom image on your lockscreen(aosp only afaik)
First decompile framework-res.apk and nav to res/layout/keyguard_screen_tab_unlock.xml. edit the second line as follows:
change the android:background="#70000000" on this line
Code:
<RelativeLayout android:gravity="center_horizontal" android:id="@id/root" android:background="#70000000" android:layout_width="fill_parent" android:layout_height="fill_parent"
to android:background="@drawable/default_wallpaper" like this
Code:
<RelativeLayout android:gravity="center_horizontal" android:id="@id/root" android:background="@drawable/default_wallpaper" android:layout_width="fill_parent" android:layout_height="fill_parent"
now this edit seems to make it call on the image called default_wallpaper in the drawable folder but when I first tried it the image on the lockscreen was actually the default_wallpaper image found in drawable-hdpi so...
the next step is to add in your custom image while still decompiled, I don't think you can add it in after recompiling,everytime I tried it bootlooped the phone but I was changing it to a png so if you keep it a jpg it might not YMMV(haven't tried to replace the jpg after a recompile)
this image can be a png for transparency if you'd like just make sure you delete the jpg thats already in there, or replace the jpg if you don't want transparency, png is better either way in my opinion...
So basically you just stick your custom image in the drawable-hdpi folder and make sure its the only one called default_wallpaper whether its a png or jpg.
recompile framework-res.apk and enjoy
Click to expand...
Click to collapse
my assumption is that if you add it in AFTER compiling, you would have to stick with a jpg, since that is what the default is. but if you want a png, change it out before compiling, thanks again raiderep!
anyway to get without heptic feedback ?
cballin22 said:
anyway to get without heptic feedback ?
Click to expand...
Click to collapse
ooh, i can try
Glad you got it because I forgot how I did it...
As for haptic removal, I did it for di18 and dk28 so you can figure it out the same way I'm sure. Check my blue theme or the dk28 thread for the mod. Its a change in framework.jar I believe. I'm looking at getting a nexus s possibly so its good to see someone getting busy with this stuff. Sprint is ticking me off and I've lost my motivation, sorry guys
sent by an Epic4g through the cosmos
raiderep said:
Glad you got it because I forgot how I did it...
As for haptic removal, I did it for di18 and dk28 so you can figure it out the same way I'm sure. Check my blue theme or the dk28 thread for the mod. Its a change in framework.jar I believe. I'm looking at getting a nexus s possibly so its good to see someone getting busy with this stuff. Sprint is ticking me off and I've lost my motivation, sorry guys
sent by an Epic4g through the cosmos
Click to expand...
Click to collapse
Cool, i may consider switching to this lockscreen once the new bonsai is out.
@raiderrep
You going to port your theme on the official froyo?
yea so far im using it with the eb13 ext 4 rom using cm6 and it works fine along with the genocide oc kernal i just dont like the heptic feedback with it ... i wonder since now eb13 is out that the lockscreen that i have seen on the evo is able to be ported with the 4 option asop config
Yay, been waiting 4 this
Sent from my SPH-D700 using XDA App
Did anyone manage to fix the landscape issues? I pointed out a few months ago that we have images missing in order for landscape to work properly. We need some who like XML in order to fix it. Any takers?
Great job getting this ported over.... Also thanks for the other mods as well.
raiderep said:
Glad you got it because I forgot how I did it...
As for haptic removal, I did it for di18 and dk28 so you can figure it out the same way I'm sure. Check my blue theme or the dk28 thread for the mod. Its a change in framework.jar I believe. I'm looking at getting a nexus s possibly so its good to see someone getting busy with this stuff. Sprint is ticking me off and I've lost my motivation, sorry guys
sent by an Epic4g through the cosmos
Click to expand...
Click to collapse
oof, that is sad to hear, you're a good resource and have helped me a lot! so yeah i can check your past mods to see how the haptic was removed, hopefully i dont get stuck, lol. cause i really dont "understand" what i'm doing as much as am replicating what others have done.
ptfdmedic said:
Did anyone manage to fix the landscape issues? I pointed out a few months ago that we have images missing in order for landscape to work properly. We need some who like XML in order to fix it. Any takers?
Great job getting this ported over.... Also thanks for the other mods as well.
Click to expand...
Click to collapse
no it doesnt look like those are fixed. i dont think its missing images, we have those in framework-res.apk/res/drawable-land-hdpi i believe. i think its more of a jar file (android.policy?) maybe not calling them correctly. i'll poke around in the files but again, i wont really know what i'm looking for.
amosher13 said:
oof, that is sad to hear, you're a good resource and have helped me a lot! so yeah i can check your past mods to see how the haptic was removed, hopefully i dont get stuck, lol. cause i really dont "understand" what i'm doing as much as am replicating what others have done.
no it doesnt look like those are fixed. i dont think its missing images, we have those in framework-res.apk/res/drawable-land-hdpi i believe. i think its more of a jar file (android.policy?) maybe not calling them correctly. i'll poke around in the files but again, i wont really know what i'm looking for.
Click to expand...
Click to collapse
We are actually missing files. I posted them in the original thread a few months ago. I noticed them while digging through the Nexus S dump. There are a dozen or so images that are missing. I'll see if I can find the post and link you to it.
EDIT: Here is the link
@amosher13 - I think the only thing I can say I did on my own was get the aosp lockscreen fixed on dk28(it was half done) so I'm like you and simply figure out how to make it work from the previous success of others. Not much in these forums is original work, its a community effort.
If you have trouble with the haptic removal I'll lend a hand.
The landscape issue might be because they only programmed it for phones without a slider but not sure. I am thinking it calls on the same images for either mode so it might take some heavy lifting to get it working right. Maybe making new resource ids and images as well as new xmls/smalis or methods...
sent by an Epic4g through the cosmos
raiderep said:
@amosher13 - I think the only thing I can say I did on my own was get the aosp lockscreen fixed on dk28(it was half done) so I'm like you and simply figure out how to make it work from the previous success of others. Not much in these forums is original work, its a community effort.
If you have trouble with the haptic removal I'll lend a hand.
The landscape issue might be because they only programmed it for phones without a slider but not sure. I am thinking it calls on the same images for either mode so it might take some heavy lifting to get it working right. Maybe making new resource ids and images as well as new xmls/smalis or methods...
sent by an Epic4g through the cosmos
Click to expand...
Click to collapse
Word.
In either case, i think i've got the haptic feedback removed ready to go, posted in the OP, stuck in a meeting and unable to test atm. if someone wants to give it a shot, be my guest and report back, make a backup first!
amosher13 said:
I know a bunch of people have been waiting on this so here you go, I bring you the AOSP lockscreen for EB13!
Click to expand...
Click to collapse
Is there any real difference between this one and the one already available for DK28? I flashed the DK28 version and it works fine for me on EB13 ROM.
anythingbutmine said:
Is there any real difference between this one and the one already available for DK28? I flashed the DK28 version and it works fine for me on EB13 ROM.
Click to expand...
Click to collapse
there is honestly probably not "MUCH" different, but there could be all kinds of minor things changed between versions. For instance, the DK17 one was thought to work on DK28 (builds only 11 days apart) but some of the string references were off. i'd flash this to be safe.
also: OP updated with confirmed working AOSP lockscreen with haptic feedback removed. framework.jar is also included in that zip.
anythingbutmine said:
Is there any real difference between this one and the one already available for DK28? I flashed the DK28 version and it works fine for me on EB13 ROM.
Click to expand...
Click to collapse
It may be that the androidpolicy.jar from dk28 is identical to eb13's but better safe than sorry.
sent by an Epic4g through the cosmos
raiderep said:
@amosher13 - I think the only thing I can say I did on my own was get the aosp lockscreen fixed on dk28(it was half done) so I'm like you and simply figure out how to make it work from the previous success of others. Not much in these forums is original work, its a community effort.
If you have trouble with the haptic removal I'll lend a hand.
The landscape issue might be because they only programmed it for phones without a slider but not sure. I am thinking it calls on the same images for either mode so it might take some heavy lifting to get it working right. Maybe making new resource ids and images as well as new xmls/smalis or methods...
sent by an Epic4g through the cosmos
Click to expand...
Click to collapse
You are correct as I looked into this. The images are there for both landscape and portrait. The problem is that it wants to display the portrait images. We need to figure out what controls the lock screen in landscape and get it to change the images that are being called. As I see it by switching bool to true its just basically rotating the screen when the keyboard slides up
Sent from my SPH-D700 using Tapatalk
Flashed this and no lockscreen? What am i doing wrong.
Just transferred the zip file to my sd card and installed zip in clockwork.
1greek4u said:
Flashed this and no lockscreen? What am i doing wrong.
Just transferred the zip file to my sd card and installed zip in clockwork.
Click to expand...
Click to collapse
nooooo lockscreen?!?!?! no idea, might try reflashing, never seen or even heard of that before. maybe even just reboot and see what happens, its working over here.
----
also, for anyone interested i have a hunch to look through framework.jar, there have to be (at least, lol) 2 places where its calling for the portrait jog dial pngs. so one of them has to be landscape and maybe it would be just changing the resource ids to the landscape pngs. i'll report back obviously but if anyone else wants to take a look be my guest.
I love it. Thank you so much!! I've forever had this quirk of my phone unlocking to lock screen after turning the screen off..... and this fixed that. Thanks!
Sent from my SPH-D700 using XDA App
You the man. I'm going to add this and all previous versions to the wiki, very useful modification.
Sent from my SPH-D700 using XDA App

[Q] Code to edit from statusbarpolicy.smali to remove battery icon (InfinityRom)?

So I recently found the awesome "battery bar" in the market, and now I am looking to remove the battery icon from the status bar, not just replace it with a blank spot mind you, but have the other icons shift right. I've gotten as far as to pull systemui.apk, decompile with baksmali, and open statusbarpolicy.smali. I've tried to edit the codes myself based on other threads but they are all slightly different (android versions/roms?) and I keep demolishing my status bar, as well as getting some other funky unwanted homescreen action.
Anyway, am I correct in finding that it is one of these two sets of code? Or possibly both that I have to edit? And what do I change it to?:
Code:
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/StatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v1, "battery"
const v2, 0x10802da
invoke-virtual {v0, v1, v2, v4}, Landroid/app/StatusBarManager;->setIcon(Ljava/lang/String;II)V
or this..
Code:
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/StatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v3, "battery"
invoke-virtual {v2, v3, v0, v1}, Landroid/app/StatusBarManager;->setIcon(Ljava/lang/String;II)V
Also, i've been using ninjamorph to sign the systemui.apk before I push it, is there another preferred way to sign the apk (by command line) while I am smali compiling after I'm done editing it?
Any help would be greatly appreciated
I'm on TweakStock so this may not apply, but I used the code from this post http://forum.xda-developers.com/showpost.php?p=21621187&postcount=2
Code:
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/StatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v2, "battery"
const v0, 0x0
invoke-virtual {v1, v2, v0}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
return-void
I searched for "updatebattery" and made the edit near the second place it shows up.

Categories

Resources