yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Nexus] walkamake:
kahvitahra, thanks.

I merged this power menu, volume skip and volume wake from evilisto. But 2 last mods conflict. When I press volume button when screen off music track switch to another but screen toggle on too. Do you know how to fix this?
[Samsung Galaxy Nexus] xIC-MACIx:
Yes, my smali code uses that image.

So I take it you haven't decompiled w/ Smali?

If you look in my sig there is a Smali tool by me that does the command line stuff for you.

If you want to use another image, decompile w/ baksmali & open globalactions.smali. Search for globalactions$10 to find the array value and its two public IDs (first is image & second is string). Just edit to point to your new image's id from public.xml

And I don't really have plans for a screenshot option since vol down & pwr is much handier. If I have time I might throw something together. I still need to get a odexed version of this mod first...
[Samsung Galaxy Nexus] kahvitahra:
You should add lines before that volumewake mod that looks if music is playing and skips that mod if it is playing.

I don't know what lines are for that mod, but for example at PhoneWindowManager.smali in ".method public interceptKeyBeforeQueueing" before added " volume rocker " mods lines, there is following code

invoke-virtual {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z

move-result v12

if-eqz v12, :cond_20

In that it looks if music is active and if it's not, it will skip to :cond_20.

So you want something similiar, but you should change that "if-eqz" to "if-nez", then it will skip to wanted cond_?? when music is active. Of course you have to also change variables and conds that fits code in your method etc.

You could try that. It might work :)

EDIT. Little OT here, but i hope that it's ok to xIC-MACIx :)

EDIT2. So this all just guessing, since i haven't looked changes for that volumewake.
[Samsung Galaxy Nexus] xIC-MACIx:
Nah it's not off topic, any discussion to make this mod more universal is welcome!

@walkamake - once you get volume skip and volume wake working together you should post your source! :victory:

I won't be able to merge in volume wake till later tonight...

-Mac
[Samsung Galaxy Nexus] walkamake:
kahvitahra

I'm noob in smali. For volume wake I just delete 2 strings in KeyguardViewMediator.smali, so I have no idea how to use your advice.

xIC-MACIx

and question to you :)

I have busybox installed from kitchen, but reboot into download mode don't works. I need to install busybox from market or how can I get working reboot into download?
[Samsung Galaxy Nexus] xIC-MACIx:
Easiest way is to download busybox installer from play store; choose the latest version & advanced install. Make sure all applets are selected & that the "symlink" box is checked for all.

Yeah, so I'm no expert, but I know my way around smali code, so here goes...

To make this work, don't we just need to add and "if-nez" statement to ".method private isWakeKeyWhenKeyguardShowing" that decides whether input is a long press or a simple click?

Would the method "handleVolumeLongPress" have to be added to KeyguardViewMediator or is it possible to just point to it in PhoneWindowManager?

Maybe something like this:

.method private isWakeKeyWhenKeyguardShowing(IZ)Z
.registers 3
.parameter "keyCode"
.parameter "isDocked"

.prologue
.line 889
if-nez v##, :cond_99 [I] //v## would be where the long press method is located[/I]

.line 890
sparse-switch p1, :sswitch_data_8 //[I]moved the switch-statement beneath the if-statement so it doesn't enter any cases[/I]

.line 911
const/4 p2, 0x1

.end local p2
:goto_4
:sswitch_4
return p2

.line 909
.restart local p2
:sswitch_5
const/4 p2, 0x0

goto :goto_4

.line 889
:cond_99 // "if long press, do nothing (nop) condition"
nop

:sswitch_data_8
.sparse-switch
0x1b -> :sswitch_5
0x4f -> :sswitch_5
0x55 -> :sswitch_5
0x56 -> :sswitch_5
0x57 -> :sswitch_5
0x58 -> :sswitch_5
0x59 -> :sswitch_5
0x5a -> :sswitch_5
0x5b -> :sswitch_5
0x7e -> :sswitch_5
0x7f -> :sswitch_5
0x82 -> :sswitch_5
0xa4 -> :sswitch_4
.end sparse-switch
.end method

