[GUIDE] [HOW-TO] [MOD] New Power Menu with Screenshot TW 4.3 MK3/MK5 - Sprint Samsung Galaxy S III

New Power Menu with Screenshot TW 4.3 MK3/MK5​
Create a Backup First​
For Stock TW 4.3 SPH-L710 MK3/MK5 Builds Only!​Do not flash this on a custom ROM, it replaces important framework files​
Notes:
I know the extended restart menu has been around for quite a while but I really prefer the simplicity and ease of access to the standard Power Menu without that extra keypress.
Features:
- Reboot to Recovery (instant - no prompt)
- Reboot to Download Mode (instant - no prompt)
- Screenshot
Update:
Added a second New Power Menu with Airplane Mode toggle removed.
Just flash over the other one if you want to try it.
[Guide How-to] Power Menu
Download the support files located at the bottom of the post.
framework-res.apk edits:
Add the 3 icons (from the support file) to framework-res/res/drawable-xhdpi
Add 3 new lines to framework-res/res/values/strings:
Code:
<string name="download">Bootloader</string>
<string name="recovery">Recovery</string>
<string name="global_action_screenshot_txt">Screenshot</string>
</resources>
Compile then De-compile the new framework-res.apk. We will need to view the public.xml file later to get a few values for the next section.
android.policy.jar edits:
Add the 6 new smali files (from the support file) to android.policy/com/android/internal/policy/impl.
(In the same path) edit GlobalActions.smali (or diff the stock and modified GlobalActions.smali included in the support file):
Before:
Code:
.field private final mDreamManager:Landroid/service/dreams/IDreamManager;
.field private mHandler:Landroid/os/Handler;
After:
Code:
.field private final mDreamManager:Landroid/service/dreams/IDreamManager;
[COLOR="Blue"].field private mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.field private mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[/COLOR].field private mHandler:Landroid/os/Handler;
Before:
Code:
.field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;
.field private final mShowSilentToggle:Z
After:
Code:
.field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;
[COLOR="Blue"].field mScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.field mScreenshotConnection:Landroid/content/ServiceConnection;
.field final mScreenshotLock:Ljava/lang/Object;
.field final mScreenshotTimeout:Ljava/lang/Runnable;
[/COLOR].field private final mShowSilentToggle:Z
Before:
Code:
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
sget-object v4, Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;->Off:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDataNetworkState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
iput-boolean v6, p0, Lcom/android/internal/policy/impl/GlobalActions;->mIsWaitingForEcmExit:Z
iput-boolean v5, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDisplayConfirm:Z
const/4 v4, 0x0
After:
Code:
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
sget-object v4, Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;->Off:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDataNetworkState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
[COLOR="Blue"] new-instance v4, Ljava/lang/Object;
invoke-direct {v4}, Ljava/lang/Object;-><init>()V
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotLock:Ljava/lang/Object;
const/4 v4, 0x0
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$29;
invoke-direct {v4, p0}, Lcom/android/internal/policy/impl/GlobalActions$29;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotTimeout:Ljava/lang/Runnable;
[/COLOR]
iput-boolean v6, p0, Lcom/android/internal/policy/impl/GlobalActions;->mIsWaitingForEcmExit:Z
iput-boolean v5, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDisplayConfirm:Z
const/4 v4, 0x0
New method:
Before:
Code:
.method static synthetic access$1700(Lcom/android/internal/policy/impl/GlobalActions;)Z
.locals 1
iget-boolean v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mKeyguardShowing:Z
return v0
.end method
.method static synthetic access$1800(Lcom/android/internal/policy/impl/GlobalActions;)Lcom/android/internal/policy/impl/GlobalActions$ConfirmDialogReceiver;
.locals 1
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mConfirmDialogReceiver:Lcom/android/internal/policy/impl/GlobalActions$ConfirmDialogReceiver;
return-object v0
.end method
After:
Code:
.method static synthetic access$1700(Lcom/android/internal/policy/impl/GlobalActions;)Z
.locals 1
iget-boolean v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mKeyguardShowing:Z
return v0
.end method
[COLOR="Blue"].method static synthetic access$1701(Lcom/android/internal/policy/impl/GlobalActions;)V
.locals 0
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->takeScreenshot()V
return-void
.end method
[/COLOR]
.method static synthetic access$1800(Lcom/android/internal/policy/impl/GlobalActions;)Lcom/android/internal/policy/impl/GlobalActions$ConfirmDialogReceiver;
.locals 1
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mConfirmDialogReceiver:Lcom/android/internal/policy/impl/GlobalActions$ConfirmDialogReceiver;
return-object v0
.end method
Before:
Code:
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$6;
const v1, 0x1080a60
const v2, 0x10401c8
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$6;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$7;
const v1, 0x1080a61
const v2, 0x10401c9
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
After:
Code:
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$6;
const v1, 0x1080a60
const v2, 0x10401c8
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$6;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[COLOR="Blue"] new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$Download;
const v1, 0x1081088
const v2, 0x1040a0b
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$Download;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$Recovery;
const v1, 0x1081089
const v2, 0x1040a0c
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$Recovery;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$28;
const v1, 0x108108a
const v2, 0x1040a0d
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$28;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[/COLOR]
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$7;
const v1, 0x1080a61
const v2, 0x10401c9
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
Edit above section
Before continuing, go back to the new DECOMPILED framework-res.apk and open res/values/public.xml with notepad++.
Search for <public type="drawable" name="tw_ic_download"
- All 3 of our new public drawable values for the png images will be listed together.
Search for <public type="string" name="download"
- All 3 of our new public string values will be listed together.
Now, using these we will edit the 3 new sections above for the these new public values. Instead of jumping back and forth in the public.xml, I do the drawables (V1 values) all at once and then go to the strings section and do the strings (V2 values) next.
Code:
<public type="drawable" name="tw_ic_download" id="0x01081088" />
<public type="drawable" name="tw_ic_recovery" id="0x01081089" />
<public type="drawable" name="tw_ic_screenshot" id="0x0108108a" />
Code:
<public type="string" name="download" id="0x01040a0b" />
<public type="string" name="recovery" id="0x01040a0c" />
<public type="string" name="global_action_screenshot_txt" id="0x01040a0d" />
For instance, we are editing these values:
Download:
const v1, 0x1081088 (V1 = DRAWABLE)
const v2, 0x1040a0b (V2 = STRING)
Important Note:
Please note that the leading zero is not used from the public value.
Next, search for const/16 v0, 0x8
Replace this entire section:
Before:
Code:
[COLOR="Red"] const/16 v0, 0x8
new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x1
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mTalkBack:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
const/4 v1, 0x2
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x3
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
const/4 v1, 0x4
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
const/4 v1, 0x5
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x6
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mBugReport:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x7
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mLonglife:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
[/COLOR]
After:
Code:
[COLOR="Blue"] const/16 v0, 0x8
new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x1
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x2
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mTalkBack:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
const/4 v1, 0x3
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
const/4 v1, 0x4
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x5
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x6
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x7
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
[/COLOR]
New method. Search for # virtual methods and insert this method BEFORE that line:
Code:
[COLOR="Blue"].method private takeScreenshot()V
.locals 8
iget-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotLock:Ljava/lang/Object;
monitor-enter v4
:try_start_0
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;
if-eqz v3, :cond_0
monitor-exit v4
:goto_0
return-void
:cond_0
new-instance v0, Landroid/content/ComponentName;
const-string v3, "com.android.systemui"
const-string v5, "com.android.systemui.screenshot.TakeScreenshotService"
invoke-direct {v0, v3, v5}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V
new-instance v2, Landroid/content/Intent;
invoke-direct {v2}, Landroid/content/Intent;-><init>()V
invoke-virtual {v2, v0}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$30;
invoke-direct {v1, p0}, Lcom/android/internal/policy/impl/GlobalActions$30;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
const/4 v5, 0x1
sget-object v6, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;
invoke-virtual {v3, v2, v1, v5, v6}, Landroid/content/Context;->bindServiceAsUser(Landroid/content/Intent;Landroid/content/ServiceConnection;ILandroid/os/UserHandle;)Z
move-result v3
if-eqz v3, :cond_1
iput-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mHandler:Landroid/os/Handler;
iget-object v5, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotTimeout:Ljava/lang/Runnable;
const-wide/16 v6, 0x2710
invoke-virtual {v3, v5, v6, v7}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
:cond_1
monitor-exit v4
goto :goto_0
:catchall_0
move-exception v3
monitor-exit v4
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v3
.end method
[/COLOR]
[Guide How-to] Remove a Menu Item
Search for const/16 v0, 0x8
Each menu item of this array is only 3 lines. We will remove the Airplane Mode toggle. Delete or comment out these 3 lines.
Code:
const/4 v1, 0x3
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
Since we have removed a menu item, the array constructor const/16 v0, 0x8
needs to be changed to const/16 v0, 0x7 (one less item 8-1=7 ).
Also, all the construct lines after the item you have just deleted need to be renumbered so they remain sequential. Here is the code changed after the item has been removed.
Code:
const/4 v1, 0x[COLOR="Red"]3[/COLOR]
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x[COLOR="Red"]4[/COLOR]
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x[COLOR="Red"]5[/COLOR]
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x[COLOR="Red"]6[/COLOR]
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
Credits: Huge credits to @rompnit for the use of the Screenshot method for this mod.

