I take no credit for this modification, it is not an original idea nor does it contain original code. It's an adaptation of the modification for the GT-I9300 by sphinx02 which can be found here. I simply made a few slight modifications to accomodate the SGH-I747.
That being said, I have not tested this on anything other than a SGH-I747, running a stock, deodexed UCALG1 or UCALH1. Whether you choose to use the CWM package or make the edits manually, please exercise caution on other devices and/or ROMs!
"CWM" HOWTO
Download the appropriate package for your firmware (eg. UCLAG1, UCALH1)
Boot into recovery.
Make a nandroid backup.
Flash package.
"MANUAL" HOWTO
This guide assumes a basic understanding of how to decompile/build jar/apk files. If you're not familiar with this process, proceed no further! Instead, please use the CWM package attached to this post!
Decompile /system/framework/android.policy.jar
Extract the attached archive (GlobalActions.zip) to your smali/com/android/internal/policy/impl/ directory.
Perform the following file edits:
FILE: smali/com/android/internal/policy/impl/GlobalActions.smali
FIND:
Code:
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$6;
REPLACE WITH:
Code:
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$99;
FIND:
Code:
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$6;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
REPLACE WITH:
Code:
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
FILE: /smali/com/android/internal/policy/impl/GlobalActions$SinglePressAction.smali
FIND:
Code:
# instance fields
.field private final mIconResId:I
REPLACE WITH:
Code:
# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;
# instance fields
.field private final mIconResId:I
FIND:
Code:
# direct methods
REPLACE WITH:
Code:
# direct methods
.method static constructor <clinit>()V
.locals 3
const/4 v0, 0x3
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Reboot"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Download"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Recovery"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method
Build new android.policy.jar
Upload and replace!
Thanks but
I'm trying to work on old style Android Power Menu with Recovery and Download in the menu.
So far it bootloops after android.policy.jar changes.
But I'm hopeful!
:fingers-crossed:
bravomail said:
I'm trying to work on old style Android Power Menu with Recovery and Download in the menu.
So far it bootloops after android.policy.jar changes.
But I'm hopeful!
:fingers-crossed:
Click to expand...
Click to collapse
Sorry, but what are you trying to do? Are you trying to manually apply the changes yourself?
* Edit: Ah, you're trying to add "Recovery" and "Download" to the main shutdown popup window, rather than having second "Restart" popup window?
Maybe I should give it a try.
ummm...I tried flashing the zip file from recovery menu and it gives an message 'error in zip file..installation aborted'.
pwned101 said:
ummm...I tried flashing the zip file from recovery menu and it gives an message 'error in zip file..installation aborted'.
Click to expand...
Click to collapse
Sorry about that. Try the new package.
magn2o said:
Sorry about that. Try the new package.
Click to expand...
Click to collapse
Ok..this time it flashed without any errors. But no options comes up on the power option. Are u sure it will work on the rooted Stock ROM?
Sorry bro..but I aint trying it anymore unless someone says it works. Not sure what it has done to my ROM now
pwned101 said:
Ok..this time it flashed without any errors. But no options comes up on the power option. Are u sure it will work on the rooted Stock ROM?
Sorry bro..but I aint trying it anymore unless someone says it works. Not sure what it has done to my ROM now
Click to expand...
Click to collapse
You have to hit the Restart option in the power menu. It will then show the options.
You are running a stock DEODEXED ROM, right?
Also, this is just a single file replacement.. its not going to "do" anything to your ROM.
Sent from my Samsung Galaxy S III
magn2o said:
You have to hit the Restart option in the power menu. It will then show the options.
You are running a stock DEODEXED ROM, right?
Also, this is just a single file replacement.. its not going to "do" anything to your ROM.
Sent from my Samsung Galaxy S III
Click to expand...
Click to collapse
Yes,,,im running a stock DEODEXED ROM. I was hoping it'll come up once i press on the reboot option. However, the default ROM popup comes "THis will reboot the phone"..thats it. It doesnt give any option like Recovery/Download. Can someone else confirm?
I'm getting the same
Sent from my SAMSUNG-SGH-I747 using Tapatalk 2
Ok. First off, just let me say that I, personally, do not use CWM; I prefer to make all of my file edits manually.
That being said, I installed CWM just to test this package and get it working. The newly attached archive is working, and I confirmed it no less than 3 times. The issue, apparently, was that the previous installer script wasn't removing the existing android.policy.jar before copying the modified one. This means the previous installers didn't actually do anything (nothing was copied and nothing was deleted). This is now rectified.
Sorry for the inconvenience!
Sent from my Samsung Galaxy S III
it is not working. i just cwm'ed it and nothing has changed.
wavrunrx said:
it is not working. i just cwm'ed it and nothing has changed.
Click to expand...
Click to collapse
Bring up your power menu and hit Restart, you should get a second menu.
Sent from my Samsung Galaxy S III
I've had a few people outside of XDA give the latest CWM package a shot, and it's been working fine.
I'm done with my MOD. It is somewhat half-baked - still brings confirmation dialog. But then goes to recovery or download.
Guide is here http://forum.xda-developers.com/showthread.php?t=1169443
Sorry didnt wrk..
pwned101 said:
Sorry didnt wrk..
Click to expand...
Click to collapse
You're flashing the archive that ends in -2.ZIP, correct?
This is why I don't use CMW. There has to be something else at play here. I'm confident that the CWM archive is working, as I've had 3 people confirm it (not including myself).
At this point, if you want, just copy the android.policy.jar file from the archive manually to your /system/framework using Root Explorer, then reboot. That's all CWM is doing.
Also, you can try reseting your dalvik/cache.
Ok.. I'll give it a go doing it manually.
Sent from my SAMSUNG-SGH-I747 using Tapatalk 2
magn2o said:
Bring up your power menu and hit Restart, you should get a second menu.
Sent from my Samsung Galaxy S III
Click to expand...
Click to collapse
yes your right; i do get a second menu; it says "This device will restart" hit ok, and ..... it restarts.
wavrunrx said:
yes your right; i do get a second menu; it says "This device will restart" hit ok, and ..... it restarts.
Click to expand...
Click to collapse
Ok. I'm through with CWM, it's not worth the headache.
The pre-modified android.policy.jar is attached to the OP, along with instructions on using Root Explorer. If someone else wants to make a CWM flashable package, that's their prerogative.
Related
First I want to make it clear that the techniques I show here are what I found scouring through the xda forums and androidforums.com
Second I am posting this because I see a lot of people asking for custom status bars. Hopefully what I put here will help other people get started or at least try their own ideas.
I want to Thank XxKolohexX for getting me started with theming and pointing me in the right direct. There is a lot I still don't know and need to learn.
I know you can use colorChange.jar v3.1 and colorchange has more options. I have put this out here for people who want to know what is going on underneath. This will also grow.
I AM NOT RESPONSIBLE FOR ANY DAMAGE DONE TO YOUR PHONE, COMPUTER, USB CABLE, TOASTER, OR ANYTHING ELSE FROM YOU USING THESE DIRECTIONS
Ok lets get started
WHAT YOU WILL NEED
Code:
[I][B]A ROOTED PHONE!![/B][/I]
ADB get it here,[URL="http://developer.android.com/sdk/index.html"] the Android SDK[/URL]
baksmali get it [URL="http://smali.googlecode.com/files/baksmali-1.2.2.jar"]here[/URL]
smali get it [URL="http://smali.googlecode.com/files/smali-1.2.2.jar"]here[/URL]
Java
A Hex editor;
for windows try HxD. Get it from [URL="http://mh-nexus.de/en/downloads.php?product=HxD"]here[/URL]
for linux try Ghex. Get it from [URL="http://live.gnome.org/Ghex"]here[/URL]
A text editor;
for windows use notepad++. get it [URL="http://sourceforge.net/projects/notepad-plus/files/"]here[/URL]
for Linux gedit will be fine
An archive manager;
for windows use 7-zip. Get it from [URL="http://www.7-zip.org/download.html"]here[/URL]
for Linux the built in will be fine
WHAT TO DO NEXT
Download the ROM you want to use.
Create a new folder on the desktop to work in. Name the folder to the name of your ROM (i.e. CM5)
Using your archive manager open up the zipped ROM (do not extract, it is not necessary) and go into the system folder
Inside the system folder go to the framework folder
Extract the framework-res.apk and the services.jar to the folder you created on the desktop
Click to expand...
Click to collapse
WORKING WITH THE XML FILES
Now open up the framework-res.apk. (In windows 7-zip will open this without having to change the extension to .zip) (Do not extract)
Now go into the res/layout folder and extract the following three files to the folder you made on the desktop
status_bar_expanded.xml
status_bar.xml
status_bar_latest_event_content.xml
Here is what these files control
status_bar_expanded.xml
Controls the text color for:
1) Clear Button
status_bar.xml
Controls the text color for:
1) USB Connected and Preparing SDcard
2) USB Debugging and Status Bar Notifications
status_bar_latest_event_content.xml
Controls the text color for:
1) Title text in pull down bar for Ongoing and Notifications
2) Description text in the pull down bar under Ongoing and Notifications
3) Text notifications time stamp in the pull down bar under notifications
Open status_bar_expaned.xml with your Hex Editor
Do a search for 08 00 00 1C
The next four 2 digit segments control color and alpha (Transparency) in this order BGRA (Blue, Green, Red, Alpha) (Sorry I had this reversed earlier)
In Hex FF would be the darkest and 00 would be the lightest, so if you set the next four 2 digit segments like this -> FF 00 00 FF then your USB Connected and Preparing SDcard text would be red. I suggest not messing with the alpha, just leave it FF
you will find two areas in this file where 08 00 00 1C appear and in the section above I show the order in which you find 08 00 00 1C and what they control. REMEMBER TO EDIT THE FOUR 2 DIGIT SEGMENTS FOLLOWING 08 00 00 1C
Save the file and edit the other two files (status_bar_expanded.xml has one instance of 08 00 00 1C, and status_bar_latest_event_content.xml has three instances of 08 00 00 1C)
All instances of 08 00 00 1C are in the order that I have outlined above
When you are done open up the framework-res.apk and go into the layout folder
Drag your newly edited files into the res/layout folder, wait for it to update then exit
Click to expand...
Click to collapse
WORKING WITH THE SMALI FILES
THE StatusBarService.smali edit DOES NOT WORK ON CM5
Open up the services.jar file with your archive manager
Extract the classes.dex file to your folder on the desktop
Now we need to disassemble the classes.dex file with baksmali so we will issue this command
java -jar baksmali-1.2.2.jar -o <output directory> <.dex file, typically classes.dex>
For example: java -jar baksmali-1.2.2.jar -o c:\users\david\desktop\CM5 c:\users\david\desktop\CM5\classes.dex
This will create the following directory c:\users\david\desktop\CM5\com\android\server
Inside the server folder/directory there is a status folder/directory go into that folder/directory
Open up the StatusBarIcon.smali file in your text editor. When the file is open look for this line
.line 46
const/high16 v6, -0x1 00
invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTextColor(I)V
Now change -0x100 to -0x1. This will change your clock to red
Save the file and exit
Open up the StatusBarService.smali file with your text editor and look for this line
iget-object v7, p0, Lcom/android/server/status/StatusBarService;->mDateView:Lcom/android/server/status/DateView;
const/4 v8, 0x4
Below the line you found add the following line
invoke-virtual {v7, v8}, Lcom/android/server/status/DateView;->setVisibility(I)V
const v8, -0x1
This will make your date white in the notification bar when it is exposed when you pull the notification bar down
Now that your edits are done it is time to put these files back into a .dex file. issue the following command
java -Xmx512M -jar smali-1.2.2.jar <output directory from above step> -o <name for new .dex output file>
For example: java -Xmx512M -jar smali-1.2.2.jar c:\users\david\desktop\CM5 c:\users\david\desktop\CM5\new-classes.dex
Delete the classes.dex file already in that folder and rename new-classes.dex to classes.dex
Add the classes.dex file back into the services.jar file
Click to expand...
Click to collapse
PUSH THE FILE TO YOUR PHONE
If the ROM is not flashed to your phone flash it now
Once your phone is setup, reboot into recovery
once your in recovery issue the following
adb shell
#mount /system
#exit
adb push c:\users\david\desktop\CM5\framework-res.apk /system/framework/
adb push c:\users\david\desktop\CM5\services.jar /system/framework/
adb reboot
Click to expand...
Click to collapse
When your phone boots up you will see your changes.
See examples here
Status Bar How To
Reserved for future tutorials
Nice Tutorial
XxKOLOHExX said:
Nice Tutorial
Click to expand...
Click to collapse
Thank You.
I owe it to you.
Nice tutorial! I'm gonna have to try this out(My brain hurts already) soon as I get time to sit down and play.
Subscribed!
Hi there,
So i'm looking for a simple black status bar, nothing else, can someone please help me? I'm confused with the whole process, even after reading it a few times...
If someone who is using the latest CM 5.0.7 DS build and have a black status bar with no other frills, please share....
thx,
Clear status bar
pleaseeee tell me someone is making a clear or drop shadow status bar for the g1, i can only seem to find it for froyo which is not yet stable for the g1.. any help here ?
Nice tut. Thanks... To those requesting mods... DON'T HIJACK, OPEN A NEW THREAD!
thingzero said:
Hi there,
So i'm looking for a simple black status bar, nothing else, can someone please help me? I'm confused with the whole process, even after reading it a few times...
If someone who is using the latest CM 5.0.7 DS build and have a black status bar with no other frills, please share....
thx,
Click to expand...
Click to collapse
pleaseeee tell me someone is making a clear or drop shadow status bar for the g1, i can only seem to find it for froyo which is not yet stable for the g1.. any help here ?
Click to expand...
Click to collapse
The status bar is a matter of editing the statusbar.background.png file you have. In order to do this you will need to open the zipped rom. Make A Backup FIRST! your using then open the system folder, then the framework folder, then open the framework-res.apk (use 7-zip in windows) then go into the res folder. Extract the drawable-mdpi folder. use photoshop or gimp to change the opacity of the statusbar.background.png file. Save the file with the exact same name. Put it back into the drawable-mdpi folder, put that folder back into the res folder of the framework-res.apk. Close the open archive program. sign the zipped file then flash it.
This may not work on all roms. but if you make a backup of the original rom you used you will be able to get back to where you were. Also I suggest Titanium Backup.
If you need more details PM me as I am not checking this thread.
There's a similar post of how to change the default homescreen in Touchwiz 4.0
unfortunately, the method by changing the "default.prop" did not work for some STOCK ROM (like ZSKF1 and ZSKF4). After spending more than a week, I have find a conclusion. (Don't laugh me spending too long on this. I9100 is my first Android Phone.....and i just want to share with those who suffered like me...)
try this:
1. download the attachment "apktool.rar"
2. extract "apktool.rar" to C:\apktool (easy for locate the files under windows's Command prompt)
3. pull "TouchWiz30Launcher.apk" from /system/app using RE Explorer and put it into C:\apktool
4. now go to CMD (Windows Command Prompt)
5. type the following:
- C:\apktool\apktool d "C:\apktool\touchwiz30launcher.apk "C:\apktool\touchwiz30launcher"
6. once it has finished, you will see there is a folder named "touchwiz30launcher"
7. inside the folder C:\apktool\touchwiz30launcher, go to \res\layout-port
8. find the "launcher.xml and edit it with Notepad
9. find the - launcher:defaultScreen="0"
10. change it to launcher:defaultScreen="3"
11. save and exit
12. go back to CMD and type:
- C:\apktool\apktool b C:\apktool\touchwiz30launcher\
13. now you've got a folder namded "build" under C:\apktool\touchwiz30launcher\
14. open your TouchWiz30Launcher.apk by using 7z (choose "Open archive") you will see a file "resources.arsc"
15. replace the "resources.arsc" with the one uncer C:\apktool\touchwiz30launcher\build\apk\
16. put TouchWiz30Launcher.apk back to your phone.
17. restart
This is the way how I've made it, but to be honest, I AM A NEWBIE, the above method i used to changing something of the Framework, and I found it also work on this.
Please if any expert can improve or point out any mistake.
It's better to have third party Launcher installed just incase if it's not working, and still have a chance to undo it by placing the original files back.
Alas this didn't work on:
Villain ROM 1.4
Also modified the launcher.xml in \res\layout-port-1024x600 but this made no difference.
Anyone managed to figure this out?
andyvaughan said:
Alas this didn't work on:
Villain ROM 1.4
Also modified the launcher.xml in \res\layout-port-1024x600 but this made no difference.
Anyone managed to figure this out?
Click to expand...
Click to collapse
i can 2nd that! would love to see a fix...
Tested on litepro 1.5. Doesnt work
You don't change xml file but you have to make changes to Launcher.smali
find the following lines:
const/4 v0, 0x4
const/4 v2, 0x0 <<< change this value to 0x3
const-string v1, "N"
.line 291
sput v2, Lcom/sec/android/app/twlauncher/Launcher;->DEFAULT_SCREEN:I
.line 292
sput v2, Lcom/sec/android/app/twlauncher/Launcher;-DEFAULT_SCREEN_NO:I
const/4 v2, 0x0 <<< add this line
recompile and copy to system/app folder
hey guys decided to use this thread to clear out one thing.
what should I edit in order to change de app/home button to other position ?
kcchik said:
There's a similar post of how to change the default homescreen in Touchwiz 4.0
unfortunately, the method by changing the "default.prop" did not work for some STOCK ROM (like ZSKF1 and ZSKF4). After spending more than a week, I have find a conclusion. (Don't laugh me spending too long on this. I9100 is my first Android Phone.....and i just want to share with those who suffered like me...)
try this:
1. download the attachment "apktool.rar"
2. extract "apktool.rar" to C:\apktool (easy for locate the files under windows's Command prompt)
3. pull "TouchWiz30Launcher.apk" from /system/app using RE Explorer and put it into C:\apktool
4. now go to CMD (Windows Command Prompt)
5. type the following:
- C:\apktool\apktool d "C:\apktool\touchwiz30launcher.apk "C:\apktool\touchwiz30launcher"
6. once it has finished, you will see there is a folder named "touchwiz30launcher"
7. inside the folder C:\apktool\touchwiz30launcher, go to \res\layout-port
8. find the "launcher.xml and edit it with Notepad
9. find the - launcher:defaultScreen="0"
10. change it to launcher:defaultScreen="3"
11. save and exit
12. go back to CMD and type:
- C:\apktool\apktool b C:\apktool\touchwiz30launcher\
13. now you've got a folder namded "build" under C:\apktool\touchwiz30launcher\
14. open your TouchWiz30Launcher.apk by using 7z (choose "Open archive") you will see a file "resources.arsc"
15. replace the "resources.arsc" with the one uncer C:\apktool\touchwiz30launcher\build\apk\
16. put TouchWiz30Launcher.apk back to your phone.
17. restart
This is the way how I've made it, but to be honest, I AM A NEWBIE, the above method i used to changing something of the Framework, and I found it also work on this.
Please if any expert can improve or point out any mistake.
It's better to have third party Launcher installed just incase if it's not working, and still have a chance to undo it by placing the original files back.
Click to expand...
Click to collapse
hi hk mate,
i suggest u go and download notepad2 or notepad++ etc, which can save txt file in unix format. don ever trust m$ notepad when u r dealing with unix/linux/android/mac
good luck
remorema said:
hey guys decided to use this thread to clear out one thing.
what should I edit in order to change de app/home button to other position ?
Click to expand...
Click to collapse
simply because ppl have diff preferences
How to get a Transparent status bar!
ok ok there are still a few problems to work out but maybe some people smarter than I will know the answers.
Here's what you should know before we begin... MAKE A BACKUP FIRST
at the moment ..
1. this does not work with the stock touchwiz launcher (may be a simple fix havn't looked into it yet.)(well works everywhere but the desktop)
works quite well with ZEAM and not too shabby with GO EX (if you use multipicture live wallpaper from the market)
havent looked into any others.
2. the status bar is still clear on the lockscreen (may annoy some)
fixible with multipicture wallpaper just set use lockscreen settings and then lock screen settings and set a black picture.
probably not perfect but it's a start.
thanks to KBanause for providing the info needed at this link http://forum.xda-developers.com/showpost.php?p=9978779&postcount=62
This tut also assumes you have some basic computer skills and can navigate from a command prompt. and that your computer has java installed. (most do you just need the runtime enviroment if you don't have it get it here http://www.oracle.com/technetwork/java/javase/downloads/jre-7u1-download-513652.html)
OK if you still want to try this
START HERE
MAKE A BACKUP FIRST
download
clearstatustry.zip (attached above)
unzip this file to a folder (7zip or winrar ect whatever)
you should have 4 files here
baksmali-1.2.8.jar
smali-1.2.8.jar
statusbar_background.9 - 25.png 25% transparency
statusbar_background.9 - 50.png 50%transparency
still here . wow ok you must really want to see this.
pick one of the statusbar_background files and rename it statusbar_background.9.png
now you need the SystemUI.apk from your phone it's in /system/app
grab it with a file browser that has root access and copy it into the folder with that other crap.
next Open SystemUI.apk with your zip tool, do not extract, just open.
navigate to the res/drawable-hdpi/ folder and copy your statusbar_background.9.png over the existing one.
now go back to the root of the SystemUI.apk and Drag classes.dex out to your folder.
open a command prompt and navigate to your folder with these files.
or just shift + right click in the folder you extracted the files to and select open command prompt here.
run this command
java -jar baksmali-1.2.8.jar -o classout/ classes.dex
now go back to your folder
and navigate to classout\com\android\systemui\statusbar
open StatusBarService.smali in a txt editor
find the line
invoke-direct/range {v0 .. v5}, Landroid/view/WindowManager$LayoutParams;-><init>(IIIII)V
above that change const/4 v5, 0x2 to const/4 v5, -0x3
save and close
Go back to your CMD prompt and enter this command
java -jar smali-1.2.8.jar classout -o classes.dex
ALMOST THERE I PROMISE
now copy the classes.dex back into the root of the SystemUI.apk file and close
MAKE A BACKUP FIRST
now just copy that systemui.apk back into the /system/app folder on your phone
dont mind the force close and reboot.
MAKE A BACKUP FIRST
if it doesn't seem to work try a live wallpaper
or use Multipicture live wallpaper from the market to set a static image.
this will probably mess up your phone but hey sorry MAKE A BACKUP FIRST
mjcollum said:
java -jar baksmali-1.2.8.jar -o classout/ classes.dex
Click to expand...
Click to collapse
For those that are unfamiliar with command line and get file not found errors, instead of typing everything try this
Code:
java -jar [b](drag baksmali-1.2.8.jar file here)[/b] -o classout/ [b](drag the classes.dex file here)[/b]
This will fill out the path to your files for you if they aren't in the root directory.
mjcollum said:
Go back to your CMD prompt and enter this command
java -jar smali-1.2.8.jar classout -o classes.dex
Click to expand...
Click to collapse
Same concept here
Code:
java -jar [b](drag smali-1.2.8.jar file here)[/b] [b](drag classout folder here)[/b] -o classes.dex
Either way, thanks for the guide. I'm sure a lot of people will find it useful
Good call I didn't even think to let people know about that.
also another heads up for anyone that doesn't know you can shift + right click in the folder and choose open command window here that way you don't have to navigate to the directory.
Wow- I can't believe this thread got buried with only a few posts.
I have followed these outstanding instructions word for word with no issues at all, however my status bar is still blacker than black! After completing this, I went back and pulled my SystemUI.apk again, decompiled it, and checked to make sure the smali edit and the .9 were still there which of course, they are. Is there an xml color code that needs to be changed as well?? I tested this with both Go launcher and ADW and no luck. Help!?!?
Thanks!
I would think that maybe using the transparent lock screen and this we could figure it out. I would love to have that option!
I really wish we could get this working. its the Last visual hack I want to do on my SII that I can't do. Everything else is perfect just really hate that black bar. I can hide it but then I can't see my info either. Grrrrr
In addition to the smali edit and the statusbar_background.9, I found an XML difference between a miui clear status bar systemUI and all of ours (as in any ET4G systemUI. I'm getting ready to mod it and push it. I'll let you know if it works!
Sent from my SPH-D710 using xda premium
I tried this step by step with no luck. To make it white could you just change -0v3 to -0v1 or make the statusbar image white?
Is this possible with apk manager using notepad++ to edit the smali file and recompiling?
Thanks.
is there an easy way for me to "change" the image to another opaque image ie an actual image not a "color"
I could just crop X pixels from the top of my image and MAKE THAT the background for the status bar if that is possible.
Ok I think I figured it out and I don't even think you have to edit the smali but I could be wrong. You have to edit the layout/statusbar xml file and at the top you see ff000000 which is black and change that to the desired color or make it transparent. I just made mine white but combined with the smali edits shown here but stock statusbar image.
nerys71 said:
is there an easy way for me to "change" the image to another opaque image ie an actual image not a "color"
I could just crop X pixels from the top of my image and MAKE THAT the background for the status bar if that is possible.
Click to expand...
Click to collapse
There is, to do that make sure you have the newest version of Android SDK, Java, and ADB
Download APK Multitool here - http://apkmultitool.com/?q=node/5
Extract it then extract the apps you are going to mod, in your case framework-res and SystemUI.
Put the SystemUI.apk in the modding folder and run the script to decompile SystemUI with the framework-res as a dependency (option 10). Before proceeding, but after decompiling check the log file to ensure everything decompiled without error, otherwise it won’t recompile. Errors are usually due to improperly patched .9.png’s, and while they can be very confusing, you can just swap bad ones out with those from a stock ROM until after you’ve made your edits.
Once you have decompiled without any errors open your project folder (inside whatever you named your APK Multitool folder and navigate to;
res/layouts/statusbar.xml:
On the second line find <com.android.systemui.statusbar.StatusBarView androidrientation="vertical" android:background="#ff000000" android:focusable="true" android:descendantFocusability="afterDescendants"
change it to
<com.android.systemui.statusbar.StatusBarView androidrientation="vertical" android:background="@drawable/statusbar_background" android:focusable="true" android:descendantFocusability="afterDescendants"
Do the same on the second to last line which is the date view. It will have the color code (#ff000000) change it to "@drawable/statusbar_background"
Follow the prompts to recompile and use the new apk created in the mod folder called unsignedSystemUI.apk. In the drawable-hdpi folder you’ll find a png named statusbar_background.9.png, which is what will now be displayed as the status bar instead of the color code. You can make it any color you’d like. Ideally, you should ensure that the .9 is properly patched, but if you swap it out after recompiling it somehow doesn’t seem to matter much.
Good luck.
I just don't feel comfortable going to those lengths just yet.
Guess I will have to wait (hope) for a simpler solution
I tried the metamorph one but it does not work (bad file)
You only have to edit calls to the image in system UI status bar XML as someone above said. No smali edits required. Currently it calls a color code. You want it to call an image. Alternately, you could simply use a color code with transparency as well and skip editing an image all together. =P
Sent from my SPH-D710 using XDA App
nerys71 said:
I just don't feel comfortable going to those lengths just yet.
Guess I will have to wait (hope) for a simpler solution
I tried the metamorph one but it does not work (bad file)
Click to expand...
Click to collapse
It's actually easier to do than it is to read, but if you're not comfortable with t yet thats understandable.
What ROM are you using? If you send me the SystemUI.apk your using I can take a look at it.
Change the color code if you want something simple, but if you want to use an image up there, do as posted a few posts up.
calkulin's 2.7
nerys71 said:
calkulin's 2.7
Click to expand...
Click to collapse
+1, if someone has this working on calks 2.7 could you please share the files you edited? Id love to add this to my theme. If no one has already did it, ill give it a try and post results if successful
I can post one tonight, its very easy to do.
Minimal black and white theme has transparent statusbar
Sent from my SPH-D710 using xda premium
Greetings and Salutations, Epic 4G Touch Owners and other curious parties!
Disclaimer: Just reading this may cause your head to burst, your phone to catch fire, dogs and cats may do the tango! I am not responsible for any bad stuff that happens from you reading or acting on the information in this thread.
If any ROM authors want to use this fix in their ROMs, I'm completely cool with that. A quick kudos in your credits section would be nice, though.
Background: People were asking about removing the ascending ringtone volume. I don't really care either way, personally, but there is demand.
Thankfully, the fix is quite simple!
Credits
the_ozyrys - One of the first posts I saw this in.
The brave XDA members who try these instructions and report their success or failure!!!
XDA for being a great source of information!!!
XDA members for thinking outside of the box!!!
The fix:
This fix requires editing your Phone.apk file. If you are using one of the fine custom ROMs on XDA, be aware that the you or the author may have already made changes to the Phone.apk file, so using my file IS NOT RECOMMENDED.
If you are using the Calkulin's E4GT ROM v1.5a ROM, you can safely use my attached Phone.apk file. It may work with other "stock" ROMs, but this is the one I based it on. Make sure to rename it to Phone.apk
What you need to perform this mod:
1. An Epic 4G Touch ROM ZIP file, or a phone running a Epic 4G Touch ROM.
2. The Java SDK -- So you can run Smali.
3. Smali/Baksmali -- So you can decompile/compile the classes.dex file.
4. Android SDK -- To push/pull files from your phone (adb only).
5. Some sort of archive tool (such as WinRAR, 7zip, etc).
5. A text editor capable of editing UNIX-formatted files. I recommend Notepad++, personally.
Ease Of Use Tips: Install Java SDK first, then Android SDK (if you need adb). Download the smali files (smali-1.2.8.jar and baksmali-1.2.8.jar at the time of this writing) to a new "working" folder where we can do our magic.
KEEP A COPY OF YOUR PRE-EDITED PHONE.APK FILE, just in case!
Android is case-sensitive, so ensure that your file is named Phone.apk, and not phone.apk.
Instructions:
1. Put your phone in AIRPLANE MODE (hold Power->Airplane Mode)
2a. [If you are using a ROM ZIP File]: Use 7zip/WinRAR/WinZip to open the ROM ZIP file. Navigate to system\app and extract Phone.apk to your "working" folder.
2b. [If you want to grab Phone.apk from your running phone]: Use adb to pull Phone.apk to your working folder. Example: adb pull /system/app/Phone.apk C:\Working\Phone.apk
TIP: To avoid problems, ONLY USE adb to pull/push Phone.apk. Phone apps may cause unknown issues.
3. Go to a command prompt in your "working" folder and run the following command: java -jar baksmali-1.2.8.jar -o Phone/ Phone.apk
4. Browse to your "working" folder and see that there is now an Phone folder inside, with other subfolders. Browse to Phone\smali\com\android\phone.
5. Edit the file called Ringer$1.smali with your favorite UNIX-format compatible text editor and look for the following text. The key is to search for setStreamVolume. There should be two results. Comment the line below that is in BOLD by adding a hash (#) in front of it.
Code:
.line 394
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
iget-object v1, v1, Lcom/android/phone/Ringer;->mAudioManager:Landroid/media/AudioManager;
[B]invoke-virtual {v1, v3, v5, v4}, Landroid/media/AudioManager;->setStreamVolume(III)V[/B]
6. Change that line to say #invoke-virtual {v1, v3, v5, v4}, Landroid/media/AudioManager;->setStreamVolume(III)V
7. Save Ringer$1.smali
8. Go back to your command prompt, change to your "working" folder and issue the following command: java -jar smali-1.2.8.jar Phone/ -o classes.dex
9. Open Phone.apk in your favorite archiver.
10. Drag the file called classes.dex from your "working" folder into Phone.apk and replace the one already in there.
11. Run the following commands to get the file on your phone:
Code:
adb remount
adb push Phone.apk /system/app/Phone.apk
adb reboot
IF ADB REBOOT DOESN'T WORK, REBOOT YOUR PHONE MANUALLY. YOU MAY HAVE TO PULL YOUR BATTERY. ANDROID DOES NOT LIKE REPLACING THE PHONE APK WHILE RUNNING.
Your phone should reboot and now have one volume level when the phone rings.
Please let me know whether or not this worked for you. I'd like to make a list of ROMs (with applicable mods) this works for or doesn't work for.
I will do whatever I can to help if you are struggling. If there's something you don't understand, please let me know. I can update the instructions if I accidentally wrote something wrong.
the_ozyrys was one of the first I saw that posted it when I was searching for this mod, so you can give credit to him, http://forum.xda-developers.com/showpost.php?p=8482676&postcount=13.
And BTW thanks for posting the how to because I was actually going to add this mod for the next release, so if people ask, I'll point them this way
Calkulin said:
BTW thanks for posting the how to because I was actually going to add this mod for the next release
Click to expand...
Click to collapse
Excellent, Calk. I'll wait for you to do that so as not to bork my phone LOL.
Nice tutorial Ithink I will give it a shot just tonsee if I could do it. Now aall I need is a tutorial on how to mod the dialer to the center like Calls.. I happen to be testing out another rom and miss that tweak. THX again OP
Sent from my SPH-D710 using XDA App
Is there any way we could get a flashable zip of this?
Nice.
Sent from my SPH-D710 using XDA App
hey guys i was wondering if i could get some help because no matter how many times i try to do this mod myself i cant seem to get it right.
if anyone could mod the themed apk file that i attached i would greatly appreciate it
thanks in advance
xx8todiefor6xx said:
hey guys i was wondering if i could get some help because no matter how many times i try to do this mod myself i cant seem to get it right.
if anyone could mod the themed apk file that i attached i would greatly appreciate it
thanks in advance
Click to expand...
Click to collapse
Sorry for the delay -- here is a file that should work. Don't forget to rename it to Phone.apk before you put it on your phone.
Thank you so much Nivron
I got so used to using the volume rocker to wake my DHD and show the lockscreen instead of the power button that i decided to try and add the same functionality to the OneX. The only caveat with this is that sometimes the volume slider shows up when it wakes, but i can live with that
Hopefully, in time, the ROM devs will add this in by default or as an option. Until then it'll require these manual mods...
Don't try the following if you're unsure what you're doing as you could potentially break the ROM if not done correctly. I recommend backing up first in Clockwork Recovery in case things go wrong.
I accept no responsibility for any issues encountered making these changes!
Requirements
Rooted phone
Android-SDK
baksmali/smali from here
Step 1 - Update android.policy.jar
1. Do the following to get the android.policy.jar from your phone and disassemble it
Code:
adb pull /system/framework/android.policy.jar .
baksmali -x android.policy.jar -o classout
2. Open the following file in a text editor
Code:
classout/com/android/internal/policy/impl/KeyguardViewMediator.smali
3. Find the method "isWakeKeyWhenKeyguardShowing(IZ)Z"
4. At the bottom of the method, there's a switch statement. Remove the following 2 lines from it:
Code:
0x18 -> :sswitch_5
0x19 -> :sswitch_5
5. Save the file and close it.
6. Run the following commmand to re-assemble classes.dex
Code:
smali classout -o classes.dex
7. Drag the classes.dex into the android.policy.jar file to update the file in there.
8. Push the updated android.policy.jar back to the phone
Code:
adb push android.policy.jar /sdcard/
adb shell
su
sysrw
cp /sdcard/android.policy.jar /system/framework/
chmod 644 /system/framework/android.policy.jar
Step 2 - Update Generic.kl
1. Pull the file from your phone
Code:
adb pull /system/usr/keylayout/Generic.kl
2. Open it in a text editor and change the lines
Code:
key 114 VOLUME_DOWN
key 115 VOLUME_UP
to
Code:
key 114 VOLUME_DOWN WAKE_DROPPED
key 115 VOLUME_UP WAKE_DROPPED
3. Push the file back to your phone
Code:
adb push Generic.kl /sdcard/
adb shell
su
sysrw
cp /sdcard/Generic.kl /system/usr/keylayout/
chmod 644 /system/usr/keylayout/Generic.kl
(of course, you could also make those changes to the file directly using a root file explorer app and text editor.)
Step 3
Reboot the phone.
Note: The first time it boots after changing android.policy.jar, there'll be an 'Android is upgrading' dialog. This is normal and it won't happen on subsequent reboots.
How if I play music in off screen mode adjusting the volume?
w1nter456 said:
How if I play music in off screen mode adjusting the volume?
Click to expand...
Click to collapse
It'll still work, but the screen will wake too.
thanks much. I need this feature much.
One question, is this change use up volume or down volume or both will work?
Am I correct that this mod will work only on deodexed android.policy.jar ?
mmx6688 said:
thanks much. I need this feature much.
One question, is this change use up volume or down volume or both will work?
Click to expand...
Click to collapse
Yep, it'll work for both.
ckpv5 said:
Am I correct that this mod will work only on deodexed android.policy.jar ?
Click to expand...
Click to collapse
Yep, the above steps are for de-odexed ROMs, but you may still be able to disassemble if you pull the jar and odex and run baksmali on android.policy.odex. If you get errors trying that then pull everything from the /system/framework folder and try it again
Annoyingly, i've just noticed that once the phone goes into a 'deep sleep', the volume buttons don't always wake it. Sometimes they'll work after a double press sometimes it needs to be the power button :-\
Thanks it worked on my device. And I have added your mod to my mod pack for easy enabling and disabling
any kind person can help to make it into a flashable zip?
ck_looi said:
any kind person can help to make it into a flashable zip?
Click to expand...
Click to collapse
+1 10 chars
Would it in theory be possible to use the home button to wake the phone or is that impossible because the buttons don't work when the screen is off?
I have wake on TP on my Desire now.
mgmCube said:
Would it in theory be possible to use the home button to wake the phone or is that impossible because the buttons don't work when the screen is off?
I have wake on TP on my Desire now.
Click to expand...
Click to collapse
Not possible as the buttons don't work when the screen is off.
And when the phone goes to deep sleep mode, volume button to wake it not really works (tried both on odex and deodex ROMs).
Totally eager to try this out.
I'm using the LC ModPack 2.1.0 and this doesn't work
ckpv5 said:
Not possible as the buttons don't work when the screen is off.
And when the phone goes to deep sleep mode, volume button to wake it not really works (tried both on odex and deodex ROMs).
Click to expand...
Click to collapse
Ok so this volume unlock doesn't really work when in deep sleep?
This isn't mentioned in the first post.
So what if I use this volume unlock and disable the power button, then I have a problem after deep sleep?
mgmCube said:
Ok so this volume unlock doesn't really work when in deep sleep?
This isn't mentioned in the first post.
So what if I use this volume unlock and disable the power button, then I have a problem after deep sleep?
Click to expand...
Click to collapse
Yeah... most of the time it doesn't work when in deep spleep. OP mentioned this on post #6 too.
With volume to wake (not unlock, you still need the swipe up to unlock), and disable the power button, you will have problem to wake and unlock when it goes deep sleep. When you have this problem, the only way to wake it is to plug-in a usb cable or charger as it will wake the phone, then you can unlock.
Well then.. I think its better to disable it as it does messes up my volume levels even if it doesnt wake up the device..
Any chance of a full feature here? Coz the phone is expected to go into deep sleep most of the time..
Sent from my HTC One X using XDA
Jumping in here real quick, i dont (unfortunately) have an amazing all powerful OneX but i do have an HD2
Anyhow, im posting in regards to the isWakeKeyWhenKeyguardShowing(I)Z method in the KeyguardViewMediator.smali file found in android.policy.jar. I already have the volume wake keys set via cyanogen mod, my question is this:
How can i ADD keys to this file to prevent the device from waking?
I tried converting the hex values from that file but they dont correspond with any key values (ex, volume down is 115) but 0x18 is 24, decimal value, so im not sure exactly what numbers must be added to correspond to the correct key.
Thanks all for your efforts and time spent reading!
Thank you for the guide. I don't have Generic.kl on my Motorola XT530, so I think I might need to fiddle round with the .kl files to see if I can get this mod working.
I had to modify my process slightly, so I'll explain what I did in case it may be of help to anyone else.
1. To copy android.policy.jar to my PC, I used Android Commander. It's nice and simple. Make sure you make a back up of android.policy.jar before you modify it in case you need/want to restore it.
2. Use Command Prompt and navigate to the folder in which android.policy.jar is located. For example:
Code:
cd C:\Android\temp
3. Disassemble classes.dex using the following command:
Code:
java -jar baksmali-1.3.2.jar -x android.policy.jar -o classout
4. Edit and save KeyguardViewMediator.smali as per the original post.
5. Reassemble classes.dex using the following command:
Code:
java -jar smali-1.3.2.jar classout -o classes.dex
6. Open android.policy.jar with 7-Zip (any archive manager should work) and replace classes.dex with the modified one.
7. Use Android Commander to replace android.policy.jar on phone.
8. Edit Generic.kl as per original post. I don't have Generic.kl on my phone, so I just left-out this step. I figured I could poke around the .kl files later if need be. I haven't done so yet.
9. Reboot.
Note: The filenames for baksmali-1.3.2.jar and smali-1.3.2.jar may be different if you have a different version. Simply adjust the commands above accordingly.
HTC Ones S --Works
Was looking for this on the HOS forums but found this close enough instead. Prob everyone knows this, but I did this same setup on my one s (t-mo-us) version, and it stuck. So thanks for this nice little tweak. Good to know dev's have our backs in everything.
this was much appreciated for my inc2!
we got a new kernel and messed up it working in the tweaks app, so this really saved me, I didn't realize the Generic.kl needed to be updated.
thanks again!
in defy, it's umts_jordan-keypad.kl instead of Generic.kl (doesn't exist).