-Mac
[Samsung Galaxy Nexus] niamul:
Thanks
[Samsung Galaxy Nexus] kahvitahra:
You can call it from KeyguardMediator, but i don't think that method will do it. I think easiest would be to see if music is active and then do something else. Can't really tell nothing for sure until i have time to test some stuff.. I'm not expert ether :)

I think you can't skip that hole method?

Before that " if-nez v##, :cond_99" you should add voke and move that object to some variable what you are refering in that. Something like what i wrote previous post.

I'll get back on this. Now i have to run :)
[Samsung Galaxy Nexus] xIC-MACIx:
Alright, cool thanks for checking it out.

I hear ya, I'm modded out for the night...err...morning haha
[Samsung Galaxy Nexus] Basian Mile:
Thank you. But i still have some Question/Problems.

I took the "android.policy.jar" from OP with Volume Skip Mod and the PowerMenu.

I decompiled it. I opened "globalactions.smali". i go to found "globalactions$10".

I see now this:

And so i get that "1080576" is pointing to following line in my "public.xml":

So "ic_lock_recovery.png" is the Image which will show for "Reboot" in PowerMenu. Right?

I use a Blue Image for that png and it is not showing (still a white one), like u see in Screenshot of me.

I think i do something wrong. I hope you dont get tired helping me cause i really like to learn.
[Samsung Galaxy Nexus] xIC-MACIx:
@Basilan

It looks like your framework has been edited to add a reboot image, not sure why that changed an existing resource ID.

Just find the image name I posted a page back and get its ID hex # in your public.xml and replace the current one with that #. Make sure to leave out the '0' after '0x' when copying the # into smali.

Also, haven't had a chance to mess with adding volume wake yet, might get some time tomorrow...
[Samsung Galaxy Nexus] Basian Mile:
Yes, the framework was edited to work with another PowerMenu.

But i still dont understand why the wrong Image is showing for me.

In ur "android.policy.jar" it says that "1080576" is used for png.

And that is "ic_lock_recovery.png". This Image is blue. And it still shows the white one. So it shows "ic_dialog_alert_holo_dark.png” even the Hex is not pointing to that.
[Samsung Galaxy Nexus] xIC-MACIx:
Lol well I got that hex value from the stock untouched framework-res.apk from 4.1.1 & "ic_lock_recovery.png" does not exist in stock 4.1.1; it sounds like the framework-res.apk you have decompiled is not the same one you have on your phone.

I would adb pull framework-res.apk straight from /system/framework and re-decompile and see if that's the case. (Hell, I would grab a stock 4.1.1 copy of framework too so you can see the image matched with the right ID)

The hex value is right, if it wasn't, the .png image the code is pointing to wouldn't be showing, does that make sense? The code doesn't lie brotha lol...

-Mac
[Samsung Galaxy Nexus] Basian Mile:
Maybe you take a few Minutes time and take a look at my 2 Files iam using.

http://dl.dropbox.com/u/1084746/SGS/myset.zip

Then you will see what i mean.
[Samsung Galaxy Nexus] xIC-MACIx:
Okay, I'm not sure what your doing wrong, but I just decompiled your framework-res.apk and baksmalied your android.policy.jar.

Here's a copy/paste of EXACTLY what your files show:

framework-res.apk:

<public type="drawable" name="ic_dialog_alert_holo_dark" id="0x0[COLOR="red"][B]10802c0[/B][/COLOR]" />

<public type="drawable" name="ic_lock_recovery" id="0x0[COLOR="Red"][B]1080576[/B][/COLOR]" />

android.policy.jar:

new-instance v2, Lcom/android/internal/policy/impl/[COLOR="red"][B]GlobalActions$10[/B][/COLOR];

const v3, 0x[COLOR="red"][B]10802c0[/B][/COLOR]

const v4, 0x[COLOR="red"][B]104033a[/B][/COLOR]

move-object/from16 v0, p0

invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/[COLOR="red"][B]GlobalActions$10[/B][/COLOR];-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