Do you have to be on a deodexed rom? Just flashed this twice on stock MK3 and I'm getting nothin'.
Sent from my SPH-L710 using XDA Premium 4 mobile app

marcran75 said:
Do you have to be on a deodexed rom? Just flashed this twice on stock MK3 and I'm getting nothin'.
Click to expand...
Click to collapse
Yes, 99% of any mods are going to be for deodexed. That is partly why it is extremely difficult to find an odexed custom rom.

tdunham said:
Yes, 99% of any mods are going to be for deodexed. That is partly why it is extremely difficult to find an odexed custom rom.
Click to expand...
Click to collapse
That's what I figured but thought I would ask anyways.
Sent from my SPH-L710 using XDA Premium 4 mobile app

another awesome mod !!! love it - so happy you have started making these - keep em' coming !!!!
VM SIII - jdsingle76's MK5 4.3
decimalman's TW dkp kernel

Between you and @CNexus, I will be killing someone soon with all the extra theming you have me doing. Nice job...
[email protected]'$ [email protected]@XY

marcran75 said:
Do you have to be on a deodexed rom? Just flashed this twice on stock MK3 and I'm getting nothin'.
Sent from my SPH-L710 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Move android.policy.jar and android.policy.jar.odex to your sdcard (to make a "backup" of them and delete at the same time) then flash this and it will work.
Deodexed mods can be used on odex, but not the other way around. Only catch is you gotta delete the affected odex files or else the system will preload those cache files and ignore the new file

CNexus said:
Move android.policy.jar and android.policy.jar.odex to your sdcard (to make a "backup" of them and delete at the same time) then flash this and it will work.
Deodexed mods can be used on odex, but not the other way around. Only catch is you gotta delete the affected odex files or else the system will preload those cache files and ignore the new file
Click to expand...
Click to collapse
Tried this and got stock at boot screen. Pulled battery and still the same.

marcran75 said:
Tried this and got stock at boot screen. Pulled battery and still the same.
Click to expand...
Click to collapse
Hmm...I've done this tons of times before on stock odexed and it's worked
Check the zip to see what (if any) other files are affected and move the odex files for those, then try flashing again

Is there anyway you could make a guide. ...I would love this on Wicked sensations.
http://i.imgur.com/qrByUGN.jpg

remotehugger said:
VM SIII - jdsingle76's MK5 4.3
decimalman's TW dkp kernel
Click to expand...
Click to collapse
Notice youre running virgin mobile... Thanks to tdunham, I have put together a zip to get the virgin mobile network running on the wicked sensations ROM... I have stock 4.3 android thru my ota update and with the zip it works perfect in VM.
ROM is here --> http://forum.xda-developers.com/showthread.php?t=2581010
Read the second post for the virgin mobile fix..
Just bored and saw that part of your post lol
Sent from my Virgin Mobile Galaxy S3, running Wicked Sensations Rom powered by DKP kernel, using Tapatalk 4.

bigpappags3 said:
Is there anyway you could make a guide. ...I would love this on Wicked sensations.
http://i.imgur.com/qrByUGN.jpg
Click to expand...
Click to collapse
Shut up clown. Don't give that other clown any ideas... Soon i'll have a 10 in 1 power menu and 60 toggles to theme...
[email protected]'$ [email protected]@XY

Confirm working on wicked and is nice. Nice mod
Sent from my SPH-L710 using xda app-developers app

Thanks for this tdunham. I already clicked thanks but this is just awesome. :thumbup:

Awesome mod. Thank you very much!

Update:
Added to the OP a second New Power Menu with Airplane Mode toggle removed.
Just flash over the other one if you want to try it.

I tried this and it force closes my phone settings (sure it is related to something I did to my personal framework-res.apk). So my question is if you could tell me which if any xmls need modified?

notmyepic said:
I tried this and it force closes my phone settings (sure it is related to something I did to my personal framework-res.apk). So my question is if you could tell me which if any xmls need modified?
Click to expand...
Click to collapse
I won't do full guide until later:
Code:
framework-res.apk edits:
Add the 3 icons (from the support file) to framework-res/res/drawable-xhdpi
Add 3 new lines to framework-res/res/values/strings:
<string name="download">Bootloader</string>
<string name="recovery">Recovery</string>
<string name="global_action_screenshot_txt">Screenshot</string>
</resources>
Still no guarantees if other changes were made that alter public values that get generated when framework-res is compiled.

Hey man, I changed he pngs to match the rest of Dandroid. In the 3rd option down instead of saying "download mode" it says "bootloader". Where would I go to change this?

Chad The Pathfinder said:
Hey man, I changed he pngs to match the rest of Dandroid. In the 3rd option down instead of saying "download mode" it says "bootloader". Where would I go to change this?
Click to expand...
Click to collapse
It's in the post before this one.
Edit: Sorry, meant the post above yours.

Related

[HOW TO] AOSP Lock + Toggle| 3 Way Ext. Power Menu| CRT-OFF| Long Menu Press to Kill

