[HOW TO] Extended Power Menu with no header (reboot / download / recovery) - Galaxy S II Themes and Apps

[HOW TO] Extended Power Menu (reboot / download / recovery) with no header
This HOW TO is rewritten from a French tutorial (HERE) itself rewritten from a XDA tutorial (HERE, and modified using this other one : HERE
Thanks to :
Okarin
untermensch
PaoloM70
Click to expand...
Click to collapse
warnings :
- This tutorial is for people who know what they will do, a mistake can fit your phone unusable so ...
- A modification of system files is always a delicate operation, pay attention and do not rush
Click to expand...
Click to collapse
Prerequisites :
First and foremost, you must master the decompilation / recompilation of APK and JAR using APK_Manager and smali/baksmali.
Click to expand...
Click to collapse
Mod the power menu :
Here is the way to add the options "Reboot", "Recovery" and "Download" to the Power menu (long press the power button)
For this part, we will work on 2 files:
framework res.apk
android.policy.jar
Click to expand...
Click to collapse
You can decompile the first with APK Manager, and the second with baksmali.
1/ framework-res.apk :
Extract it with APK_Manager (extracted in /project folder)
a/ Then, before going any further, you will have to find three new .PNG images to be displayed in the power menu, and name them :
"ic_lock_reboot.png" for reboot menu
"ic_lock_recovery.png" to enter recovery
"ic_lock_download.png" for download Mode
Click to expand...
Click to collapse
Place these 3 images in the : APK_Manager/project/framework-res.apk/res/drawable-hdpi
where you will find the other pictures already in the menu concerned.
It is easier for beginners to add customised icons (like for power off, silent or plane modes icons )after recompilation, using 7zip for example. .
b/ With NotePad + +, edit the file " res/values/strings.xml "
Go to the end of the file, and add before the last line "</resources>", the three lines:
Code:
<string name="reboot_recovery">Recovery</string>
<string name="reboot_download">Download</string>
<string name="reboot">Reboot</string>
This should give you something like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
c/ Save your file.
d/ Now you can recompile the file "framework-res.apk" with APK Manager.
Remember that this is an APK system and delete the "keep/resources.arsc", since we have modified an XML file.
You will have a your moded apk here : "place-apk-here-for-modding/unsignedframework-res.apk"
Warning: You should not have errors when you re-compil. don't forget to add 3 new icons;
e/ using APK-Manager, decompil "place-apk-here-for-modding/unsignedframework-res.apk".
*Go to res/values/public.xml and edit with Notepad ++
*public.xml is auto-generated from others modifications during APK_MANAGER re-compilation. 6 new lines have been added, with 6 new Hex numbers. You will need these numbers later ...
Look for :
Code:
<public type="string" name="reboot" id="[B]0x01040488[/B]" />
<public type="string" name="reboot_recovery" id="[B]0x01040489[/B]" />
<public type="string" name="reboot_download" id="[B]0x0104048a[/B]" />
and for :
Code:
<public type="drawable" name="ic_lock_reboot" id="[B]0x010803d2[/B]" />
<public type="drawable" name="ic_lock_recovery" id="[B]0x010803d3[/B]" />
<public type="drawable" name="ic_lock_download" id="[B]0x010803d4[/B]" />
f/ Now you just have to rename "place-apk-here-for-modding/unsignedframework-res.apk" to "framework-res.apk" and voila!
Edit : never sign a system File using APK_Manager.
Here is the first part ended.
A tip, try this file on your phone, if it restarts fine, then the mod is correct, otherwise you can start over
It is important to test step by step, because it lets you know exactly from witch file comes the error.
2/ Now, we attack the second file "android.policy.jar".
Once decompiled with baksmal, edit the "out/com/android/internal/policy/impl/GlobalActions.smali."
Caution: Do not confuse it with the file "GlobalActions$Action.Smali"
a/ Find the line ".method private createDialog()Landroid/app/AlertDialog;"
then a few lines below, replace "const/4 v9, 0x4" with "const/4 v9, 0x7".
This line indicates the number of menu entries of extinction, we move from 4 to 7 (3 mor entries). You should have this after the changes made:
b/ Then find the line "
Code:
invoke-static {v0}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
" and insert just above:
Code:
const/4 v1, 0x4
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$8;
const v3, 0x10803d2
const v4, 0x1040488
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
const/4 v1, 0x5
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$9;
const v3, 0x10803d3
const v4, 0x1040489
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$9;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
const/4 v1, 0x6
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$10;
const v3, 0x10803d4
const v4, 0x104048a
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$10;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
You will notice in the code, the previous hex numbers generated. You have to modify the hex numbers quoted with the hex numbers you found in step 2 after decompilation of unsignedframework-res.apk
Warning in this code, the hex numbers have a 0 in less after the "0x" like : 0x1234567... and not 0x011234567 like in string.xml[/COLOR]...
Please not in the code you just added the GlobalActions$8, GlobalActions$9, GlobalActions$10 : you will add files .smali with same name later. If in your firmware GlobalActions$8 is already existing, then modify the "$X" to follow last used number
To help, here's what you should have:
3/ If you want to remove the header of the extended power menu, not having to scroll,
a/ search for ".method private prepareDialog()",
then look a few lines below, you should find "const v4, 0x104014a"
where This hexadecimal digit corresponds to the entry "<public type="string"name="global_actions" id="0x0104014a" /> in the "public.xml" file, which itself refers to the text of the menu in" string.xml " :
b/ find the corresponding hexadecimal number 0xXXXXX to the entry "<string name="config_tether_apndata" />" in the "string.xml" file. This entry has no text.
Now replace in "const v4, 0x104014a" with "const v4, 0xXXXXX," so it will not show anything in the power menu.
Save the file.
c/ Come on, we're almost there ...
Now copy the "out/com/android/internal/policy/impl/GlobalActions$4.Smali" to "out/com/android/internal/policy/impl/GlobalActions$8.Smali".
We choose #4 because it is one that contains the shutdown of the phone. We will rename it 8 because it's 8 in the next free issue ...
Remember this if ever in a future version of the files they are change.
d/ Now open the new file "out/com/android/internal/policy/impl/GlobalActions$8.Smali" and replace in, all occurrences of "\GlobalActions$4" with "\GlobalActions$8"
Then, Replace :
Code:
const/4 v1, 0x1
invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V
With :
Code:
const/4 v1, 0x1
const-string v2, "now"
invoke-static {v0, v2, v1}, Lcom/android/internal/app/ShutdownThread;->reboot(Landroid/content/Context;Ljava/lang/String;Z)V
e/ Save the file and copy it to "out/com/android/internal/policy/impl/GlobalActions$9.Smali"
Open it and replace in, all occurrences of "\GlobalActions$8" with "\GlobalActions$9
and
const-string v2, "now" with const-string v2, "recovery"
f/ Save the file and copy it to "out/com/android/internal/policy/impl/GlobalActions$10.Smali"
Open it and replace in, all occurrences of "\GlobalActions$9" with "\GlobalActions$10
and
const-string v2, "recovery" with const-string v2, "download"
Save the file and then ... compile it all!
The result, you will see that I also forgot to replace an icon:

Thanks you! finally someone willing to write a tutorial on this.

great tutorial.
thanx, we all need help sometimes

Excellent. Now for a tutorial on how to get the mobile data toggle in the notification bar and we can all build custom roms.
Sent from my GT-I9100 using Tapatalk

Wow, u really went the whole 9 yards explaining this, thanks, as always grateful for ur sharing....

Seems like you put a lot of time and effort in this post.
Very good and clear instructions on something I wanted to add to my custom rom for a long time. (without just adding some files)
Thank you very much.

No credit for the how to you copied this from?
what a shame
http://forum.xda-developers.com/showthread.php?t=811532

Nice guide. Two things when using apkmanager:
1) Never ever edit the public.xml
2) When Recompiling: Never sign system files. Copy their signature!
Sent from my GT-I9100 using XDA Premium App