As you can see, you files point to exactly what I said they did. Like I said, my source is just fine man....

Apparently your just not looking at the right code. You need slow down a bit and take the files you just sent me and actually decompile them. Don't use any existing decompiles you have...

-Mac
[Samsung Galaxy Nexus] Basian Mile:
I always decompile new for every Mod iam doing.

Apparently i dont look at the right code in the policy file. Can you point me pls to the exact position of what you showed there.
[Samsung Galaxy Nexus] xIC-MACIx:
Open Globalactions.smali and search for the lines I posted. Even better you can search for "0x10802c0" which is the ID for ic_dialog_alert_holo_dark.

Also, I would go ahead and take your ic_dialog_alert_holo_dark image and make it blue. That's really all you need to do b/c the code is working you just haven't themed that particular image yet lol

-Mac
[Samsung Galaxy Nexus] Basian Mile:
Of course i have already change it to blue. :)

But its not just that. I want to learn and understand.

Tomorrow i will take a look again and search it. Thank you.

I will report back.
[Samsung Galaxy Nexus] xIC-MACIx:
Yeha man I completely understand; smali is a spawn of hell haha it takes a while to get a grasp it.

These link helped me out and I still use them quite a bit:

LINK

LINK

LINK

-Mac
[Samsung Galaxy Nexus] c_zal:
xIC-MACIx, I like the battery icon on the screen shot. care to share.. I'm using JellyBelly v3
[Samsung Galaxy Nexus] xIC-MACIx:
Here ya go: LINK

Back up your original systemUI.apk, idk what existing mods JellyBelly has.

-Mac
[Samsung Galaxy Nexus] Basian Mile:
Ok...Shame goes all to me...I was looking again and looking again what is my fault.

And then....suddenly a Lamp comes over my Head and enlighten me that there is a classes.dex file in my Folder which is a wrong one. And i always thought that the Baksmali is decompiling my ".jar" file instead of the ".dex". But i was so wrong and it was just that simple. Normaly i know that i need to get the dex file out of the jar but i dont know why i have not do that.

Soory to take your time but know its clear to me.

Anyway...Could you pls add the Screenshot Function to the PowerMenu? Iam really not able to do that.

And is it possible to Mod the VolumeSkip a bit like that:

Now when screen is on and i press long on volume - or + the Loudness get fast high or low.

I like to have long press, when screen is on, will skip track when music is on. Just like on screen out in your fantastic Mod here.
[Samsung Galaxy Nexus] xIC-MACIx:
Yeah, classes.dex is what is decompiled, sorry I don't think I ever mentioned that tad bit of info.

Yeah when I get some time I'll at screenshot & long press skip with screen on. I'm taking a summer biz calc class so i'm a little busy around this time of the week.
[Samsung Galaxy Nexus] Basian Mile:
If you could do that many People will be Happy :) Including me.

But take your time....
[Samsung Galaxy Nexus] kahvitahra:
IIRC that volume track skip caused conlict that you could not change volume while talking in call and sensor have turned screen off. That's why there was added line that skips this mod if screen is on.

This was in early gb roms, so there might have things changed since then. But just a little heads up that you know to check it :)
[Samsung Galaxy Nexus] destinydmm:
I tried to flash the Volume MOD on AOKP JB preview #3 but it put me in a boot loop. Any idea why this wouldn't work with that JB ROM/build?
[Samsung Galaxy Nexus] xIC-MACIx:
Because aokp uses heavily modified framework files. Flashing this basically puts a stock aosp file on a cm10 sourced ROM. Which means some aokp mods essential to the phone booting up are no longer there.
[Samsung Galaxy Nexus] reference.phone:
Hi xIC-MACIx

Thanks for these great works! If you have time, plz give us the gude like http://rootzwiki.com/topic/30278-how-to-step-by-step-guide-to-add-menu-and-search-soft-keys/
[Samsung Galaxy Nexus] kahvitahra:
Hi!