Hy Guys! in my request to isolate all the codes in Smali files to enable Extended Power Menu, CRT-OF, Long Menu Press To Kill and AOSP Lockscreen working separately to implement in my ROM (crDroid ROM) i manage to found how to do it!
Updated 19.01.2013 = Working in latest XXELLC
Requirements :
- You need to know how to work with apktool, smali and baksmali stuffs.
- Notepad++
- 7-zip
WE WILL USE FOLLOING STEPS IN ALL 4 MODS
1 - You need to extract from inside the stock framework/ a file called android.policy.jar;
2 - Open android.policy.jar with 7-zip;
3 - Extract classes.dex from it;
2 - Decompile using baksmail commands;
3 - Once it's done Recompile using smali commands:
Click to expand...
Click to collapse
== AOSP Lockscreen with Toggle ==
Decompile android.policy.jar
Go to: com\android\internal\policy\impl\LockPatternKeyguardView.smali
Click to expand...
Click to collapse
Find this method
Code:
.method createLockScreen()Landroid/view/View;
And switch completely with this (Same method with new codes inside)
Code:
[left][color="blue"].method createLockScreen()Landroid/view/View;
.registers 7
.prologue
.line 1254
iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "aosp_lock"
const/4 v2, 0x0
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-nez v0, :cond_1f
new-instance v0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/sec/CircleLockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
goto :goto_2e
.line 1260
:cond_1f
new-instance v0, Lcom/android/internal/policy/impl/LockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
.local v0, lockView:Landroid/view/View;
:goto_2e
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->initializeTransportControlView(Landroid/view/View;)V
.line 1261
return-object v0
.end method[/color][/left]
It will create the AOSP lockscreen but with one issue. Adding only this "new" method will made the lockscreen unlockable using menu button;
So let's made some changes to fix this. There are 2 ways to fix it
1st way
Go to: com\android\internal\policy\impl\LockScreen.smali
Click to expand...
Click to collapse
Find and delete the red one
Code:
.field private mCreationOrientation:I
[color="red"]--- .field private mEnableMenuKeyInLockScreen:Z[/color]
.field private mEnableRingSilenceFallback:Z
Find and delete the red ones
Code:
[left].line 447
iput-object p5, p0, Lcom/android/internal/policy/impl/LockScreen;->mCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
.line 448
[color="red"]--- invoke-direct {p0}, Lcom/android/internal/policy/impl/LockScreen;->shouldEnableMenuKey()Z
--- move-result v0
--- iput-boolean v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mEnableMenuKeyInLockScreen:Z[/color]
.line 449
iget v0, p2, Landroid/content/res/Configuration;->orientation:I[/left]
Find the method and delete completely
Code:
[left][color="red"].method public onKeyDown(ILandroid/view/KeyEvent;)Z
.registers 4
.parameter "keyCode"
.parameter "event"
.prologue
.line 541
const/16 v0, 0x52
if-ne p1, v0, :cond_d
iget-boolean v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mEnableMenuKeyInLockScreen:Z
if-eqz v0, :cond_d
.line 542
iget-object v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-interface {v0}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V
.line 544
:cond_d
const/4 v0, 0x0
return v0
.end method[/color][/left]
Recompile android.policy.jar and it's done!
AOSP Lockscreen Properly working
2nd way (Thanks to jimbo77)
Using this method we will need to decompile framework-res.apk
Go to: res/values/bools
Click to expand...
Click to collapse
Find and switch
Code:
[color="red"]--- <bool name="config_disableMenuKeyInLockScreen">false</bool>[/color]
[color="blue"]+++ <bool name="config_disableMenuKeyInLockScreen">true</bool>[/color]
Recompile framework-res.apk and it's done.
Lets put toggle in SecSettings.apk
decompile SecSettings.apk
Go to:res/values/strings
Click to expand...
Click to collapse
Add this at the end of the file, before close resources</resources>.
This 2 string bellow will be shown in settings, so feel free to change.
Code:
[left][color="blue"]+++ <string name="aosp">Jelly Bean (AOSP) Lockscreen</string>
+++ <string name="aosp_summary">Enable Original Jelly Bean Lockscreen</string>[/color]
[/left]
Go to: res/xml/Lockscreen_Settings.xml
Click to expand...
Click to collapse
Find and add
Code:
[left]<SwitchPreferenceScreen android:title="@string/lock_screen_shortcut_title" android:key="lock_screen_shortcut" android:summary="@string/lock_screen_shortcut_summary">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.lockscreenshortcut.LockScreenShortcutSettings" />
</SwitchPreferenceScreen>
[color="blue"]+++ <CheckBoxPreference android:title="@string/aosp" android:key="say_your_wakeup" android:summary="@string/aosp_summary" />[/color]
<SwitchPreferenceScreen android:title="@string/information_ticker" android:key="information_ticker" android:summary="@string/information_ticker_summary" android:fragment="com.android.settings.InformationTicker" />
[/left]
Go to: smali\com\android\settings\LockScreenSettings.smali
Click to expand...
Click to collapse
Find and add
Code:
[left].field private isWeatherEnabled:Z
[color="blue"]+++ .field private mAospLock:Landroid/preference/CheckBoxPreference;[/color]
.field private mCameraShortCut:Landroid/preference/SwitchPreferenceScreen;[/left]
Find and Switch
Code:
[left]iput-object v0, p0, Lcom/android/settings/LockScreenSettings;->mMotionDialog:Landroid/app/AlertDialog;
[color="red"]--- const/16 v0, 0x8[/color]
[color="blue"]+++ const/16 v0, 0x11[/color]
new-array v0, v0, [I[/left]
Find and Switch
Code:
[left]invoke-virtual {v6, v3}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 294
:cond_3
[color="red"]--- iget-object v3, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++ iget-object v3, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
if-eqz v3, :cond_4
.line 295
[color="red"]--- iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++ iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
[color="red"]--- const-string v7, "wake_up_lock_screen"[/color]
[color="blue"]+++ const-string v7, "aosp_lock"[/color]
invoke-static {v3, v7, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I[/left]
Find and Switch
Code:
[left]const-string v8, "say_your_wakeup"
invoke-virtual {p0, v8}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v8
check-cast v8, Landroid/preference/CheckBoxPreference;
[color="red"]--- iput-object v8, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++ iput-object v8, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
.line 212
iget-object v8, p0, Lcom/android/settings/LockScreenSettings;->mRippleEffect:Landroid/preference/CheckBoxPreference;
if-eqz v8, :cond_8[/left]
Find and Switch
Code:
[left]goto :goto_4
:cond_9
[color="red"]--- iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++ iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_0
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
[color="red"]--- const-string v5, "wake_up_lock_screen"[/color]
[color="blue"]+++ const-string v5, "aosp_lock"[/color]
[color="red"]---iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_a[/left]
Find Switch and delete
Code:
[left]
invoke-interface {v1}, Ljava/util/List;->size()I
move-result v8
if-ge v8, v9, :cond_f
.line 240
[color="red"]--- iget-object v8, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++ iget-object v8, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
if-eqz v8, :cond_e
[color="red"]--- invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;[/color]
[color="red"]--- move-result-object v8[/color]
[color="red"]--- iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="red"]--- invoke-virtual {v8, v9}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z[/color]
:cond_e
if-eqz v6, :cond_f
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;[/left]
Recompile SecSettings.apk and it's done!
== 3 Way Extended Power Menu ==
Go to: com/android/internal/policy/impl/GlobalActions.smali
Click to expand...
Click to collapse
Find this
Code:
[LEFT].line 368
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$5;[/LEFT]
And switch with this
Code:
[LEFT][COLOR="Blue"].line 368
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$99;[/COLOR][/LEFT]
Find this
Code:
[LEFT]invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$5;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V[/LEFT]
And switch with this
Code:
[LEFT][COLOR="Blue"]invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V[/COLOR][/LEFT]
Now go to
com/android/internal/policy/impl/GlobalActions$SinglePressAction.smali
Click to expand...
Click to collapse
Find this
Code:
[LEFT].end annotation
# instance fields
.field private final mIconResId:I
.field private final mMessage:Ljava/lang/CharSequence;
.field private final mMessageResId:I
[/LEFT]
And between .end annotation and # instance fields, add this
Code:
[LEFT][COLOR="Blue"]# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;[/COLOR][/LEFT]
Find this
Code:
[LEFT]# direct methods
.method protected constructor <init>(II)V
.registers 4
.parameter "iconResId"
.parameter "messageResId"
[/LEFT]
And between # direct methods and .method protected constructor <init>(II)V, add this
Code:
[LEFT][COLOR="Blue"].method static constructor <clinit>()V
.registers 3
const/4 v0, 0x3
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Reboot"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Download"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Recovery"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method[/COLOR][/LEFT]
To finalize Extended Power Menu you need to copy tree smali files (GlobalActions$99$1.smali, GlobalActions$99$2, and GlobalActions$1.smali) and paste then inside -> com/android/internal/policy/impl/
Recompile android.policy.jar using smali commands it's DONE!
== CRT OFF Animation ==
Follow the same procedure as android.policy.jar to decompile and extract classes.dex
Go to
Go to: com/android/internal/policy/impl/PhoneWindowManager.smali
Click to expand...
Click to collapse
find this
Code:
[LEFT]# interfaces
.implements Landroid/view/WindowManagerPolicy;
# annotations
[/LEFT]
Between .implements Landroid/view/WindowManagerPolicy and # annotations, add this
Code:
[LEFT][COLOR="Blue"].implements Ljava/lang/Runnable;[/COLOR][/LEFT]
find this
Code:
[LEFT].line 5938
.end local v9 #isAllowed:Z
.end local v16 #kioskMode:Landroid/app/enterprise/kioskmode/KioskMode;
:cond_66
:goto_66
return v19[/LEFT]
Between :goto_66 and return v19, add this
Code:
[LEFT][COLOR="Blue"]and-int/lit8 v0, v19, 0x4
if-eqz v0, :cond_71
and-int/lit8 v19, v19, -0x5
move-object/from16 v0, p0
invoke-virtual {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->sleepDelay()V
:cond_71[/COLOR][/LEFT]
Go to the Bottom of the file and add this hole code
Code:
[LEFT][COLOR="Blue"].method public sleepDelay()V
.locals 10
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
const-wide v2, 0x64
check-cast p0, Ljava/lang/Runnable;
invoke-virtual {v0, p0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
return-void
.end method
.method public run()V
.locals 10
.prologue
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const-string v1, "power"
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v2
const-wide/16 v6, 0x3e8
add-long/2addr v2, v6
invoke-virtual {v0, v2, v3}, Landroid/os/PowerManager;->goToSleep(J)V
return-void
.end method[/COLOR][/LEFT]
Now you can recompile android.policy.jar using smali commands.
Now
Extract services.jar from inside framework folder and follow the same procedure extract classes.dex and decompile it.
Go to
Go to: com/android/server/PowerMangerService$ScreenBrightnessAnimator.smali
Click to expand...
Click to collapse
find this
Code:
[LEFT]#getter for: Lcom/android/server/PowerManagerService;->mScreenBrightnessHandler:Landroid/os/Handler;
invoke-static {v7}, Lcom/android/server/PowerManagerService;->access$7300(Lcom/android/server/PowerManagerService;)Landroid/os/Handler;
move-result-object v7
const/16 v9, 0xa[/LEFT]
Between move-result-object v7 and const/16 v9, 0xa, add this
Code:
[LEFT][COLOR="Blue"]if-eqz p2, :cond_75
const/16 v9, 0xb
const/4 v10, 0x0
const v2, 0x10
invoke-virtual {v7, v9, v2, v10}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;
move-result-object v9
invoke-virtual {v9}, Landroid/os/Message;->sendToTarget()V
:cond_75[/COLOR][/LEFT]
Now you can recompile services.jar using apktool and smali commands
== Long Menu Press to Kill App ==
Follow the same procedure as android.policy.jar and services.jar to decompile and extract classes.dex again from android.policy.jar
Go to: com/android/internal/policy/impl/PhoneWindowManager.smali
Click to expand...
Click to collapse
find this
Code:
.line 1455
[COLOR="Red"]new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$8;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$8;-><init (Lcom/android/internal/policy/impl/PhoneWindowManager;)V[/COLOR]
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mMenuLongPress:Ljava/lang/Runnable;
change the red ones for blues under
Code:
[COLOR="Blue"]+ new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$MenuLongPress;
+ invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$MenuLongPress;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V[/COLOR]
Extract the PhoneWindowManager-file.zip attached, extract the file int it and copy to com/android/internal/policy/impl/
Recompile android.policy.jar using smali commands and it's done!
With this we will be able to add or remove this 4 mods from inside any other
CREDITS
For CRT OFF Animation method all the credits goes to Sorg. I've just follow his tutorial.
For part Extended Power Menu i like to thanks mgn2o
For part of AOSP Lockscreen i like to thanks Didact74
Nice, an EPM whitout Hot Reboot (mgn2o) thanks for reference ....
Enviado de meu GT-I9300 usando o Tapatalk 2
Excellent guide! Would love one for lockscreen media skip !! I cant find the source/guide anywhere !
Great guide.
It will be great:
Can you add how to decompile .odex such that we obtain .smali for editing ??
Thanks in advance mate.
Post updated with Long Menu Press to Kill for XXELK4
Akshay (Aky) said:
Great guide.
It will be great:
Can you add how to decompile .odex such that we obtain .smali for editing ??
Thanks in advance mate.
Click to expand...
Click to collapse
You can try to deodex a file, made the changes and re-odex.
I never try with odex. I only use roms deodexed and my (crDroid) in development is surely deodexed.
Take a look in here: CLICK
how to Inkeffect tutorial
One more thing, how to add the function "Long press volume key to jump muisc" in lockscreen mode? Thanks.
I'll definitely use this to add crt animation to the 4.1.2 ROM I have for the Sprint S2. Thanks!
Sent from my SPH-D710 using xda premium
Great job, Hoping this will become a central hub for source code ! Bookmarked for future use.. looking forward to future sources!
Would you please also add the mod for "long press volume key to skip song"? Thanks.
dongfangri said:
Would you please also add the mod for "long press volume key to skip song"? Thanks.
Click to expand...
Click to collapse
I'm working on this. Trying some kind of "reverse engineering" to spot the codes.
Great tutorial, for my first attempt at these types of edits, it made life very easy. Although i have a small problem. Ive made the edits so i can have extended power menu, crt off and any app multi window in my rom. Everything went smoothly but it seems that crt off is erratic. Sometimes it works and sometimes it does not. Any ideas?
Sent from my GT-I9300 using Tapatalk 2
anaraxia said:
Great tutorial, for my first attempt at these types of edits, it made life very easy. Although i have a small problem. Ive made the edits so i can have extended power menu, crt off and any app multi window in my rom. Everything went smoothly but it seems that crt off is erratic. Sometimes it works and sometimes it does not. Any ideas?
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Well a never had this kind of problem.
Using Kernle Perseus, by the way? It seems to broke CRT.
Cristiano Matos said:
Well a never had this kind of problem.
Using Kernle Perseus, by the way? It seems to broke CRT.
Click to expand...
Click to collapse
No... Stock kernel. Keeping in simple
Sent from my GT-I9300 using Tapatalk 2
anaraxia said:
No... Stock kernel. Keeping in simple
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
There's a problem with the Stock kernel on the newest JB update (For both leak and official)
Try using Siyah's 1.8.3 and use the CRT Fix in the STweaks application.
---------- Post added at 11:15 AM ---------- Previous post was at 10:29 AM ----------
Thanks alot for this tutorial, very simple and straight to the point!
Lost.soul said:
There's a problem with the Stock kernel on the newest JB update (For both leak and official)
Try using Siyah's 1.8.3 and use the CRT Fix in the STweaks application.
Thanks for the help. Downloaded, flashed and tested. Works perfectly now. Will have to add it to my next release. Thanks again :thumbup:
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Loved your post, but i have a question: is it possible to do this with gingerbread rom? is it the same procedure?
Também sou brasileiro, hehehe. Tem como tu me ajudar com algumas coisas?
Click to expand...
Click to collapse
Note II InkEffect Lockscreen
It is not compatible with Note II InkEffect Lockscreen Mod.
When I flash this mod (extended menu) the ink effect lockscreen stop working
thank you
anaraxia said:
Great tutorial, for my first attempt at these types of edits, it made life very easy. Although i have a small problem. Ive made the edits so i can have extended power menu, crt off and any app multi window in my rom. Everything went smoothly but it seems that crt off is erratic. Sometimes it works and sometimes it does not. Any ideas?
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Can you confirm it works ONLY with Wifi On ? Seams like that on my try
in the service.jar...i have 2 times those codes...234, 264 something, so how do you choose where to insert your part ?
later edit:
Makes no diff where i add those it seams. Still CRT only works with WIFI on, its like a CRT SWICH haha...suppose "stuff" should be inserted differently on 4.1.2.

[MOD][HOW-TO][2.0] Long press volume to skip tracks (the right way!)

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?

[GUIDE][How-to] New Power Menu JB - With Screenshot

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.

[MOD][HowTo] Samsung KeyBoard Swipe Color Change Found!

Okay, alot of dev's/themers been looking for this one...
If you use, please give credit, I spent many hours finding this Mod... Don't take credit for someone else's work...
This Mod will allow you to change the Samsung KeyBoard Swipe Color..(SamsungIME.apk)
Look for:
smali\com\diotek\ime\framework\view\AbstractKeyBoardView.smali
Search for -> .method private setTracePaintOptionsWithSettings()V
Click to see Org Code
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
.prologue
const/16 v4, 0xff
const/4 v1, 0x1
const/4 v3, 0x0
.line 9829
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
.line 9830
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
.line 9832
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
.line 9833
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 9835
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
.line 9836
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
.line 9837
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
.line 9838
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, 0xa5
const/16 v2, 0xf3
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
Click to see what to change:
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
.prologue
const/16 v4, [B][U][COLOR="Blue"]0xff[/COLOR][/U][/B] [B][COLOR="seagreen"]Change for Alpha Value - "0xff" [/COLOR][/B]
const/4 v1, 0x1
const/4 v3, [B][U][COLOR="Blue"]0x0[/COLOR][/U][/B] [B][COLOR="seaGreen"] - Change for Red Value - "0x0"[/COLOR][/B]
.line 9829
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
.line 9830
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
.line 9832
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
.line 9833
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 9835
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
.line 9836
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
.line 9837
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
.line 9838
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, [B][U][COLOR="Blue"]0xa5[/COLOR][/U][/B] [COLOR="seagreen"]- Change for Green Value - "0xa5"[/COLOR]
const/16 v2, [B][U][COLOR="Blue"]0xf3[/COLOR][/U][/B] [COLOR="seagreen"] - Change for Blue Value - "0xf3"[/COLOR]
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
So what it boils down to is that the Swipe Color is what we call RGB color coding. I suggest a site like this to see values you can use:
Hex to RGB Color converter
Thats it folks.. swipe color squashed!!!!
A Little clarification on Instructions.
I was swamped with questions on how to edit and such.. So with @strongsteve help we dug more and here is an easier way to get your colors instead of trying to use RGB values..
Note III - Edits
change code:
Code:
const/16 v1, 0xa5
const/16 v2, 0xf3
to
Code:
const v3, 0x33
const v1, 0x66
const v2, 0xcc
Note II - Edits
change code:
Code:
const/16 v1, 0xff
const/16 v2, 0xa5
const/16 v3, 0xf3
change to:
Code:
const/16 v1, 0xff
const v2, 0x66
const v3, 0xcc
const v4, 0x33
Then just use any normal Hex Color code you would normally use!!!
In the above example I used 3366cc which is DarkHorse Blue..
I hope that helps
Text Color in Text Editor(Second Screen Shot)
Note III
Search for
Code:
constructor <init>(Lcom/visionobjects/textwidget/e/a;Landroid/util/DisplayMetrics;)V
and then look for:
Code:
const/high16 v1, -0x100 <--- Black Text Color Previous Typed Word
const v2, -0xcc4a1b <--- Last Typed Word
Change Black Text to a Smali Color Code
Change Last Typed Word to Smali Color code (-0xcc4a1b)
For example:
3366cc converts to -0xCC9934 for smali color codes
Thx to @EMSpilot for pointing out the Black Text Line... Thank you!!!
Black Text Color
If you want to take it a step further the line just below const v2, -0xcc4a1b is
const/high16 v1, -0x100 this is the black text color that shows up when you move on to the next word.
Change it to const v1, "put your color code here" I used -0x4cf0 which is ffb310 in hex. The finished line looks like this const v1, -0x4cf0
Great Job Michael. Your work is greatly appreciated!!!
BTW for me the smali was located here.
SamsungIME\smali\com\visionobjects\textwidget\f\b\a.smali

[Guide] Listview Animations for Lollipop

Listview Animations for Lollipop - MM files added for compare
This guide is based on the Sprint Galaxy S5 OA6 Lollipop 5.0 firmware.
framework.jar smali edits
\smali_classes2\android\widget\AbsListView$FlingRunnable$1.smali
Delete the line in RED and add the new code in BLUE
Make sure the values in the new code match surrounding code.
Code:
.method public run()V
.
.
.
:cond_2
iget-object v4, p0, Landroid/widget/AbsListView$FlingRunnable$1;->this$1:Landroid/widget/AbsListView$FlingRunnable;
[COLOR="Red"]invoke-virtual {v4}, Landroid/widget/AbsListView$FlingRunnable;->endFling()V
[/COLOR]
[COLOR="Blue"]const/4 v5, 0x0
invoke-virtual {v4, v5}, Landroid/widget/AbsListView$FlingRunnable;->endFling(Z)V
[/COLOR]
iget-object v4, p0, Landroid/widget/AbsListView$FlingRunnable$1;->this$1:Landroid/widget/AbsListView$FlingRunnable;
iget-object v4, v4, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
const/4 v5, 0x3
iput v5, v4, Landroid/widget/AbsListView;->mTouchMode:I
iget-object v4, p0, Landroid/widget/AbsListView$FlingRunnable$1;->this$1:Landroid/widget/AbsListView$FlingRunnable;
iget-object v4, v4, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
const/4 v5, 0x1
invoke-virtual {v4, v5}, Landroid/widget/AbsListView;->reportScrollStateChange(I)V
goto :goto_0
.end method
\smali_classes2\android\widget\AbsListView$FlingRunnable.smali
Rename the following method header in RED to the new name in BLUE:
Code:
[COLOR="Red"].method endFling()V
[/COLOR]
[COLOR="Blue"].method endFling(Z)V[/COLOR]
Add new method right above the newly renamed method:
Code:
.method endFling()V
.locals 1
const/4 v0, 0x1
invoke-virtual {p0, v0}, Landroid/widget/AbsListView$FlingRunnable;->endFling(Z)V
return-void
.end method
Now, make the following edits in BLUE in that newly renamed method also.
Code:
.method endFling(Z)V
.locals 2
iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
const/4 v1, -0x1
iput v1, v0, Landroid/widget/AbsListView;->mTouchMode:I
iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
invoke-virtual {v0, p0}, Landroid/widget/AbsListView;->removeCallbacks(Ljava/lang/Runnable;)Z
iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
iget-object v1, p0, Landroid/widget/AbsListView$FlingRunnable;->mCheckFlywheel:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/widget/AbsListView;->removeCallbacks(Ljava/lang/Runnable;)Z
iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
const/4 v1, 0x0
invoke-virtual {v0, v1}, Landroid/widget/AbsListView;->reportScrollStateChange(I)V
[COLOR="blue"]if-eqz p1, :cond_td[/COLOR]
iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
# invokes: Landroid/widget/AbsListView;->clearScrollingCache()V
invoke-static {v0}, Landroid/widget/AbsListView;->access$3100(Landroid/widget/AbsListView;)V
[COLOR="blue"]:cond_td[/COLOR]
Same smali, make the following edits in BLUE
and delete the lines in RED. Note the access$3100 in the following code in GREEN, we may need to change that right after this edit.
Code:
.method start(I)V
.locals 9
const v6, 0x7fffffff
const/4 v1, 0x0
[COLOR="Red"]if-gez p1, :cond_1[/COLOR]
[COLOR="blue"]invoke-static {p1}, Ljava/lang/Math;->abs(I)I
move-result v0
iget-object v3, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
invoke-static {v3}, Landroid/widget/AbsListView;->access$1234(Landroid/widget/AbsListView;)I
move-result v3
if-le v0, v3, :cond_td
iget-object v0, p0, Landroid/widget/AbsListView$FlingRunnable;->this$0:Landroid/widget/AbsListView;
invoke-static {v0}, Landroid/widget/AbsListView;->[COLOR="Green"]access$3100[/COLOR](Landroid/widget/AbsListView;)V
:cond_td
if-gez p1, :cond_td1[/COLOR]
.
.
.
:cond_0
return-void
[COLOR="Red"]:cond_1
[/COLOR] [COLOR="Blue"]:cond_td1
[/COLOR] move v2, v1
goto :goto_0
.end method
Now lets go confirm that the access$3100 that is called from this smali is the correct one.
Look in and confirm that the following method matches, if it doesn't change the access$3100 in the previous edit so that it does.
\smali_classes2\android\widget\AbsListView.smali
Code:
.method static synthetic access$3100(Landroid/widget/AbsListView;)V
.locals 0
invoke-direct {p0}, Landroid/widget/AbsListView;->clearScrollingCache()V
return-void
.end method
If it matches, perfect. We will continue working in this smali to add changes:
\smali_classes2\android\widget\AbsListView.smali
Add new code in BLUE to #instance fields.
Code:
# instance fields
[COLOR="blue"].field private mDecacheThreshold:I
.field mHeight:I
.field mIsGridView:Z
.field mIsScrolling:Z
.field mIsWidget:Z
.field mWidth:I
.field mvPosition:I
[/COLOR]
.field protected AIR_VIEW_WINSET:Z
.field private HOVERSCROLL_DELAY:I
.field private HOVERSCROLL_SPEED:F
Same smali, add new code in BLUE making sure values match surrounding code.
Code:
.method public constructor <init>(Landroid/content/Context;)V
.
.
.
iput v5, p0, Landroid/widget/AbsListView;->mActivePointerId:I
iput v4, p0, Landroid/widget/AbsListView;->mPointerCount:I
iput-boolean v4, p0, Landroid/widget/AbsListView;->mHapticOverScroll:Z
iput v4, p0, Landroid/widget/AbsListView;->mDirection:I
[COLOR="blue"]iput v4, p0, Landroid/widget/AbsListView;->mHeight:I
iput-boolean v4, p0, Landroid/widget/AbsListView;->mIsGridView:Z
[/COLOR]
iput v4, p0, Landroid/widget/AbsListView;->mHoverTopAreaHeight:I
iput v4, p0, Landroid/widget/AbsListView;->mHoverBottomAreaHeight:I
iput-wide v8, p0, Landroid/widget/AbsListView;->mHoverRecognitionDurationTime:J
Add new method in BLUE
Code:
.method static synthetic access$000(Landroid/widget/AbsListView;Z)V
.locals 0
invoke-direct {p0, p1}, Landroid/widget/AbsListView;->setFastScrollerEnabledUiThread(Z)V
return-void
.end method
[COLOR="Blue"].method static synthetic access$1234(Landroid/widget/AbsListView;)I
.registers 1
iget v0, p0, Landroid/widget/AbsListView;->mDecacheThreshold:I
return v0
.end method[/COLOR]
Same smali, add new code in BLUE making sure new values match surrounding code
Code:
.method private initAbsListView()V
.
.
.
iput v6, p0, Landroid/widget/AbsListView;->mTouchSlop:I
invoke-virtual {v1}, Landroid/view/ViewConfiguration;->getScaledMinimumFlingVelocity()I
move-result v6
iput v6, p0, Landroid/widget/AbsListView;->mMinimumVelocity:I
invoke-virtual {v1}, Landroid/view/ViewConfiguration;->getScaledMaximumFlingVelocity()I
move-result v6
iput v6, p0, Landroid/widget/AbsListView;->mMaximumVelocity:I
[COLOR="blue"] iget v6, p0, Landroid/widget/AbsListView;->mMaximumVelocity:I
div-int/lit8 v6, v6, 0x2
iput v6, p0, Landroid/widget/AbsListView;->mDecacheThreshold:I[/COLOR]
invoke-virtual {v1}, Landroid/view/ViewConfiguration;->getScaledOverscrollDistance()I
move-result v6
iput v6, p0, Landroid/widget/AbsListView;->mOverscrollDistance:I
invoke-virtual {v1}, Landroid/view/ViewConfiguration;->getScaledOverflingDistance()I
move-result v6
iput v6, p0, Landroid/widget/AbsListView;->mOverflingDistance:I
.
.
.
:cond_6
[COLOR="blue"]const/4 v1, 0x3
invoke-virtual {p0, v1}, Landroid/widget/AbsListView;->setPersistentDrawingCache(I)V
[/COLOR]
return-void
:catch_0
move-exception v4
goto :goto_0
:catch_1
move-exception v4
goto :goto_0
.end method
Add new code in BLUE making sure values match surrounding code.
Code:
.method private scrollIfNeeded(IILandroid/view/MotionEvent;)V
.
.
.
iget v3, v0, Landroid/widget/AbsListView;->mLastY:I
sub-int v3, p2, v3
add-int v21, v3, v34
:goto_1
const/16 v22, 0x0
move-object/from16 v0, p0
iget v3, v0, Landroid/widget/AbsListView;->mTouchMode:I
const/4 v4, 0x3
if-ne v3, v4, :cond_13
[COLOR="blue"]const/4 v3, 0x0
move-object/from16 v0, p0
iput-boolean v3, v0, Landroid/widget/AbsListView;->mIsWidget:Z
[/COLOR] move-object/from16 v0, p0
iget-object v3, v0, Landroid/widget/AbsListView;->mScrollStrictSpan:Landroid/os/StrictMode$Span;
if-nez v3, :cond_2
const-string v3, "AbsListView-scroll"
invoke-static {v3}, Landroid/os/StrictMode;->enterCriticalSpan(Ljava/lang/String;)Landroid/os/StrictMode$Span;
Add new line in BLUE making sure value matches surrounding code.
Code:
.method protected handleDataChanged()V
.locals 15
const/4 v14, 0x5
const/4 v13, -0x1
const/4 v8, 0x3
const/4 v9, 0x1
const/4 v12, 0x0
[COLOR="blue"]iput-boolean v9, p0, Landroid/widget/AbsListView;->mIsWidget:Z
[/COLOR]
iget v1, p0, Landroid/widget/AbsListView;->mItemCount:I
Add new code in BLUE making sure value matches surrounding code.
Code:
.method obtainView(I[Z)Landroid/view/View;
.
.
.
:cond_4
iget-object v7, p0, Landroid/widget/AbsListView;->mRecycler:Landroid/widget/AbsListView$RecycleBin;
invoke-virtual {v7, p1}, Landroid/widget/AbsListView$RecycleBin;->getScrapView(I)Landroid/view/View;
move-result-object v3
iget-object v7, p0, Landroid/widget/AbsListView;->mAdapter:Landroid/widget/ListAdapter;
invoke-interface {v7, p1, v3, p0}, Landroid/widget/ListAdapter;->getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
move-result-object v0
[COLOR="blue"]iget-boolean v7, p0, Landroid/widget/AbsListView;->mIsScrolling:Z
if-eqz v7, :cond_td
iget-boolean v7, p0, Landroid/widget/AbsListView;->mIsWidget:Z
if-nez v7, :cond_td
invoke-virtual {p0, v0}, Landroid/widget/AbsListView;->setAnimation(Landroid/view/View;)Landroid/view/View;
move-result-object v0
:cond_td
[/COLOR]
if-eqz v3, :cond_6
if-eq v0, v3, :cond_7
invoke-virtual {v3}, Landroid/view/View;->isAccessibilityFocused()Z
move-result v7
if-eqz v7, :cond_5
invoke-virtual {v3}, Landroid/view/View;->clearAccessibilityFocus()V
invoke-virtual {v0}, Landroid/view/View;->requestAccessibilityFocus()Z
Add new code in BLUE making sure value matches surrounding code.
Code:
.method protected onLayout(ZIIII)V
.
.
.
:cond_1
invoke-virtual {p0}, Landroid/widget/AbsListView;->layoutChildren()V
const/4 v2, 0x0
iput-boolean v2, p0, Landroid/widget/AbsListView;->mInLayout:Z
sub-int v2, p5, p3
div-int/lit8 v2, v2, 0x3
iput v2, p0, Landroid/widget/AbsListView;->mOverscrollMax:I
[COLOR="Blue"]invoke-virtual {p0}, Landroid/widget/AbsListView;->getHeight()I
move-result v2
iput v2, p0, Landroid/widget/AbsListView;->mHeight:I
invoke-virtual {p0}, Landroid/widget/AbsListView;->getWidth()I
move-result v2
iput v2, p0, Landroid/widget/AbsListView;->mWidth:I
[/COLOR]
iget-object v2, p0, Landroid/widget/AbsListView;->mFastScroll:Landroid/widget/FastScroller;
if-eqz v2, :cond_2
iget-object v2, p0, Landroid/widget/AbsListView;->mFastScroll:Landroid/widget/FastScroller;
invoke-virtual {p0}, Landroid/widget/AbsListView;->getChildCount()I
Add new code in BLUE making sure value matches surrounding code.
Code:
.method reportScrollStateChange(I)V
.
.
.
:goto_3
iput v5, p0, Landroid/widget/AbsListView;->mDVFSCookie:I
:cond_6
invoke-static {v5}, Landroid/os/DVFSHelper;->onScrollEvent(Z)V
iput-boolean v5, p0, Landroid/widget/AbsListView;->mDVFSLockAcquired:Z
:cond_7
iput p1, p0, Landroid/widget/AbsListView;->mLastScrollState:I
[COLOR="blue"]if-eqz p1, :cond_td
const/4 v0, 0x1
:goto_td
iput-boolean v0, p0, Landroid/widget/AbsListView;->mIsScrolling:Z
[/COLOR]
iget-object v0, p0, Landroid/widget/AbsListView;->mOnScrollListener:Landroid/widget/AbsListView$OnScrollListener;
if-eqz v0, :cond_8
iget-boolean v0, p0, Landroid/widget/AbsListView;->mHoverAreaEnter:Z
if-nez v0, :cond_8
iget v0, p0, Landroid/widget/AbsListView;->mQCstate:I
if-eq v0, v7, :cond_8
iget-object v0, p0, Landroid/widget/AbsListView;->mOnScrollListener:Landroid/widget/AbsListView$OnScrollListener;
invoke-interface {v0, p0, p1}, Landroid/widget/AbsListView$OnScrollListener;->onScrollStateChanged(Landroid/widget/AbsListView;I)V
:cond_8
return-void
[COLOR="blue"]:cond_td
const/4 v0, 0x0
goto :goto_td
[/COLOR]
:catch_0
move-exception v0
Add new method above .method public setAirScrollEnable(Z)V (or at the bottom if this method does not exist)
Code:
.method setAnimation(Landroid/view/View;)Landroid/view/View;
.locals 14
const/4 v5, 0x1
const/high16 v2, 0x3f800000
const/high16 v1, 0x3f000000
const/4 v4, 0x0
iget-object v3, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v6, "listview_animation"
invoke-static {v3, v6, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v10
const/4 v13, 0x0
const/4 v11, 0x0
:try_start_0
invoke-virtual {p0}, Landroid/widget/AbsListView;->computeVerticalScrollOffset()I
:try_end_0
.catch Ljava/lang/NullPointerException; {:try_start_0 .. :try_end_0} :catch_0
move-result v13
:goto_0
if-nez v10, :cond_1
:cond_0
:goto_1
return-object p1
:catch_0
move-exception v9
iget v13, p0, Landroid/widget/AbsListView;->mvPosition:I
goto :goto_0
:cond_1
iget v3, p0, Landroid/widget/AbsListView;->mvPosition:I
if-ge v3, v13, :cond_2
const/4 v11, 0x1
:cond_2
iput v13, p0, Landroid/widget/AbsListView;->mvPosition:I
const/4 v0, 0x0
packed-switch v10, :pswitch_data_0
:goto_2
const-wide/16 v1, 0x1f4
invoke-virtual {v0, v1, v2}, Landroid/view/animation/Animation;->setDuration(J)V
iget-object v1, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "listview_interpolator"
const/4 v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
packed-switch v12, :pswitch_data_1
:goto_3
if-eqz p1, :cond_0
invoke-virtual {p1, v0}, Landroid/view/View;->startAnimation(Landroid/view/animation/Animation;)V
goto :goto_1
:pswitch_0
new-instance v0, Landroid/view/animation/ScaleAnimation;
invoke-direct {v0, v1, v2, v1, v2}, Landroid/view/animation/ScaleAnimation;-><init>(FFFF)V
goto :goto_2
:pswitch_1
new-instance v0, Landroid/view/animation/ScaleAnimation;
move v3, v1
move v4, v2
move v6, v2
move v7, v5
move v8, v2
invoke-direct/range {v0 .. v8}, Landroid/view/animation/ScaleAnimation;-><init>(FFFFIFIF)V
goto :goto_2
:pswitch_2
new-instance v0, Landroid/view/animation/ScaleAnimation;
move v3, v1
move v4, v2
move v6, v1
move v7, v5
move v8, v1
invoke-direct/range {v0 .. v8}, Landroid/view/animation/ScaleAnimation;-><init>(FFFFIFIF)V
goto :goto_2
:pswitch_3
new-instance v0, Landroid/view/animation/AlphaAnimation;
invoke-direct {v0, v4, v2}, Landroid/view/animation/AlphaAnimation;-><init>(FF)V
goto :goto_2
:pswitch_4
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v1, p0, Landroid/widget/AbsListView;->mHeight:I
neg-int v1, v1
int-to-float v1, v1
invoke-direct {v0, v4, v4, v1, v4}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
goto :goto_2
:pswitch_5
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v1, p0, Landroid/widget/AbsListView;->mHeight:I
int-to-float v1, v1
invoke-direct {v0, v4, v4, v1, v4}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
goto :goto_2
:pswitch_6
if-eqz v11, :cond_3
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v1, p0, Landroid/widget/AbsListView;->mHeight:I
neg-int v1, v1
int-to-float v1, v1
invoke-direct {v0, v4, v4, v1, v4}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
goto :goto_2
:cond_3
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v1, p0, Landroid/widget/AbsListView;->mHeight:I
int-to-float v1, v1
invoke-direct {v0, v4, v4, v1, v4}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
goto :goto_2
:pswitch_7
if-eqz v11, :cond_4
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v1, p0, Landroid/widget/AbsListView;->mHeight:I
int-to-float v1, v1
invoke-direct {v0, v4, v4, v1, v4}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
goto :goto_2
:cond_4
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v1, p0, Landroid/widget/AbsListView;->mHeight:I
neg-int v1, v1
int-to-float v1, v1
invoke-direct {v0, v4, v4, v1, v4}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
goto :goto_2
:pswitch_8
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v1, p0, Landroid/widget/AbsListView;->mWidth:I
neg-int v1, v1
int-to-float v1, v1
invoke-direct {v0, v1, v4, v4, v4}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
goto/16 :goto_2
:pswitch_9
new-instance v0, Landroid/view/animation/TranslateAnimation;
iget v1, p0, Landroid/widget/AbsListView;->mWidth:I
int-to-float v1, v1
invoke-direct {v0, v1, v4, v4, v4}, Landroid/view/animation/TranslateAnimation;-><init>(FFFF)V
goto/16 :goto_2
:pswitch_a
new-instance v0, Landroid/view/animation/RotateAnimation;
const/high16 v3, 0x43340000
move-object v2, v0
move v6, v1
move v7, v5
move v8, v1
invoke-direct/range {v2 .. v8}, Landroid/view/animation/RotateAnimation;-><init>(FFIFIF)V
goto/16 :goto_2
:pswitch_b
iget-object v1, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
const v2, 0x10a0005
invoke-static {v1, v2}, Landroid/view/animation/AnimationUtils;->loadInterpolator(Landroid/content/Context;I)Landroid/view/animation/Interpolator;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/animation/Animation;->setInterpolator(Landroid/view/animation/Interpolator;)V
goto/16 :goto_3
:pswitch_c
iget-object v1, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
const v2, 0x10a0006
invoke-static {v1, v2}, Landroid/view/animation/AnimationUtils;->loadInterpolator(Landroid/content/Context;I)Landroid/view/animation/Interpolator;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/animation/Animation;->setInterpolator(Landroid/view/animation/Interpolator;)V
goto/16 :goto_3
:pswitch_d
iget-object v1, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
const v2, 0x10a0004
invoke-static {v1, v2}, Landroid/view/animation/AnimationUtils;->loadInterpolator(Landroid/content/Context;I)Landroid/view/animation/Interpolator;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/animation/Animation;->setInterpolator(Landroid/view/animation/Interpolator;)V
goto/16 :goto_3
:pswitch_e
iget-object v1, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
const v2, 0x10a0007
invoke-static {v1, v2}, Landroid/view/animation/AnimationUtils;->loadInterpolator(Landroid/content/Context;I)Landroid/view/animation/Interpolator;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/animation/Animation;->setInterpolator(Landroid/view/animation/Interpolator;)V
goto/16 :goto_3
:pswitch_f
iget-object v1, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
const v2, 0x10a0008
invoke-static {v1, v2}, Landroid/view/animation/AnimationUtils;->loadInterpolator(Landroid/content/Context;I)Landroid/view/animation/Interpolator;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/animation/Animation;->setInterpolator(Landroid/view/animation/Interpolator;)V
goto/16 :goto_3
:pswitch_10
iget-object v1, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
const v2, 0x10a0009
invoke-static {v1, v2}, Landroid/view/animation/AnimationUtils;->loadInterpolator(Landroid/content/Context;I)Landroid/view/animation/Interpolator;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/animation/Animation;->setInterpolator(Landroid/view/animation/Interpolator;)V
goto/16 :goto_3
:pswitch_11
iget-object v1, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
const v2, 0x10a000a
invoke-static {v1, v2}, Landroid/view/animation/AnimationUtils;->loadInterpolator(Landroid/content/Context;I)Landroid/view/animation/Interpolator;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/animation/Animation;->setInterpolator(Landroid/view/animation/Interpolator;)V
goto/16 :goto_3
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
:pswitch_1
:pswitch_2
:pswitch_3
:pswitch_4
:pswitch_5
:pswitch_6
:pswitch_7
:pswitch_8
:pswitch_9
:pswitch_a
.end packed-switch
:pswitch_data_1
.packed-switch 0x1
:pswitch_b
:pswitch_c
:pswitch_d
:pswitch_e
:pswitch_f
:pswitch_10
:pswitch_11
.end packed-switch
.end method
Add new method in BLUE
Code:
.method public setFriction(F)V
.locals 1
iget-object v0, p0, Landroid/widget/AbsListView;->mFlingRunnable:Landroid/widget/AbsListView$FlingRunnable;
if-nez v0, :cond_0
new-instance v0, Landroid/widget/AbsListView$FlingRunnable;
invoke-direct {v0, p0}, Landroid/widget/AbsListView$FlingRunnable;-><init>(Landroid/widget/AbsListView;)V
iput-object v0, p0, Landroid/widget/AbsListView;->mFlingRunnable:Landroid/widget/AbsListView$FlingRunnable;
:cond_0
iget-object v0, p0, Landroid/widget/AbsListView;->mFlingRunnable:Landroid/widget/AbsListView$FlingRunnable;
# getter for: Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;
invoke-static {v0}, Landroid/widget/AbsListView$FlingRunnable;->access$2100(Landroid/widget/AbsListView$FlingRunnable;)Landroid/widget/OverScroller;
move-result-object v0
invoke-virtual {v0, p1}, Landroid/widget/OverScroller;->setFriction(F)V
return-void
.end method
[COLOR="blue"].method public setGridView(Z)V
.locals 0
iput-boolean p1, p0, Landroid/widget/AbsListView;->mIsGridView:Z
return-void
.end method[/COLOR]
Framework files have been added to the bottom of this post for diffing.
If you have a Galaxy S5, you might be able to get away with just replacing the modified framework files for this modification, however there are no guarantees it wont cause other issues with your build.
Continue to Post #2 to add the menu items for the toggles
Addendum:
Listview disabled by default.
Some users were complaining about listview being active on a fresh flash to this how to disable it as default until they go in and make a choice.
Replace the line in RED with the code in BLUE
\smali_classes2\android\widget\AbsListView.smali
Code:
.method setAnimation(Landroid/view/View;)Landroid/view/View;
.locals 14
const/4 v5, 0x1
const/high16 v2, 0x3f800000
const/high16 v1, 0x3f000000
const/4 v4, 0x0
iget-object v3, p0, Landroid/widget/AbsListView;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v6, "listview_animation"
[COLOR="Red"]invoke-static {v3, v6, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
[/COLOR] [COLOR="Blue"] invoke-static {v3, v6, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
[/COLOR]
Full credits to @Adi Aisiteru Reborn for the original thread HERE
also credit to @lacoursiere18 for the updated KitKat guide HERE
Adding Toggles/Menu Item for Listview
To add Listview Animations menu item to SecSettings, refer to the guide by @lacoursiere18 here:
[GUIDE][SMALI][4.4.2] How to port Mokee ListView Animation for TouchWiz 4.4.2
Note:
For lollipop, I believe the xml edit in res/xml the file to edit is going to be display_settings_2014.xml
_________________________________________________
To add Listview Animations menu item to CustomSettings.apk:
\res\values\arrays.xml
Add new items in BLUE
Code:
[COLOR="blue"]<string-array name="listview_animation_entries">
<item>@string/listview_off</item>
<item>@string/listview_wave_left</item>
<item>@string/listview_wave_right</item>
<item>@string/listview_scale</item>
<item>@string/listview_alpha</item>
<item>@string/listview_stack_top</item>
<item>@string/listview_stack_bottom</item>
<item>@string/listview_unfold</item>
<item>@string/listview_fold</item>
<item>@string/listview_translate_left</item>
<item>@string/listview_translate_right</item>
<item>@string/listview_rotate</item>
</string-array>
<string-array name="listview_animation_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
</string-array>
<string-array name="listview_interpolator_entries">
<item>@string/listview_off</item>
<item>@string/listview_accelerate_interpolator</item>
<item>@string/listview_decelerate_interpolator</item>
<item>@string/listview_accelerate_decelerate_interpolator</item>
<item>@string/listview_anticipate_interpolator</item>
<item>@string/listview_overshoot_interpolator</item>
<item>@string/listview_anticipate_overshoot_interpolator</item>
<item>@string/listview_bounce_interpolator</item>
</string-array>
<string-array name="listview_interpolator_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
</string-array>
[/COLOR]</resources>
\res\values\strings.xml
Add new items in BLUE
Code:
[COLOR="blue"]<string name="listview_off">Off</string>
<string name="listview_wave_left">Wave (left)</string>
<string name="listview_wave_right">Wave (right)</string>
<string name="listview_alpha">Alpha</string>
<string name="listview_scale">Scale</string>
<string name="listview_stack_top">Stack (top)</string>
<string name="listview_stack_bottom">Stack (bottom)</string>
<string name="listview_unfold">Unfold</string>
<string name="listview_fold">Fold</string>
<string name="listview_translate_left">Translate (left)</string>
<string name="listview_translate_right">Translate (right)</string>
<string name="listview_rotate">Rotate</string>
<string name="listview_accelerate_interpolator">Accelerate</string>
<string name="listview_decelerate_interpolator">Decelerate</string>
<string name="listview_accelerate_decelerate_interpolator">Accelerate decelerate</string>
<string name="listview_anticipate_interpolator">Anticipate</string>
<string name="listview_overshoot_interpolator">Overshoot</string>
<string name="listview_anticipate_overshoot_interpolator">Anticipate overshoot</string>
<string name="listview_bounce_interpolator">Bounce</string>
[/COLOR]</resources>
\res\xml\preferences.xml
Code:
<PreferenceScreen android:title="Mokee Listview Animations">
<ListPreference android:persistent="false" android:entries="@array/listview_animation_entries" android:title="Listview animation" android:key="listview_animation" android:summary="%s" android:dependency="listview_animation" android:entryValues="@array/listview_animation_values" />
<ListPreference android:persistent="false" android:entries="@array/listview_interpolator_entries" android:title="Listview interpolator" android:key="listview_interpolator" android:summary="%s" android:dependency="listview_interpolator" android:entryValues="@array/listview_interpolator_values" />
</PreferenceScreen>
Rom Control V2 Entries:
Code:
<string-array name="listview_animation_entries">
<item>Off</item>
<item>Wave Left</item>
<item>Wave Right</item>
<item>Scale</item>
<item>Alpha</item>
<item>Stack Top</item>
<item>Stack Bottom</item>
<item>Unfold</item>
<item>Fold</item>
<item>Translate Left</item>
<item>Translate Right</item>
<item>Rotate</item>
</string-array>
<string-array name="listview_animation_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
</string-array>
<string-array name="listview_interpolator_entries">
<item>Off</item>
<item>Accelerate</item>
<item>Decelerate</item>
<item>Accelerate decelerate</item>
<item>Anticipate</item>
<item>Overshoot</item>
<item>Anticipate overshoot</item>
<item>Bounce</item>
</string-array>
<string-array name="listview_interpolator_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
</string-array>
<PreferenceCategory
android:title="Mokee Listview Animations">
<com.wubydax.romcontrol.v2.prefs.MyListPreference
android:entries="@array/listview_animation_entries"
android:title="Listview animation"
android:key="listview_animation"
android:defaultValue="0"
android:dependency="listview_animation"
android:entryValues="@array/listview_animation_values" />
<com.wubydax.romcontrol.v2.prefs.MyListPreference
android:entries="@array/listview_interpolator_entries"
android:title="Listview interpolator"
android:key="listview_interpolator"
android:defaultValue="0"
android:dependency="listview_interpolator"
android:entryValues="@array/listview_interpolator_values" />
</PreferenceCategory>
Thanks for another great mod and guide. Works great. I wasn't sure what the animations looked like but figured I would try it out. Pretty cool options.
metalfan78 said:
Thanks for another great mod and guide. Works great. I wasn't sure what the animations looked like but figured I would try it out. Pretty cool options.
Click to expand...
Click to collapse
Yes it is pretty cool.
I'm still waiting for some feedback from some of the users that have a different phone to give the framework edits a try.
Its a big task but its worth it.
Yea, it took awhile, pretty neat
metalfan78 said:
Yea, it took awhile, pretty neat
Click to expand...
Click to collapse
Don't you still have the S5?
You could have just replaced the smali files with the ones I posted and been done with it except for adding the menu items.
Good practice though.
Yea, still s5. I did the edits just because I like to, then I diffed.
tdunham said:
Listview Animations for Lollipop
Click to expand...
Click to collapse
It's pretty cool guide.
This is my video from SGS4 i9500: https://youtube.com/watch?feature=youtu.be&v=Jx9_IKhtRKU
Surghikov said:
It's pretty cool guide.
This is my video from SGS4 i9500: https://youtube.com/watch?feature=youtu.be&v=Jx9_IKhtRKU
Click to expand...
Click to collapse
@Surghikov
Very nice. I am curious if you did the full framework modification or just used the files I provided.
I followed your instructions for modifications Framework & SecSettings, were minor discrepancies, but as you can see, it works on my sgs4 i9500.
Thank you and good luck!
@tdunham I am trying this mod on Note 3. it is stuck on boot logo, I attached my stock and modified smalis as well as log, If you could have time looking at my smalis and log and see what's the culprit I would be very thankful. :angel:
kmokhtar79 said:
@tdunham I am trying this mod on Note 3. it is stuck on boot logo, I attached my stock and modified smalis as well as log, If you could have time looking at my smalis and log and see what's the culprit I would be very thankful. :angel:
Click to expand...
Click to collapse
The smali you sent looks fine.
The log wasn't a lot of help so I look at the edit I did for AbsListView$FlingRunnable.smali and see new code for access$3100 where I ask you to check if yours matches the one I posted. I see your AbsListView;->access$3100 is for scrollingcache also. You didn't change that did you?
And just for reference, try plugging in my smali files to see what happens.
Also, send me the other 2 smalis that you edited.
tdunham said:
And just for reference, try plugging in my smali files to see what happens.
Also, send me the other 2 smalis that you edited.
Click to expand...
Click to collapse
OK, let me check.
This is my method which shows the same access
Code:
.method static synthetic access$3100(Landroid/widget/AbsListView;)V
.locals 0
.param p0, "x0" # Landroid/widget/AbsListView;
.prologue
.line 132
invoke-direct {p0}, Landroid/widget/AbsListView;->clearScrollingCache()V
return-void
.end method
I believe those samlis are identical but let's narrow it down the failure.
kmokhtar79 said:
OK, let me check.
This is my method which shows the same access
Code:
.method static synthetic access$3100(Landroid/widget/AbsListView;)V
.locals 0
.param p0, "x0" # Landroid/widget/AbsListView;
.prologue
.line 132
invoke-direct {p0}, Landroid/widget/AbsListView;->clearScrollingCache()V
return-void
.end method
I believe those samlis are identical but let's narrow it down the failure.
Click to expand...
Click to collapse
Right away I see you did not do the edits to AbsListView$FlingRunnable$1.smali or to AbsListView$FlingRunnable.smali because the new method .method endFling(Z)V is missing I think. Read the first part a little more closely, maybe my wording is difficult to understand.
tdunham said:
Right away I see you did not do the edits to AbsListView$FlingRunnable$1.smali or to AbsListView$FlingRunnable.smali because the new method .method endFling(Z)V is missing I think. Read the first part a little more closely, maybe my wording is difficult to understand.
Click to expand...
Click to collapse
Yes I did, I thought you remembering me in mixing up stuff. I uploaded the stock ones. Here I attached the modded smalis. BTW, is this mod going to control or use those animation resources in framework. Because I compiled it successfully and booted fine but there is no animation changes, all I have is stock animation.
kmokhtar79 said:
Yes I did, I thought you remembering me in mixing up stuff. I uploaded the stock ones. Here I attached the modded smalis. BTW, is this mod going to control or use those animation resources in framework. Because I compiled it successfully and booted fine but there is no animation changes, all I have is stock animation.
Click to expand...
Click to collapse
Yes, I got the new set and it looks good too.
Animations only take effect wherever you are scrolling through a list.
Did you add the toggles? Not sure, maybe check for the keys with a sql editor to see if they change on toggle.
tdunham said:
Yes, I got the new set and it looks good too.
Animations only take effect wherever you are scrolling through a list.
Did you add the toggles? Not sure, maybe check for the keys with a sql editor to see if they change on toggle.
Click to expand...
Click to collapse
Yes mate I am aware of that and confirming toggle works but no effect I guess there is something different on Note 3 smalis or resources, anyway thanks for help I think I should move on.
kmokhtar79 said:
Yes mate I am aware of that and confirming toggle works but no effect I guess there is something different on Note 3 smalis or resources, anyway thanks for help I think I should move on.
Click to expand...
Click to collapse
Not sure. I think @lacoursiere18 has a note 4 but not sure if he's tried this yet for his build. Maybe he can share his smali.
Have you tried mine yet? Straight up replacing yours.
tdunham said:
Not sure. I think @lacoursiere18 has a note 4 but not sure if he's tried this yet for his build. Maybe he can share his smali.
Have you tried mine yet? Straight up replacing yours.
Click to expand...
Click to collapse
You mean without comparing? Let me try if it works that way.

Categories

Resources