designgears said:
No credit for the how to you copied this from?
what a shame
http://forum.xda-developers.com/showthread.php?t=811532
Click to expand...
Click to collapse
as Cognition user i can only agree with "my" developer, that most of the statings above are simply coppied - Ctrl+a--->Ctrl+V ---> well done

_JKay_ said:
Nice guide. Two things when using apkmanager:
1) Never ever edit the public.xml
2) When Recompiling: Never sign system files. Copy their signature!
Sent from my GT-I9100 using XDA Premium App
Click to expand...
Click to collapse
If we don't edit Public.xml, how are going to achieve this? I keep getting errors while recompiling using apkmanager? They sometimes don't even extract the resources.arsc and throw a lot of errors.
I'm working on adding a few options in the settings apk and neither apkmanger nor apktool is letting me decompile settings apk. It always throws errors. I need to decompile to edit a few xml in values which i don't find if i unzip it with 7-zip or winrar! Editing smali files is not a prob for now!
Any solutions?

@ sicopat
All three options call the Shutdown thread and present the "Your phone will shutdown" dialog. How do we change this?
And i also want to add the subtext in all three options in the main options, where are those located?

Ghostbustersin said:
If we don't edit Public.xml, how are going to achieve this? I keep getting errors while recompiling using apkmanager? They sometimes don't even extract the resources.arsc and throw a lot of errors.
I'm working on adding a few options in the settings apk and neither apkmanger nor apktool is letting me decompile settings apk. It always throws errors. I need to decompile to edit a few xml in values which i don't find if i unzip it with 7-zip or winrar! Editing smali files is not a prob for now!
Any solutions?
Click to expand...
Click to collapse
public.xml is auto-generated! Try add a string or a png and compile then decompile again. You will see that the new resources has been added to the public.xml
The ids MUST be unique and increased by one! Its all done in the apktool!

designgears said:
No credit for the how to you copied this from?
what a shame
http://forum.xda-developers.com/showthread.php?t=811532
Click to expand...
Click to collapse
You are totaly right.
I didn't find lines to modify,
I just built a new How To, from a french one I found here : http://www.galaxys-team.fr/viewtopic.php?f=6&t=14562
I believe this french How To took its inspiration from this thread : http://forum.xda-developers.com/showthread.php?t=811532
I didn't found this thread myself, you found it for me.
I finished to write this thread at 1h30 AM and I am going just now correct this mistake ...
Sorry for this

_JKay_ said:
Nice guide. Two things when using apkmanager:
1) Never ever edit the public.xml
2) When Recompiling: Never sign system files. Copy their signature!
Sent from my GT-I9100 using XDA Premium App
Click to expand...
Click to collapse
1/ Why never edit public.xml ?
2/ You are right for that

_JKay_ said:
public.xml is auto-generated! Try add a string or a png and compile then decompile again. You will see that the new resources has been added to the public.xml
The ids MUST be unique and increased by one! Its all done in the apktool!
Click to expand...
Click to collapse
Ok but i never had errors using this How To and so, modifing public.xml.
But I will add your recommandation for people to try this How To, without modifing public.xml.
Thanks

sicopat said:
I insist on it here: only perform additions, never modify the images during the decompilation / recompilation of APK with APK_Manager.
Thanks
Click to expand...
Click to collapse
Why this statement? I'd rather say ONLY edit PNGs when decompiled!

_JKay_ said:
Why this statement? I'd rather say ONLY edit PNGs when decompiled!
Click to expand...
Click to collapse
Cause when using Apk manager, during re-compilation a keep folder is created and if you don't delete every files (and png) you modified in this keep folder, then after recompilation you will have olds .png from the keep folder and not your new png from your project folder.
It is easier to just push your new .png after recompilation.
I am just a noob who want to help a little with my short experience.
I am ready to learn and to optimise my how to
Sent from my GT-I9100 using XDA Premium App

sicopat said:
Cause when using Apk manager, during re-compilation a keep folder is created and if you don't delete every files (and png) you modified in this keep folder, then after recompilation you will have olds .png from the keep folder and not your new png from your project folder.
It is easier to just push your new .png after recompilation.
I am just a noob who want to help a little with my short experience.
I am ready to learn and to optimise my how to
Sent from my GT-I9100 using XDA Premium App
Click to expand...
Click to collapse
Its true you need to delete the files you modify from the keep folder. But you should never try and modify 9patch pngs if they are not decompiled!!

_JKay_ said:
Its true you need to delete the files you modify from the keep folder. But you should never try and modify 9patch pngs if they are not decompiled!!
Click to expand...
Click to collapse
Yes i agree with you.
But in this How to, you don't need to edit 9patch.png
For begginers i think it's easier to push the customised reboot, power off, download mode icons ... after recompilation.
Sent from my GT-I9100 using XDA Premium App

sicopat said:
Yes i agree with you.
But in this How to, you don't need to edit 9patch.png
For begginers i think it's easier to push the customised reboot, power off, download mode icons ... after recompilation.
Sent from my GT-I9100 using XDA Premium App
Click to expand...
Click to collapse
Ok...... But I think this could make beginners believe that this is always the case and how it should always be done. I rather teach them the right way

Related

[MOD] no am/pm on ics status bar for the devs