I wrote how to - in gs2 section ( check op for link ). Its pretty much same, just add reboot button to globalactions.smali and use extra files from this threads android.policy.. not the ones from my thread. Only thing changed in those are shutdownthreads location and ids of course. :)
[Samsung Galaxy Nexus] xIC-MACIx:
There is a link in the OP already to Kahvitahra's tut.

Here's the OP context w/ the link:
[Samsung Galaxy Nexus] tristan202:
Doesn't work for me running thunderstick 1.0.5. Volume longpress down skips back as supposed, but volume up just turns screen on.
[Samsung Galaxy Nexus] reference.phone:
Many thanks kahvitahra and xIC-MACIx

decompile android.policy.jar, edit and recompile

1. Copy attached folder to yours

2. /com/android/internal/policy/impl/GlobalActions.smali

find "0x1080030"

and paste following code after "invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z"

new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$99;

const v3, 0x10802c0

const v4, 0x104033a

move-object/from16 v0, p0

invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

(kahvitahra: $99 / xIC-MACIx: $10)

Is that "add reboot button"?

3. /com/android/internal/policy/impl/GlobalActions$SinglePressAction.smali

-Before line "# instance fields"

paste following code

# static fields
.field protected static rebootMode:I

.field protected static final rebootOptions:[Ljava/lang/String;

-Then after line "# direct methods"

paste following code

.method static constructor <clinit>()V
.registers 3

const/4 v0, 0x4

new-array v0, v0, [Ljava/lang/String;

const/4 v1, 0x0

const-string v2, "Reboot"

aput-object v2, v0, v1

const/4 v1, 0x1

const-string v2, "Hot Boot"

aput-object v2, v0, v1

const/4 v1, 0x2

const-string v2, "Bootloader"

aput-object v2, v0, v1

const/4 v1, 0x3

const-string v2, "Recovery"

aput-object v2, v0, v1

sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;

return-void
.end method

※ busybox needed

correct?

Edit : Thanks again :)
[Samsung Galaxy Nexus] xIC-MACIx:
Sounds like you've got the volume wake mod also. Figured out last night that CM source has these two working together so maybe I can look into it
[Samsung Galaxy Nexus] xIC-MACIx:
Yeah step two is the reboot button. Just add it after the power button which is globalactions$3 I think.

There is also info in K's tut that shows how to add or remove the popup titles for reboot options.
[Samsung Galaxy Nexus] Basian Mile:
I just want to ask again for Screenshot Button.

http://xdaforums.com/showpost.php?p=29107149&postcount=86

Any time to do it?
[Samsung Galaxy Nexus] fansulaw:
Rom Supported

Hi All,

May I please ask if the vol skip mod works on Resurrection Rom 3.0.5 (JB4.1.1)??

Many Thanks
[Samsung Galaxy Nexus] mobidzid:
Is it compatible with 4.1.2?
[Samsung Galaxy Nexus] m4a1rifle:
Interested to know as well, this is the last thing i missed moving from 4.1.1 to 4.1.2.
[Samsung Galaxy Nexus] ChrisRaabe:
it's compatible with 4.1.2

Hi,

I've just installed APM on my Galaxy Nexus with JZ054K by teshxx. It works fine as before ;)

Chr!s
[Samsung Galaxy Nexus] m4a1rifle:
The file size of original android.policy.jar of Android 4.1.1 and 4.1.2 is different seems to suggest that there are changes in the jar file. And I think the APM is based on the original android.policy.jar, so the changes in 4.1.2 is not included.
[Samsung Galaxy Nexus] gaich:
On 4.1.2.it works only if you choose pattern unlock. with slide unlock it does not open anything from the lockscreen. All the icons of the ring become active, but you cannot use them. I tried this mod and other from there (i think it`s the same). I tried to replace 3 smali files of my android.policy with the three files from this thread (PhoneWindowManager, PhoneWindowManager$22, PhoneWindowManager$21) and my phone stucks on the bootlogo. The same if I change PhoneWindowManager only. Is it possible to make anything?:crying:
[Samsung Galaxy Nexus] Khizar:
flashed just the epm on bigxies 4.1.2 stock rom and it works perfectly
[Samsung Galaxy Nexus] navien:
Any chance of an updated version of this volume skip mod?

As the size of android.policy.jar has changed from 4.1.1 to 4.1.2 there must be differences in the content which i do not want to override with the 'old' content from the 4.1.1 mod.
[Samsung Galaxy Nexus] xIC-MACIx:
I looked through the code edits and compared with 4.1.2. While they are very similar, 4.1.2 uses different values in some of the code functions. If you find any issues, that is most likely the case.

Yupp, definitely some small changes here and there, I've done the reboot mod so far. I'm going to take another look tonight to compare stock 4.1.1 and 4.1.2 code a bit more, shouldn't take long at all.

Edit: Also, I'm running CM10 ATM and don't think it is necessary to flash stock 4.1.2 to test this. So if someone could test and report back here when I get the mods uploaded tonight, that would be fantastic!

- Mac
[Samsung Galaxy Nexus] xIC-MACIx:
4.1.2 Version are now available for download in the OP

Made from STOCK DEODEXED 4.1.2!

I haven't tested these, but as I said in the above post, there is nothing conflicting enough to cause problems. Same as before, there are 3 different zip files. Pick one and flash in recovery.

WARNING: If you have any other mods that use android.policy.jar, this mod will conflict and cause issues!

- Mac
[Samsung Galaxy Nexus] gaich:
With my rom the same problem with 4.1.2 volumeskip only mod, as I described above, although I do not use other mods containing androidpolicy.jar.

The lockscreen freezes and doesn`t allow to open anything.

Can anybody tell me what`s wrong, please? There is the original file.View attachment android.policy.jar Thank you.
[Samsung Galaxy Nexus] xIC-MACIx:
What rom are you running? I used a cdma stock 4.1.2 deodexed build for this mod.

The code for the lockscreen is located in androidpolicy.jar, so if the rom you are on is in any way different from stock AOSP, things like this happen.

-Mac
[Samsung Galaxy Nexus] navien:
Wow. That was a fast response!

I've installed the combined mod on stock rom. Track skipping and the reboot menu are working! No other issues so far (and are not expected).

Many thanks for the update!
[Samsung Galaxy Nexus] terenceleechan:
Combined 4.1.2 mod works great on teshxx stock 4.1.2 rom
[Samsung Galaxy Nexus] gaich:
Minco v5, in signature, it is AOSP ROM too. Don't understand what's wrong-only unlock pattern works...
[Samsung Galaxy Nexus] xIC-MACIx:
Yes, Minco is aosp as with most of the roms here, I'm talking about

stock

aosp...without any extra modifications.

Plain & simple - Minco, for example, has a

power menu

already, which uses

androidpolicy.jar

and I'm sure that's not the only feature that uses the same file.

-Mac
[Samsung Galaxy Nexus] gaich:
Thank you, I see.

I extracted both original and your jars, tried to play with changes.I made a lot of variants, because I`m a real noob in encoding something, all I know to do is to replace one file with another...:D

The final compilation, which worked, was where I replaced all phonewindowsmanager smalis, which were different and added those which weren`t present. As a result, I have 169 instead of 165 original files, some phonewindowsmanager smalis are of the same size, but the volume skip works fine, the power menu remained.I tried to conserve the smalis quantity several times and by different ways, but I had bootloops only. My phone is hot of testing!:laugh: Maybe my compilation will affect some other things, but right now I obtained what I wanted to, my future test will show, whether everything is right.

Thank you for your work!!!,

I`ve uploaded my compilation for other Minco users.
[Samsung Galaxy Nexus] weppa83:
it works great! thanks
[Samsung Galaxy Nexus] xIC-MACIx:
Glad you got it working. There are two extra files to add: PhoneWindowManager$21 and PhoneWindowManager$21 and one to edit: PhoneWindowManager.

As for editing/comparing smali files, I use a diff tool called WinMerge. I would go mad shuffling through smali code without it. Lol

-Mac
[Samsung Galaxy Nexus] ginny777singh:
does this mod work on miui rom also.
[Samsung Galaxy Nexus] xIC-MACIx:
That's a negative. I would check the miui forums.
[Samsung Galaxy Nexus] semsemx:
work with 4.2 ?
[Samsung Galaxy Nexus] Savant:
Do a back up and see for yourself.
[Samsung Galaxy Nexus] xIC-MACIx:
I doubt it works without breaking something. The file edited for this mod is where the code for the lock screen is located. (android.policy.jar) I would assume that the new "lockscreen widgets" feature in 4.2 has dependencies located in android.policy.jar too.
[Samsung Galaxy Nexus] semsemx:
havent try ... still waiting 4.2 deodexed version..

but someone work installing softkey on 4.2 odex via zipthemer
[Samsung Galaxy Nexus] gaich:
Softkeys is a different thing, you can change them without dong harm to the system. I, for the instance, settled zenith via CWM (vrtheme). And to edit android policy you have to be very skillful.:rolleyes:
[Samsung Galaxy Nexus] androidphone2012:
http://xdaforums.com/showthread.php?p=34152296#post34152296

Please look into that
[Samsung Galaxy Nexus] xIC-MACIx:
Thanks, I haven't even looked into a 4.2 update yet. Shouldn't be too hard as some of the past smali code edits I have done were pretty headache-inducing lol. (Like ICS ports to GB for my ROM)

From what I saw in your link, it looks like a similar situation when Jelly Bean 4.1 was first released. The ICS code just needed some extra edits to get it working. I'll take a look at it tomorrow and get this Mod updated accordingly! :thumbup:
[Samsung Galaxy Nexus] Khizar:
you can try and let us know ;)
[Samsung Galaxy Nexus] xIC-MACIx:
Well fellas, looks like I'm going to have to wait a bit to get this done, unless someone can get me the public.xml from framework-res.apk. I'm sure there is a way to rig it like when JB first came out, I just don't have time to jump through those hoops lol.

The current apktool beta build can't decompile framework-res.apk with a valid public.xml which is need for the reboot menu. :(

Hopefully in a day or two, we will have apktool back for 4.2!

- Mac
[Samsung Galaxy Nexus] EddyOS:
New smali/baksmali is out (1.4.1) which can deodex API 17 if you need it (and 1.5.1 of apktool is about)...

http://code.google.com/p/smali/downloads/list

Would be nice if you could get this working ;)
[Samsung Galaxy Nexus] xIC-MACIx:
Thanks for the heads up!

