Howdy folks -
After numerous folks asked about having icons that showed the actual connection type on T-Mobile stock roms (here in particular) I decided to take a crack at figuring something out for my little concoction of a rom called Tweaked. While what is in Tweaked has a small difference from what I discuss here, the underlying changes are largely the same. What follows is a hopefully adequate guide for what I ended up doing - one that will hopefully allow others wanting to tinker on their own as opposed to use the tinkerings of others.
That being said, the original request was for 2 flashables - so I will post those here. In an attempt to make things as "painless" as possible (with pain being defined as "messes up my theme images"), the zips posted are vrtheme-style and will not change and images or xmls - just flash in recovery
[size=+1]Jedi Master 13[/size] STANDARD
Download md5 C7D3CD3550938F930AE343E591112F15
[size=+1]Jedi Master 13[/size] AOSP THEME BY FOREVERLOCO
Download md5 1E1CE78803D58BBECB7937174428AE7F
If you are more interested in taking a crack at doing the mod yourself - read on
Also - I should put out the disclaimer that I haven't tested these... so tread cautiously and make a backup before flashing!
Let me know if there are any issues.
[size=+1]How to do my particular twist on the data icon mod[/size]
Alright, first off this is NOT the only way to do things - it just happens to be the way I did it. This does not make it better/worse than other approaches - do what works for you. For example, if you are comfortable using apktool or one of the front-end ui interfaces for apktool like apkmultitool or the like - great, you will be fine (just decompile and recompile the entirety of SystemUI.apk).
That being said - if you are following this a bit closer to what I've laid out you will need a few things up front for this guide to be of any use. Again - there are several ways/methods/tools that can be used to go about this process - what follows is just what I tend to use.
Ok, so this guide uses/requires the following:
Ability to use baksmali/smali
WHAT I USE:
- I have to use a Windows environment for work, so for better or worse I tend to stay there. To emulate the land o' linux, I use CygWin - there are better methods/tools I am sure, but this is the one I use based on previous non-android exposure to it.
- I also use the baksmali-1.4.2.jar and smali-1.4.2.jar (off-topic: looks like some nice changes in store for the 2.0 beta ) from here.
NOTE: To use the jars above you need to have java installed, though I believe you can use the "standard" java that is often already on a machine.
Ability to extract/replace files within an apk
WHAT I USE:
- Really this is just a fancy way of saying you need some sort of archiving utility to extract/replace the classes.dex you will pull from SystemUI.apk. I tend to use JZip or 7zip myself.
Ability to view/edit text files
WHAT I USE:
- Notepad++ is awesome. That is all.
Ok - now for the fun stuff
First you will need the SystemUI.apk (located in /system/app) for whatever UVBMB4-base rom you are using. Once you have that - open up the apk and pull out the classes.dex. To avoid any sorts of path issues, make a directory wherever and drop the classes.dex and the two .jars (baksmali and smali) into it. Now fire up CygWin and cd yourself to the directory where all that now resides.
{
"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"
}
Once there, do this:
Code:
java -jar baksmali-1.4.2.jar -a 16 -o /Path/to/the/directory/outSysUI/ classes.dex
This is basically saying "use this baksmali jar file and decompile this android 4.1.x classes.dex file and dump the output/decompiled stuff into the /Path/to/the/directory/outSysUI/ directory." You will of course need to edit things depending on where that directory (the one w/ classes.dex and the 2 jars) is.
There should now be a folder called outSysUI in the directory - go to it and then go to /com/android/systemui/statusbar/policy and open NetworkController.smali.
Ok, before getting into the code part of what I did, I thought I would offer a little background that explains my thinking behind getting this working.
In the NetworkController.smali I noticed there were a bunch of update...DataNetType()V methods, so I traced their calls back to a method called getUpdateDataNetType()V. It was there I saw that the method basically tests what network you are on, and based on that it calls a method that then uses/calls the appropriate icons to display. Given that, I looked around for an update...DataNetType()V sort of method that used the H (referenced as DATA_H here) icons, and while there were a few the method I really landed on was the updateDataNetType()V method. This appeared to be a general sort of call when no other carrier was detected (felt "AOSP"-ish), and more importantly it had the H icon references in it. I then looked at the TMobile one (updateTMoDataNetType()V) to see how it was structured, and noticed it was a wee bit simplified as far as some of the checks that were done compared to the more general method I was looking at - I also paid particular attention to the bits that call up the LTE relevant icons in the TMo-based method.
I decided to copy the general method to use as a base, and then trimmed out some of the unneeded calls based on their absense from the TMo-based method. I then edited/worked in the LTE icon calls (changing a DATA_ call and some resource ids at the appropriate pswitch location) from the TMo method to make a new method. That last part was a little tricky, but I just compared the pswtich calls at the end of both methods to figure out where the LTE call was in the TMo method and where it should go in the new method.
If interested in taking a crack at crafting it on your own - have at it! Make sure to pay special attention to how the TMo method calls the lte icons (there are some resource id calls that need to be transferred over You can always use the below for reference as well!
Below is the method I cobbled together. Paste it in it's entirety right above this line:
Code:
.method private final updateTMODataNetType()V
New method:
Code:
.method private final updateAccTMODataNetType()V
.registers 8
.prologue
const v6, 0x7f0200a3
const v5, 0x7f020096
const/4 v4, 0x0
const v3, 0x7f0a0069
const v2, 0x7f020097
.line 1423
iget v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataNetType:I
packed-switch v0, :pswitch_data_12c
:goto_12
return-void
.line 1528
:pswitch_13
sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_G:[[I
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 1530
const v0, 0x7f0200a0
iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
.line 1531
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContext:Landroid/content/Context;
const v1, 0x7f0a0068
invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContentDescriptionDataType:Ljava/lang/String;
goto :goto_12
.line 1434
:pswitch_2c
sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_G:[[I
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 1436
iput v4, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
.line 1437
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContext:Landroid/content/Context;
const v1, 0x7f0a0068
invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContentDescriptionDataType:Ljava/lang/String;
goto :goto_12
.line 1444
:pswitch_42
sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_E:[[I
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 1446
const v0, 0x7f02009f
iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
.line 1447
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContext:Landroid/content/Context;
const v1, 0x7f0a006d
invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContentDescriptionDataType:Ljava/lang/String;
goto :goto_12
.line 1454
:pswitch_5b
sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_3G:[[I
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 1455
iput v2, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
.line 1456
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContext:Landroid/content/Context;
invoke-virtual {v0, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContentDescriptionDataType:Ljava/lang/String;
goto/16 :goto_12
.line 1462
:pswitch_6f
iget-boolean v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mHspaDataDistinguishable:Z
if-eqz v0, :cond_8d
.line 1463
sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_H:[[I
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 1464
const v0, 0x7f0200a1
iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
.line 1465
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContext:Landroid/content/Context;
const v1, 0x7f0a006a
invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContentDescriptionDataType:Ljava/lang/String;
goto/16 :goto_12
.line 1468
:cond_8d
sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_3G:[[I
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 1469
iput v2, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
.line 1470
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContext:Landroid/content/Context;
invoke-virtual {v0, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContentDescriptionDataType:Ljava/lang/String;
goto/16 :goto_12
.line 1477
:pswitch_a1
iget-boolean v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mHspaDataDistinguishable:Z
if-eqz v0, :cond_bf
.line 1478
sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_H_PLUS:[[I
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 1479
const v0, 0x7f0200a2
iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
.line 1480
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContext:Landroid/content/Context;
const v1, 0x7f0a006a
invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContentDescriptionDataType:Ljava/lang/String;
goto/16 :goto_12
.line 1483
:cond_bf
sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_3G:[[I
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 1484
iput v2, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
.line 1485
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContext:Landroid/content/Context;
invoke-virtual {v0, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContentDescriptionDataType:Ljava/lang/String;
goto/16 :goto_12
.line 1493
:pswitch_d3
sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_1X:[[I
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 1495
iput v5, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
.line 1496
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContext:Landroid/content/Context;
const v1, 0x7f0a006c
invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContentDescriptionDataType:Ljava/lang/String;
goto/16 :goto_12
.line 1503
:pswitch_ea
sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_1X:[[I
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 1505
iput v5, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
.line 1506
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContext:Landroid/content/Context;
const v1, 0x7f0a006c
invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContentDescriptionDataType:Ljava/lang/String;
goto/16 :goto_12
.line 1516
:pswitch_101
sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_3G:[[I
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 1517
iput v2, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
.line 1518
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContext:Landroid/content/Context;
invoke-virtual {v0, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContentDescriptionDataType:Ljava/lang/String;
goto/16 :goto_12
.line 1522
:pswitch_115
sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_LTE:[[I
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 1523
iput v6, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
.line 1524
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContext:Landroid/content/Context;
const v1, 0x7f0a00b6
invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mContentDescriptionDataType:Ljava/lang/String;
goto/16 :goto_12
.line 1432
:pswitch_data_12c
.packed-switch 0x0
:pswitch_2c
:pswitch_13
:pswitch_42
:pswitch_5b
:pswitch_d3
:pswitch_101
:pswitch_101
:pswitch_ea
:pswitch_6f
:pswitch_6f
:pswitch_6f
:pswitch_13
:pswitch_101
:pswitch_115
:pswitch_101
:pswitch_a1
.end packed-switch
.end method
The last little bit of code editing is to replace the call to the original TMo data icon method with the new one. This call can be found in
Code:
.method private getUpdateDataNetType()V
Just search for
Code:
updateTMODataNetType()V
and replace that call with
Code:
updateAccTMODataNetType()V
(or whatever you end up calling it).
So for a more exact visual:
Instead of
Code:
invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/NetworkController;->updateTMODataNetType()V
it now says
Code:
invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/NetworkController;->updateAccTMODataNetType()V
Now save the NetworkController.smali and return to CygWin. Type the following:
Code:
java -Xmx1024M -jar smali-1.4.2.jar -a 16 outSysUI/ -o classes.dex
This is basically saying "using up to this much memory (1024M), use the smali-1.4.2.jar file to compile the contents of the outSysUI/ directory into a 4.1.x classes.dex file."
You then take that newly compiled classes.dex and drop it back into SystemUI.apk. Then you can push/flash the apk and blammo you are all set
Hope this helps folks
I know I say it often, but there are so many ways to go about this - what I showed was just one way (and it could be convoluted for all I know lol). Also - don't take anything I say as "concrete must-be-true" facts - I am often wrong and if so feel free to (constructively) point it out This is all about learning after all, right?
You the man bro!! Thanks so much for sharing your knowledge.
Sent from my SGH-T889 using Xparent Skyblue Tapatalk 2
thank you so much for sharing :good:
Awesome, appreciate your work!
Sent from my SGH-T889 using Tapatalk 4 Beta
As I don't like making edits directly to the various system APKs, here's a version using Xposed.
NOTE: This does NOTHING if you don't have the framework installed. http://forum.xda-developers.com/showthread.php?t=1574401
Install the framework, following the directions in that thread. Once you have that working, install this module. It should give you a notification that the module isn't enabled. Select it, then enable the module and reboot. It seems to be working fine here, but I don't have LTE so there might be issues with that. I do get H, H+, and 3G so far. The code is basically what is in the OP, modified for reflection as required. I'll push the source to my github in a bit. Thanks go to dwitherell, this module is just a port.
This is currently only tested on MB4. It should work on most any TMO ROM. It only overrides the Tmobile specific method, so international ROMs, other carrier ROMs, AOSP, are probably not going to work. Most of those seem to have the "correct" icons anyway. TMobile just likes to call everything faster than Edge "4G". I doubt it will cause any problems in those cases, it will probably just fail to load, not finding the method to override.
If there end up being a lot of questions etc, I'll make a new thread so we don't hijack this one. There's not much to it, so I don't expect much for issues. Please don't post questions about this module to the framework thread I linked above.
ttabbal said:
As I don't like making edits directly to the various system APKs, here's a version using Xposed...
Click to expand...
Click to collapse
Nice job! If for nothing else than to learn something new I should really look into doing little things like this (with "this" referring to what is in the OP) using xposed... It would take some learning though... I feel like I've stumbled upon how-tos on the topic, but @ttabbal if there are particulars you found useful and feel like sharing (with "sharing" being more accurately defined as "supporting my laziness about doing a search at the moment")... feel free to PM me
dwitherell said:
Nice job! If for nothing else than to learn something new I should really look into doing little things like this (with "this" referring to what is in the OP) using xposed... It would take some learning though... I feel like I've stumbled upon how-tos on the topic, but @ttabbal if there are particulars you found useful and feel like sharing (with "sharing" being more accurately defined as "supporting my laziness about doing a search at the moment")... feel free to PM me
Click to expand...
Click to collapse
I totally get being lazy. The code is in my repo now. It's much like the code you posted, the big difference is that you don't have access to the actual member variables and such directly. So you have to access them via Reflection. Using tools like VTS to decompile the classes to java style code helps a lot. Then you just adjust it a little to make reflection calls rather than direct like you do with smali. The biggest thing I like about this stuff over smali edits is that you can add/remove whatever you like as a user without affecting anything else, as mods tend to be self-contained.
https://github.com/travistabbal/XposedMods/tree/master/DataIconsFix
Hope it helps, comparing what I have to what you did should make it pretty clear. For Xposed itself, they provide some nice tutorials for the basic setup to build a module. It's not that much really, just a couple properties in the manifest and a text file in /res.
Ahhhh.... So it was in systemui and not framework-res! Network control Smali huh? I remember that one when I was doing those throttle hacks and from some themeing. It makes sense now. Thanks for the how to! And thanks for mentioning Tweaked ROM. It is so awesome with all the visual options. Tsm parts reminds me of CM6 with all the ui options before the simpler systemui theme apks. Love having the option to change slight things here and there. Feeds my ocd very nicely lol! I ended up pairing it with saber kernel from ptmr (for CPU/GPU OCing UVing, voodoo sound, and Trickster Mod support), for ever loco's AOSP theme (with a few of my own modded/added images for total awesomeness), and a few of my standard system works, init.d scripts, build.prop edits. I don't think I'll ever switch ROMs again until we at least get a stable, solid 4.2.2 ROM I bet international with get one shortly after the Note 3 is released. This baby with keep me happy until then... thanks again for pointing me in the right direction and showing your work on the icon mod! I know you added it on 2.1 but it's nice to know how you got there
---------- Post added at 11:29 PM ---------- Previous post was at 11:22 PM ----------
ttabbal said:
I totally get being lazy. The code is in my repo now. It's much like the code you posted, the big difference is that you don't have access to the actual member variables and such directly. So you have to access them via Reflection. Using tools like VTS to decompile the classes to java style code helps a lot. Then you just adjust it a little to make reflection calls rather than direct like you do with smali. The biggest thing I like about this stuff over smali edits is that you can add/remove whatever you like as a user without affecting anything else, as mods tend to be self-contained.
https://github.com/travistabbal/XposedMods/tree/master/DataIconsFix
Hope it helps, comparing what I have to what you did should make it pretty clear. For Xposed itself, they provide some nice tutorials for the basic setup to build a module. It's not that much really, just a couple properties in the manifest and a text file in /res.
Click to expand...
Click to collapse
Wow! That sounds very useful! Might try it for any future edits. And yeah, xposed modules are too difficult from what I've read also. I just haven't had any good ideas on what to make atm... Might make one soon for the hell of it. I just don't have the time I used to, unfortunately.
I can confirm that the xposed module I posted works properly with LTE.
As it's really just a port of the code dwitherell posted, I don't see any reason his wouldn't.
ttabbal said:
I can confirm that the xposed module I posted works properly with LTE.
As it's really just a port of the code dwitherell posted, I don't see any reason his wouldn't.
Click to expand...
Click to collapse
Yep, I don't think it's official yet but LTE testing has been going on in my area - all good on my end as well Thanks for the xposed feedback!
Related
{
"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"
}
****** For ICS 4.0.4, the code has changed a bit. Instead of changing the original tutorial, I'm providing a known working patch I did for an i9100 XWLPT build ******
(there's also a 2nd patch below to ignore regular swipe actions while using AOSP lockscreen)
https://github.com/shoman94/SHOstock2-XWLPT/commit/523075aac1730883a14e365e29c58eb8cce03248
https://github.com/shoman94/SHOstock2-XWLPT/commit/a55fb9b42a5f3f0c0c840c72e68372ab6a199cc2
This tutorial will be a bit involved, you've been warned! It was more of a learning experience, so here are the things you will see:
1. Add toggle settings via xml
2. Add global settings that are retained
3. Add code support for your toggles
4. Have your toggles be smart, and enable/disable other related toggles
5. Add a debug message using Slog, this is invaluable for any project!
Based on 4.0.3 LP3 base..Adjust resource IDs (bolded) for your base!!
--------------------------------------------------------------------------
Step 1. Adding the toggles to Settings/Date & Time (the easy part)
Decompile Settings.apk, modify the following:
public.xml, add:
Code:
<public type="string" name="disable_ampm" id="[b]0x7f0b0923[/b]" />
<public type="string" name="disable_ampm_text" id="[b]0x7f0b0924[/b]" />
<public type="string" name="disable_time" id="[b]0x7f0b0925[/b]" />
<public type="string" name="disable_time_text" id="[b]0x7f0b0926[/b]" />
strings.xml, add:
Code:
<string name="disable_time">Hide Time</string>
<string name="disable_time_text">Remove time from status bar</string>
<string name="disable_ampm">Hide AM/PM</string>
<string name="disable_ampm_text">Remove AM/PM from time in status bar</string>
xml/date_time_prefs.xml, add:
Code:
<CheckBoxPreference android:title="@string/disable_time" android:key="hide_time" android:summary="@string/disable_time_text" />
<CheckBoxPreference android:title="@string/disable_ampm" android:key="hide_ampm" android:summary="@string/disable_ampm_text" />
Compile settings.apk, u/l and reboot. Make sure the toggles are added!
Step 2. Adding code for the settings (the not so easy part). This code gets a bit involved since we have to handle the new settings, and also add 'toggle logic' for different combinations to enable/disable them.
Still in settings.apk, DateTimeSettings.smali:
At top, add:
Code:
.field private mHideTime:Landroid/preference/Preference;
.field private mHideAmPm:Landroid/preference/Preference;
Then in the '.method private initUI()V', find 'return-void' and add this code above it:
Code:
const-string v6, "hide_time"
invoke-virtual {p0, v6}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v6
check-cast v6, Landroid/preference/Preference;
iput-object v6, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
const-string v6, "hide_ampm"
invoke-virtual {p0, v6}, Lcom/android/settings/DateTimeSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v6
check-cast v6, Landroid/preference/Preference;
iput-object v6, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
if-eqz v0, :no_disablebtns
const/4 v0, 0x0
iget-object v6, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v6, v0}, Landroid/preference/Preference;->setEnabled(Z)V
iget-object v6, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
invoke-virtual {v6, v0}, Landroid/preference/Preference;->setEnabled(Z)V
:no_disablebtns
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
if-eqz v0, :no_disableampm
const/4 v0, 0x0
iget-object v6, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v6, v0}, Landroid/preference/Preference;->setEnabled(Z)V
:no_disableampm
Now search for '.method public onPreferenceTreeClick' and on the line below, change .locals 2 to:
Code:
.locals 6
Now search for:
:cond_2
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
if-ne p2, v0, :cond_0
change the last line to:
Code:
if-ne p2, v0, :cond_new
About 10 lines below that, you will see 'invoke-direct {p0, v0}, Lcom/android/settings/DateTimeSettings;->set24Hour(Z)V', add this below that line:
Code:
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
if-nez v0, :cond_hideampm
const/4 v0, 0x1
goto :set_ampm
:cond_hideampm
const/4 v0, 0x0
:set_ampm
invoke-virtual {v1, v0}, Landroid/preference/Preference;->setEnabled(Z)V
:cond_updatetime
Then search for 'goto :goto_0' about 10 lines below and add this before '.end method':
Code:
:cond_new
const-string v3, "hide_ampm"
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
if-ne p2, v0, :cond_new2
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v2
:save_ampm
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "hide_ampm"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :cond_updatetime
:cond_new2
const-string v3, "hide_time"
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
if-ne p2, v0, :goto_0
iget-object v0, p0, Lcom/android/settings/DateTimeSettings;->mHideTime:Landroid/preference/Preference;
check-cast v0, Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v2
:save_time
invoke-virtual {p0}, Lcom/android/settings/DateTimeSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "hide_time"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
if-nez v2, :cond_hidebtns
const/4 v2, 0x1
goto :cond_setbtns
:cond_hidebtns
const/4 v2, 0x0
:cond_setbtns
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mHideAmPm:Landroid/preference/Preference;
invoke-virtual {v1, v2}, Landroid/preference/Preference;->setEnabled(Z)V
iget-object v1, p0, Lcom/android/settings/DateTimeSettings;->mTime24Pref:Landroid/preference/Preference;
invoke-virtual {v1, v2}, Landroid/preference/Preference;->setEnabled(Z)V
goto :cond_updatetime
And that's it for Settings! Recompile and upload and check everything looks right in Settings/Date and Time and the toggles work.
Step 3. Modifying the clock code to handle new changes (kinda easy =)
Decompile SystemUI and open Clock.smali.
Search for the following in func getSmallTime:
.local v3, context:Landroid/content/Context;
invoke-static {v3}, Landroid/text/format/DateFormat;->is24HourFormat(Landroid/content/ContextZ
Then add this code BEFORE the invoke-static .. line above (NOTE: there's a constant below that refers to the clock resource in public.xml [<public type="id" name="clock" id="0x7f0e0027" />], be sure it matches!):
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, [b]0x7f0e0027[/b]
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
About 20 lines below that, you will see:
.local v1, MAGIC2:C
invoke-virtual {v3, v5}, Landroid/content/Context;->getString(I)Ljava/lang/String;
move-result-object v4
Add this directly after:
Code:
if-nez v2, :cond_continue
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "hide_ampm"
const/4 v0, 0x0
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v7
########### Start of debug msg, can be removed #######
const-string v0, "ampm"
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "getint returned="
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I
########### End of debug msg ###########
move v2, v7
if-eqz v2, :cond_continue
const-string v4, "h:mm"
:cond_continue
That's it for Clock.smali.
Step 4. Almost there, now we just have to make one more change to SystemUI in PhoneStatusBar.smali.
Find '.method public showClock' and change .locals 2 to:
Code:
.locals 3
Find:
if-eqz p1, :cond_1
const/4 v0, 0x0
and insert this code after it:
Code:
iget-object v2, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "hide_time"
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eqz v2, :goto_0
const/16 v0, 0x8
Recompile SystemUI and reboot. Now try out the new feature =)
Excellent.... built into my rom. Thanks !
...or just use 24h format which is shorter and more natural
sorg said:
...or just use 24h format which is shorter and more natural
Click to expand...
Click to collapse
Ummm You can use this to remove the clock completely....
I just updated to OP to include Step 4. I didn't realize the lock screen was interfering with the feature since I don't use one..Fixed now.
Building into mine as well, tonight if I don't fall asleep.
And a few moments of disagreeing with smali, got it going...thanks a bunch Jeboo!
nice, welldone!
but it s better to leave public.xml, add only the others xml and recompile once.
then decompile again to get the public xml
it s safer, and then match the smali changes with the new public values.
Anyway great guide
if your decompiling with smali/baksmali directly make sure to use the -l flag (thats a L) so you have local varibles instead of registers, learned this the hard way lol
This mod is amazing, thank you very much my friend works fabulously
Add a toggle for CRT Animation
Building upon the same theme from the OP, we can now add another toggle under display settings for CRT animation. This feature is controlled by the boolean animateScreenLights in framework-res.apk (thanks to whomever the original author was!).
Since adding the setting is pretty much identical to the procedure in the OP, I will just discuss the relevant code needed to access the new setting (I leave adding the setting up to you!). The only requirement is you name your setting 'crt_animation'.
Our patch point will be inside services.jar, specifically PowerManagerService$BrightnessState.smali (this is based on LP7):
Code:
iget-object v6, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
iget-boolean v6, v6, Lcom/android/server/PowerManagerService;->mAnimateScreenLights:Z
if-nez v6, :cond_19
NOTE: cond_19 may differ depending on your decompiler.
So we need to delete the 3 lines above. In its place, add our new code:
Code:
iget-object v0, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
invoke-static {v0}, Lcom/android/server/PowerManagerService;->access$4300(Lcom/android/server/PowerManagerService;)Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "crt_animation"
const/4 v4, 0x0
invoke-static {v0, v1, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v6
if-eqz v6, :cond_19
NOTE: Again, if cond_19 is different, fix the last line above!
Recompile settings.apk & services.jar, u/l and reboot!
Porting this mod to the skyrocket
Hey jeboo, as i told you I am trying to port this over to my rom but need some guidance in clock.smali and PhoneStatusBar.smali Thanks I appreciate the help I am attaching the smali files...
adding toggle CRT animation settings
jeboo said:
Building upon the same theme from the OP, we can now add another toggle under display settings for CRT animation. This feature is controlled by the boolean animateScreenLights in framework-res.apk (thanks to whomever the original author was!).
Since adding the setting is pretty much identical to the procedure in the OP, I will just discuss the relevant code needed to access the new setting (I leave adding the setting up to you!). The only requirement is you name your setting 'crt_animation'.
Our patch point will be inside services.jar, specifically PowerManagerService$BrightnessState.smali (this is based on LP7):
Code:
iget-object v6, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
iget-boolean v6, v6, Lcom/android/server/PowerManagerService;->mAnimateScreenLights:Z
if-nez v6, :cond_19
NOTE: cond_19 may differ depending on your decompiler.
So we need to delete the 3 lines above. In its place, add our new code:
Code:
iget-object v0, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
invoke-static {v0}, Lcom/android/server/PowerManagerService;->access$4300(Lcom/android/server/PowerManagerService;)Landroid/content/Context;
move-result-object v0
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "crt_animation"
const/4 v4, 0x0
invoke-static {v0, v1, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v6
if-eqz v6, :cond_19
NOTE: Again, if cond_19 is different, fix the last line above!
Recompile settings.apk & services.jar, u/l and reboot!
Click to expand...
Click to collapse
hi Mr Jeboo.. could u specify the settings in the strings.xml and public.xml in settings.apk? i assume u have got this mod to work.. I couldn't get what to add in this files.. thanks..
Apparently when I was redoing the whole thing to do AOSP/CRT toggle I placed the step 4 in the wrong spot.
How would we disable Weather in Lockscreen when AOSP is checked?
Clock.smali
Ok so I found out that the the statusbarservices is where I look instead of phonestatusbar.smali
however I'm having trouble with the Clock.smali inserts.
Could someone take a look, who knows, and make any suggestions or point me where i need to edit?
jeboo said:
...
Find:
if-eqz p1, :cond_1
const/4 v0, 0x0
and insert this code after it:
Code:
iget-object v2, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "hide_time"
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eqz v2, [B][COLOR="DarkOrange"]:goto_0[/COLOR][/B]
const/16 v0, 0x8
Recompile SystemUI and reboot. Now try out the new feature =)
Click to expand...
Click to collapse
On LPD, instead of :goto_0, use :goto_e
Robobob1221 said:
Ok so I found out that the the statusbarservices is where I look instead of phonestatusbar.smali
however I'm having trouble with the Clock.smali inserts.
Could someone take a look, who knows, and make any suggestions or point me where i need to edit?
Click to expand...
Click to collapse
I took a quick look at your clock.smali, GB sure made things complicated (24 registers vs 9 in ICS). When the registers change that much, unfortunately you're going to have to track them, it sucks.
One major problem I see is the return value from is24hourfmt in your ver uses v9, so you need to update the line 'if-nez v2, :cond_continue' to use v9 as well. Try that and let me know.
Thanks to the others for helping with the other changes lately..I must admit I use a much shorter patch for personal use, so I can fall behind with the latest code changes =)
jeboo
jeboo said:
I took a quick look at your clock.smali, GB sure made things complicated (24 registers vs 9 in ICS). When the registers change that much, unfortunately you're going to have to track them, it sucks.
One major problem I see is the return value from is24hourfmt in your ver uses v9, so you need to update the line 'if-nez v2, :cond_continue' to use v9 as well. Try that and let me know.
Thanks to the others for helping with the other changes lately..I must admit I use a much shorter patch for personal use, so I can fall behind with the latest code changes =)
jeboo
Click to expand...
Click to collapse
Thanks for checking out my file.
So you mean that the line should be 'if-nez v2, v9 :cond_continue' or just replace v2 with v9?
Thanks for the help
私はローボーボブ。 Haro!!
Robobob1221 said:
Thanks for checking out my file.
So you mean that the line should be 'if-nez v2, v9 :cond_continue' or just replace v2 with v9?
Thanks for the help
私はローボーボブ。 Haro!!
Click to expand...
Click to collapse
if-nez v9, :cond_continue
Basically if you're using military time, there's no need to worry about am/pm.
Still no compiling
jeboo said:
if-nez v9, :cond_continue
Basically if you're using military time, there's no need to worry about am/pm.
Click to expand...
Click to collapse
In plain English it seems so simple! Lol!
Thanks again. I'll check it out and see if it works. I hope it does Thanks again for the help.
Ok I tried the change you suggested and it still won't compile
I tried a few other changes but it results in the same error '
Could not smali file: [email protected]'. Sometimes the numbers ate end vary but its the same result.
another set is this
[email protected]
私はローボーボブ。 Haro!!
jeboo said:
if-nez v9, :cond_continue
Basically if you're using military time, there's no need to worry about am/pm.
Click to expand...
Click to collapse
Hello Jeboo!
Weird to say but.. with ur tutorial I ve been able to make a toggle to choose Samsung lockscreen or the AOSP one credits for u in my next Simplistic Disaster III Rom
whoa!
This has been updated. Check out the new thread: http://forum.xda-developers.com/showthread.php?t=2254022
Now includes checkbox in settings to enable and disable!
Thanks to jakubklos for his diff file and getting me in the right direction.
And a HUGE thanks to the CM team.
CODE IN RED IS NEW!
CODE IN BLUE IS MODIFIED!
Some of your lines/variables may be different.
I've attached the original and modified files so you can diff them yourself!
First, decompile SecSettings.apk. If you're unsure how to do that you're going to have some pretty big issues ahead.
Navigate to res/values/strings.xml
and add the following to the end:
Code:
<string name="volbtn_music_controls_title">Volume rocker music controls</string>
<string name="volbtn_music_controls_summary">When screen off, long-pressing the volume rockers will seek music tracks</string>
Next navigate to res/xml/sound_settings.xml
and add the section in red:
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/sound_settings" android:key="sound_settings"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<com.android.settings.RingerVolumePreference android:persistent="false" android:title="@string/all_volume_title" android:key="ring_volume" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/all_volume_title" android:streamType="ring" />
<com.android.settings.VibrationFeedbackPreference android:title="@string/vibration_intensity" android:key="vibration_feedback_intensity" android:summary="" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/vibration_intensity" />
<PreferenceScreen android:title="@string/phone_profile" android:key="phone_profile" android:summary="@string/normal" android:fragment="com.android.settings.phoneprofile.PhoneProfileSettings" />
<Preference android:title="@string/musicfx_title" android:key="musicfx">
<intent android:targetPackage="com.android.musicfx" android:targetClass="com.android.musicfx.ControlPanelPicker" />
</Preference>
<PreferenceCategory android:title="@string/sound_category_calls_and_notification_title" android:key="category_calls_and_notification" />
<PreferenceScreen android:title="@string/download_ringtones" android:key="download_ringtone" android:summary="">
<intent android:action="android.intent.action.VIEW" android:data="http://waprd.telstra.com/redirect?target=3glatesttones" />
</PreferenceScreen>
<com.android.settings.DefaultRingtonePreference android:persistent="false" android:title="@string/ringtone_title" android:key="ringtone" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/ringtone_title" android:ringtoneType="ringtone" />
<com.android.settings.DefaultRingtonePreference android:persistent="false" android:title="@string/voice_call_ringtone2" android:key="ringtone2" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/voice_call_ringtone2" android:ringtoneType="ringtone2" />
<PreferenceScreen android:title="@string/phone_vibration_title" android:key="phone_vibration" android:summary="@string/phone_vibration_summary" android:widgetLayout="@layout/round_more_icon">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.personalvibration.SelectPatternDialog" />
</PreferenceScreen>
<com.android.settings.DefaultRingtonePreference android:persistent="false" android:title="@string/notification_sound_title" android:key="notification_sound" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/notification_sound_dialog_title" android:ringtoneType="notification" />
<CheckBoxPreference android:persistent="false" android:title="@string/vibrate_on_ring_title" android:key="vibrate_when_ringing" />
<PreferenceCategory android:title="@string/sound_category_system_title" />
<CheckBoxPreference android:title="@string/dtmf_tone_enable_title" android:key="dtmf_tone" android:defaultValue="true" android:summaryOn="@string/dtmf_tone_enable_summary_on" android:summaryOff="@string/dtmf_tone_enable_summary_off" />
<CheckBoxPreference android:title="@string/sound_effects_enable_title" android:key="sound_effects" android:defaultValue="true" android:summaryOn="@string/sound_effects_enable_summary_on" android:summaryOff="@string/sound_effects_enable_summary_off" />
<CheckBoxPreference android:title="@string/lock_sounds_enable_title" android:key="lock_sounds" android:defaultValue="true" android:summaryOn="@string/lock_sounds_enable_summary_on" android:summaryOff="@string/lock_sounds_enable_summary_off" />
<CheckBoxPreference android:title="@string/gps_notification_sounds_title" android:key="gps_notification_sounds" />
<CheckBoxPreference android:title="@string/haptic_feedback_enable_title" android:key="haptic_feedback" android:defaultValue="true" android:summaryOn="@string/haptic_feedback_enable_summary_on" android:summaryOff="@string/haptic_feedback_enable_summary_off" />
<SwitchPreferenceScreen android:title="@string/auto_haptic" android:key="autohaptic_settings" android:fragment="com.android.settings.autohaptic.AutoHapticSettings" />
<ListPreference android:entries="@array/emergency_tone_entries" android:title="@string/emergency_tone_title" android:key="emergency_tone" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/emergency_tone_values" />
[COLOR="Red"]<CheckBoxPreference android:persistent="false" android:title="@string/volbtn_music_controls_title" android:key="volbtn_music_controls" android:summary="@string/volbtn_music_controls_summary" />[/COLOR]
</PreferenceScreen>
Now let's get into some smail.
Open up com/android/settings/SoundSettings.smali
Code:
.field private mSoundSettings:Landroid/preference/PreferenceGroup;
.field private mUnloadSoundEffectRunnable:Ljava/lang/Runnable;
.field private mVibrateWhenRinging:Landroid/preference/CheckBoxPreference;
[COLOR="red"].field private mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;[/COLOR]
.field private mVolume:Lcom/android/settings/RingerVolumePreference;
method onCreate:
Code:
const-string v18, "lockscreen_sounds_enabled"
const/16 v20, 0x1
move-object/from16 v0, v18
move/from16 v1, v20
invoke-static {v15, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v18
if-eqz v18, :cond_f
const/16 v18, 0x1
:goto_6
move-object/from16 v0, v19
move/from16 v1, v18
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 291
[COLOR="red"]const-string v18, "volbtn_music_controls"
move-object/from16 v0, p0
move-object/from16 v1, v18
invoke-virtual {v0, v1}, Lcom/android/settings/SoundSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v18
check-cast v18, Landroid/preference/CheckBoxPreference;
move-object/from16 v0, v18
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;
move-object/from16 v18, v0
const/16 v19, 0x0
invoke-virtual/range {v18 .. v19}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;
move-object/from16 v19, v0
const-string v18, "volbtn_music_controls"
const/16 v20, 0x1
move-object/from16 v0, v18
move/from16 v1, v20
invoke-static {v15, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v18
if-eqz v18, :cond_long
const/16 v18, 0x1
:goto_long
move-object/from16 v0, v19
move/from16 v1, v18
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR]
const-string v18, "ringtone"
move-object/from16 v0, p0
move-object/from16 v1, v18
invoke-virtual {v0, v1}, Lcom/android/settings/SoundSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
Code:
:cond_d
const/16 v18, 0x0
goto/16 :goto_4
.line 280
:cond_e
const/16 v18, 0x0
goto/16 :goto_5
.line 288
:cond_f
const/16 v18, 0x0
goto/16 :goto_6
[COLOR="red"]:cond_long
const/16 v18, 0x0
goto/16 :goto_long[/COLOR]
.line 315
.restart local v17 #vibrator:Landroid/os/Vibrator;
:cond_11
invoke-virtual/range {p0 .. p0}, Lcom/android/settings/SoundSettings;->getActivity()Landroid/app/Activity;
move-result-object v18
invoke-static/range {v18 .. v18}, Lcom/android/settings/Utils;->isTablet(Landroid/content/Context;)Z
method onPreferenceTreeClick:
Code:
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mLockSounds:Landroid/preference/CheckBoxPreference;
invoke-virtual {v4}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_e
:goto_8
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1
:cond_e
move v0, v1
goto :goto_8
.line 640
:cond_f
[COLOR="red"]iget-object v2, p0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;
if-ne p2, v2, :cond_next
.line 637
invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "volbtn_music_controls"
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;
invoke-virtual {v4}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_long
:goto_long
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1
:cond_long
move v0, v1
goto :goto_long
:cond_next[/COLOR]
iget-object v0, p0, Lcom/android/settings/SoundSettings;->mMusicFx:Landroid/preference/Preference;
if-ne p2, v0, :cond_0
goto/16 :goto_2
.end method
Now recompile SecSettings and the setting should be there. It won't do anything though.
Next we need to decompile android.policy.jar.
First file is com\android\internal\policy\impl\PhoneWindowManager$PolicyHandler.smali
Add another switch statement:
Code:
:pswitch_4
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
#calls: Lcom/android/internal/policy/impl/PhoneWindowManager;->enableSPenGesture()V
invoke-static {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->access$300(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
goto :goto_0
[COLOR="red"]:pswitch_5
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;
check-cast v0, Landroid/view/KeyEvent;
invoke-virtual {v1, v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->dispatchMediaKeyWithWakeLockToAudioService(Landroid/view/KeyEvent;)V
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;
check-cast v0, Landroid/view/KeyEvent;
const/16 v3, 0x01
invoke-static {v0, v3}, Landroid/view/KeyEvent;->changeAction(Landroid/view/KeyEvent;I)Landroid/view/KeyEvent;
move-result-object v0
invoke-virtual {v1, v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->dispatchMediaKeyWithWakeLockToAudioService(Landroid/view/KeyEvent;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
const/4 v2, 0x1
iput-boolean v2, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
goto :goto_0[/COLOR]
.line 828
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
:pswitch_1
:pswitch_2
:pswitch_3
:pswitch_4
[COLOR="red"]:pswitch_5[/COLOR]
.end packed-switch
.end method
Next: com\android\internal\policy\impl\PhoneWindowManager$SettingsObserver.smali
method observe:
Code:
const-string v1, "incall_power_button_behavior"
invoke-static {v1}, Landroid/provider/Settings$Secure;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
[COLOR="red"]const-string v1, "volbtn_music_controls"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V[/COLOR]
.line 878
const-string v1, "accelerometer_rotation"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
Next: com\android\internal\policy\impl\PhoneWindowManager.smali
Code:
.field static final LONG_PRESS_POWER_NOTHING:I = 0x0
.field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2
[COLOR="Red"].field private static final LONG_PRESS_TIMEOUT:I = 0x190[/COLOR]
.field static final MINI_APP_DIALOG_LAYER:I = 0x5
.field static final MINI_APP_LAYER:I = 0x3
Code:
.field private mIsSensorhubEnabled:Z
.field private mIsVisibleSPenGestureView:Z
[COLOR="red"].field mIsVolumeAction:Z
.field mIsVolumeBlocking:Z[/COLOR]
.field mKeyboardTapVibePattern:[J
.field mKeyguard:Landroid/view/WindowManagerPolicy$WindowState;
Code:
.field mVoiceTalkDefaultLaunch:Z
.field mVoiceTalkIntent:Landroid/content/Intent;
[COLOR="red"].field mVolBtnMusicControls:I[/COLOR]
.field private mVolumeDownKeyConsumedByScreenshotChord:Z
method handleVolumeKey:
Code:
.method handleVolumeKey(II)V
.locals 5
[COLOR="red"]move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-nez v0, :cond_vc[/COLOR]
invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getAudioService()Landroid/media/IAudioService;
move-result-object v0
if-nez v0, :cond_0
.line 4898
[COLOR="Red"]:cond_vc[/COLOR]
:goto_0
return-void
.line 4875
:cond_0
Add the following after the above method handleVolumeKey
Code:
[COLOR="Red"].method handleVolumeLongPress(Landroid/view/KeyEvent;)V
.locals 11
.parameter "event"
.prologue
const/4 v7, 0x0
.line 26
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
.line 27
iput-boolean v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
.line 28
invoke-virtual {p1}, Landroid/view/KeyEvent;->getKeyCode()I
move-result v0
const/16 v1, 0x18
if-ne v0, v1, :cond_0
.line 29
const/16 v6, 0x57
.line 30
.local v6, newKeyCode:I
:goto_0
iget-object v9, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
const/4 v10, 0x6
.line 31
new-instance v0, Landroid/view/KeyEvent;
invoke-virtual {p1}, Landroid/view/KeyEvent;->getDownTime()J
move-result-wide v1
invoke-virtual {p1}, Landroid/view/KeyEvent;->getEventTime()J
move-result-wide v3
invoke-virtual {p1}, Landroid/view/KeyEvent;->getAction()I
move-result v5
invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;->(JJIII)V
.line 30
invoke-virtual {v9, v10, v0}, Landroid/os/Handler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message;
move-result-object v8
.line 32
.local v8, msg:Landroid/os/Message;
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
sget v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->LONG_PRESS_TIMEOUT:I
int-to-long v1, v1
invoke-virtual {v0, v8, v1, v2}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z
.line 33
return-void
.line 29
.end local v6 #newKeyCode:I
.end local v8 #msg:Landroid/os/Message;
:cond_0
const/16 v6, 0x58
goto :goto_0
.end method
.method handleVolumeLongPressAbort()V
.locals 2
.prologue
.line 36
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
.line 37
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
const/4 v1, 0x6
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V
.line 38
return-void
.end method[/COLOR]
method interceptKeyBeforeQueueing:
This one's kind of hard to find so here's some extra lines before and after:
Code:
.line 5201
const/16 v23, 0x0
move/from16 v0, v23
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownKeyConsumedByScreenshotChord:Z
.line 5202
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingPowerKeyAction()V
.line 5203
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingScreenrecordChordAction()V
.line 5204
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->interceptScreenshotChord()V
.line 5246
:cond_1a
:goto_8
if-eqz v5, [COLOR="Blue"]:cond_long[/COLOR]
.line 5247
invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getTelephonyService()Lcom/android/internal/telephony/ITelephony;
move-result-object v22
.line 5248
.local v22, telephonyService:Lcom/android/internal/telephony/ITelephony;
if-eqz v22, :cond_20
.line 5250
:try_start_0
invoke-interface/range {v22 .. v22}, Lcom/android/internal/telephony/ITelephony;->isRinging()Z
Code:
const-string v23, "WindowManager"
const-string v24, "ITelephony threw RemoteException"
move-object/from16 v0, v23
move-object/from16 v1, v24
invoke-static {v0, v1, v6}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
.line 5333
.end local v6 #ex:Landroid/os/RemoteException;
:cond_20
move-object/from16 v0, p0
[COLOR="Red"]iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenOnEarly:Z
if-nez v0, :cond_reg
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z
move-result v21
if-eqz v21, :cond_reg
const/16 v1, 0x1
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
if-ne v0, v1, :cond_reg
move-object/from16 v0, p0
move-object/from16 v1, p1
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress(Landroid/view/KeyEvent;)V
:cond_reg
move-object/from16 v0, p0[/COLOR]
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-nez v23, :cond_1
and a couple lines down:
Code:
move-object/from16 v23, v0
invoke-virtual/range {v23 .. v23}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V
goto/16 :goto_2
.line 5341
.end local v22 #telephonyService:Lcom/android/internal/telephony/ITelephony;
[COLOR="Blue"]:cond_long[/COLOR]
[COLOR="Red"]if-nez v5, :cond_vc
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_vc
const/16 v1, 0x1
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
if-ne v0, v1, :cond_vc
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
if-nez v0, :cond_vc
move-object/from16 v0, p0
const/4 v3, 0x0
invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_vc[/COLOR]
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-eqz v23, :cond_1
method updateSettings:
Code:
const-string v19, "incall_power_button_behavior"
const/16 v20, 0x1
move-object/from16 v0, v19
move/from16 v1, v20
invoke-static {v13, v0, v1}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v9
[COLOR="red"]const-string v19, "volbtn_music_controls"
const/16 v20, 0x0
move-object/from16 v0, v19
move/from16 v1, v20
invoke-static {v13, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3[/COLOR]
.line 2006
const-string v19, "user_rotation"
Code:
iput v6, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mEndcallBehavior:I
.line 2028
move-object/from16 v0, p0
iput v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIncallPowerBehavior:I
[COLOR="red"]move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I[/COLOR]
.line 2030
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUserRotation:I
Newer Firmwares:(Sprint 4.1.2 MR2, etc.)
com\android\internal\policy\impl\PhoneWindowManager.smali
We need to edit one of the sections in method interceptKeyBeforeQueueing.
Remove the code in purple and add the code in green.
Code:
move-object/from16 v23, v0
invoke-virtual/range {v23 .. v23}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V
goto/16 :goto_2
.line 5341
.end local v22 #telephonyService:Lcom/android/internal/telephony/ITelephony;
[COLOR="Blue"]:cond_long[/COLOR]
[COLOR="Red"]if-nez v5, :cond_vc
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_vc
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
if-nez v0, :cond_vc
move-object/from16 v0, p0
const/4 v3, 0x0
[COLOR="Purple"]invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V[/COLOR]
[COLOR="Green"]iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
move-object/from16 v0, v23
invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->handleVolume(II)V[/COLOR]
:cond_vc[/COLOR]
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-eqz v23, :cond_1
com\android\internal\policy\impl\PhoneWindowManager$SamsungVolumeControlThread.smali
method handleVolume:
Code:
.method handleVolume(II)V
.locals 6
[COLOR="Red"]iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-nez v0, :cond_vc[/COLOR]
iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
iget-object v3, v3, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const-string v4, "audio"
invoke-virtual {v3, v4}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/media/AudioManager;
if-nez v0, :cond_0
[COLOR="red"]:cond_vc[/COLOR]
:goto_0
return-void
:cond_0
:try_start_0
invoke-virtual {v0}, Landroid/media/AudioManager;->dismissVolumePanel()V
sparse-switch p2, :sswitch_data_0
goto :goto_0
ISSUES:
Pressing volume up or down both turn the volume down(or up):
Looking at a little bit more from the last entry:
Code:
move-object/from16 v23, v0
invoke-virtual/range {v23 .. v23}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V
goto/16 :goto_2
.line 5341
.end local v22 #telephonyService:Lcom/android/internal/telephony/ITelephony;
[COLOR="Blue"]:cond_long[/COLOR]
[COLOR="Red"]if-nez v5, :cond_vc
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_vc
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
if-nez v0, :cond_vc
move-object/from16 v0, p0
const/4 v3, 0x0
invoke-virtual {v0, v3, [COLOR="orange"]v15[/COLOR]}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_vc[/COLOR]
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-eqz v23, :cond_1
.line 5342
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
move-object/from16 v0, v23
invoke-virtual {v0, [COLOR="Orange"]v15[/COLOR], v5, v4}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->updateInfo(IZZ)V
Pull the variable in orange from the last line and replace the variable in line
Code:
invoke-virtual {v0, v3, [COLOR="orange"]v15[/COLOR]}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
Make sure you're not replacing the last line with anything, but using it as reference.
Cool
Sent from my SAMSUNG-SGH-I747 using xda app-developers app
This is great! made the changes and everything is running great.
Sent you a donation, Cheers! have a beer on me *Happy New Year!*
Thanks for all your hard work it is much appreciated
enewman17 said:
This is great! made the changes and everything is running great.
Sent you a donation, Cheers! have a beer on me *Happy New Year!*
Thanks for all your hard work it is much appreciated
Click to expand...
Click to collapse
Did you use the cond's in green? Or did you just replace the file?
loserskater said:
Did you use the cond's in green? Or did you just replace the file?
Click to expand...
Click to collapse
I did not use the cond's in green, I manually made the changes excluding them.
I am curious now if it will work using those cond's I will try it later. I'm just so happy you were able to get it working! and well!
I had problems compiling it with apktool after I made the changes, but doing it manually worked and now apktool will compile and decompile without error. I don't get it.
I've only tested it with the stock player and google play music and it works perfectly. I don't use anything else so i didn't test.
enewman17 said:
I did not use the cond's in green, I manually made the changes excluding them.
I am curious now if it will work using those cond's I will try it later. I'm just so happy you were able to get it working! and well!
I had problems compiling it with apktool after I made the changes, but doing it manually worked and now apktool will compile and decompile without error. I don't get it.
I've only tested it with the stock player and google play music and it works perfectly. I don't use anything else so i didn't test.
Click to expand...
Click to collapse
What showed up with apktool? It's possible you missed a cond somewhere...
loserskater said:
What showed up with apktool? It's possible you missed a cond somewhere...
Click to expand...
Click to collapse
I don't remember, something like false value blah blah...
I diff'ed the the files using win merge and they are exactly the same. It's not the first time it's happened to me seem's like it's the way notepad++ saves the file... maybe.... I had more problems using getdiz as a text editor. I don't know maybe it's me. But I do know it works.
When I changed the sound file in the SecContacts to get rid of the water drop sound from the dial pad I could not get apktool to compile it for the life of me, If I put the original sound back, apktool worked. Used manual commands and poof it worked like some sort of fairy magic. It was really starting to annoy me, but persistence pays off. Now apktool will decompile and compile my modded SecContacts with no problem. Also had the same problem when editing the SecPhone to get rid of the increasing ringtone. Same false value error. did it manually and it worked but I kind of figured it would happen cause that mod is kind of hacky to begin with, I didn't delete the lines for that mod, but rather omitted those lines with a #
Thanks for sharing man. Works great with both att and tmo!:good:
Thanks! Will be trying this soon.
First of all, thank you for this Tutorial. I'll try it now since a few hours, but it won't recompile. I'll tried it with the green ones and without it. Apktool gives me this errors:
I: Checking whether sources has changed...
I: Smaling...
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
: [email protected]
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:64)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:48)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:35)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:243)
at brut.androlib.Androlib.buildSources(Androlib.java:200)
at brut.androlib.Androlib.build(Androlib.java:191)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
Drücken Sie eine beliebige Taste . . .
Maybe someone have an idea. Thank you (=
hells
hellsgod said:
First of all, thank you for this Tutorial. I'll try it now since a few hours, but it won't recompile. I'll tried it with the green ones and without it. Apktool gives me this errors:
I: Checking whether sources has changed...
I: Smaling...
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
: [email protected]
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:64)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:48)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:35)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:243)
at brut.androlib.Androlib.buildSources(Androlib.java:200)
at brut.androlib.Androlib.build(Androlib.java:191)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
Drücken Sie eine beliebige Taste . . .
Maybe someone have an idea. Thank you (=
hells
Click to expand...
Click to collapse
I had trouble too, if your sure the changes you made are right you'll have to take the android.policy and manually decompile the dex file make the changes and recompile it again using smali commands. It should work and not give you any errors just using smali and baksmali
noob question here, Will this be avaliable in a flashable form? Im not familiar with decompiling but would really love this feature on my current rom
best thing to do when working with smalis is to drag the classes.dex out of the apk file such as systemui.apk & secsettings.apk and so forth and use a baksmali/smali tool and it'll decompile just the smalis rather then the whole apk and then causing a fuss later when compiling it.. Once thats done compile the classes.dex with ur edits done and then drag it back to apk & push to system and profit ..
svfreddy said:
noob question here, Will this be avaliable in a flashable form? Im not familiar with decompiling but would really love this feature on my current rom
Click to expand...
Click to collapse
I'll make a couple flashable zips for lk4 and lk3
loserskater said:
I'll make a couple flashable zips for lk4 and lk3
Click to expand...
Click to collapse
Thanks!!
Sent from my SPH-L710 using xda app-developers app
Thanks, I fixed ours using this in the Sprint section (here).
But just an FYI, I used WinMerge to check diff's between your org and mod, and it looks like you changed a bunch of :cond's towards the end which was unnecessary.
Here is the last part that is needed to change:
http://i16.photobucket.com/albums/b38/Migs351/first_zps538afb44.jpg
And here is where some of the unnecessary changes are:
http://i16.photobucket.com/albums/b38/Migs351/second_zps05e5de7c.jpg
For some reason you increased all the :cond's by 2, which doesn't actually change anything, as this is just a "label" for the if statements to goto if the statement returns true.
Just thought I'd point that out.
But other than that, nice job! No more need for those extra files. Simple code modification.
I'm curious though, for my own sanity anyways, what's the main difference here between the this mod and the original mod. (which didn't work, properly, in JB) I know the original one sent the MEDIA_NEXT and MEDIA_PREVIOUS keys to the system, and this was getting interpreted incorrectly and being sent to the default Media Player, regardless of what currently had Audio Focus.
What does this one use as it's method of changing the tracks, something more direct, or does it tap into another type of Media key?
I could go through the code and figure it out, but I'm too lazy right now.
Unknownforce said:
Thanks, I fixed ours using this in the Sprint section (here).
But just an FYI, I used WinMerge to check diff's between your org and mod, and it looks like you changed a bunch of :cond's towards the end which was unnecessary.
Here is the last part that is needed to change:
http://i16.photobucket.com/albums/b38/Migs351/first_zps538afb44.jpg
And here is where some of the unnecessary changes are:
http://i16.photobucket.com/albums/b38/Migs351/second_zps05e5de7c.jpg
For some reason you increased all the :cond's by 2, which doesn't actually change anything, as this is just a "label" for the if statements to goto if the statement returns true.
Just thought I'd point that out.
But other than that, nice job! No more need for those extra files. Simple code modification.
I'm curious though, for my own sanity anyways, what's the main difference here between the this mod and the original mod. (which didn't work, properly, in JB) I know the original one sent the MEDIA_NEXT and MEDIA_PREVIOUS keys to the system, and this was getting interpreted incorrectly and being sent to the default Media Player, regardless of what currently had Audio Focus.
What does this one use as it's method of changing the tracks, something more direct, or does it tap into another type of Media key?
I could go through the code and figure it out, but I'm too lazy right now.
Click to expand...
Click to collapse
Here from the Sprint GS III forums as unknownforce was able to convert your work to function for us Sprint folks. Just wanted to say thank you loserskater for your hard work on this and for getting this working. I have been waiting for this forever since upgrading to 4.1
Thanks loserskater and also thanks unknownforce,
Whiteice
Unknownforce said:
Thanks, I fixed ours using this in the Sprint section (here).
But just an FYI, I used WinMerge to check diff's between your org and mod, and it looks like you changed a bunch of :cond's towards the end which was unnecessary.
Here is the last part that is needed to change:
http://i16.photobucket.com/albums/b38/Migs351/first_zps538afb44.jpg
And here is where some of the unnecessary changes are:
http://i16.photobucket.com/albums/b38/Migs351/second_zps05e5de7c.jpg
For some reason you increased all the :cond's by 2, which doesn't actually change anything, as this is just a "label" for the if statements to goto if the statement returns true.
Just thought I'd point that out.
But other than that, nice job! No more need for those extra files. Simple code modification.
I'm curious though, for my own sanity anyways, what's the main difference here between the this mod and the original mod. (which didn't work, properly, in JB) I know the original one sent the MEDIA_NEXT and MEDIA_PREVIOUS keys to the system, and this was getting interpreted incorrectly and being sent to the default Media Player, regardless of what currently had Audio Focus.
What does this one use as it's method of changing the tracks, something more direct, or does it tap into another type of Media key?
I could go through the code and figure it out, but I'm too lazy right now.
Click to expand...
Click to collapse
That's why I added the conds in green so you don't have to change all of the ones after. But if you add the 21 and 22 you'll have multiple instances which throws errors when trying to compile.
The difference between this and the previous mod is that sending the media button presses would send an ordered broadcast and the app with the highest priority would take the broadcast and see if it needed it and then pass it along if it didn't. Well must audio apps haven't been updated to use this method. And if you changed it to just broadcast instead of offered all media players would get the broadcast do you'd have a bunch of apps trying to all play music. This uses private apis that that only the system can use and it's the same method the lockscreen controls use which is controlled by the audio service instead of broadcasts. I hope that all makes sense
loserskater said:
That's why I added the conds in green so you don't have to change all of the ones after. But if you add the 21 and 22 you'll have multiple instances which throws errors when trying to compile.
The difference between this and the previous mod is that sending the media button presses would send an ordered broadcast and the app with the highest priority would take the broadcast and see if it needed it and then pass it along if it didn't. Well must audio apps haven't been updated to use this method. And if you changed it to just broadcast instead of offered all media players would get the broadcast do you'd have a bunch of apps trying to all play music. This uses private apis that that only the system can use and it's the same method the lockscreen controls use which is controlled by the audio service instead of broadcasts. I hope that all makes sense
Click to expand...
Click to collapse
Oh! Yeah, the "named" method should work for most compilers, I don't see why it wouldn't, but I got it now.
Makes perfect sense, thanks for explaining. This makes for a much cleaner and friendlier method of doing it too, nice.
Is this only for Touchwiz?
This is based off of FL16/GB08 JB 4.1.2.
A touchwiz 4.3 guide has been posted here:
[Guide How-to/MOD] New Power Menu with Screenshot TW 4.3
This will allow you to have Recovery and Bootloader (download mode) right in the Power Menu selections. I grew tired of the extended restart menu so I wrote this.
This is not a flashable mod, it is a guide only.
The attached zip file are support files only that are necessary to create this modification.
Power Menu Guide
Code:
[U][B]Framework-res.apk changes[/B]:[/U]
Add these lines to res/values/strings.xml
[CODE] <string name="download">Bootloader</string>
<string name="recovery">Recovery</string>
Add the two png files in the attachment to:
res/drawable-hdpi
Recompile framework-res.apk.
Decompile the new framework-res.apk and open res/values/public.xml.
We need to write down these values because we need them later. Yours will probably be different. Leave off the leading zero:
Code:
<public type="drawable" name="tw_ic_download" id="0x0[COLOR="Red"]1080ad6[/COLOR]" />
<public type="drawable" name="tw_ic_recovery" id="0x0[COLOR="Red"]1080ad7[/COLOR]" />
<public type="string" name="download" id="0x0[COLOR="Red"]1040843[/COLOR]" />
<public type="string" name="recovery" id="0x0[COLOR="Red"]1040844[/COLOR]" />
Android.policy.jar changes:
Add the two smali files in the attachment to com\android\internal\policy\impl
Smali edit:
com\android\internal\policy\impl\GlobalActions.smali
New line before:
Code:
.field private mDialog:Landroid/app/AlertDialog;
.field private mHandler:Landroid/os/Handler;
After:
Code:
.field private mDialog:Landroid/app/AlertDialog;
[COLOR="Red"].field private mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[/COLOR].field private mHandler:Landroid/os/Handler;
New line before:
Code:
.field private mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.field private mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
After:
Code:
.field private mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[COLOR="Red"].field private mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[/COLOR].field private mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
Find around line 1075:
Code:
.line 372
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;
const v2, 0x10808ee
const v3, 0x1040192
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 399
Add new lines after this section:
***NOTE THE LINES IN BLUE, THESE MUST MATCH THE VALUES WE GOT FROM FRAMEWORK (without the leading zero)***
Code:
.line 372
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;
const v2, 0x10808ee
const v3, 0x1040192
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 399
[COLOR="Red"] new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Download;
const v2, 0x[COLOR="Blue"]1080ad6[/COLOR]
const v3, 0x[COLOR="Blue"]1040843[/COLOR]
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Download;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 400
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Recovery;
const v2, 0x[COLOR="Blue"]1080ad7[/COLOR]
const v3, 0x[COLOR="Blue"]1040844[/COLOR]
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Recovery;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 401
[/COLOR] new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$5;
Now we are going to expand the existing array to include 2 more entries.
Around line 1138:
Before:
Code:
.line 428
const/4 v1, 0x5
After:
Code:
.line 428
[COLOR="Red"]const/4 v1, 0x7[/COLOR]
Find around line 1137:
Code:
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v3, v1, v2
const/4 v2, 0x4
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
Replace with:
Code:
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v3, v1, v2
const/4 v2, 0x4
move-object/from16 v0, p0
[COLOR="Red"] iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
const/4 v2, 0x5
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
const/4 v2, 0x6
move-object/from16 v0, p0[/COLOR]
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
How to remove menu items:
Smali edit:
com\android\internal\policy\impl\GlobalActions.smali
We need to reconfigure the array that displays the options.
Before:
Code:
.line 428
const/4 v1, 0x7
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
const/4 v2, 0x0
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
const/4 v2, 0x1
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
const/4 v2, 0x2
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v3, v1, v2
const/4 v2, 0x3
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v3, v1, v2
const/4 v2, 0x4
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
const/4 v2, 0x5
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
const/4 v2, 0x6
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
move-result-object v1
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
We need to split up the array so that we can easily see the different sections.
It will make it easier to modify the line you want to remove.
Code:
.line 428
const/4 v1, 0x7
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
#
const/4 v2, 0x0
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
const/4 v2, 0x1
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
const/4 v2, 0x2
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v3, v1, v2
#
const/4 v2, 0x3
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v3, v1, v2
#
const/4 v2, 0x4
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
const/4 v2, 0x5
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
const/4 v2, 0x6
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
move-result-object v1
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
Now we will remove the Data Network Mode and Airplane Mode choices from the menu. We need to shrink the array by 2 and also renumber the remaining options. Please note the changes in red.
Code:
.line 428
[COLOR="Red"] const/4 v1, 0x5[/COLOR]
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
#
const/4 v2, 0x0
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
const/4 v2, 0x1
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
[COLOR="Red"] # const/4 v2, 0x2
# move-object/from16 v0, p0
# iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
# aput-object v3, v1, v2
[/COLOR]
#
[COLOR="Red"] # const/4 v2, 0x3
# move-object/from16 v0, p0
# iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
# aput-object v3, v1, v2[/COLOR]
#
[COLOR="Red"] const/4 v2, 0x2[/COLOR]
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
[COLOR="Red"] const/4 v2, 0x3
[/COLOR]
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
[COLOR="Red"] const/4 v2, 0x4
[/COLOR]
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2
#
invoke-static {v1}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
move-result-object v1
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
Note: Use of the # symbol is not necessary. I use it simply for clarification and to separate out the sections for easier viewing while editing. Additionally, any lines edited with the # symbol will be ignored when recompiling.
Addendum - Adding Screenshot to Power Menu
(This is an addon to the original Power Menu Guide posted above).
Framework-res.apk changes:
Add these lines to res/values/strings.xml
Code:
<string name="global_action_screenshot_txt">Screenshot</string>
Add png file in the screenshot attachment to:
res/drawable-hdpi
Recompile framework-res.apk.
Decompile the new framework-res.apk and open res/values/public.xml.
We need to write down these values because we need them later. Yours will probably be different. Leave off the leading zero:
Code:
<public type="string" name="global_action_screenshot_txt" id="0x01040845" />
<public type="drawable" name="tw_ic_screenshot" id="0x01080ad8" />
Android.policy.jar changes:
Add the two smali files in the attachment to com\android\internal\policy\impl
Smali edit:
com\android\internal\policy\impl\GlobalActions.smali
New line before:
Code:
.field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;
.field private mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$SilentModeAction;
After:
Code:
.field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;
[COLOR="Red"].field private mScreenCapture:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
.field private mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$SilentModeAction;
New Section Before:
Code:
.line 372
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;
const v2, 0x10808ee
const v3, 0x1040192
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.line 399
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Download;
const v2, 0x1080ad6
const v3, 0x1040843
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Download;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
After:
***NOTE THE LINES IN BLUE, THESE MUST MATCH THE VALUES WE GOT FROM FRAMEWORK (without the leading zero)***
Code:
.line 372
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;
const v2, 0x10808ee
const v3, 0x1040192
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[COLOR="Red"] .line 388
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$16;
const v2, 0x[COLOR="Blue"]1080ad8[/COLOR]
const v3, 0x[COLOR="Blue"]1040845[/COLOR]
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$16;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenCapture:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[/COLOR]
.line 399
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$Download;
const v2, 0x1080ad6
const v3, 0x1040843
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$Download;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
Now to edit the array and add ScreenShot
NOTE: FYI, here we are removing replacing DataToggle with Airplane Mode to keep menu from overlapping the screen.
Find around line 1180:
Code:
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v3, v1, v2
const/4 v2, 0x3
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v3, v1, v2
const/4 v2, 0x4
move-object/from16 v0, p0
Replace with:
Code:
[COLOR="Red"] iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;[/COLOR]
aput-object v3, v1, v2
const/4 v2, 0x3
move-object/from16 v0, p0
[COLOR="Red"]iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenCapture:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR]
aput-object v3, v1, v2
const/4 v2, 0x4
move-object/from16 v0, p0
If porting this to another phone
Important update info for Screenshot mod:
You may have to possibly change this value in GlobalActions$16$1.smali which is one of the addon files to match your code.
Code:
invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->[COLOR="Red"]access$200[/COLOR](Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
Here is my access$200 in GlobalActions.smali, just search for the line in red. If it is different access$xxx in your smali, also change access$xxx to match in GlobalActions$16$1.smali:
Code:
.method static synthetic access$200(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
.registers 2
.parameter "x0"
.prologue
.line 88
[COLOR="Red"]iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;[/COLOR]
return-object v0
.end method
Credits to Mirko DDD for the ScreenShot method!!!
OP updated with new section.
How to remove options from Power Menu. Screenshot attached with modification.
thx buddy, i will look into asap.
Looks Nice
Re: [GUIDE][How-to] New Power Menu JB
So those the zip replace all the script changes in the op?
Not sure, changes to script+zip - or just zip to get new power menu?
Pp.:beer:
sent from a jellybean filled epic touch.
Re: [GUIDE][How-to] New Power Menu JB
PanchoPlanet said:
So those the zip replace all the script changes in the op?
Not sure, changes to script+zip - or just zip to get new power menu?
Pp.:beer:
sent from a jellybean filled epic touch.
Click to expand...
Click to collapse
The zip contains extra support files that need to be added to the classes.dex file before it gets recompiled. So yes, the last part of what you said.
And also a couple files for the framework edit are in the zip too.
Sent from my SPH-D710 using xda premium
Re: [GUIDE][How-to] New Power Menu JB
This thread got mentioned on Google+, keep up the good work!
{
"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"
}
Sent from my SPH-D710 using Xparent Skyblue Tapatalk 2
Great Job!! :good:
Gonna try this awesomenesssss..
Samsung Fanboy said:
This thread got mentioned on Google+, keep up the good work!
Click to expand...
Click to collapse
Thanks for keeping an eye out for me.
Yes, another very well written writeup by Egzthunder1.
http://www.xda-developers.com/andro...ems-to-your-jelly-bean-powered-epic-4g-touch/
Very nice, I did that on my Galaxy S3 Mini and works great.
I would love to see a Xposed module made out of this. Would be awesome!
Re: [GUIDE][How-to] New Power Menu JB
Congrats Td on the write-up and recognition. :thumbup::beer::beer::beer:
Keep up the great work and contributions to the community.
Pp.:beer::beer::beer:
sent from a jellybean filled epic touch.
Hi @tdunham
I have been trying to add recovery option using or guide.
It goes well with framework-res.apk but stuck at android. policy.jar
While editing global action.smali I can't find any thing u specified.
Have appached the file
.salil. said:
Hi @tdunham
I have been trying to add recovery option using or guide.
It goes well with framework-res.apk but stuck at android. policy.jar
While editing global action.smali I can't find any thing u specified.
Have appached the file
Click to expand...
Click to collapse
This doesn't look like it came from a touchwiz rom. What rom did you pull it from?
Re: [GUIDE][How-to] New Power Menu JB
tdunham said:
This doesn't look like it came from a touchwiz rom. What rom did you pull it from?
Click to expand...
Click to collapse
Uh its not touchwiz
Is there a way to get through
.salil. said:
Uh its not touchwiz
Is there a way to get through
Click to expand...
Click to collapse
The method is very different and I do not see too many similarities on how they created power menu in this one. I am only familiar with Touchwiz, maybe someone more familiar with the platform you are using could help using same principle but it would require a much different approach.
Re: [GUIDE][How-to] New Power Menu JB
tdunham said:
The method is very different and I do not see too many similarities on how they created power menu in this one. I am only familiar with Touchwiz, maybe someone more familiar with the platform you are using could help using same principle but it would require a much different approach.
Click to expand...
Click to collapse
Kk
Thanks anyway.
Sent from
my bullet proof revolver™ //"="" ````°.
I didn't see a post for this anywhere and didn't want to make a separate one since this is all TD's work. Here is the Power Mod for stock GB27. TD you can post this in the OP or do whatever you want with it. Your guide was excellent and I thank you for putting that together for us.
Download: GB27 Power Mod Deodexed http://tinyw.in/yMcu
MD5: 2df0540be214e3d85bac3eedea0c794d
GB27 Power Mod Odexed http://tinyw.in/9DXd
MD5: 4eddf84ad1cc6b50d36e281ae5be05bf
crawrj said:
I didn't see a post for this anywhere and didn't want to make a separate one since this is all TD's work. Here is the Power Mod for stock GB27. TD you can post this in the OP or do whatever you want with it. Your guide was excellent and I thank you for putting that together for us.
Download: GB27 Power Mod Deodexed http://tinyw.in/yMcu
MD5: 2df0540be214e3d85bac3eedea0c794d
GB27 Power Mod Odexed http://tinyw.in/9DXd
MD5: 4eddf84ad1cc6b50d36e281ae5be05bf
Click to expand...
Click to collapse
Just curious is there a screen shot of this? Wondering what options are in the power menu?
Sent from my SPH-D710 using Tapatalk 2
JonSCSL said:
Just curious is there a screen shot of this? Wondering what options are in the power menu?
Sent from my SPH-D710 using Tapatalk 2
Click to expand...
Click to collapse
It is the full power menu that is in the OP.
Long Press Back to Kill in JB
Credits to Mirko DDD in i9100 thread for the original guide for this.
Android.policy.jar changes
Add attached file PhoneWindowManager$KillConcept.smali to:
com/android/internal/policy/impl/
Smali edit:
com/android/internal/policy/impl/PhoneWindowManager.smali
Before:
Code:
.field final mAllowSystemUiDelay:Ljava/lang/Runnable;
.field mAssistKeyLongPressed:Z
After:
Code:
.field final mAllowSystemUiDelay:Ljava/lang/Runnable;
[COLOR="Red"].field mBackKillTimeout:Z
[/COLOR]
.field mAssistKeyLongPressed:Z
Before:
Code:
.line 1667
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$9;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$9;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
After:
Code:
.line 1667
[COLOR="Red"] new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$KillConcept;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$KillConcept;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
[/COLOR]
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
Before:
Code:
.line 7480
iput-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBootMsgDialog:Landroid/app/ProgressDialog;
.line 7619
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$35;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$35;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenLockTimeout:Ljava/lang/Runnable;
After:
Code:
.line 7480
iput-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBootMsgDialog:Landroid/app/ProgressDialog;
[COLOR="Red"]new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$KillConcept;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$KillConcept;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
[/COLOR]
.line 7619
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$35;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$35;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenLockTimeout:Ljava/lang/Runnable;
Before:
Code:
.line 3292
:cond_1cf
const/16 v47, 0x3
move/from16 v0, v27
move/from16 v1, v47
After:
Code:
.line 3292
:cond_1cf
[COLOR="Red"]const/16 v35, 0x4
move/from16 v0, v35
move/from16 v1, v27
if-ne v1, v0, :cond_mi
if-nez v9, :cond_mi
.line 1741
and-int/lit8 v35, v12, 0x20
if-nez v35, :cond_mi
.line 1742
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
move-object/from16 v35, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
move-object/from16 v1, v35
invoke-virtual {v1, v0}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
.line 1743
add-int/lit8 v35, v12, 0x20
move-object/from16 v0, p2
move/from16 v1, v35
invoke-static {v0, v1}, Landroid/view/KeyEvent;->changeFlags(Landroid/view/KeyEvent;I)Landroid/view/KeyEvent;
.line 1744
const/16 v35, 0x0
move/from16 v0, v35
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackKillTimeout:Z
.line 1752
:cond_mi
[/COLOR] const/16 v47, 0x3
move/from16 v0, v27
move/from16 v1, v47
Before:
Code:
.line 3680
.end local v10 #e:Landroid/os/RemoteException;
:cond_6ed
const/16 v47, 0xdb
move/from16 v0, v27
move/from16 v1, v47
After:
Code:
.line 3680
.end local v10 #e:Landroid/os/RemoteException;
:cond_6ed
[COLOR="Red"]const/16 v35, 0x4
move/from16 v0, v35
move/from16 v1, v27
if-ne v1, v0, :cond_mirko
.line 1863
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackKillTimeout:Z
move/from16 v35, v0
if-nez v35, :cond_mirko
if-eqz v9, :cond_mirko
if-nez v36, :cond_mirko
.line 1864
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
move-object/from16 v46, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
move-object/from16 v47, v0
invoke-static {}, Landroid/view/ViewConfiguration;->getGlobalActionKeyTimeout()J
move-result-wide v48
invoke-virtual/range {v46 .. v49}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
.line 1865
const/16 v34, 0x1
move/from16 v0, v35
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackKillTimeout:Z
.line 1875
:cond_mirko[/COLOR]
const/16 v47, 0xdb
move/from16 v0, v27
move/from16 v1, v47
Before:
Code:
.line 6695
:cond_931
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsMultiWindowEnabled:Z
move/from16 v29, v0
if-eqz v29, :cond_6a
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mEnableMultiWindowUISetting:I
move/from16 v29, v0
if-eqz v29, :cond_6a
After:
Code:
.line 6695
:cond_931
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsMultiWindowEnabled:Z
move/from16 v29, v0
[COLOR="Red"]if-eqz v29, :cond_968[/COLOR]
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mEnableMultiWindowUISetting:I
move/from16 v29, v0
[COLOR="Red"]if-eqz v29, :cond_968[/COLOR]
Hi,
do you still have the complete PhoneWindowManager.smali? I'm trying to port this, but my line numbers and conditions are way different. Did you edit other files in impl folder as well?
Thanks for any help.
tempdroid said:
Hi,
do you still have the complete PhoneWindowManager.smali? I'm trying to port this, but my line numbers and conditions are way different. Did you edit other files in impl folder as well?
Thanks for any help.
Click to expand...
Click to collapse
You wouldn't be able to use our smali, your phone wouldn't boot if you tried to use it.
Your line numbers and variables/conditions will not be exactly the same for porting. You must find the associated area that is as close to exact match and make the appropriate changes so it matches your code.
These guides were created for Jellybean. If you are trying to port this to a 4.2 or 4.3, 4.4 version I think the code will not be similar enough for you to port this.
Here is another thread that I got the guide from:
http://forum.xda-developers.com/showthread.php?t=1969499
tdunham said:
You wouldn't be able to use our smali, your phone wouldn't boot if you tried to use it.
Your line numbers and variables/conditions will not be exactly the same for porting. You must find the associated area that is as close to exact match and make the appropriate changes so it matches your code.
These guides were created for Jellybean. If you are trying to port this to a 4.2 or 4.3, 4.4 version I think the code will not be similar enough for you to port this.
Here is another thread that I got the guide from:
http://forum.xda-developers.com/showthread.php?t=1969499
Click to expand...
Click to collapse
Thanks, I know this and I know Mirko's guide, but his explanation is too short to find the corresponding lines as well. I don't want the smali to put it into my policy, but to compare and adapt, as you say "find the corresponding area"
Maybe you can upload, thank you.
Here is an older file that I could find. Hopefully it is enough.
Let me know if you get stuck.
tdunham said:
Here is an older file that I could find. Hopefully it is enough.
Let me know if you get stuck.
Click to expand...
Click to collapse
Thanks, I'll have a look at it.
tdunham said:
Here is an older file that I could find. Hopefully it is enough.
Let me know if you get stuck.
Click to expand...
Click to collapse
Hi mate, this file could not help me, because Samsung changed implementation massively, but I finally could manage, have a look:
Thanks.
JB Notification Panel Menu
While I really like the lidroid extended toggles, I have been interested in getting the stock extended toggles working now that there is capability to have the same features to rearrange & remove toggles (plus 4g is there in stock). However, this feature is not fully enabled on our JB build.
I need to know if this is enabled stock on any Samsung build so we can take a closer look at what might need to be done to get ours working.
The image is of a working Panel Menu that was ported over to the i9100.
BTW, the brightness slider toggle already works on our E4GT as shown.
\
{
"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"
}
Looks like I need this, I know a few including me that would like to have 4g toggle. I was reading earlier today about this somewhere. Ill see if I can find it, and Ill post
This video shows that the international s3 has this feature on the stock rom. I'll be downloading and looking for differences.
EDIT:
Just noticed 4.2.1 dropped for international sgs3 !
Sent from my SPH-L900 using Xparent Skyblue Tapatalk 2
elijahbrown said:
Click to expand...
Click to collapse
Yup, that's what I'm hoping for.
tdunham said:
Yup, that's what I'm hoping for.
Click to expand...
Click to collapse
I'm hoping I get some time to dig into this. Need to see if I can modify this stock version. Notice the lack of a 4g AND 3g toggle.
The Note 2 currently had no way to toggle any data. It is all done by the connection manager. Not that this phone is in need of it, I can get 24 hours with days constantly on and 3 hours screen time, but I don't like not having the control.
Sent from my SPH-L900 using Xparent Skyblue Tapatalk 2
anything going on with this mod?
comptonhubbard said:
anything going on with this mod?
Click to expand...
Click to collapse
Not yet, they have it working elsewhere but no luck for our phone yet.
Sent from my SPH-D710 using xda premium
tdunham said:
Not yet, they have it working elsewhere but no luck for our phone yet.
Sent from my SPH-D710 using xda premium
Click to expand...
Click to collapse
was looking forward to this mod...hopefully we get some action on this soon.
Didn't couple of early jb leaks for our phone have more toggles in pulldown than gb27?
===================
BluesRulez said:
Didn't couple of early jb leaks for our phone have more toggles in pulldown than gb27?
Click to expand...
Click to collapse
There were. We removed the options that were either unavailable or didn't work for our phone. The base code is the same across many different Samsung phones but not all the features work. Mainly because of hardware differences.
tdunham said:
There were. We removed the options that were either unavailable or didn't work for our phone. The base code is the same across many different Samsung phones but not all the features work. Mainly because of hardware differences.
Click to expand...
Click to collapse
looks like we're at a standstill with this....did jb source help any?
I noticed some on GT-I9100 forum successfully added extra toggles in Settings -> Display -> Notification panel section (airplane, torch and notifications).
Credits to:
- shoman94
- jeboo
- Mirko_ddd
Click to expand...
Click to collapse
I tried to study xml and smali and resources changes in order to port it to other JellyBean 4.1.2 ROMs..
I consulted Mirko_ddd that had succeed adding new toggles in his custom ROM
Here are the changes that I noticed:
1) For SystemUI.apk:
- I added extra resources images to "drawable-xhdpi" folder [tw_quick_panel_icon_flashlight_off.png] and [tw_quick_panel_icon_flashlight_on.png] other for airplane and notifications are already there.
- I added the following strings to strings.xml in values folder:
Code:
<string name="quickpanel_flashlight_text">Torch</string>
other strings for airplane and notifications are already there.
- Then I recompiled SystemUI.apk again to generate new ids in public.xml files then decompile the new SystemUI.apk
- Then I added [FlashlightQuickSettingButton.smali] file to SystemUI.apk\smali\com\android\systemui\statusbar\policy\quicksetting folder
- Then I opened this smali and changes the 3 ids that starts with 0x7f?????? with new ids generated in public.xml in the following orders:
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.parameter "context"
.prologue
const/4 v6, 0x0
.line 35
const/4 v2, 0x0
const v3, [B][COLOR="Red"]0x7f0a014c[/COLOR] [COLOR="Green"]<!-- id of quickpanel_flashlight_text[/COLOR][/B]
const v4, [B][COLOR="Red"]0x7f020280[/COLOR] [COLOR="Green"]<!-- id of tw_quick_panel_icon_flashlight_on[/COLOR][/B]
const v5, [B][COLOR="Red"]0x7f02027f[/COLOR] [COLOR="Green"]<!-- id of tw_quick_panel_icon_flashlight_off[/COLOR][/B]
move-object v0, p0
- Then I recompiled the finished SystemUI project.
2) For SecSettings.apk:
- I added extra resources images to "drawable-xhdpi" folder [notification_panel_airplane.png] and [notification_panel_flashlight.png] and [notification_panel_notification.png]
- Then I added these strings to strings.xml in values folder:
Code:
<string name="notification_panel_flashlight">Torch</string>
<string name="notification_panel_airplane">Airplane Mode</string>
<string name="notification_panel_notification">Notifications</string>
- Then I navigated to SecSettings.apk\smali\com\android\settings folder and open NotificationPanel.smali file.
- I searched for ".method public MakeConvertPanelName()V" and I added these lines (the blue ones):
Code:
.method public MakeConvertPanelName()V
.locals 3
.prologue
.line 119
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Wifi"
const-string v2, "notification_panel_wifi"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
..
..
..
const-string v1, "Sync"
const-string v2, "notification_panel_sync"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[B][COLOR="RoyalBlue"] .line 154
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Flashlight"
const-string v2, "notification_panel_flashlight"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 155
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "AirplaneMode"
const-string v2, "notification_panel_airplane"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 156
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "DoNotDisturb"
const-string v2, "notification_panel_notification"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;[/COLOR][/B]
.line 135
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 136
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_wifi"
const-string v2, "Wifi"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 137
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_gps"
const-string v2, "Location"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
..
..
..
.line 151
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_sync"
const-string v2, "Sync"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[B][COLOR="RoyalBlue"] .line 155
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_flashlight"
const-string v2, "Flashlight"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 156
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_airplane"
const-string v2, "AirplaneMode"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 157
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_notification"
const-string v2, "DoNotDisturb"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[/COLOR][/B]
.line 152
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_empty"
const-string v2, "Empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 153
return-void
.end method
- Then I recompiled the finished project...
Then I pushed SystemUI.apk and SecSettings.apk and Torch.apk to my phone and I fixed permissions, but still I have no extra toggles in Settings -> Display -> Notification panel section..
I consulted Mirko_ddd again and he said:
Now only thing left is to update the database (db).
U need to add nu quick panels name to database helper in secsettingsprovider.apk
In res string.xml
Database will load only once so need a wipe to take effect.
Click to expand...
Click to collapse
I added the new toggles name to strings in SecSettingsProvider.apk like what he did:
Code:
<string name="def_active_notification_list">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;MultiWindow;Sync</string>
<string name="def_candidate_notification_list">AirplaneMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;AllShareCast;Sync;</string>
<string name="def_candidate_notification_list_tablet">DrivingMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet_vzw">Bluetooth;Location;SilentMode;AirplaneMode;AutoRotate;PowerSaving;SmartStay;DrivingMode;AllShareCast;Sync;</string>
<string name="def_candidate_notification_list_tablet_vzw">Wifi;MobileData;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet_spr">Wifi;Bluetooth;Location;SilentMode;AutoRotate;AirplaneMode;PowerSaving;AllShareCast;Empty;Empty;</string>
<string name="def_candidate_notification_list_tablet_spr">MobileData;DormantMode;Sync;DrivingMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;</string>
<string name="def_country_code">011</string>
<string name="def_active_notification_list_q1">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;MultiWindow;Sync;</string>
<string name="def_candidate_notification_list_q1">DrivingMode;SmartStay;Flashlight;AirplaneMode;DoNotDisturb;Empty;Empty;Empty;Empty;Empty;</string>
But doing these changes and doing full wipe to phone in order to load new database give me bootloop!!! So wild thinking, I think I missed something in DatabaseHelper.smali itself in SecSettingsProvider.apk..
This is what I have reached to.. and I hope someone can get benifit from it and continue from where I stuck on (SecSettingsProvider.apk),,,
Resources are in the attachment
Cheers
majdinj said:
I noticed some on GT-I9100 forum successfully added extra toggles in Settings -> Display -> Notification panel section (airplane, torch and notifications).
I tried to study xml and smali and resources changes in order to port it to other JellyBean 4.1.2 ROMs..
I consulted Mirko_ddd that had succeed adding new toggles in his custom ROM
Here are the changes that I noticed:
1) For SystemUI.apk:
- I added extra resources images to "drawable-xhdpi" folder [tw_quick_panel_icon_flashlight_off.png] and [tw_quick_panel_icon_flashlight_on.png] other for airplane and notifications are already there.
- I added the following strings to strings.xml in values folder:
Code:
<string name="quickpanel_flashlight_text">Torch</string>
other strings for airplane and notifications are already there.
- Then I recompiled SystemUI.apk again to generate new ids in public.xml files then decompile the new SystemUI.apk
- Then I added [FlashlightQuickSettingButton.smali] file to SystemUI.apk\smali\com\android\systemui\statusbar\policy\quicksetting folder
- Then I opened this smali and changes the 3 ids that starts with 0x7f?????? with new ids generated in public.xml in the following orders:
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.parameter "context"
.prologue
const/4 v6, 0x0
.line 35
const/4 v2, 0x0
const v3, [B][COLOR="Red"]0x7f0a014c[/COLOR] [COLOR="Green"]<!-- id of quickpanel_flashlight_text[/COLOR][/B]
const v4, [B][COLOR="Red"]0x7f020280[/COLOR] [COLOR="Green"]<!-- id of tw_quick_panel_icon_flashlight_on[/COLOR][/B]
const v5, [B][COLOR="Red"]0x7f02027f[/COLOR] [COLOR="Green"]<!-- id of tw_quick_panel_icon_flashlight_off[/COLOR][/B]
move-object v0, p0
- Then I recompiled the finished SystemUI project.
2) For SecSettings.apk:
- I added extra resources images to "drawable-xhdpi" folder [notification_panel_airplane.png] and [notification_panel_flashlight.png] and [notification_panel_notification.png]
- Then I added these strings to strings.xml in values folder:
Code:
<string name="notification_panel_flashlight">Torch</string>
<string name="notification_panel_airplane">Airplane Mode</string>
<string name="notification_panel_notification">Notifications</string>
- Then I navigated to SecSettings.apk\smali\com\android\settings folder and open NotificationPanel.smali file.
- I searched for ".method public MakeConvertPanelName()V" and I added these lines (the blue ones):
Code:
.method public MakeConvertPanelName()V
.locals 3
.prologue
.line 119
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Wifi"
const-string v2, "notification_panel_wifi"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
..
..
..
const-string v1, "Sync"
const-string v2, "notification_panel_sync"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[B][COLOR="RoyalBlue"] .line 154
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Flashlight"
const-string v2, "notification_panel_flashlight"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 155
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "AirplaneMode"
const-string v2, "notification_panel_airplane"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 156
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "DoNotDisturb"
const-string v2, "notification_panel_notification"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;[/COLOR][/B]
.line 135
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 136
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_wifi"
const-string v2, "Wifi"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 137
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_gps"
const-string v2, "Location"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
..
..
..
.line 151
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_sync"
const-string v2, "Sync"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[B][COLOR="RoyalBlue"] .line 155
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_flashlight"
const-string v2, "Flashlight"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 156
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_airplane"
const-string v2, "AirplaneMode"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 157
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_notification"
const-string v2, "DoNotDisturb"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[/COLOR][/B]
.line 152
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_empty"
const-string v2, "Empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 153
return-void
.end method
- Then I recompiled the finished project...
Then I pushed SystemUI.apk and SecSettings.apk and Torch.apk to my phone and I fixed permissions, but still I have no extra toggles in Settings -> Display -> Notification panel section..
I consulted Mirko_ddd again and he said:
I added the new toggles name to strings in SecSettingsProvider.apk like what he did:
Code:
<string name="def_active_notification_list">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;MultiWindow;Sync</string>
<string name="def_candidate_notification_list">AirplaneMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;AllShareCast;Sync;</string>
<string name="def_candidate_notification_list_tablet">DrivingMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet_vzw">Bluetooth;Location;SilentMode;AirplaneMode;AutoRotate;PowerSaving;SmartStay;DrivingMode;AllShareCast;Sync;</string>
<string name="def_candidate_notification_list_tablet_vzw">Wifi;MobileData;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet_spr">Wifi;Bluetooth;Location;SilentMode;AutoRotate;AirplaneMode;PowerSaving;AllShareCast;Empty;Empty;</string>
<string name="def_candidate_notification_list_tablet_spr">MobileData;DormantMode;Sync;DrivingMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;</string>
<string name="def_country_code">011</string>
<string name="def_active_notification_list_q1">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;MultiWindow;Sync;</string>
<string name="def_candidate_notification_list_q1">DrivingMode;SmartStay;Flashlight;AirplaneMode;DoNotDisturb;Empty;Empty;Empty;Empty;Empty;</string>
But doing these changes and doing full wipe to phone in order to load new database give me bootloop!!! So wild thinking, I think I missed something in DatabaseHelper.smali itself in SecSettingsProvider.apk..
This is what I have reached to.. and I hope someone can get benifit from it and continue from where I stuck on (SecSettingsProvider.apk),,,
Resources are in the attachment
Cheers
Click to expand...
Click to collapse
please say how to add notification panel setting in settings menu for i9100 ? i open secsettings.apk and notification menu found other roms. but can not put my apk. i get an error. please help me. which files I need to put where. Can you tell us more
citymen34 said:
please say how to add notification panel setting in settings menu for i9100 ? i open secsettings.apk and notification menu found other roms. but can not put my apk. i get an error. please help me. which files I need to put where. Can you tell us more
Click to expand...
Click to collapse
I didn't manage to have extra toggles by the original way :crying:
You can check Mirko_ddd custom ROM (DisaterROM) that has extra toggles enabled by him
majdinj said:
I didn't manage to have extra toggles by the original way :crying:
You can check Mirko_ddd custom ROM (DisaterROM) that has extra toggles enabled by him
Click to expand...
Click to collapse
When you diff the original SecSettingsProvider.apk of the S2 and the modified ones, there are changes in Database*. smali and in two or three files in res/values folder. But applying the changes myself will always lead to bootloop after factory reset.
majdinj said:
I noticed some on GT-I9100 forum successfully added extra toggles in Settings -> Display -> Notification panel section (airplane, torch and notifications).
I tried to study xml and smali and resources changes in order to port it to other JellyBean 4.1.2 ROMs..
I consulted Mirko_ddd that had succeed adding new toggles in his custom ROM
Here are the changes that I noticed:
1) For SystemUI.apk:
- I added extra resources images to "drawable-xhdpi" folder [tw_quick_panel_icon_flashlight_off.png] and [tw_quick_panel_icon_flashlight_on.png] other for airplane and notifications are already there.
- I added the following strings to strings.xml in values folder:
Code:
<string name="quickpanel_flashlight_text">Torch</string>
other strings for airplane and notifications are already there.
- Then I recompiled SystemUI.apk again to generate new ids in public.xml files then decompile the new SystemUI.apk
- Then I added [FlashlightQuickSettingButton.smali] file to SystemUI.apk\smali\com\android\systemui\statusbar\policy\quicksetting folder
- Then I opened this smali and changes the 3 ids that starts with 0x7f?????? with new ids generated in public.xml in the following orders:
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.parameter "context"
.prologue
const/4 v6, 0x0
.line 35
const/4 v2, 0x0
const v3, [B][COLOR="Red"]0x7f0a014c[/COLOR] [COLOR="Green"]<!-- id of quickpanel_flashlight_text[/COLOR][/B]
const v4, [B][COLOR="Red"]0x7f020280[/COLOR] [COLOR="Green"]<!-- id of tw_quick_panel_icon_flashlight_on[/COLOR][/B]
const v5, [B][COLOR="Red"]0x7f02027f[/COLOR] [COLOR="Green"]<!-- id of tw_quick_panel_icon_flashlight_off[/COLOR][/B]
move-object v0, p0
- Then I recompiled the finished SystemUI project.
2) For SecSettings.apk:
- I added extra resources images to "drawable-xhdpi" folder [notification_panel_airplane.png] and [notification_panel_flashlight.png] and [notification_panel_notification.png]
- Then I added these strings to strings.xml in values folder:
Code:
<string name="notification_panel_flashlight">Torch</string>
<string name="notification_panel_airplane">Airplane Mode</string>
<string name="notification_panel_notification">Notifications</string>
- Then I navigated to SecSettings.apk\smali\com\android\settings folder and open NotificationPanel.smali file.
- I searched for ".method public MakeConvertPanelName()V" and I added these lines (the blue ones):
Code:
.method public MakeConvertPanelName()V
.locals 3
.prologue
.line 119
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Wifi"
const-string v2, "notification_panel_wifi"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
..
..
..
const-string v1, "Sync"
const-string v2, "notification_panel_sync"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[B][COLOR="RoyalBlue"] .line 154
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Flashlight"
const-string v2, "notification_panel_flashlight"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 155
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "AirplaneMode"
const-string v2, "notification_panel_airplane"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 156
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "DoNotDisturb"
const-string v2, "notification_panel_notification"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;[/COLOR][/B]
.line 135
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "Empty"
const-string v2, "notification_panel_empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 136
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_wifi"
const-string v2, "Wifi"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 137
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_gps"
const-string v2, "Location"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
..
..
..
.line 151
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_sync"
const-string v2, "Sync"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[B][COLOR="RoyalBlue"] .line 155
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_flashlight"
const-string v2, "Flashlight"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 156
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_airplane"
const-string v2, "AirplaneMode"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 157
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_notification"
const-string v2, "DoNotDisturb"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
[/COLOR][/B]
.line 152
iget-object v0, p0, Lcom/android/settings/NotificationPanel;->mConvertPanelItemstring:Ljava/util/HashMap;
const-string v1, "notification_panel_empty"
const-string v2, "Empty"
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 153
return-void
.end method
- Then I recompiled the finished project...
Then I pushed SystemUI.apk and SecSettings.apk and Torch.apk to my phone and I fixed permissions, but still I have no extra toggles in Settings -> Display -> Notification panel section..
I consulted Mirko_ddd again and he said:
I added the new toggles name to strings in SecSettingsProvider.apk like what he did:
Code:
<string name="def_active_notification_list">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;MultiWindow;Sync</string>
<string name="def_candidate_notification_list">AirplaneMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;AllShareCast;Sync;</string>
<string name="def_candidate_notification_list_tablet">DrivingMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet_vzw">Bluetooth;Location;SilentMode;AirplaneMode;AutoRotate;PowerSaving;SmartStay;DrivingMode;AllShareCast;Sync;</string>
<string name="def_candidate_notification_list_tablet_vzw">Wifi;MobileData;Flashlight;Empty;Empty;Empty;Empty;Empty;Empty;Empty;</string>
<string name="def_active_notification_list_tablet_spr">Wifi;Bluetooth;Location;SilentMode;AutoRotate;AirplaneMode;PowerSaving;AllShareCast;Empty;Empty;</string>
<string name="def_candidate_notification_list_tablet_spr">MobileData;DormantMode;Sync;DrivingMode;SmartStay;Flashlight;Empty;Empty;Empty;Empty;</string>
<string name="def_country_code">011</string>
<string name="def_active_notification_list_q1">Wifi;Location;SilentMode;AutoRotate;Bluetooth;MobileData;DormantMode;PowerSaving;MultiWindow;Sync;</string>
<string name="def_candidate_notification_list_q1">DrivingMode;SmartStay;Flashlight;AirplaneMode;DoNotDisturb;Empty;Empty;Empty;Empty;Empty;</string>
But doing these changes and doing full wipe to phone in order to load new database give me bootloop!!! So wild thinking, I think I missed something in DatabaseHelper.smali itself in SecSettingsProvider.apk..
This is what I have reached to.. and I hope someone can get benifit from it and continue from where I stuck on (SecSettingsProvider.apk),,,
Resources are in the attachment
Cheers
Click to expand...
Click to collapse
This is the work of jeboo and I for our rom. I gave it to mirko some we share some mods. Make sure credit is given correctly. ... Thanks
Sent from my SAMSUNG-SGH-I337 using Tapatalk 4 Beta
shoman94 said:
This is the work of jeboo and I for our rom. I gave it to mirko some we share some mods. Make sure credit is given correctly. ... Thanks
Sent from my SAMSUNG-SGH-I337 using Tapatalk 4 Beta
Click to expand...
Click to collapse
Oh.. sorry I didn't mean to be rude man, but I saw it in DisasterROM of Mirko_ddd, so I started to investigate it,,,
I didn't know that was you shoman94 :laugh:
Also I post it here because I couldn't have it to work by doing these changes (of course I compare smali myself so I though there was a mistake, so I asked Mirko; I didn't intend to steal anyone work so that's why I said credits to Mirko which turned to be you man and jeboo, anyhow I will correct that post)
So do you know what is wrong with smali code here??
majdinj said:
Oh.. sorry I didn't mean to be rude man, but I saw it in DisasterROM of Mirko_ddd, so I started to investigate it,,,
I didn't know that was you shoman94 :laugh:
Also I post it here because I couldn't have it to work by doing these changes (of course I compare smali myself so I though there was a mistake, so I asked Mirko; I didn't intend to steal anyone work so that's why I said credits to Mirko which turned to be you man and jeboo, anyhow I will correct that post)
So do you know what is wrong with smali code here??
Click to expand...
Click to collapse
No problem! I'm actually glad you made the notes. I'm working on 4.2.2 now, and will hopefully have a version that doesn't require SecSettingsProvider patch (thus no more wipe!).
would be pretty cool since i dont use the 4g toggle and would like to have a 3g one