The rom devs will know what this is ....
did this for skyrocket devs but works for your ics ports as well.
made this thread over here so i can stop getting pms from this side on howtos...
info http://forum.xda-developers.com/showthread.php?t=1591030
Remove AM/PM
1. Decompile SystemUI.apk
2. Goto: /systemui.apk /smali/com/android/systemui/statusbar/policy
3. edit Clock.smali
4. the line you want is typically 36 (its the static constructor)
5. change "const/4 v0, 0x0" to "const/4 v0, 0x2"
6. yup thats right, 1 character edit!
7. save and recompile
Color for Clock (if you havnt already)
1. Decompile SystemUI.apk
2. Goto: /res/values/
3. edit styles.xml
4. the style you want is "<style name="TextAppearance.StatusBar.Clock" parent="@android:style/TextAppearance.StatusBar.Icon">"
5. change "<item name="android:textColor">#ff33b5e5</item>" under this style (this is android blue, change at will)
6. save and recompile
enjoy!!
Will be put to use. Thanks.
theHOTNESS said:
The rom devs will know what this is ....
did this for skyrocket devs but works for your ics ports as well.
made this thread over here so i can stop getting pms from this side on howtos...
info http://forum.xda-developers.com/showthread.php?t=1591030
Remove AM/PM
1. Decompile SystemUI.apk
2. Goto: /systemui.apk /smali/com/android/systemui/statusbar/policy
3. edit Clock.smali
4. the line you want is typically 36 (its the static constructor)
5. change "const/4 v0, 0x0" to "const/4 v0, 0x2"
6. yup thats right, 1 character edit!
7. save and recompile
Color for Clock (if you havnt already)
1. Decompile SystemUI.apk
2. Goto: /res/values/
3. edit styles.xml
4. the style you want is "<style name="TextAppearance.StatusBar.Clock" parent="@android:style/TextAppearance.StatusBar.Icon">"
5. change "<item name="android:textColor">#ff33b5e5</item>" under this style (this is android blue, change at will)
6. save and recompile
enjoy!!
Click to expand...
Click to collapse
Tried it on stock FD10 ICS4.0.3 build for E4GT.
Didn't work unfortunately.
I found 3 instances of const/4 v0, 0x0 and changing any of them or any combination of 2 of them didn't remove AM/PM from status bar clock.
Any ideas or suggestions?
I also am trying this mod and would like to know what are the lines before or after the mod. Just to make sure I am making the changes to the right one since I also see 3 of them... Thanks in Advance
agat63 said:
Tried it on stock FD10 ICS4.0.3 build for E4GT.
Didn't work unfortunately.
I found 3 instances of const/4 v0, 0x0 and changing any of them or any combination of 2 of them didn't remove AM/PM from status bar clock.
Any ideas or suggestions?
Click to expand...
Click to collapse
Use notepad++ and go to line 36 and change the value
Sent from my SGH-T989 using Tapatalk 2
`SBR` said:
Use notepad++ and go to line 36 and change the value
Sent from my SGH-T989 using Tapatalk 2
Click to expand...
Click to collapse
actually I do not see static constructor but public constructor and lines 34-41 show this
Code:
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 1
.parameter "context"
.prologue
.line 72
const/4 v0, 0x0
`SBR` said:
Use notepad++ and go to line 36 and change the value
Sent from my SGH-T989 using Tapatalk 2
Click to expand...
Click to collapse
I'm using notepad++.
There is no instance/value on line 36 in ICS file for E4GT.
First instance is on line 39.
Did try it. No dice.
And as mentioned above did try any combination of 3 instances of that value thru the file. No go.
May be ICS for E4GT is different and we should look somewhere else.
playya said:
actually I do not see static constructor but public constructor and lines 34-41 show this
Code:
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 1
.parameter "context"
.prologue
.line 72
const/4 v0, 0x0
Click to expand...
Click to collapse
agat63 said:
I'm using notepad++.
There is no instance/value on line 36 in ICS file for E4GT.
First instance is on line 39.
Did try it. No dice.
And as mentioned above did try any combination of 3 instances of that value thru the file. No go.
May be ICS for E4GT is different and we should look somewhere else.
Click to expand...
Click to collapse
Hope you're looking into the file in the below path.
SystemUI\smali\com\android\systemui\statusbar\policy\Clock.smali
and search for the below line
Code:
sput v0, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
above the line
Code:
const/4 v0, 0x0
change the 0 to 2 like below, it will be like this .
Code:
const/4 v0, 0x2
Save it and decompile the systemui.apk
`SBR` said:
Hope you're looking into the file in the below path.
SystemUI\smali\com\android\systemui\statusbar\policy\Clock.smali
and search for the below line
Code:
sput v0, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
above the line
Code:
const/4 v0, 0x0
change the 0 to 2 like below, it will be like this .
Code:
const/4 v0, 0x2
Save it and decompile the systemui.apk
Click to expand...
Click to collapse
yea been there and its a no go apparently my Clock.smali is dfferent
playya said:
yea been there and its a no go apparently my Clock.smali is dfferent
Click to expand...
Click to collapse
I confirm that.
There is no such line in Clock.smali in E4GT ICS SystemUI.apk smali file.
There has been a lot of changes in apk, dex and jar files from GB to ICS.
agat63 said:
I confirm that.
There is no such line in Clock.smali in E4GT ICS SystemUI.apk smali file.
There has been a lot of changes in apk, dex and jar files from GB to ICS.
Click to expand...
Click to collapse
shhhhhhoooot I am trying to do it on GB but I looked in ICS as well and did not see it. I looked in services.jar and did not see it.. Believe me I know it should be out there somewhere but other than TSM mods I can not seem to find any tutorials on how to just remove am/pm... If anyone knows how to do this on GB or ICS which may be similiar please let me know. Its for the E4GT
Thx

[DEV] [MOD] [HOW-TO] Remove AM/PM on LG8 Based Sprint ROMS [MOD]