Still need apktool OR a way to decompile resources.arsc for the public.xml for reboot string and image. (Might be able to rig an older apk to decompile with 4.2 resources...Will give that a shot later tonight!

Unfortunately, iBotPeaches has said THIS about 1.5.1, i.e. after the Thanksgiving holiday...

- Mac
[Samsung Galaxy Nexus] dhuberto:
Don't work.
[Samsung Galaxy Nexus] androidphone2012:
http://xdaforums.com/showpost.php?p=34406050&postcount=915

with that, can decompie 4.2 framework-res.apk

(but, cant recompile without mod :confused: )
[Samsung Galaxy Nexus] iHeWho:
Really hoping to see you update this mod for 4.2. I use my GNex in the car and the volume skip mod is such a blessing. Thanks in advance
[Samsung Galaxy Nexus] Fuzzy13:
I cant get this to work with AOKP to save my life. Even tried manually changing the files in the AOKP's android.policy.jar but to no avail.

Any advice?
[Samsung Galaxy Nexus] SilentStormer:
Can't wait for 4.2 support, this is one of my two favorite mods and my android experience just isn't compete without it.

Sent from my Jellin Gnex
[Samsung Galaxy Nexus] xIC-MACIx:
Will not work on AOKP, this mod is for stock AOSP Jelly Bean ROMs. Plus AOKP already has a rbt menu &

other features that mood the same file..

Yeah, its been busy w/ the holidays, no time to flash to stock 4.2 to test! lol. Both of these features are a must for me too, I should get some time in the next day or so after I get back home.