Short step by step write-up about how I changed the status bar clock color to red (because I like red )
NOTE BEFORE YOU START:
Standard disclaimer, I don't guarantee anything that might happen after following these steps, and I mean anything!! These steps worked for me and I have tried to include every minute step! My phone is running CM 3.9.9.1 but this should theoretically work on any ROM. But no guarantees.
1. Connect phone using USB and check that you can see your device using: adb devices
2. in your SDK/tools directory from command line do: adb pull /system/framework/services.jar services.jar
3. Make a backup of the services.jar file that just popped in the tools folder just in case!
4. Download smali and baksmali from http://code.google.com/p/smali/ and place them in the tools folder. Rename the files to baksmali.jar and smali.jar to save on typing later
5. Open the services.jar file with something such as winrar or 7zip or whatever you prefer
6. Copy out the classes.dex file to your SKD/tools folder
7. run following from command line: java -jar baksmali.jar -o classout/ classes.dex
8. Now browse to your new folders classout/com/android/server/status
9. Open the file StatusBarIcon.smali in something like notepad or context or any text editor
10. Locate a line that says: .line 46, under this line it should have something like:
const/high16 v6, -0x100
11. Change this to say: const/high16 v6, -0x1
12. Save the file
13. Now back to the command line and from your SDK/tools folder run: java -Xmx512M -jar smali.jar classout/ -o new-classes.dex
14. If the above finishes without errors you should have a file called new-classes.dex in your SDK/tools folder now that is the same size as your classes.dex file.
15. Rename the old classes.dex file to classes-old.dex and rename the new-classes.dex file to classes.dex
16. Open the services.jar file with your archiving tool again from step 5 and replace the existing classes.dex file with our new classes.dex we just created.
17. From command line run: adb remount
18. also from command line: adb push services.jar /system/framework/
19. Finally run: adb shell reboot
Your phone should now restart and after being very very patient (5+ mins i've had) the phone starts and your clock is now Red =o)))
Hope this worked out for you, too tired to change the other texts now...need sleep
.FxN
ps. Thanks to Cyanogen (in general), XDA-developers and this thread so; Ohsaka and mianosm and JF
nice... will try it out latter today... what would be the code for white color text? does this also modifies notification fonts?
To change it to white just change this line:
const/high16 v6, -0x100
to
const v6, -0x1
And for the date where is the line?
superatmel said:
And for the date where is the line?
Click to expand...
Click to collapse
date is in layout, status_bar.xml
Great write up! My problem is the OS I'm using uses odex files. I'm assuming the part I need to modify is in that file since my services.jar does not have classes.dex and its file size is only 1k. Do you know how to modify the odex file?
.line 45
.local v2, layoutParams:Landroid/widget/LinearLayout$LayoutParams;
const/high16 v6, 0x4180
invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTextSize(F)V
.line 46
const v6, -0xe0e0f
invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTextColor(I)V
.line 47
Click to expand...
Click to collapse
Ok, I got this far, and this is what I see... Which one is the color? And how do I find the codes for other colors? My clock is white right now... Want to change that...
zapote21 said:
Ok, I got this far, and this is what I see... Which one is the color? And how do I find the codes for other colors? My clock is white right now... Want to change that...
Click to expand...
Click to collapse
const/high16 v6, 0x4180 is the color dude, it was answered in the post when some asked whats the code for the color white.
setzer715 said:
Great write up! My problem is the OS I'm using uses odex files. I'm assuming the part I need to modify is in that file since my services.jar does not have classes.dex and its file size is only 1k. Do you know how to modify the odex file?
Click to expand...
Click to collapse
I have same problem: no classes.dexfile in services.jar, any ideas how to proceed?
Thanks fxn, worked for my Donut theme.
If you guys need help deodexing, I have a theme thread with full howto (including a link here) to help you out. Post #2 has it all.
thnx for this nice thread. i got a request. cud u plz tell me which line to edit to get clock in white in HERO rom?? i am editing rom for my HTC Hero and want to have the clock in White which is in black now. cheers
FxN: hi bro cud u plz tell me which file to edit to get black colored clock in status bar of Hero?? it wud be really appreciated. cheers
attached a zip containing statusbaricon.smali and statusbarservices.smali from hero
fxn said:
To change it to white just change this line:
const/high16 v6, -0x100
to
const v6, -0x1
Click to expand...
Click to collapse
I tried you directions and was able to change my clock, but I wanted it to be white, but what you wrote in the quoted post is the same thing you said to to change it to red as now I have a red clock. How do I get it to be white?
help with classout
On a mac, I keep getting "unable to access jarfile" when I enter:
java -jar Users/names/Desktop/android-sdk-mac_86/tools/baksmali.jar -o classout/ classes.dex
Any idea what I'm doing wrong here?
Is this thread still active? Ive got issues with deodexing services.odex file. The problem is, it wont Deodex.
aupeters said:
On a mac, I keep getting "unable to access jarfile" when I enter:
java -jar Users/names/Desktop/android-sdk-mac_86/tools/baksmali.jar -o classout/ classes.dex
Any idea what I'm doing wrong here?
Click to expand...
Click to collapse
i get the same thing but i'm on win 7
i do
C:\Android\AndroidSDK\tools>java -jar baksmali.jar -0 classout/ classes.dex
Invalid or corrupt jarfile baksmali.jar
I downloaded the baksmali (wrapper script) and went to rename and put a .jar at the end of the name.
please help...
I tried grab and use services.jar from another rom which has white clock...
also I tried this tutorial, but I can't get my clock to white...
I'm using samsung spica...
MFK DGAF said:
i get the same thing but i'm on win 7
i do
C:\Android\AndroidSDK\tools>java -jar baksmali.jar -0 classout/ classes.dex
Invalid or corrupt jarfile baksmali.jar
I downloaded the baksmali (wrapper script) and went to rename and put a .jar at the end of the name.
Click to expand...
Click to collapse
Try downloading Avabox...In the smali folder there is a folder called backsmali which has the files in it. Just take off the -1.1 at the end. These worked for me.
NisseGurra said:
I have same problem: no classes.dexfile in services.jar, any ideas how to proceed?
Click to expand...
Click to collapse
i have the same problem
Related
alright...ive got the classes.dex file open and able to make edits but when i try to close it and recompress it it gives me errors. can someone help please.
Gtalk is [email protected]
You need to use smali from avabox by avalaunch
Sent from my HERO200 using the XDA mobile application powered by Tapatalk
danaff37 said:
You need to use smali from avabox by avalaunch
Sent from my HERO200 using the XDA mobile application powered by Tapatalk
Click to expand...
Click to collapse
ok thats how i got the classes.dex file by breaking down the apk.
then ran a command to open up the classes.dex file.
it created a file called classout which had all the folders and files inside of the classes.dex file
i made it to the change i needed to make and edited and saved.
then ran a command that should close up the classes out folder back into the classes.dex file and it gives me errors. im changing colors of text in the keyboard and used hex codes to change the color
So whats the error and what command are you using?
Are you using the batch file or typing it in in command prompt.
Not sure which one you are doing so I will post what works for me
I double clicked backsmali.bat and when done editing smali.bat.
java -jar baksmali-1.2.1.jar -x blah.apk will deodex the .apk and make an out folder for the the classes.dex.
java -jar smali-1.2.1.jar out -o classes.dex will recompile the .smali files including the ones you edited. This will make a "New" classes.dex that you can drag and drop into your .apk. This is the best way rather than using a script that may or may not work...
&RoidRage said:
Are you using the batch file or typing it in in command prompt.
Not sure which one you are doing so I will post what works for me
I double clicked backsmali.bat and when done editing smali.bat.
Click to expand...
Click to collapse
i go to command prompt and type in this in the sdk/tools folder
java -jar baksmali.jar -o classout/ classes.dex
that pulls the files out into a classout file
do my editing
then
type in
java -Xmx512M -jar smali.jar classout/ -o new-classes.dex
then comes up with these errors afterward
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Chad Barlan>cd C:\android-sdk-windows\tools
C:\android-sdk-windows\tools>java -jar baksmali.jar -o classout/ classes.dex
Unable to access jarfile baksmali.jar
C:\android-sdk-windows\tools>java -jar baksmali.jar -o classout/ classes.dex
C:\android-sdk-windows\tools\classout\com\htc\android\htcime\ezsip\KeyboardView.
smali[0,0] -0xFF1874CD cannot fit into an int
C:\android-sdk-windows\tools\classout\com\htc\android\htcime\ezsip\KeyboardView.
smali[3889,4] mismatched tree node: I_STATEMENT_FORMAT35c_METHOD expecting I_CAT
CHES
C:\android-sdk-windows\tools\classout\com\htc\android\htcime\ezsip\KeyboardView.
smali[3892,4] mismatched tree node: I_STATEMENT_FORMAT11n expecting <UP>
these r the errors i get
im changing text color
using FF1874CD
whitch is just a shade of blue in a hex code form
Lol, that's not how it works .
Color codes, typically in decompiled code are in the form of ARGB bitwise shifted hex values, not standard hex.
R bitwise shifted 16 bits to the left
G bitwise shifted 8 bits to the left
B No shift
Here is a good explanation of how to handle color values in the code:
http://board.flashkit.com/board/archive/index.php/t-657269.html
cbarlan said:
i go to command prompt and type in this in the sdk/tools folder
java -jar baksmali.jar -o classout/ classes.dex
that pulls the files out into a classout file
do my editing
then
type in
java -Xmx512M -jar smali.jar classout/ -o new-classes.dex
then comes up with these errors afterward
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Chad Barlan>cd C:\android-sdk-windows\tools
C:\android-sdk-windows\tools>java -jar baksmali.jar -o classout/ classes.dex
Unable to access jarfile baksmali.jar
C:\android-sdk-windows\tools>java -jar baksmali.jar -o classout/ classes.dex
C:\android-sdk-windows\tools\classout\com\htc\android\htcime\ezsip\KeyboardView.
smali[0,0] -0xFF1874CD cannot fit into an int
C:\android-sdk-windows\tools\classout\com\htc\android\htcime\ezsip\KeyboardView.
smali[3889,4] mismatched tree node: I_STATEMENT_FORMAT35c_METHOD expecting I_CAT
CHES
C:\android-sdk-windows\tools\classout\com\htc\android\htcime\ezsip\KeyboardView.
smali[3892,4] mismatched tree node: I_STATEMENT_FORMAT11n expecting <UP>
these r the errors i get
im changing text color
using FF1874CD
whitch is just a shade of blue in a hex code form
Click to expand...
Click to collapse
By any chance do you have the .smali files still open? By the way, you dont have to use -o classout/ when you baksmali. Baksmali creates an out folder by default. It was designed that way. When you smali, you also dont need -Xmx512M. My suggestion is go here... http://code.google.com/p/smali/ Download the latest baksmali-1.2.2.jar and smali-1.2.2.jar. This will alleviate any errors. Also, do me a favor, pastebin both your edited and non edited .smali files. I'll take a look at them.
By the way, what Js said is correct. You need to use this value for .smali Smali color = -0x100. This is the shifted hex values converted from your standard hex.
JsChiSurf said:
Lol, that's not how it works .
Color codes, typically in decompiled code are in the form of ARGB bitwise shifted hex values, not standard hex.
R bitwise shifted 16 bits to the left
G bitwise shifted 8 bits to the left
B No shift
Click to expand...
Click to collapse
yeah i just figured that out when i looked at another file that has a different color already
so i dropped the transperency
And please FOR THE LOVE OF GOD, upgrade your baksmali and smali .jars
VinceOB said:
By any chance do you have the .smali files still open? By the way, you dont have to use -o classout/ when you baksmali. Baksmali creates an out folder by default. It was designed that way. When you smali, you also dont need -Xmx512M. My suggestion is go here... http://code.google.com/p/smali/ Download the latest baksmali-1.2.2.jar and smali-1.2.2.jar. This will alleviate any errors. Also, do me a favor, pastebin both your edited and non edited .smali files. I'll take a look at them.
By the way, what Js said is correct. You need to use this value for .smali Smali color = -0xe78b33. This is the shifted hex values converted from your standard hex.
Click to expand...
Click to collapse
yeah so im an idiot and got it to work.
thanks for ur help
i had already downloaded the newer smali and baksmali files and put them in the sdk tools folder. was typing to much in the commands and also used the transperency when i was putting in the hex color i.e. FF1874CD instead of just using 1874CD which is what worked and didnt give me any errors.
cbarlan said:
yeah so im an idiot and got it to work.
thanks for ur help
i had already downloaded the newer smali and baksmali files and put them in the sdk tools folder. was typing to much in the commands and also used the transperency when i was putting in the hex color i.e. FF1874CD instead of just using 1874CD which is what worked and didnt give me any errors.
Click to expand...
Click to collapse
So did it change the color for you?
VinceOB said:
And please FOR THE LOVE OF GOD, upgrade your baksmali and smali .jars
Click to expand...
Click to collapse
i upgraded them just changed the name of them to take of the numbers lol much less typing, im lazy lol
cbarlan said:
yeah so im an idiot and got it to work.
thanks for ur help
i had already downloaded the newer smali and baksmali files and put them in the sdk tools folder. was typing to much in the commands and also used the transperency when i was putting in the hex color i.e. FF1874CD instead of just using 1874CD which is what worked and didnt give me any errors.
Click to expand...
Click to collapse
That might have "fit" into the size of the variable defined in the code, but that is not how you calculate the color code. Odds are, if it works, you are going to end up with black, regardless of the color you are trying to achieve. See my previous post.
JsChiSurf said:
That might have "fit" into the size of the variable defined in the code, but that is not how you calculate the color code. Odds are, if it works, you are going to end up with black, regardless of the color you are trying to achieve...
Click to expand...
Click to collapse
what do u mean
im using codes from this site
http://www.december.com/html/spec/colorhex.html
cbarlan said:
what do u mean
im using codes from this site
http://www.december.com/html/spec/colorhex.html
Click to expand...
Click to collapse
What happened when you booted? Did you get the color you expected?
you should use the bat files for that. i only use cmd line codes for auto sign. i find the batch files for baksmali to be perfect for me.
good luck.
Avalaunchmods said:
you should use the bat files for that. i only use cmd line codes for auto sign. i find the batch files for baksmali to be perfect for me.
good luck.
Click to expand...
Click to collapse
Here's what I was getting at with Avabox. He has batch files in there and if you put the apk's in the folder called apk run backsmali.bat. It will create a folder inside the apk folder with the decompressed apk. You can go in there and edit all the .smali files and when you are done run smali.bat. It will recompress and put it back into the apk you originally put into the folder.
Am I correct Avalaunch?
This just makes it easier as you are not having to type anything in.
&RoidRage said:
Here's what I was getting at with Avabox. He has batch files in there and if you put the apk's in the folder called apk run backsmali.bat. It will create a folder inside the apk folder with the decompressed apk. You can go in there and edit all the .smali files and when you are done run smali.bat. It will recompress and put it back into the apk you originally put into the folder.
Am I correct Avalaunch?
This just makes it easier as you are not having to type anything in.
Click to expand...
Click to collapse
tadaa. but it depends on what your doing. i use it to extract the whole apk easily into afolder. then do edits to png's so forth. but it only re creates the classes.dex so png edits wont save. i just recreate the apk. archive to zip, sign, change to apk.
and im not gonna give to much away for free butttt you can also open and edit alot of different android files by changing their extensions and placing them into a folder.
I can not open classes.dex for the life of me. I have tried multiple ways with different commands and such and still can not get it to open.
I have found this method to get me the farthest but still no go on opening it. every time I enter the command
java -jar baksmali.jar -o classout/ classes.dex
Click to expand...
Click to collapse
I get "Unable to access jarfile baksmaili.jar"
Thanks to anyone who is willing to help.
Download AvaboxV2 and unzip the folder. Inside there are tools for editing and such, namely the "Smali" folder which is hopefully what you are looking for.
kyouko said:
Download AvaboxV2 and unzip the folder. Inside there are tools for editing and such, namely the "Smali" folder which is hopefully what you are looking for.
Click to expand...
Click to collapse
I tried that. It will only do apks... I need to to do it to a .dex or a .jar
okay now I see the folder C:\Users\Devin\Documents\AvaboxV2\Smali\baksmali
but still I will need the command prompt and I will be in the same trouble i am in now.
Put the classes.dex file in the \smali\baksmali folder. then navigate to that folder in command prompt:
Code:
cd\
cd C:\Users\Devin\Documents\AvaboxV2\Smali\baksmali
java -jar baksmali-1.1.jar -o classout/ classes.dex
*that should create a folder called "classout" in \baksmali with the smali files*
Then make your edits to the .smali files using notepad++ or w/e
To close up the classout folder and put it back into a classes.dex enter this in cmd:
Code:
java -jar smali-1.1.jar classout -o classes.dex
Edit: fixed file name mix-up
kyouko said:
Put the classes.dex file in the \smali\baksmali folder. then navigate to that folder in command prompt:
Then make your edits to the .smali files using notepad++ or w/e
To close up the classout folder and put it back into a classes.dex enter this in cmd:
Code:
java -jar smali-1.2.1.jar classout -o classes.dex
Click to expand...
Click to collapse
dude no matter what I type cmd will NOT go to that folder. "Folder not found" or some ****.
I can NOT wait till iPhone 4 comes out android is total ****.
got it to go to teh folder in cmd but like I said i get the stupid ass unable to access jarfile baksmali.jar
When baksmali.jar is clearly in the freaking folder.
Is there not an easier way to do this?
Ooohhh shii- lol I'm a dumbass
Haha it should be baksmali-1.1.jar and smali-1.1.jar
I just edited my previous post to fix that mixup
I even pasted strait from yours.. it does not work man. I give up android is gay
Never mind thank you so much man.. I was just getting pissed off because I have been trying this for so long. Thanks for the help.
Funny thing is, you think you'll be able to mod I phone easier? Ha!
-------------------------------------
Sent via the XDA Tapatalk App
roflcopter
danaff37 said:
Funny thing is, you think you'll be able to mod I phone easier? Ha!
-------------------------------------
Sent via the XDA Tapatalk App
Click to expand...
Click to collapse
..Thumbs up
Srsly..its not difficult to mod android and its apps/framework(/resources)...at all. Only 2 real vars: setup and level of incompetence
not related->Getting a mac soon, mostly everything is windows compatible (80% of market/business/etc), mac not so much...parallel+windows 7 good idea?
kthxbai
I run a dual boot between ubuntu and windows 7 for work
Sent from my HERO200 using XDA App
Anyone have a clue why i get this error?
Smali\baksmali>java -jar framework.jar
-o classout/ classes.dex
Failed to load Main-Class manifest attribute from
framework.jar
This prog hero specific?
Thanks'
hellmonger said:
Anyone have a clue why i get this error?
Smali\baksmali>java -jar framework.jar
-o classout/ classes.dex
Failed to load Main-Class manifest attribute from
framework.jar
This prog hero specific?
Click to expand...
Click to collapse
it not hero specific > link
framework.jar doesn't have the "Main-class" header which is why you're getting that error.
it should be
Code:
java -jar baksmali.jar -o classout/ classes.dex
NOT
Code:
java -jar [COLOR="red"]framwork[/COLOR].jar -o classout/ classes.dex
java -jar is used to run the baksmali and smali.jar "applications"
can this be done in window? cygwin? I have tried to call baksmali for a classes.dex also and having no luck. any insight?
thank
thanksssssss
this app, everytime i start it, i have to press OK button (that annoying) but it work. see what can we do with it:
- i try to extract the classes.dex file, (using winrar)
- edit some code (to remove the dialog appear when it start),
- compress the code back .dex file
- put the .dex into .apk file
- install on the phone fail
can anyone give me suggestion or please do something..
khanhj said:
this app, everytime i start it, i have to press OK button (that annoying) but it work. see what can we do with it:
- i try to extract the classes.dex file, (using winrar)
- edit some code (to remove the dialog appear when it start),
- compress the code back .dex file
- put the .dex into .apk file
- install on the phone fail
can anyone give me suggestion or please do something..
Click to expand...
Click to collapse
Why you have attached a warez spy app?
Can anyone tell why I get this error?
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: bad magic value: 64 65 79 0a 30 33 36 00
at org.jf.dexlib.DexFile.<init>(DexFile.java:359)
at org.jf.baksmali.main.main(main.java:176)
Using Win7. I've always just thrown all editing files in Android/SMALI folder.
Hold Shift, Right Click "Open Command Window Here".
Then for compressing/decompressing the commands I use are.
java -jar baksmali.jar -o classout/ classes.dex
java -Xmx512M -jar smali.jar classout -o classes.dex
Haven't run into any issues yet. I noticed no one has put the "-Xmx512M" in their code.
I hope this helps.
This works on JPY/JS3, and ought to work on any other i9000 ROM, with a bit of ingenuity.
Download the Home_Haptic_Editing.zip at the end of this post. Extract the files to somewhere of your choosing.
Now, look at the theme package. The file you'll need is android.policy.jar.
Open android.policy.jar inside a .zip program, such as 7-zip or WinRAR. Extract the file "classes.dex" to the same folder as baksmali.jar and smali.jar.
Open a command prompt and navigate to that folder. (Or, hold Shift and right click inside the folder and hit "Open command window here").
Enter into that command prompt the following:
Code:
java -jar baksmali.jar -o classout/ classes.dex
This will create a folder called "classout" filled with .smali files.
Delete the classes.dex file.
Replace the PhoneWindowManager.smali with the uploaded one.
Back inside the command prompt, enter the following:
Code:
java -Xmx512M -jar smali.jar classout/ -o classes.dex
This will generate a classes.dex file.
Delete the classout folder.
Using 7-zip or similar, replace the classes.dex inside the android.policy.jar.
Put the android.policy.jar back inside your theme, and you're done.
It compiled. Will test tomorrow, as I don't feel like dealing with forces closes if I ****ed up tonight.
x3nhydr4lutr1sx said:
It compiled. Will test tomorrow, as I don't feel like dealing with forces closes if I ****ed up tonight.
Click to expand...
Click to collapse
My first victim tester.
Works on JS3 and JPY.
can u explain more what should this mod does exactly ?? and ought to work on any other i9000 ROM, with a bit of ingenuity?? is that mean if i try to replace ur PhoneWindowManager.smali with mine could break my phone ???
ingvay2009 said:
can u explain more what should this mod does exactly ?? and ought to work on any other i9000 ROM, with a bit of ingenuity?? is that mean if i try to replace ur PhoneWindowManager.smali with mine could break my phone ???
Click to expand...
Click to collapse
It means that it adds haptic
feedback to the home key.
It means that if you try it on non-JPY/JS3, I don't know what will happen.
Sent from my Captivate.
Compilled, now testing... AFAIK it shouldn't **** up.
But it's android - sign for that file is now bad, so it will recompile dalvik-cache (yeah, crazy i know)
Edit: **** up DID not occured, replaced file via recovery and adb. JS3 firmware
So I take it it worked?
Yep, but feedback on home is a bit stronger than other buttons.this is weird
ive tried multiple times but the windows phone 7 theme woll not work
As always tha.ks for the guide. Think we might need to make a roll up of your guids so they are easy to find.
As far as the windows theme what is the theme built off?
Thanks for posting this info. Keep up all your great work my cappy would be bone stock if not for you
Can you point me in the direction in how to add haptic feedback for jvp or even jvq, I'm trying to port a I9000 to tmobile vibrant.
jrafael said:
Can you point me in the direction in how to add haptic feedback for jvp or even jvq, I'm trying to port a I9000 to tmobile vibrant.
Click to expand...
Click to collapse
It's the same.
Sent from my Infuse 4G
Ok i think the most here knows the cool low.ram feature in newer Android roms,but in some cases its not used because
it can have issues with the transperancy in statusbar.
So most user need to deceide to have lowram but no great looking transparent statusbar,or in other case have trans statusbar but no lowram.
Here is a sollution to have low.ram feature in case you need it as alone,or when need both,im not sure its working on all devices and roms,its tested
on some different devices on different roms,but thats no garanty for 100%,please do it only when you have a lil knowledge
about this stuff,there is a high failrisk for beginner,so dont cry and learn by doing.
------
First, we need:
- Android device with rooted 4.4+ rom,deodexed.
- A nandroid backup,just in case
- Apktool or any thing like that and the knowledge to use it
- Notepad++ (on Windows)
- Its better to wipe dalvik before reboot the system when done.
------
Ok, so let's start:
Step 1:
Copy these files from your phone to your computer:
/system/framework/framework.jar
/system/priv-app/SystemUI.apk
/system/build.prop
------
Step 2:
open build.prop in notepad++, find this line:
"ro.config.low_ram="
if it say "true", skip to step 4 ,if it say "false", just change to "true" and reboot your phone,
if you can not find this line, or nothing change after you changed it to "true" and reboot, follow step 3.
------
Step 3:
(force enable low Ram)
Add this line to your build.prop:
"ro.config.low_ram.mod=true"
-------
Now use apktool etc. to decompile your framework.jar.
Navigate to \framework.jar.out\smali\android\app\ActivityManag er.smali, open it in notepad++ and find this line:
"ro.config.low_ram"
and change it to:
"ro.config.low_ram.mod"
-------
Compile it and move it back to your phone to replace the old one with it.Wipe dalvik and reboot,done.
-------
Step 4:
(force enable status bar transparent)
Decompile SystemUI.apk
Navigate to \SystemUI\smali\com\android\systemui\statusbar\phone\BarTransitions.smali and find these line:
"invoke-static {}, Landroid/app/ActivityManager;->isHighEndGfx()Z"
move-result v0
------
Change it to:
"const/4 v0, 0x1"
-------------
Compile it and do it on your phone to replace the old one with it.
Wipe dalvik and reboot your phone,done.
--------
WHEN YOU HAVE LUCK AND HAVE DONE IT RIGHT,THAN MAYBE IT LOOKS LIKE THE SECOND
PICTURE BELOW ME,THE FIRST IS BEFORE AND WITH BLACK STATBAR.
--------
AS I SAY BEFORE,I CANT GIVE A GARANTY FOR UNIVERSAL WORK!!!!
HAVE FUN-PRESENTED BY TEAM-OPTIMA!!!!!!!
-CALIBAN666- said:
"ro.config.low_ram"
Click to expand...
Click to collapse
Hey, without de-compile the apk, if you set low_ram in build.prop, then you can go to setting>performance and check the "force graphic high-end" then reboot, and you have again trasparent effects
However as far as i know adding ro.config.lowram it remove trasparent effect from system, no other about ram :'(
this should be a flag that developers can read from their apps and use custom setting for old phone, if they dont use it, there wont be nothing to do
change only "invoke-static {}, Landroid/app/ActivityManager;->isHighEndGfx()Z" to "const/4 v0, 0x1" or "invoke-static {}, Landroid/app/ActivityManager;->isHighEndGfx()Z" and "move-result v0" to "const/4 v0, 0x1"? Another question though does it matter if I have odexed apks and jar? or do I need to deodex them first before compiling?
deodex before
-CALIBAN666- said:
Step 4:
(force enable status bar transparent)
Decompile SystemUI.apk
Navigate to \SystemUI\smali\com\android\systemui\statusbar\phone\BarTransitions.smali and find these line:
"invoke-static {}, Landroid/app/ActivityManager;->isHighEndGfx()Z"
move-result v0
------
Change it to:
"const/4 v0, 0x1"
-------------
Compile it and do it on your phone to replace the old one with it.
Wipe dalvik and reboot your phone,done.
[/COLOR]
Click to expand...
Click to collapse
I don't understand here only. Help me!!
I realise that this subject already has multiple threads, but many of them do not include proper instructions, and are therefore hard to understand for users who are not familiar with Smali and other more complicated Android terminology.
This guide will help you to restore functionality similar to the Galaxy S4 and earlier models, by changing the new Recent Apps softkey back to menu, and restoring the long-press of the home button to the recent apps switcher. Unlike most other modifications that achieve this, the home button long press retains it's haptic feedback.
Before beginning, you need the following:
- Rooted Galaxy S5. Should work on all variants but I have personally tested on the G900I and G900F
- PC with Windows (Can obviously be done on Linux or OSX, but for this tutorial I will be using Windows)
- ADB Drivers for Samsung (HERE)
- Deodexed rom. I don't think this will work with an Odexed rom, as you won't be able to mod android.policy.jar
- ES File explorer, ADB or any file manager capable of editing files in root.
- ADB (Go HERE)
- JDK (Go HERE)
- Smali & Backsmali (Will be covered further down, Download from HERE)
- WinRar, 7zip or other program capable of unzipping JAR files
You do not need Xposed framework for this to work, making it compatible with Android 5+
I have tested this as working on the following devices & Android versions:
G900I: Android 5.0 (TW), Android 4.4.2 (TW)
G900F: Android 4.4.2 (TW)
Right, lets get started.
First, the easy part. For the ease of this guide I'll be using ES File Explorer to make changes, but if you are comfortable with ADB push/pull you can use that, or any other root file explorer.
Connect your phone to your computer, making sure USB debugging is enabled (Settings > Developer Options > USB Debugging)
Run ADB with your device connected (Navigate to the directory it's installed in in a command prompt window). If you don't have it, download this and install it.
Now, issue the following commands:
adb shell After a second you should see [email protected]:/ $
Now, type su and hit enter. You will likely have to grant superuser access on your device.
Now you can issue mount -o remount,rw /system to allow us to save the modifications we make back to the system partition.
Hit Control-C on the command prompt window to exit ADB, but leave the window open and the device connected.
Back on the phone, open ES File Explorer. If you haven't already you will need to go to Tools and enable 'Root Explorer' and grant superuser access.
Now, navigate to the root directory by tapping the directory you are in to bring up the history window, then tapping '/ Device'. Then go to system/usr/keylayout
Edit the file 'Generic.kl' by tapping it, opening as text (Use ES Note Editor), tapping the three dots in the top right and selecting 'Edit'
Scroll just past halfway to find the following section, And edit the line in red to MENU (It should originally be APP_SWITCH)
Code:
key 224 BRIGHTNESS_DOWN
key 225 BRIGHTNESS_UP
key 226 HEADSETHOOK
# samsung
key 252 USER
# samsung
[COLOR="Red"]key 254 MENU[/COLOR]
key 256 BUTTON_1
key 257 BUTTON_2
key 258 BUTTON_3
key 259 BUTTON_4
Save the file and repeat the above steps to edit the file 'gpio-keys.kl' changing the same thing at the bottom of the file (Changing APP_SWITCH to MENU).
Now for the more difficult part. Back on your PC, in the command prompt window type adb pull /system/framework/android.policy.jar you should now have a file called 'android.policy.jar' in your ADB directory. Copy it to a new folder somewhere on your computer.
In the folder with android.policy.jar, place smali-X.X.X.jar and baksmali-X.X.X.jar. Links to these files are at the top of the post.
Now, using WinRar or similar, extract the file 'classes.dex' from android.policy.jar and place it in the same folder as the jar itself.
Shift-rightclick in the folder holding smali, baksmali and classes.dex and select 'Open command window here'. This should open a new CMD window, in it type java -jar baksmali-2.0.5.jar -o out classes.dex (If you have a different version of baksmali, change the command accordingly)
You should now have a new folder called out. Navigate to \out\com\android\internal\policy\impl and then edit the file 'PhoneWindowManager.smali' with your favourite text editor. I recommend Notepad++ but you could get away with Notepad.
Now, there are a few different things that might need to be changed here. Online I have found many recommendations that say to change a line with if-ne v2, v5, :cond_6 however this did not work for me. If the first option does not work, try the second.
First, search for a section that looks like this:
Code:
iget v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLongPressOnHomeBehavior:I
if-eqz v2, :cond_0
iput-boolean v5, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomeConsumed:Z
const/4 v2, 0x0
invoke-virtual {p0, v2, v4, v4}, Lcom/android/internal/policy/impl/PhoneWindowManager;->performHapticFeedbackLw(Landroid/view/WindowManagerPolicy$WindowState;IZ)Z
iget v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLongPressOnHomeBehavior:I
[COLOR="red"]if-ne v2, v5, :cond_6[/COLOR]
invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->toggleRecentApps()V
and remove the line that is highlighted in red. If you don't have this line, don't worry, neither did I. Instead, look for this:
Code:
iput-boolean v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomeConsumed:Z
const/4 v0, 0x0
invoke-virtual {p0, v0, v1, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->performHapticFeedbackLw(Landroid/view/WindowManagerPolicy$WindowState;IZ)Z
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLongPressOnHomeBehavior:I
[COLOR="red"]if-ne v0, v2, :cond_1d[/COLOR]
invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->toggleRecentApps()V
goto :goto_a
And remove the red line. For me, it was on line #2547.
If you do not have either of these lines, PM me or reply with your PhoneWindowManager.smali along with what rom, version and variant of the S5 you have and I'll try to locate the correct line for you, then add it to the OP.
Now you need to recompile it and load it back on to your phone. To do this, save the PhoneWindowManager.smali if you haven't already. Now back out of the folders you are in until you are in the folder with out, Baksmali, smali, etc in it.
Rename the file 'classes.dex' to 'classes.dex.bak', this way we can restore from a backup if anything goes wrong.
Now open a command window again (Either use the one you had from before or open a new one with Shift-rightclick > Open new command window) and type java -jar smali-2.0.5.jar out -o classes.dex (If you have a different version of smali, change the command accordingly)
This should create a new classes.dex file, you can now open the android.policy.jar with WinRar again, and replace the classes.dex inside with the one that you just recompiled. Copy this android.policy.jar file back on to your phone, placing it on the root of the SD card like you would any other file. It is possible to use ADB push, however I had issues with it.
Back on the phone in ES File Explorer, go to your SD card where you just pasted the android.policy.jar and copy it. Then go to /system/framework and remove the existing android.policy.jar before pasting the new one.
Done! Reboot into recovery, wipe cache, boot your phone. It WILL take some time to boot back up, possibly upwards of 10-15min, and will say 'Android is upgrading' upon first boot. Don't take the battery out or force reboot the phone unless you are sure it's not working.
If anyone has any issues, let me know in a reply and I'll try to help. Likewise, if your phone no longer boots or you want to restore it to how it was before, I'll create an undo tutorial if required.
If I've missed anything or made some obvious typos, correct me
Credits:
In no way did I come up with all this without help, I spent a fair bit of time looking around to find all this information. If anyone thinks I've ripped off their work here, tell me and I'll give due credit.
I use Xposed addition to do that, but thank you
The point is that xposed doesn't work on stock Samsung lollipop devices yet.
Sent from my SM-G900F using XDA Free mobile app
Yeah, it works for Lollipop Touchwiz roms, and although it's not a big deal I found that the Xposed module did not have haptic feedback for opening the recents menu.
kaise123 said:
I realise that this subject already has multiple threads, but many of them do not include proper instructions, and are therefore hard to understand for users who are not familiar with Smali and other more complicated Android terminology.
This guide will help you to restore functionality similar to the Galaxy S4 and earlier models, by changing the new Recent Apps softkey back to menu, and restoring the long-press of the home button to the recent apps switcher. Unlike most other modifications that achieve this, the home button long press retains it's haptic feedback.
Before beginning, you need the following:
- Rooted Galaxy S5. Should work on all variants but I have personally tested on the G900I and G900F
- PC with Windows (Can obviously be done on Linux or OSX, but for this tutorial I will be using Windows)
- ADB Drivers for Samsung (HERE)
- Deodexed rom. I don't think this will work with an Odexed rom, as you won't be able to mod android.policy.jar
- ES File explorer, ADB or any file manager capable of editing files in root.
- ADB (Go HERE)
- JDK (Go HERE)
- Smali & Backsmali (Will be covered further down, Download from HERE)
- WinRar, 7zip or other program capable of unzipping JAR files
You do not need Xposed framework for this to work, making it compatible with Android 5+
I have tested this as working on the following devices & Android versions:
G900I: Android 5.0 (TW), Android 4.4.2 (TW)
G900F: Android 4.4.2 (TW)
Right, lets get started.
First, the easy part. For the ease of this guide I'll be using ES File Explorer to make changes, but if you are comfortable with ADB push/pull you can use that, or any other root file explorer.
Connect your phone to your computer, making sure USB debugging is enabled (Settings > Developer Options > USB Debugging)
Run ADB with your device connected (Navigate to the directory it's installed in in a command prompt window). If you don't have it, download this and install it.
Now, issue the following commands:
adb shell After a second you should see [email protected]:/ $
Now, type su and hit enter. You will likely have to grant superuser access on your device.
Now you can issue mount -o remount,rw /system to allow us to save the modifications we make back to the system partition.
Hit Control-C on the command prompt window to exit ADB, but leave the window open and the device connected.
Back on the phone, open ES File Explorer. If you haven't already you will need to go to Tools and enable 'Root Explorer' and grant superuser access.
Now, navigate to the root directory by tapping the directory you are in to bring up the history window, then tapping '/ Device'. Then go to system/usr/keylayout
Edit the file 'Generic.kl' by tapping it, opening as text (Use ES Note Editor), tapping the three dots in the top right and selecting 'Edit'
Scroll just past halfway to find the following section, And edit the line in red to MENU (It should originally be APP_SWITCH)
Code:
key 224 BRIGHTNESS_DOWN
key 225 BRIGHTNESS_UP
key 226 HEADSETHOOK
# samsung
key 252 USER
# samsung
[COLOR="Red"]key 254 MENU[/COLOR]
key 256 BUTTON_1
key 257 BUTTON_2
key 258 BUTTON_3
key 259 BUTTON_4
Save the file and repeat the above steps to edit the file 'gpio-keys.kl' changing the same thing at the bottom of the file (Changing APP_SWITCH to MENU).
Now for the more difficult part. Back on your PC, in the command prompt window type adb pull /system/framework/android.policy.jar you should now have a file called 'android.policy.jar' in your ADB directory. Copy it to a new folder somewhere on your computer.
In the folder with android.policy.jar, place smali-X.X.X.jar and baksmali-X.X.X.jar. Links to these files are at the top of the post.
Now, using WinRar or similar, extract the file 'classes.dex' from android.policy.jar and place it in the same folder as the jar itself.
Shift-rightclick in the folder holding smali, baksmali and classes.dex and select 'Open command window here'. This should open a new CMD window, in it type java -jar baksmali-2.0.5.jar -o out classes.dex (If you have a different version of baksmali, change the command accordingly)
You should now have a new folder called out. Navigate to \out\com\android\internal\policy\impl and then edit the file 'PhoneWindowManager.smali' with your favourite text editor. I recommend Notepad++ but you could get away with Notepad.
Now, there are a few different things that might need to be changed here. Online I have found many recommendations that say to change a line with if-ne v2, v5, :cond_6 however this did not work for me. If the first option does not work, try the second.
First, search for a section that looks like this:
Code:
iget v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLongPressOnHomeBehavior:I
if-eqz v2, :cond_0
iput-boolean v5, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomeConsumed:Z
const/4 v2, 0x0
invoke-virtual {p0, v2, v4, v4}, Lcom/android/internal/policy/impl/PhoneWindowManager;->performHapticFeedbackLw(Landroid/view/WindowManagerPolicy$WindowState;IZ)Z
iget v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLongPressOnHomeBehavior:I
[COLOR="red"]if-ne v2, v5, :cond_6[/COLOR]
invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->toggleRecentApps()V
and remove the line that is highlighted in red. If you don't have this line, don't worry, neither did I. Instead, look for this:
Code:
iput-boolean v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomeConsumed:Z
const/4 v0, 0x0
invoke-virtual {p0, v0, v1, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->performHapticFeedbackLw(Landroid/view/WindowManagerPolicy$WindowState;IZ)Z
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLongPressOnHomeBehavior:I
[COLOR="red"]if-ne v0, v2, :cond_1d[/COLOR]
invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->toggleRecentApps()V
goto :goto_a
And remove the red line. For me, it was on line #2547.
If you do not have either of these lines, PM me or reply with your PhoneWindowManager.smali along with what rom, version and variant of the S5 you have and I'll try to locate the correct line for you, then add it to the OP.
Now you need to recompile it and load it back on to your phone. To do this, save the PhoneWindowManager.smali if you haven't already. Now back out of the folders you are in until you are in the folder with out, Baksmali, smali, etc in it.
Rename the file 'classes.dex' to 'classes.dex.bak', this way we can restore from a backup if anything goes wrong.
Now open a command window again (Either use the one you had from before or open a new one with Shift-rightclick > Open new command window) and type java -jar smali-2.0.5.jar out -o classes.dex (If you have a different version of smali, change the command accordingly)
This should create a new classes.dex file, you can now open the android.policy.jar with WinRar again, and replace the classes.dex inside with the one that you just recompiled. Copy this android.policy.jar file back on to your phone, placing it on the root of the SD card like you would any other file. It is possible to use ADB push, however I had issues with it.
Back on the phone in ES File Explorer, go to your SD card where you just pasted the android.policy.jar and copy it. Then go to /system/framework and remove the existing android.policy.jar before pasting the new one.
Done! Reboot into recovery, wipe cache, boot your phone. It WILL take some time to boot back up, possibly upwards of 10-15min, and will say 'Android is upgrading' upon first boot. Don't take the battery out or force reboot the phone unless you are sure it's not working.
If anyone has any issues, let me know in a reply and I'll try to help. Likewise, if your phone no longer boots or you want to restore it to how it was before, I'll create an undo tutorial if required.
If I've missed anything or made some obvious typos, correct me
Credits:
In no way did I come up with all this without help, I spent a fair bit of time looking around to find all this information. If anyone thinks I've ripped off their work here, tell me and I'll give due credit.
Click to expand...
Click to collapse
How do I remap longpress menu or double tap menu button to lock screen, long press back key to kill foreground app and double tap back key switch previous app??
slimshouki said:
How do I remap longpress menu or double tap menu button to lock screen, long press back key to kill foreground app and double tap back key switch previous app??
Click to expand...
Click to collapse
I am out and about at the moment so I can't sit down and look at the files in detail, however I'm not sure how to remap long-press actions off the top of my head. I can think of a couple of workarounds though.
For the long press/double tap menu button to lock screen, this can be achieved via an app. Apps that have device administrator access are able to perform actions like locking the screen, so anything that runs in the background and has an action for long pressing menu can be set as the default action, and therefore lock the screen. The easiest way I can think of doing this is to install the app Greenify (https://play.google.com/store/apps/details?id=com.oasisfeng.greenify&hl=en) and then hold your menu button down. It should ask if you want to complete the action with Greenify (Hibernate + Lock screen), and that will lock your screen if set as default.
For killing an app with a long press of the home button, I don't believe there is a default way of assigning this to a button via any of the built in files, either. You would need to find an app or mod which enables it. You can install this (http://www.mediafire.com/download/p8rtci9bttn14s7/Hold_Back_To_Kill_v1.0.apk) and give it a shot (You'll need Unknown sources enabled and a rooted device). It should do what you're looking for.
As for double tapping the back button to switch to your last app, I'm out of ideas. Maybe someone else around the forums can help here.
As far as I'm aware, the keymapping files can only customise buttons to do things that the keys on the phone are already capable of, so switching the menu to recents is possible, and so is moving recents to long press of home, but adding things beyond this (Like killing apps, etc) is only possible with additional software that is beyond my ability to code.
Good luck, and if you find any other solution to this please let me know and I'll add it to the OP incase anyone else wants to know how to do it.
I do everything exactly like in 1 post.
I managed to do smaling.
Copied modified android.policy.jar back to phone, phone restarts, Android is upgrading.
Short press works, but after long-press there is no recent apps switcher, instead I get google now search and s search at the same time.
I'm 99% sure I made everything correct, cause I made it on my 2 phones (G900F and G900FD) and the result is the same.
@tdunham could you please help or anybody
kold11 said:
I do everything exactly like in 1 post.
I managed to do smaling.
Copied modified android.policy.jar back to phone, phone restarts, Android is upgrading.
Short press works, but after long-press there is no recent apps switcher, instead I get google now search and s search at the same time.
I'm 99% sure I made everything correct, cause I made it on my 2 phones (G900F and G900FD) and the result is the same.
@tdunham could you please help or anybody
Click to expand...
Click to collapse
This is supposed to make long pressing your home button bring up the recent apps switcher, not long pressing the menu button. Did you try that?
Good
Thanks a lot for answer.
You are right, my bad.
Home key brings recent apps.
But I think there is one important step missing for little experienced users (like me):
You have to change android.policy.jar permissions, cause my phone freaked out without it.
Wysłane z mojego SM-G900FD przy użyciu Tapatalka