Hey everyone! In response to sudden events i am deciding to make tutorials for all my MODS for interested DEVS. Here is removing AM/PM from clock on status bar MOD.
First you're going to need to decompile the Smali in SystemUI.apk
Now edit the following code in the following smali:
/systemui.apk /smali/com/android/systemui/statusbar/policy/Clock.smali
Edit the following code:
Code:
# direct methods
.method static constructor <clinit>()V
.registers 1
[COLOR="Red"] --const/4 v0, 0x0
[/COLOR][COLOR="Green"] ++const/4 v0, 0x2[/COLOR]
sput v0, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
return-void
.end method
.method public constructor <init>(Landroid/content/Context;)V
.registers 3
That's all. Recompile and the AM/PM in the status bar should have disappeared
Have Fun!
clark44 said:
Hey everyone! In response to sudden events i am deciding to make tutorials for all my MODS for interested DEVS. Here is removing AM/PM from clock on status bar MOD.
First you're going to need to decompile the Smali in SystemUI.apk
Now edit the following code in the following smali:
/systemui.apk /smali/com/android/systemui/statusbar/policy/Clock.smali
Edit the following code:
Code:
# direct methods
.method static constructor <clinit>()V
.registers 1
[COLOR="Red"] --const/4 v0, 0x0
[/COLOR][COLOR="Green"] ++const/4 v0, 0x2[/COLOR]
sput v0, Lcom/android/systemui/statusbar/policy/Clock;->AM_PM_STYLE:I
return-void
.end method
.method public constructor <init>(Landroid/content/Context;)V
.registers 3
That's all. Recompile and the AM/PM in the status bar should have disappeared
Have Fun!
Click to expand...
Click to collapse
Thanks for sharing!
Sent from my SPH-L710 using xda premium
Thanks Clark!
I will post the updated clock MODS in your ROM thread.
I am trying to make some changes in the framework-res.apk but I am having issues recompiling. All other APKs recompile fine for me except framework-res. Even if I make no changes at all it will not recompile. Decompile is fine, just wont recompile. Do I need to install different framework when working withing framework-res?
The command "apktool if framework-res.apk" should work for de/recompiling framework-res correct?
Didact74 said:
I am trying to make some changes in the framework-res.apk but I am having issues recompiling. All other APKs recompile fine for me except framework-res. Even if I make no changes at all it will not recompile. Decompile is fine, just wont recompile. Do I need to install different framework when working withing framework-res?
The command "apktool if framework-res.apk" should work for de/recompiling framework-res correct?
Click to expand...
Click to collapse
Use twframework-res.apk instead. So...
apktool if twframework-res.apk
clark44 said:
Use twframework-res.apk instead. So...
apktool if twframework-res.apk
Click to expand...
Click to collapse
Bingo! Thank you sir! :good:
---------- Post added at 11:46 PM ---------- Previous post was at 11:11 PM ----------
So framework-res had information to change the lockscreen information but twframework-res does not. Which TW APK hold the lockscreen info?
Didact74 said:
Bingo! Thank you sir! :good:
---------- Post added at 11:46 PM ---------- Previous post was at 11:11 PM ----------
So framework-res had information to change the lockscreen information but twframework-res does not. Which TW APK hold the lockscreen info?
Click to expand...
Click to collapse
Not sure. Would probably be systemui.
I'm going to bet that you are having the plurals error. Try recompiling again and read the errors, if you see the world plurals, do the following.
in res\values\plurals.xml
look for
Code:
<item quantity="other">%d of %d</item>
make it
Code:
<item quantity="other">%d of %%d</item>
res\values-en-rUS\plurals.xml
look for:
Code:
<item quantity="other">%d of %d</item>
make it
Code:
<item quantity="other">%d of %%d</item>
res\values-es\plurals.xml
look for:
Code:
<item quantity="other">%d de %d</item>
make it
Code:
<item quantity="other">%d de %%d</item>
It should compile just fine after that. I had the same errors.
Didact74 said:
I am trying to make some changes in the framework-res.apk but I am having issues recompiling. All other APKs recompile fine for me except framework-res. Even if I make no changes at all it will not recompile. Decompile is fine, just wont recompile. Do I need to install different framework when working withing framework-res?
The command "apktool if framework-res.apk" should work for de/recompiling framework-res correct?
Click to expand...
Click to collapse
Good call on the plurals Jimie, that fixed my errors but when it compiles I get a bunch of warnings but it does compile. Wheni try to push it to Framework via TWRP flash it causes a bootloop. Even when no changes are made. Were you able to successfully modify framework-res and not bootloop? Here are my warnings....
From my experience, the warnings are nothing to worry about. Are you using root explorer to set the appropriate file permissions?
Didact74 said:
Good call on the plurals Jimie, that fixed my errors but when it compiles I get a bunch of warnings but it does compile. Wheni try to push it to Framework via TWRP flash it causes a bootloop. Even when no changes are made. Were you able to successfully modify framework-res and not bootloop? Here are my warnings....
Click to expand...
Click to collapse
Tsudeily said:
From my experience, the warnings are nothing to worry about. Are you using root explorer to set the appropriate file permissions?
Click to expand...
Click to collapse
It was due to my updater script. I forgot to changethe directories/permissions within the script. It loaded fine this time but the change did not take. I am trying to manipulate the date, time, and "wipe screen to unlock" on the lockscreen but I can not find out where the XML is to do it. I thought i had found it in framework-res/res/values/strings.xml but it did not work.
Thanks for reminding me about the permissions or I probably would have never checked the updater script .
Please Donate--for even more development
All, not that I am a beggar by any means, but please donate to Clark, he needs it..trust me when I say this...Behind the scenes, he is buying equipment to continue his development. The donation go towards this. Thanks (and I too have donated)...:highfive::highfive::highfive:
Click Here > http://forum.xda-developers.com/donatetome.php?u=3885544
Happy to help. Strange about it not taking. Did you wipe your caches?
Didact74 said:
It was due to my updater script. I forgot to changethe directories/permissions within the script. It loaded fine this time but the change did not take. I am trying to manipulate the date, time, and "wipe screen to unlock" on the lockscreen but I can not find out where the XML is to do it. I thought i had found it in framework-res/res/values/strings.xml but it did not work.
Thanks for reminding me about the permissions or I probably would have never checked the updater script .
Click to expand...
Click to collapse
I was reading this link (yes, I know it is for the SGS2): http://forum.xda-developers.com/showpost.php?p=24853926&postcount=1
I was successfully able to get the "easy" part complete, the SecSettings.apk part of adding the toggles to Settings - Date and Time (see attached). They toggle correctly meaning the checkboxes work, but nothing happens as I cannot get the edits described to work with clock.smali (compiling errors with apktool). Again I know it is a guide for the SGS2, but the smali code is very close, so I think that if someone with smali experience (I have next to none) looked at it, this would be do-able.
I am using the SGS3 on US Cellular's network. It seems that I am close to getting this, but does anyone have any thoughts/suggestions?
pretty cool idea. Did you have to change the identifier to get it to compile?
When I use "0x7f0b0923" it errors out because that identifier is already being used. However, if I change it to something like 0xf0d0af2 it will compile but i can not get into settings at all once I reboot.
Didact74 said:
pretty cool idea. Did you have to change the identifier to get it to compile?
When I use "0x7f0b0923" it errors out because that identifier is already being used. However, if I change it to something like 0xf0d0af2 it will compile but i can not get into settings at all once I reboot.
Click to expand...
Click to collapse
Here's what I changed mine to, since apktool was complaining of the same thing.
<public type="string" name="disable_ampm" id="0x7f0d0b2f" />
<public type="string" name="disable_ampm_text" id="0x7f0d0b30" />
<public type="string" name="disable_time" id="0x7f0d0b31" />
<public type="string" name="disable_time_text" id="0x7f0d0b32" />
I was then able to recompile SecSettings.apk, it did give me warnings but it worked and I wasn't getting the identifier already used error. I feel like I'm really close I just need to figure out the smali part for Clock.smali and PhoneStatusBar.smali yet. Hopefully I can get help or pointed in the right direction soon.
RMarkwald said:
Here's what I changed mine to, since apktool was complaining of the same thing.
<public type="string" name="disable_ampm" id="0x7f0d0b2f" />
<public type="string" name="disable_ampm_text" id="0x7f0d0b30" />
<public type="string" name="disable_time" id="0x7f0d0b31" />
<public type="string" name="disable_time_text" id="0x7f0d0b32" />
I was then able to recompile SecSettings.apk, it did give me warnings but it worked and I wasn't getting the identifier already used error. I feel like I'm really close I just need to figure out the smali part for Clock.smali and PhoneStatusBar.smali yet. Hopefully I can get help or pointed in the right direction soon.
Click to expand...
Click to collapse
I will see if I can get it to work. Nice find.
clark44 said:
I will see if I can get it to work. Nice find.
Click to expand...
Click to collapse
It was random... Kinda. I used from what I could tell wasn't in use to the point where apktool didn't complain. Whether or not that's good/bad I'm not sure yet...
- Sent from my US Cellular SGS3
RMarkwald said:
It was random... Kinda. I used from what I could tell wasn't in use to the point where apktool didn't complain. Whether or not that's good/bad I'm not sure yet...
- Sent from my US Cellular SGS3
Click to expand...
Click to collapse
Your hex did not work for me either. I had to use 0x7f0d0af2 - 0x7f0d0af5 to get it to compile.
It seems that the first code made in the clock.smali is what is causing the recompile issues:
Code:
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v7, "hide_time"
const/4 v0, 0x0
invoke-static {v2, v7, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v7
const/4 v0, 0x0
if-eqz v7, :cond_nohide
const/16 v0, 0x8
:cond_nohide
const v1, 0x7f0e0027
invoke-virtual {p0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v1
invoke-virtual {v1, v0}, Landroid/view/View;->setVisibility(I)V
If I make all changes except that one I can get it to compile. However, I have random isues where settings will not open at all. I am sure Clark can make sense of it as my smali skills are subpar as well.
I figured it may be different for you. I did notice that too with the code, but then I also did notice that the other code would let it compile (2nd part of code for Clock.smali), and the PhoneStatusBar.smali stuff just FC'd SystemUI. Clark PM'd me last night, so hopefully something will come of this soon. If the smali stuff gets worked out to work with the SGS3, then the XML stuff will fall in line pretty easy, just need to find hex to work probably for each model, as I'm sure it's all a little different.

[MOD][GUIDE]Enable and change color of %battery digits in 4.4 KitKat

So as you probably know by now, Android 4.4 came with a hidden feature in SystemUI to enable %battery within the battery icon when it's not charging. This can be accomplished by an app (credit to @kroegerama), an adb command, or a manual SystemUI smali edit (a quite easy one explained in this walkthrough). The problem is this text is the same color as the battery fill (white), making it useless until the battery is about 50% or less. I played around with the smali for a while and couldn't properly get the text to change colors (smali is certainly not my native tongue...), so I did it the old fashioned way. I changed it in source, built, and compared the results. With that, I'll show you how you can change the text color of the digits when %battery is enabled.
This tutorial will assume you have know how to use APKTool to decompile/recompile APKs while keeping their signatures in tact. There are walkthroughs that will show you how to accomplish this readily available. Method 1 will show you an easy way to change the color to black, and method 2 will show you how you can change things so you can set the text color to whatever you want, without having to figure out the java hex -> smali const equation (though if someone knows it I'm always loving to learn new things). This tutorial is for users on a DEODEXED ROM. If your ROM is odexed, it's probably easiest to deodex SystemUI, make the changes, then reodex ALWAYS HAVE A BACKUP READILY AVAILABLE IN CASE SOMETHING GOES WRONG!
Things you'll need:
APKTool
Notepad++
SystemUI.apk from your 4.4 ROM
Method 1 - an easy way to make the digits black.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
1. Using APKTool, decompile SystemUI.apk
2. Open \smali\com\android\systemui\BatteryMeterView.smali in Notepad++
3. If you don't already have the white %battery enabled, enable it now. Find:
Code:
const-string v7, "status_bar_show_battery_percent"
const/4 v8, 0x0
and change 0x0 to 0x1
4. Now find:
Code:
iget-object v6, p0, Lcom/android/systemui/BatteryMeterView;->mTextPaint:Landroid/graphics/Paint;
const/4 v7, -0x1
and change "const/4 v7, -0x1" to "const/high16 v7, -0x100" (this is changing white (-0x1) to black (-0x100))
(Note: if you get an error regarding this line when recompiling, try "const/16 v7, -0x100" (without the "high". I know, where's the fun in that?))
4b. - Optional: If you'd like to change the font family, or make it bold, etc, you can do it here as well.
Search for:
Code:
const-string v6, "sans-serif-condensed"
const/4 v7, 0x0
"sans-serif-condensed" can be changed to "sans-serif" (or other families), and the result is slightly larger digits. The 0x0 is indicating it's normal style. Change this to 0x1 for Bold.
5. Save the changes and recompile the APK making sure to retain the original signature. Push back to /system/priv-app/ and set with RW/R/R permissions. Voila, now you have black text for your %battery
Method 2 - a few extra steps and a little more involved smali change, but will make it much easier to change the color to whatever you want once it's complete:
1. Using APKTool, decompile SystemUI.apk
2. Open \res\values\colors.xml
3. Under
Code:
<color name="batterymeter_bolt_color">#b2000000</color>
make a new line that reads
Code:
<color name="batterymeter_percent_color">#xxxxxxxx</color>
(where xxxxxxxx is an 8 digit hex color value - first 2 alpha, last 6 color):
4. Recompile the apk with the changes, preserving the signature
5. Decompile the new SystemUI that was just created
6. Open \res\values\public.xml and find:
Code:
<public type="color" name="batterymeter_percent_color" id="0x########" />
and write down/copy/take note of the 10 digit id number (0x########)
7. Open \smali\com\android\systemui\BatteryMeterView.smali in Notepad++
8. If you don't already have the white %battery enabled, enable it now. Find:
Code:
const-string v7, "status_bar_show_battery_percent"
const/4 v8, 0x0
and change 0x0 to 0x1
9. Now find:
Code:
iget-object v6, p0, Lcom/android/systemui/BatteryMeterView;->mTextPaint:Landroid/graphics/Paint;
const/4 v7, -0x1
invoke-virtual {v6, v7}, Landroid/graphics/Paint;->setColor(I)V
and replace it with the following, changing the id (0x########) with the one you previously made a note of:
Code:
iget-object v6, p0, Lcom/android/systemui/BatteryMeterView;->mTextPaint:Landroid/graphics/Paint;
const v7, 0x########
invoke-virtual {v5, v7}, Landroid/content/res/Resources;->getColor(I)I
move-result v7
invoke-virtual {v6, v7}, Landroid/graphics/Paint;->setColor(I)V
9b - Optional: If you'd like to change the font family, or make it bold, etc, you can do it here as well.
Directly under the code you just pasted, you'll see
Code:
const-string v6, "sans-serif-condensed"
const/4 v7, 0x0
"sans-serif-condensed" can be changed to "sans-serif" (or other families), and the result is slightly larger digits. The 0x0 is indicating it's normal style. Change this to 0x1 for Bold.
10. Save the changes and recompile the APK making sure to retain the original signature. Push back to /system/priv-app/ and set with RW/R/R permissions
Now if you want to change the color, just change the HEX value in \res\values\colors.xml and recompile
Building from source?
Method 1 when building from source:
-Open \frameworks\base\packages\SystemUI\src\com\android\systemui\BatteryMeterView.java.
-On line 191 you can turn the %battery on and off
-On line 208 you can set the %color.
Method 2 from source:
-Open \frameworks\base\packages\SystemUI\src\com\android\systemui\BatteryMeterView.java.
-On line 191 you can turn the %battery on and off, and on line 208 change (0xFF000000) to (res.getColor(R.color.batterymeter_percent_color)).
-Now open \frameworks\base\packages\SystemUI\res\values\colors.xml and add a line under "#B2000000" that reads "#XXXXXXXX" (where XXXXXXXX is your hex color value).
Happy Modding! :good:
homeslice976 said:
So as you probably know by now, Android 4.4 came with a hidden feature in SystemUI to enable %battery within the battery icon when it's not charging...
Happy Modding! :good:
Click to expand...
Click to collapse
Great guide :good:
As I'm running 4.4 odexed, I don't have access to the smali when decompiling SystemUI.apk so I went in a different direction and changed the colour of the battery icon (and a lot of other stuff too).
Spannaa said:
Great guide :good:
As I'm running 4.4 odexed, I don't have access to the smali when decompiling SystemUI.apk so I went in a different direction and changed the colour of the battery icon (and a lot of other stuff too).
Click to expand...
Click to collapse
Ah that's a good point. Odexed roms are going to be a little different, as you'll be working with Systemui.odex rather than Systemui.apk. I'll add that to the guide..
homeslice976 said:
So as you probably know by now, Android 4.4 came with a hidden feature in SystemUI to enable %battery within the battery icon when it's not charging. This can be accomplished by an app (credit to @kroegerama), an adb command, or a manual SystemUI smali edit (a quite easy one explained in this walkthrough). The problem is this text is the same color as the battery fill (white), making it useless until the battery is about 50% or less. I played around with the smali for a while and couldn't properly get the text to change colors (smali is certainly not my native tongue...), so I did it the old fashioned way. I changed it in source, built, and compared the results. With that, I'll show you how you can change the text color of the digits when %battery is enabled.
This tutorial will assume you have know how to use APKTool to decompile/recompile APKs while keeping their signatures in tact. There are walkthroughs that will show you how to accomplish this readily available. Method 1 will show you an easy way to change the color to black, and method 2 will show you how you can change things so you can set the text color to whatever you want, without having to figure out the java hex -> smali const equation (though if someone knows it I'm always loving to learn new things). This tutorial is for users on a DEODEXED ROM. If your ROM is odexed, it's the same idea, but you'll need to be working with SystemUI.odex and SystemUIapk, and decompliling/recompiling/pushing the odex file. Or deodex SystemUI before starting. ALWAYS HAVE A BACKUP READILY AVAILABLE IN CASE SOMETHING GOES WRONG!
Things you'll need:
APKTool
Notepad++
SystemUI.apk from your 4.4 ROM
Method 1 - an easy way to make the digits black.
1. Using APKTool, decompile SystemUI.apk
2. Open \smali\com\android\systemui\BatteryMeterView.smali in Notepad++
3. If you don't already have the white %battery enabled, enable it now. Find:
Code:
const-string v7, "status_bar_show_battery_percent"
const/4 v8, 0x0
and change 0x0 to 0x1
4. Now find:
Code:
iget-object v6, p0, Lcom/android/systemui/BatteryMeterView;->mTextPaint:Landroid/graphics/Paint;
const/4 v7, -0x1
and change "const/4 v7, -0x1" to "const/high16 v7, -0x100"
5. Save the changes and recompile the APK making sure to retain the original signature. Push back to /system/priv-app/ and set with RW/R/R permissions. Voila, now you have black text for your %battery
Method 2 - a few extra steps and a little more involved smali change, but will make it much easier to change the color to whatever you want once it's complete:
1. Using APKTool, decompile SystemUI.apk
2. Open \res\values\colors.xml
3. Under "#B2000000", make a new line that reads (where xxxxxxxx is an 8 digit hex color value - first 2 alpha, last 6 color):
Code:
#xxxxxxxx
4. Recompile the apk with the changes, preserving the signature
5. Decompile the new SystemUI that was just created
6. Open \res\values\public.xml and find:
Code:
and write down/copy/take note of the 10 digit id number
7. Open \smali\com\android\systemui\BatteryMeterView.smali in Notepad++
8. If you don't already have the white %battery enabled, enable it now. Find:
Code:
const-string v7, "status_bar_show_battery_percent"
const/4 v8, 0x0
and change 0x0 to 0x1
9. Now find:
Code:
iget-object v6, p0, Lcom/android/systemui/BatteryMeterView;->mTextPaint:Landroid/graphics/Paint;
const/4 v7, -0x1
invoke-virtual {v6, v7}, Landroid/graphics/Paint;->setColor(I)V
and replace it with the following, changing the id (0x########) with the one you previously made a note of:
Code:
iget-object v6, p0, Lcom/android/systemui/BatteryMeterView;->mTextPaint:Landroid/graphics/Paint;
const v7, 0x########
invoke-virtual {v5, v7}, Landroid/content/res/Resources;->getColor(I)I
move-result v7
invoke-virtual {v6, v7}, Landroid/graphics/Paint;->setColor(I)V
10. Save the changes and recompile the APK making sure to retain the original signature. Push back to /system/priv-app/ and set with RW/R/R permissions
Now if you want to change the color, just change the HEX value in \res\values\colors.xml and recompile
Building from source?
Method 1 when building from source:
-Open \frameworks\base\packages\SystemUI\src\com\android\systemui\BatteryMeterView.java.
-On line 191 you can turn the %battery on and off
-On line 208 you can set the %color.
Method 2 from source:
-Open \frameworks\base\packages\SystemUI\src\com\android\systemui\BatteryMeterView.java.
-On line 191 you can turn the %battery on and off, and on line 208 change (0xFF000000) to (res.getColor(R.color.batterymeter_percent_color)).
-Now open \frameworks\base\packages\SystemUI\res\values\colors.xml and add a line under "#B2000000" that reads "#XXXXXXXX" (where XXXXXXXX is your hex color value).
Happy Modding! :good:
Click to expand...
Click to collapse
This is a great tutorial for changing battery text color. In particular, I like your method 2. I can change color with success.
Sorry on offtopic.. Is there any solution to disable double press home button on cm11? Because home button has delay when I press it.. It is some kind of laggy ..
Sent from my One using Tapatalk
I wanna thank you.... Worked like a charm on Nexus 7 2013
Sent from my Nexus 7 using XDA Premium 4 mobile app
vrda08 said:
Sorry on offtopic.. Is there any solution to disable double press home button on cm11? Because home button has delay when I press it.. It is some kind of laggy ..
Sent from my One using Tapatalk
Click to expand...
Click to collapse
Yes. See this ( http://forum.xda-developers.com/showthread.php?p=47660002) post. You'll want to set double tap to 0 for no action
mrjaydee82 said:
I wanna thank you.... Worked like a charm on Nexus 7 2013
Sent from my Nexus 7 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Glad its working!
Sent from my One using Tapatalk 4
homeslice976 said:
Yes. See this ( http://forum.xda-developers.com/showthread.php?p=47660002) post. You'll want to set double tap to 0 for no action
Glad its working!
Sent from my One using Tapatalk 4
Click to expand...
Click to collapse
Anyway to make the writing bigger or bolder Lol?
Sent from my Nexus 7 using XDA Premium 4 mobile app
mrjaydee82 said:
Anyway to make the writing bigger or bolder Lol?
Sent from my Nexus 7 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Sure is. That was my next venture. Should be simple enough though and when I've got it bI'll add to the walkthrough
Sent from my One using Tapatalk 4
homeslice976 said:
Sure is. That was my next venture. Should be simple enough though and when I've got it bI'll add to the walkthrough
Sent from my One using Tapatalk 4
Click to expand...
Click to collapse
Awesome ? can't wait
Sent from my Nexus 7 using XDA Premium 4 mobile app
@homeslice976 I try method 1 & 2 but not sucsess, would you mind to share your SystemUI.apk in method 1? Thanks
Device: Nexus 4
Rom: Stock KRT16S
Also interested on put this baby on my nexus 5 but to stupid to do it myself,any help will be much aprecieted.
mrjaydee82 said:
Anyway to make the writing bigger or bolder Lol?
Sent from my Nexus 7 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Added notes in method 2 for making the digits slightly larger and/or bold..will keep playing to see if I can make them even larger
PigFire said:
@homeslice976 I try method 1 & 2 but not sucsess, would you mind to share your SystemUI.apk in method 1? Thanks
Device: Nexus 4
Rom: Stock KRT16S
Click to expand...
Click to collapse
Cruzfire said:
Also interested on put this baby on my nexus 5 but to stupid to do it myself,any help will be much aprecieted.
Click to expand...
Click to collapse
If you guys can upload your SystemUI I can probably do it for you
homeslice976 said:
If you guys can upload your SystemUI I can probably do it for you
Click to expand...
Click to collapse
Attached, thanks
PigFire said:
Attached, thanks
Click to expand...
Click to collapse
Here ya go. No reason anything should break, but for peace of mind please make a backup first. This is flashable in recovery. It will be black text, but I used method 2, so if you want to change the font color, all you need to do is decompile, open \res\values\colors.xml, change the hex value of <color name="batterymeter_percent_color">#ff000000</color>, and recompile.
i'm also having errors on compiling it..il just upload OMNI systemui instead.. TIA
View attachment SystemUI.apk
homeslice976 said:
Added notes in method 2 for making the digits slightly larger and/or bold..will keep playing to see if I can make them even larger
If you guys can upload your SystemUI I can probably do it for you
Click to expand...
Click to collapse
Thanks man try it later after work
Sent from my HTC One using XDA Premium 4 mobile app
---------- Post added at 09:23 PM ---------- Previous post was at 09:06 PM ----------
I can't compile the 2nd method and want the bold... https://docs.google.com/file/d/0B6ptKjzTSh3SUHJYZWNkeXhMTHM/edit?usp=docslist_api here's my systemui.apk if you could do it...I'd be very greatful..thank you for your awesome work..this is for a nexus 7.2
Sent from my HTC One using XDA Premium 4 mobile app
jefbuan said:
i'm also having errors on compiling it..il just upload OMNI systemui instead.. TIA
View attachment 2406866
Click to expand...
Click to collapse
Here ya go. No reason anything should break, but for peace of mind please make a backup first. This is flashable in recovery. It will be black text, but I used method 2, so if you want to change the font color, all you need to do is decompile, open \res\values\colors.xml, change the hex value of <color name="batterymeter_percent_color">#ff000000</color>, and recompile.
mrjaydee82 said:
Thanks man try it later after work
Sent from my HTC One using XDA Premium 4 mobile app
---------- Post added at 09:23 PM ---------- Previous post was at 09:06 PM ----------
I can't compile the 2nd method and want the bold... https://docs.google.com/file/d/0B6ptKjzTSh3SUHJYZWNkeXhMTHM/edit?usp=docslist_api here's my systemui.apk if you could do it...I'd be very greatful..thank you for your awesome work..this is for a nexus 7.2
Sent from my HTC One using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Here ya go. No reason anything should break, but for peace of mind please make a backup first. This is flashable in recovery. It will be black text, but I used method 2, so if you want to change the font color, all you need to do is decompile, open \res\values\colors.xml, change the hex value of <color name="batterymeter_percent_color">#ff000000</color>, and recompile. I also changed the font from sans-serif-condensed to sans-serif, bold
homeslice976 said:
Here ya go. No reason anything should break, but for peace of mind please make a backup first. This is flashable in recovery. It will be black text, but I used method 2, so if you want to change the font color, all you need to do is decompile, open \res\values\colors.xml, change the hex value of <color name="batterymeter_percent_color">#ff000000</color>, and recompile. I also changed the font from sans-serif-condensed to sans-serif, bold
Click to expand...
Click to collapse
Awesome...ty so much
Sent from my HTC One using XDA Premium 4 mobile app

[MOD][GUIDE]Porting PlatLogo Activity from S5 resources

Hi to all! In this guide I explain how to port the kitkat platlogo activity from S5 resource to S2.
Requirements:
- use apktool, backsmali and smali tool;
- notepad++;
- framework-res.apk;
- framework.jar and framework2.jar;
- patience and brain.
1)First decompile framework-res.apk with apktool and download attach file.
Extract the drawable-nodpi folder from the archive and insert and replace the platlogo.png in the res/drawable-nodpi folder of the framework-res.
Recompile and sign the framework-res.
For sign the framework insert in the build/apk folder the original meta-inf folder and AndroidManifest.xml from the original framework-res.apk.
2)Then, decompile framework.jar with backsmali tool (1.bat)
Extract the smali folder from the archive and insert the file in com/android/internal/app.
After insert the file, open the PlatlogoActivity and search this:
Code:
const v0, [COLOR="Red"]0x10805b8[/COLOR]
Open the public.xml from res/values folder of the framework-res and search:
Code:
type="drawable" name="platlogo"
Now replace the red line with the public id of platlogo image.
At the end recompile the framework.jar with smali tool (2.bat)
3)Decompile framework2.jar with backsmali tool (1.bat)
Go to android/widget/ and open FrameLayout$LayoutParams.smali
Insert this method at the end of the file.
Code:
.method public constructor <init>(Landroid/widget/FrameLayout$LayoutParams;)V
.locals 1
.parameter "source"
.prologue
.line 667
invoke-direct {p0, p1}, Landroid/view/ViewGroup$MarginLayoutParams;-><init>(Landroid/view/ViewGroup$MarginLayoutParams;)V
.line 609
const/4 v0, -0x1
iput v0, p0, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
.line 669
iget v0, p1, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
iput v0, p0, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
.line 670
return-void
.end method
Now recompile with smali tool (2.bat).
Insert the framework-res.apk, framework.jar and framework2.jar in the installer that I attached. Insert in system/framework folder.
That is all
Thanks for this guide and for all the other.
Awesome Guide.
THANKS AND RATED 5*
Thanks for this guide
@gerryS2,
Hey mate, thanks to your guide I finally got what I wanted. But could you please tell me how to replace replace the "J" with a "K".. thanks in advance
Sami Kabir said:
@gerryS2,
Hey mate, thanks to your guide I finally got what I wanted. But could you please tell me how to replace replace the "J" with a "K".. thanks in advance
Click to expand...
Click to collapse
maybe this thread can help you
http://forum.xda-developers.com/showthread.php?t=2580249
thanks
Troubadour666 said:
maybe this thread can help you
http://forum.xda-developers.com/showthread.php?t=2580249
thanks
Click to expand...
Click to collapse
Thanks mate, but I am already aware of that thread. I would have continued with that thread but instead I went with this one because it didn't require any additional app to be installed
I will go through the smali codes once more to find this "J" and replace it with a "K"...
Sami Kabir said:
Thanks mate, but I am already aware of that thread. I would have continued with that thread but instead I went with this one because it didn't require any additional app to be installed
I will go through the smali codes once more to find this "J" and replace it with a "K"...
Click to expand...
Click to collapse
post 2 of the thread :
const-string v0, "K"
Troubadour666 said:
post 2 of the thread :
const-string v0, "K"
Click to expand...
Click to collapse
My PlatLogoActivity.smali doesn't contain any const-string v0, "K".. the closest thing I found is const-string v1, "Android "
in AICP rom, all things are in framework2.jar .
gerryS2 said:
Hi to all! In this guide I explain how to port the kitkat platlogo activity from S5 resource to S2.
Requirements:
- use apktool, backsmali and smali tool;
- notepad++;
- framework-res.apk;
- framework.jar and framework2.jar;
- patience and brain.
1)First decompile framework-res.apk with apktool and download attach file.
Extract the drawable-nodpi folder from the archive and insert and replace the platlogo.png in the res/drawable-nodpi folder of the framework-res.
Recompile and sign the framework-res.
For sign the framework insert in the build/apk folder the original meta-inf folder and AndroidManifest.xml from the original framework-res.apk.
2)Then, decompile framework.jar with backsmali tool (1.bat)
Extract the smali folder from the archive and insert the file in com/android/internal/app.
After insert the file, open the PlatlogoActivity and search this:
Code:
const v0, [COLOR="Red"]0x10805b8[/COLOR]
Open the public.xml from res/values folder of the framework-res and search:
Code:
type="drawable" name="platlogo"
Now replace the red line with the public id of platlogo image.
At the end recompile the framework.jar with smali tool (2.bat)
3)Decompile framework2.jar with backsmali tool (1.bat)
Go to android/widget/ and open FrameLayout$LayoutParams.smali
Insert this method at the end of the file.
Code:
.method public constructor <init>(Landroid/widget/FrameLayout$LayoutParams;)V
.locals 1
.parameter "source"
.prologue
.line 667
invoke-direct {p0, p1}, Landroid/view/ViewGroup$MarginLayoutParams;-><init>(Landroid/view/ViewGroup$MarginLayoutParams;)V
.line 609
const/4 v0, -0x1
iput v0, p0, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
.line 669
iget v0, p1, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
iput v0, p0, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
.line 670
return-void
.end method
Now recompile with smali tool (2.bat).
Insert the framework-res.apk, framework.jar and framework2.jar in the installer that I attached. Insert in system/framework folder.
That is all
Click to expand...
Click to collapse
will it work on galaxy s advance with stock 4.1.2
psycho_boy52 said:
will it work on galaxy s advance with stock 4.1.2
Click to expand...
Click to collapse
Yes it will. I did it
gerryS2 said:
Hi to all! In this guide I explain how to port the kitkat platlogo activity from S5 resource to S2.
Requirements:
- use apktool, backsmali and smali tool;
- notepad++;
- framework-res.apk;
- framework.jar and framework2.jar;
- patience and brain.
1)First decompile framework-res.apk with apktool and download attach file.
Extract the drawable-nodpi folder from the archive and insert and replace the platlogo.png in the res/drawable-nodpi folder of the framework-res.
Recompile and sign the framework-res.
For sign the framework insert in the build/apk folder the original meta-inf folder and AndroidManifest.xml from the original framework-res.apk.
2)Then, decompile framework.jar with backsmali tool (1.bat)
Extract the smali folder from the archive and insert the file in com/android/internal/app.
After insert the file, open the PlatlogoActivity and search this:
Code:
const v0, [COLOR="Red"]0x10805b8[/COLOR]
Open the public.xml from res/values folder of the framework-res and search:
Code:
type="drawable" name="platlogo"
Now replace the red line with the public id of platlogo image.
At the end recompile the framework.jar with smali tool (2.bat)
3)Decompile framework2.jar with backsmali tool (1.bat)
Go to android/widget/ and open FrameLayout$LayoutParams.smali
Insert this method at the end of the file.
Code:
.method public constructor <init>(Landroid/widget/FrameLayout$LayoutParams;)V
.locals 1
.parameter "source"
.prologue
.line 667
invoke-direct {p0, p1}, Landroid/view/ViewGroup$MarginLayoutParams;-><init>(Landroid/view/ViewGroup$MarginLayoutParams;)V
.line 609
const/4 v0, -0x1
iput v0, p0, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
.line 669
iget v0, p1, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
iput v0, p0, Landroid/widget/FrameLayout$LayoutParams;->gravity:I
.line 670
return-void
.end method
Now recompile with smali tool (2.bat).
Insert the framework-res.apk, framework.jar and framework2.jar in the installer that I attached. Insert in system/framework folder.
That is all
Click to expand...
Click to collapse
Sami Kabir said:
Yes it will. I did it
Click to expand...
Click to collapse
bro can u plz upload those framework.jar n freamework2.jar cz those baksmali n smali tool r not workin on my pc....
psycho_boy52 said:
bro can u plz upload those framework.jar n framework2.jar cz those baksmali n smali tool r not workin on my pc....
Click to expand...
Click to collapse
Okay. But it might contain some other mods because they are from my ROM.. The zip is not flashable, extract it and place the files to their respective location.
Link: https://www.mediafire.com/?q5e9jnfvuapu73j
PS: I have a feeling that this might not work for you, if it doesn't then please tell me asap
Sami Kabir said:
Okay. But it might contain some other mods because they are from my ROM.. The zip is not flashable, extract it and place the files to their respective location.
Link: https://www.mediafire.com/?q5e9jnfvuapu73j
PS: I have a feeling that this might not work for you, if it doesn't then please tell me asap
Click to expand...
Click to collapse
thnx bro lets try!!!... btw dont u use stock jb on ur i9070???
psycho_boy52 said:
thnx bro lets try!!!... btw dont u use stock jb on ur i9070???
Click to expand...
Click to collapse
I use my ROM. Which is based on stock firmware
Sami Kabir said:
Okay. But it might contain some other mods because they are from my ROM.. The zip is not flashable, extract it and place the files to their respective location.
Link: https://www.mediafire.com/?q5e9jnfvuapu73j
PS: I have a feeling that this might not work for you, if it doesn't then please tell me asap
Click to expand...
Click to collapse
wow!!!.... its working bt cnt we write jb instade of j
psycho_boy52 said:
wow!!!.... its working bt cnt we write jb instade of j
Click to expand...
Click to collapse
You should ask that to the creator of this thread, not me (because even I don't know how to change this letter to some other letter)
Sami Kabir said:
You should ask that to the creator of this thread, not me (because even I don't know how to change this letter to some other letter)
Click to expand...
Click to collapse
anyways !!! thnx a lot bro for helping me
bt buddy dere is a problm wid dis mod... its not cumming lyk d 2nd scrnsht.... how to fix it

[HOWTO] Enable 2G/3G Toggle from Statusbar/Launcher

* ARTICLES MADE IN MACHINE LG G3 ANDROID 4.4.2 MACHINE DO THE SAME AND FLEXIBLE THINKING.
Preparation:
computers
Preset apktool
You must know how to use apktool okay.
File LGPhone.apk and LGSystemUI.apk was taken in Rom deodex you want Mod okay.
Begin.
A. Working with files this most important LGPhone.apk okay.
1. Decompile LGPhone.apk out
2. Navigate to the path LGPhone / smali / com / android / phone
Find PhoneGlobals.smali open in Notepad + +
> Find the following keywords.
Code:
.field private final mMediaButtonReceiver:Landroid/content/BroadcastReceiver;
> Add the following line immediately below it.
Code:
.field private final mModeReceiver:Landroid/content/BroadcastReceiver;
> Find Next line after.
Code:
mReceiver:Landroid/content/BroadcastReceiver;
> Add the following line immediately below it.
Code:
.line 236
new-instance v0, Lcom/android/phone/NetworkModeReceiver;
invoke-direct {v0}, Lcom/android/phone/NetworkModeReceiver;-><init>()V
iput-object v0, p0, Lcom/android/phone/PhoneGlobals;->mModeReceiver:Landroid/content/BroadcastReceiver;
> Find next keyword.
Code:
registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
> Add the following line immediately below it.
Code:
.line 633
new-instance v0, Landroid/content/IntentFilter;
const-string v1, "com.android.phone.CHANGE_NETWORK_MODE"
invoke-direct {v0, v1}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
iget-object v1, p0, Lcom/android/phone/PhoneGlobals;->mModeReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {p0, v1, v0}, Lcom/android/phone/PhoneGlobals;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
> Save PhoneGlobals.smali
3. NetworkModeReceiver Download this file to extract and copy all the files in the path LGPhone smali / smali / com / android / phone
4. Recompile the LGPhone.
5. Fixing what replaces it back old LGPhone.apk file.
-------- 2G/3G toggle mod Guide --------- Choimobile
B. How on LGSystemUI.apk
1. Decompile LGSystemUI.apk out
2. Navigate to the path LGSystemUI/smali/com/lge/quicksettings/
> Open QuicksettingsItemList.smali using Notepad + +
> Find and fix all the 2GOnlyHandler EcoHandler
> Save QuicksettingsItemList.smali back
3. Find LGsystemUI/res/values-xx/
> Open strings.xml by Notepad + +
> Sp_quicksettings_eco_mode_NORMAL edit> Eco mode <a> The 2G <
> Save the strings.xml
4. Find LGSystemUI/res/values
> Open bools.xml using Notepad + +
> Find eco edit keywords >false< >true< save.
5. Download the file, unzip
> Copy smali in LGSystemUI/smali/com/lge/quicksettings/handlers
> Copy image to LGSystemUI/res/drawable-xxhdpi
6. Recompile the LGSystemUI
Replace the following items in LGSystemUI/build/apk file into the root LGSystemUI.apk
- 2 image file in res/drawable-xxhdpi on LGSystemUI.apk/res/drawable-xxhdpi
- Resources.arsc on LGSystemUI.apk
- Classes.dex into LGSystemUI.apk
C. Copy LGPhone.apk and LGSystemUI.apk have to edit the system/app and set 644 memory and delete files LGPhone.odex LGSystemUI.odex go. Reboot the machine and see the results.
Note: The tutorial is done on LG G3 Android 4.4.2 on another machine thinking you have flexibility with each release and each code.
Mod Guide Choimobile 2G/3G toggle.
-Thank: chuc by choimobile.vn/forums
- source: http://choimobile.vn/threads/huong-dan-mod-toggle-2g-3g-2g-only-len-cac-may-android-lg.27391/
Great guide
Thanks
Seems not the same lines can be found on KK.
Also, LGPhone.apk is LGTeleService.apk on my ROM.
Also the lines on smali files are not totally the same.
Thanks for the guide though.
Hi, I know this is an old thread, but I was wondering if you would do "how to enable flashlight toggle"
I have a LG Gpro 240K running one of your lollipop roms. I would REALLY appreciate it.
:good::good::good::good::good:
hi please fix network toggle for lgsystemui and lgteleservice
hi please help
i can't do this changes to my rom
here is files you need
LGTeleService.apk
View attachment LGTeleService.apk
the network toggle is here but don't work ( it can't change network )
i spend a lot of time , i hope some one can fix it
actually can't understand what should i do with lgteleservice.apk ( how to add toggles to this apk?) how to add this codes to lgteleservice?
sorry for my bad english
hi please help
i can't do this changes to my rom
here is files you need
LGTeleService.apk
View attachment 4269150
the network toggle is here but don't work ( it can't change network )
i spend a lot of time , i hope some one can fix it
actually can't understand what should i do with lgteleservice.apk ( how to add toggles to this apk?) how to add this codes to lgteleservice?
sorry for my bad english
EAGLEBOOY said:
hi please help
i can't do this changes to my rom
here is files you need
LGTeleService.apk
View attachment 4269150
the network toggle is here but don't work ( it can't change network )
i spend a lot of time , i hope some one can fix it
actually can't understand what should i do with lgteleservice.apk ( how to add toggles to this apk?) how to add this codes to lgteleservice?
sorry for my bad english
Click to expand...
Click to collapse
hi i fixed it
you should change this line in build.prop
ro.build.user=cloudyfa
to
ro.build.user=matrix_neo
+++++++++++++++++++++++++++++++
this is because
in SystemUI\smali\com\lge\systemui
a file with this name "ModelFeature.smali" in lines 527 and 541
const-string v0, "matrix_neo"
const-string v0, "matrix_neo"
should same as line in build.prop
ro.build.user=*********

Categories

Resources