[MOD] ARHD 7.3 Sensation camera higher bitrates. - HTC Sensation

Hello!
using ApkTool I created very simple MOD to achieve higher bitrates on video, include 3 lower format.
So, this MOD has following bitrates:
FHD 1920x1088 > 20 mbits
HD 1280x720 > 16 mbits
QHD 960x544 > 12 mbits
VGA 640x480 > 6 mbits
on good light conditions!
on less lights bitrates are lower ~ 25%.
MODifications in RecordLimitCheck.smali:
Code:
.method public setByteRate(Lcom/android/camera/HTCCamera;)V
...
...
.line 75
:cond_0
iget v3, v2, Lcom/android/camera/Resolution;->width:I
.line 79
.local v3, video_width:I
const v0, 0x11170
.line 80
.local v0, bitrate_setting:I
const/16 v4, 0x780
if-lt v3, v4, :cond_2
.line 81
const v0, [COLOR="Red"]20000000[/COLOR]
.line 120
:cond_1
:goto_1
iput v0, p0, Lcom/android/camera/RecordLimitCheck;->mVideoBitrate:I
.line 131
const/16 v1, 0x4e20
.line 132
.local v1, extraBitrate:I
add-int/2addr v0, v1
.line 134
div-int/lit8 v4, v0, 0x8
iput v4, p0, Lcom/android/camera/RecordLimitCheck;->mByteRate:I
goto :goto_0
.line 82
.end local v1 #extraBitrate:I
:cond_2
const/16 v4, 0x500
if-le v3, v4, :cond_3
.line 83
const v0, [COLOR="red"]16000000[/COLOR]
goto :goto_1
.line 84
:cond_3
const/16 v4, 0x3c0
if-le v3, v4, :cond_4
.line 85
const v0, [COLOR="red"]16000000[/COLOR]
goto :goto_1
.line 86
:cond_4
const/16 v4, 0x320
if-lt v3, v4, :cond_5
.line 87
const v0, [COLOR="red"]12000000[/COLOR]
goto :goto_1
.line 88
:cond_5
const/16 v4, 0x2d0
if-lt v3, v4, :cond_6
.line 89
const v0, [COLOR="red"]7000000[/COLOR]
goto :goto_1
.line 90
:cond_6
const/16 v4, 0x280
if-lt v3, v4, :cond_7
.line 91
const v0, [COLOR="red"]6000000[/COLOR]
goto :goto_1
howto install ? EASY
put MOD-file onto SDCARD and correct its name to HTCCamera.apk
open ES file explorer with root access & go to ROOT explorer > Mount RW & switch /system to RW
backup copy file HTCCamera to your SDCARD
then go to ROOT explorer > Uninstall system app, choose & uninstall Camera
wait few seconds.
go back to SDCARD & copy MOD to /system/app. change file attributes as -rw-r-r
go to ROOT explorer > Mount RW & switch /system back to R
exit from ES file explorer & in menu you should again see camera icons, but from desktops it can be missing;
just copy them again if you need.
no restart is need.
NOTE1:
I think, more correct is 19MBs bitrate;
this will fit 30 min video in 4GB file size.
NOTE2:
before increasing bitrate, be sure about SDCard speed!!!
2nd class SDCard has 2mbyte write speed >> 16mbits.

bcome said:
Correct me if I'm wrong, but I do believe that ARHD does 20mbit by default, since the following mod has been implemented in ARHD since 6.6.2.
http://forum.xda-developers.com/showthread.php?t=1533238
Click to expand...
Click to collapse
SORRY!
my misstape ARHD is 7.3, not as I wrote 3.7 in title;
I now will correct title..

Sorry if the answer is obvious, but does this work on aosp roms?
Sent from my HTC Sensation using xda app-developers app

PantsFullOfGuns said:
Sorry if the answer is obvious, but does this work on aosp roms?
Sent from my HTC Sensation using xda app-developers app
Click to expand...
Click to collapse
Don't think so

updated first post with source showing MOD.

Related

[FIX] Wallpaper scrolling on TouchWiz30Launcher in 2.3.6

THIS WAS POSTED IN THE ATT Gnote's themes and apps forum but since we share the same problem I post this here as well .
Part A_
1_ USE GALLERY3D.apk form 2.3.5 to allow full size of 'wallpaper'
Part B_
_framework.jar\smali\android\service\wallpaper\WallpaperService$Engine.smali
find :
method doOffsetsChanged()V
then
find :
Code:
.line 735
const/high16 v1, 0x3f00
.line 736
.local v1, xOffset:F
const/4 v2, 0x0
.line 737
.local v2, yOffset:F
const/4 v3, 0x0
.line 738
.local v3, xOffsetStep:F
const/4 v4, 0x0
.line 739
.local v4, yOffsetStep:F
:try_start_0
iget-boolean v9, p0, Landroid/service/wallpaper/WallpaperService$Engine;->mPendingSync:Z
replace with
Code:
.line 735
:try_start_0
iget v1, p0, Landroid/service/wallpaper/WallpaperService$Engine;->mPendingXOffset:F
.line 736
.local v1, xOffset:F
iget v2, p0, Landroid/service/wallpaper/WallpaperService$Engine;->mPendingYOffset:F
.line 737
.local v2, yOffset:F
iget v3, p0, Landroid/service/wallpaper/WallpaperService$Engine;->mPendingXOffsetStep:F
.line 738
.local v3, xOffsetStep:F
iget v4, p0, Landroid/service/wallpaper/WallpaperService$Engine;->mPendingYOffsetStep:F
.line 739
.local v4, yOffsetStep:F
iget-boolean v9, p0, Landroid/service/wallpaper/WallpaperService$Engine;->mPendingSync:Z
note that the line numbers might not be the same .
if you use this in your rom please mention my name somewhere
a simple thanks goes a long way a cofee even further
heads up its fixed
will update op with info for rom devs .
Great thanx for the share!
Rocketing on Juggernaut¡
Dagr8
I'm sure people here would love to have your ROM ported to our phone!
Sent from my SAMSUNG-SGH-I727 using XDA
ZIP it ;-).. Lol
Sent from my SAMSUNG-SGH-I717 using XDA
FYI, I was able to just copy the gallery3d.apk from 2.3.5 and my scrolling wallpaper was fixed (after a reboot) without altering the framework code as above. I'm using MHX 3.1/UCLA base.
Can someone upload the .apk from 2.3.5 please.
rkrasny said:
FYI, I was able to just copy the gallery3d.apk from 2.3.5 and my scrolling wallpaper was fixed (after a reboot) without altering the framework code as above. I'm using MHX 3.1/UCLA base.
Click to expand...
Click to collapse
what is ucla isnt it ICS ? i
No, ucla3 was the last gb release.
Sent from my SAMSUNG-SGH-I727 using XDA

[GUIDE][HOW-TO] Add 6 lockscreens Mod + Lockscreen Gestures (of Cyanogen)

Well, this a very simple guide on adding 6 lockscreen mod to your rom.
Files To be downloaded :
1. android.policy.zip
2. Lidroid-res.apk
3. Lidroid-Parts
Files to be Affected :
1. android.policy.jar
2. systemui.apk (only if you have added 14 status bar toggles before)
Steps :
-Pullout android.policy.jar from '/system/framework' (Must be Deodexed)
-Decompile it (Please dont expect a guide on how to decompile)
-Extract the android.policy.zip file
-copy the smali folder to directory where you decompiled your android.policy.jar
-Now open this file android.policy.jar.out\smali\com\android\internal\policy\impl\KeyguardUpdateMonitor.smali and make the following changes :
-At the begining after '#annonations' search for this line "Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$AirplaneModeChangeCallback;"
after that add this line
Code:
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;,
-Now find this line ".field private mLockscreenWallpaperDrawable:Landroid/graphics/drawable/Drawable;"
-Below it paste this line
Code:
.field private mMediaCallbacks:Ljava/util/ArrayList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayList",
"<",
"Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;",
">;"
}
.end annotation
.end field
-Find this line ".field private mWallpaperModeValue:I"
and jus below paste this
Code:
.field private timezone:Ljava/lang/String;
-Now find this method ".method private handleSimStateChange(Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$SimArgsV"
and above it paste this :
Code:
.method private handleMediaUpdate(IILandroid/net/Uri;)V
.locals 5
.parameter "isPlaying"
.parameter "isStop"
.parameter "mediaUri"
.prologue
const/4 v4, 0x0
const/4 v3, 0x1
.line 467
if-ne p1, v3, :cond_0
move v0, v3
.line 468
.local v0, bIsPlaying:Z
:goto_0
if-ne p2, v3, :cond_1
move v1, v3
.line 470
.local v1, bIsStop:Z
:goto_1
const/4 v2, 0x0
.local v2, i:I
:goto_2
iget-object v3, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mMediaCallbacks:Ljava/util/ArrayList;
invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
move-result v3
if-ge v2, v3, :cond_2
.line 471
iget-object v3, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mMediaCallbacks:Ljava/util/ArrayList;
invoke-virtual {v3, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v3
check-cast v3, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;
invoke-interface {v3, v0, v1, p3}, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;->onMediaUpdated(ZZLandroid/net/Uri;)V
.line 470
add-int/lit8 v2, v2, 0x1
goto :goto_2
.end local v0 #bIsPlaying:Z
.end local v1 #bIsStop:Z
.end local v2 #i:I
:cond_0
move v0, v4
.line 467
goto :goto_0
.restart local v0 #bIsPlaying:Z
:cond_1
move v1, v4
.line 468
goto :goto_1
.line 473
.restart local v1 #bIsStop:Z
.restart local v2 #i:I
:cond_2
return-void
.end method
-Now find this line ".method public getFailedAttempts()I"
above it again paste this :
Code:
.method public getChangedTimeZone()Ljava/lang/String;
.locals 1
.prologue
.line 1131
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->timezone:Ljava/lang/String;
return-object v0
.end method
this one's last for this file , search for ".method public isDevicePluggedIn()Z"
and above it paste :
Code:
.method public isDeviceCharged()Z
.locals 2
.prologue
.line 866
iget v0, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mBatteryLevel:I
const/16 v1, 0x64
if-lt v0, v1, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
-Now close this file and open "\smali\com\android\internal\policy\impl\LockPatternKeyguardView"
-Search for this method now ".method createLockScreen()Landroid/view/View;"
Find this (Jus one line below)
Code:
.prologue
.line 868
below it paste this :
Code:
const/4 v2, 0x0
const/4 v0, 0x0
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "lockscreen_style_pref"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
const/4 v2, 0x1
if-eq v2, v0, :cond_3
const/4 v2, 0x2
if-eq v2, v0, :cond_3
const/4 v2, 0x3
if-eq v2, v0, :cond_3
const/4 v2, 0x4
if-eq v2, v0, :cond_3
const/4 v2, 0x5
if-eq v2, v0, :cond_3
if-eqz v0, :cond_0
.line 869
const/4 v2, 0x0
const/4 v0, 0x0
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "lockscreen_style_pref"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
const/4 v2, 0x6
if-eq v2, v0, :cond_2
const/4 v2, 0x7
if-eq v2, v0, :cond_1
:cond_0
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
goto :goto_0
:cond_1
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
goto :goto_0
:cond_2
after ':cond_2' there will be your default lockscreen so dont leave any line between them.
After the end of your default lockscreen , it might be like this
" invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/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/KeyguardScreenCallbackV
"
paste this
Code:
:goto_0
then on the next line after "return-object v0"
paste this
Code:
:cond_3
new-instance v0, Lcom/android/internal/policy/impl/CyanogenLockScreen;
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/CyanogenLockScreen;-><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_0
Now you may save and close the file.
Now recompile the android.policy.jar and push it to /system/framework with lidroid-res.apk .
Also Push the Lidroid-Parts.apk to '/system/app'
In case If you already have 14 toggles in the status bar adding this may affect it resulting in force closes . So to fix it follow this :
*Prooceed here only if you have 14 status bar toggles mod in your rom*
1.Decompile SystemUI.apk
2.Delete these two folders (if present) : /smali/com/lidroid & /smali/lidroid
3.Download Status_bar_fix from attachments below.
4.Extract it and copy the smali folder to your decompiled SystemUI.apk
5.Recompile and push the SystemUI.apk back to /system/app
Credits
Lidroid - This Mod Isnt Possible without him.
Regarding any help please prefer commenting on this thread rather than sending PM's.
nice guide :good:
Cool... Great guide... Thanks Aryan ^_^
Does the 6 lockscreen include ICS lockscreen? And do I have to download lidroid res? I already had it in my current rom ...
Sent from my GT-S5360 using xda app-developers app
advance user :|
I can't wait for the update.
Please update soon sir
:good::good::good:
ocoot said:
advance user :|
Click to expand...
Click to collapse
its actually quite easy. .
AvijitGhosh82 said:
Does the 6 lockscreen include ICS lockscreen? And do I have to download lidroid res? I already had it in my current rom ...
Sent from my GT-S5360 using xda app-developers app
Click to expand...
Click to collapse
Yes...the new res file contains resources for cyanogen lockscreens..
Waiting for 14 toggle fix!!
Sent from my GT-S5360 using XDA
Good one thanks pratyush
If my status bar is themed, what happens when I add lidroid res apk? Does the theme stay or go away? Thanks.
Sent from my GT-S5360 using xda app-developers app
awesome guide siirrr...:good: but my Status bar FC :laugh:
Creed when are u going to put d 14 toggle fix??
Sent from my GT-S6102 using xda premium
Bhocan said:
awesome guide siirrr...:good: but my Status bar FC :laugh:
Click to expand...
Click to collapse
Was busy for a bit...will put up the status bar fix today !!
pratyush.creed said:
Was busy for a bit...will put up the status bar fix today !!
Click to expand...
Click to collapse
Ohkz.. Gr8.. Eagerly w8ing!!!.
Dude 1 more qs?? Dude u hav put d code for only 6 lockscreens.. But actually there are 9 rite??
Sent from my GT-S6102 using xda premium
Only 6 in this...
Means u knoe how to make only 6 work or in this post there are 6 only?? Coz in ur Rom its 8 and in cyanogen 9...
Sent from my GT-S6102 using xda premium
Status Bar fix added to the guide ... Do not forget to sign your apps after applying it
pratyush.creed said:
Status Bar fix added to the guide ... Do not forget to sign your apps after applying it
Click to expand...
Click to collapse
putting modded classes.dex and res in original systemUI.apk will not work?
The fix you've added....do we have to use it AFTER the lockscreen adding part? Or is it a separate part?
Sent from my GT-S5360 using xda app-developers app
Creed can u add 2 more lockscreens??
Sent from my GT-S6102 using xda premium

[MOD][CM10 loSconosciut][CM10.1 A6] Transparent Status Bar [guide and fix]

This mod and functional for all ROM based on CM10 loSconoscuito
For CM10.1 Alpha 6 here
X-GamerZ - Slim Bean - Like S4 and CM10 loSconoscuito
How to make this mod for other device
decompile SystemUI
/res/values/drawable.xml
<drawable name="status_bar_background">#ff000000</drawable>
change #ff000000 original black by values transparency then compile
decompile android.policy.jar
com/android/internal/policy/impl/PhoneWindowManager.smali
in line 7583 found
Code:
.line 2975
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
.line 2977
:goto_1a
return v0
.line 2976
:cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_26
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
goto :goto_1a
.line 2977
:cond_26
const/4 v0, 0x0
goto :goto_1a
.end method
replace by
Code:
.line 2975
const/4 v0, 0x0
return v0
.end method
com/android/internal/policy/impl/PhoneWindow$DecorView.smali
in line 921 found
Code:
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_7 .. :try_end_a} :catch_17
move-result-object v0
.line 2145
.local v0, ai:Landroid/content/pm/ApplicationInfo;
:goto_b
if-eqz v0, :cond_1a
invoke-virtual {v3, v0}, Landroid/content/pm/PackageManager;->getApplicationLabel(Landroid/content/pm/ApplicationInfo;)Ljava/lang/CharSequence;
move-result-object v4
:goto_11
check-cast v4, Ljava/lang/String;
move-object v1, v4
check-cast v1, Ljava/lang/String;
.line 2147
.local v1, applicationName:Ljava/lang/String;
return-object v1
.line 2142
.end local v0 #ai:Landroid/content/pm/ApplicationInfo;
.end local v1 #applicationName:Ljava/lang/String;
:catch_17
move-exception v2
.line 2143
.local v2, e:Landroid/content/pm/PackageManager$NameNotFoundException;
const/4 v0, 0x0
.restart local v0 #ai:Landroid/content/pm/ApplicationInfo;
goto :goto_b
.line 2145
.end local v2 #e:Landroid/content/pm/PackageManager$NameNotFoundException;
:cond_1a
const/4 v4, 0x0
replace by
Code:
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_7 .. :try_end_a} :catch_14
move-result-object v0
.line 2145
.local v0, ai:Landroid/content/pm/ApplicationInfo;
:goto_b
if-eqz v0, :cond_17
invoke-virtual {v3, v0}, Landroid/content/pm/PackageManager;->getApplicationLabel(Landroid/content/pm/ApplicationInfo;)Ljava/lang/CharSequence;
move-result-object v1
:goto_11
check-cast v1, Ljava/lang/String;
.line 2147
.local v1, applicationName:Ljava/lang/String;
return-object v1
.line 2142
.end local v0 #ai:Landroid/content/pm/ApplicationInfo;
.end local v1 #applicationName:Ljava/lang/String;
:catch_14
move-exception v2
.line 2143
.local v2, e:Landroid/content/pm/PackageManager$NameNotFoundException;
const/4 v0, 0x0
.restart local v0 #ai:Landroid/content/pm/ApplicationInfo;
goto :goto_b
.line 2145
.end local v2 #e:Landroid/content/pm/PackageManager$NameNotFoundException;
:cond_17
const/4 v1, 0x0
0% = #00000000 > 100 transparency
5% = #0d000000 > 95 transparency
10% = #16000000 > 90 transparency
15% = #26000000 > 85 transparency
20% = #32000000 > 80 transparency
25% = #40000000 > 75 transparency
30% = #48000000 > 70 transparency
35% = #59000000 > 65 transparency
40% = #64000000 > 60 transparency
45% = #73000000 > 55 transparency
50% = #80000000 > 50 transparency
55% = #8c000000 > 45 transparency
60% = #96000000 > 40 transparency
65% = #a6000000 > 35 transparency
70% = #11200000 > 30 transparency
75% = #bf000000 > 25 transparency
80% = #d9000000 > 20 transparency
85% = #12800000 > 15 transparency
90% = #14400000 > 10 transparency
95% = #f2000000 > 5 transparency
100% (original black) = #ff000000 > 0 NO transparency
How to install
- Put the zip file on your SD and reboot in recovery
- Choose install zip from sdcard
- Restart
- Enjoy transparency
LoLaTiOn said:
How to install
- Put the zip file on your SD and reboot in recovery
- Choose install zip from sdcard
- Restart
- Enjoy transparency
Click to expand...
Click to collapse
thanks and keep rocking LoLa
Great lola:thumbup:
~radio friendly unit shifter~
work very smoth lola you are realy the best frinde with our low legacy devices ....
thanks
Thanks LoLa, I will test that
Where is 45% ? ^^ Thanks for put this Transparency !
I hope to revive this project to comply with the NEW cm10.1 alpha5
abderrezak said:
I hope to revive this project to comply with the NEW cm10.1 alpha5
Click to expand...
Click to collapse
I was about to ask whether it works with 10.1 or not. Thanks
Dunno why with tickle my android when prepare system app for pushing there is something missing with systemui
Sent from my GT-I9003 using xda premium
Don't flash this on cm10.1 alpha 5 it will boot loop .Would like to see this working,as i find black notification bar to thick and ugly.
TRANSPARENT STATUS BAR FOR CM10.1
1. DECOMPILE android.policy.jar
\com\android\internal\policy\impl\PhoneWindowManager.smali
find this method
.method public getSystemDecorRectLw(Landroid/graphics/RectI
DELETE it until its .end method
Code:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
.registers 3
.parameter "systemRect"
.prologue
.line 3057
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemLeft:I
iput v0, p1, Landroid/graphics/Rect;->left:I
.line 3058
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemTop:I
iput v0, p1, Landroid/graphics/Rect;->top:I
.line 3059
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemRight:I
iput v0, p1, Landroid/graphics/Rect;->right:I
.line 3060
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemBottom:I
iput v0, p1, Landroid/graphics/Rect;->bottom:I
.line 3061
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
.line 3063
:goto_1a
return v0
.line 3062
:cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_26
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
goto :goto_1a
.line 3063
:cond_26
const/4 v0, 0x0
goto :goto_1a
.end method
and replace with this
Code:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
.registers 3
.parameter "systemRect"
.prologue
.line 3057
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemLeft:I
iput v0, p1, Landroid/graphics/Rect;->left:I
.line 3058
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemTop:I
iput v0, p1, Landroid/graphics/Rect;->top:I
.line 3059
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemRight:I
iput v0, p1, Landroid/graphics/Rect;->right:I
.line 3060
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemBottom:I
iput v0, p1, Landroid/graphics/Rect;->bottom:I
.line 3063
const/4 v0, 0x0
return v0
.end method
DONE & COMPILE
2. DECOMPILE SystemUI.apk
. /res/layout/status_bar_expanded_header.xml
LINE xml 2 , replace with my line
Code:
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/header" android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_header_height" android:baselineAligned="false"
/res/values/drawables.xml
100% Transparency
Code:
<item type="drawable" name="status_bar_background">[COLOR="Red"]#00000000[/COLOR]</item>
OR
80% Transparency
Code:
<item type="drawable" name="status_bar_background">[COLOR="Red"]#88000000[/COLOR]</item>
DONE !!, AND COMPILE
Make it for cm10.1 alpha 5 lola
Sent from my GT-I9003 using xda premium
Lola, any chance for flashable version for CM10.1?
Sent from my GT-I9003 using Tapatalk 4 Beta
I will not make tousent
tell me exactly what you want
LoLaTiOn said:
I will not make tousent
tell me exactly what you want
Click to expand...
Click to collapse
65% and 100% if possible.
+1 to 100% and 0% to be able to revert if needed.
make two of 88% and 100% transparent:laugh:
I have 80% transparent for alpha 5,if someone need you can pm me and i will upload
Sent from my GT-I9003 using xda premium
Update!!! Alpha 5
80% transparent
http://db.tt/EVXRifvh
100% soon!
Sent from my GT-I9003 using xda premium
MR.Volkf said:
100% soon!
Click to expand...
Click to collapse
:highfive:

[Guide] LockScreen torch mod

This mod will make you able to have torch flash light while you are on LockScreen by long pressing on the home button...!!!​
Actual mod was done by RobbieHood and eybee1970
Needed tools:
1) Backsmali/Smali program from here
2) Notepad++ program from here
3) WinRAR or 7-zip archiver
The procedure:
- Backsmali android.policy.jar
- Navigate to classout/com/android/internal/policy/impl/ folder
- We will be working on 3 smali files:
KeyguardViewMediator$4.smali
- Search for "packed-switch" and add the blue line just above "return-void":
Code:
.line 1255
iget v2, p1, Landroid/os/Message;->what:I
packed-switch v2, :pswitch_data_72
.line 1298
:goto_7
[B][COLOR="Blue"]:pswitch_7[/COLOR][/B]
return-void
.line 1257
- Search for ":catchall" and add these lines above it:
Code:
.line 1295
monitor-exit v1
goto :goto_[B][COLOR="Red"]7[/COLOR][/B]
[B][COLOR="Blue"] :pswitch_6e
iget-object v2, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator$4;->this$0:Lcom/android/internal/policy/impl/KeyguardViewMediator;
iget v3, p1, Landroid/os/Message;->arg1:I
if-eqz v3, :cond_majdi
move v3, v0
:goto_nj
#calls: Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
invoke-static {v2, v3}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->access$2400(Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
goto :goto_[COLOR="Red"]7[/COLOR]
:cond_majdi
move v3, v1
goto :goto_nj[/COLOR][/B]
:catchall_7b
move-exception v0
monitor-exit v1
N.B: pay attention to number 7 in goto :goto_7 that could be different in your smali according to your ROM, make sure it is the same as the first one which is just above the new line ":pswitch_6e"
Click to expand...
Click to collapse
- Search for "nop" and another "nop" line bellow it (don't forget to leave empty line in between):
Code:
.line 1255
nop
[B][COLOR="Blue"]nop[/COLOR][/B]
- Now go to the end of smali and add these switches above ".end packed-switch" line:
Code:
:pswitch_data_72
.packed-switch 0x1
:pswitch_8
:pswitch_10
:pswitch_16
:pswitch_1c
:pswitch_22
:pswitch_28
:pswitch_2e
:pswitch_38
:pswitch_40
:pswitch_4c
:pswitch_52
:pswitch_58
:pswitch_64
[B][COLOR="Blue"]:pswitch_7
:pswitch_7
:pswitch_7
:pswitch_7
:pswitch_7
:pswitch_7
:pswitch_6e[/COLOR][/B]
.end packed-switch
.end method
N.B: if your smali has :pswitch_7 and :pswitch_6e by default, then use another :pswitch_value for :pswitch_7 and :pswitch_6e. If you do so, then don't forget to change :pswitch_7 and :pswitch_6e value in added codes from the beginning above as well
Click to expand...
Click to collapse
Save changes...
KeyguardViewMediator.smali
- Search for ".field private static final SET_HIDDEN:I = 0xc" and add this line bellow it (the blue one):
Code:
.field private static final SET_HIDDEN:I = 0xc
[B][COLOR="Blue"].field private static final SET_TORCH:I = 0x14[/COLOR][/B]
.field private static final SHOW:I = 0x2
- Search for ".field private mTelephonyManager:Landroid/telephony/TelephonyManager;" and add thses lines bellow it (the blue ones):
Code:
.field private mTelephonyManager:Landroid/telephony/TelephonyManager;
[B][COLOR="Blue"].field private mTorchEnabled:Z
.field private mTorchStateChanged:Z[/COLOR][/B]
.field private mUnlockSoundId:I
- Search for this method ".method public constructor <init>(Landroid/content/Context;Lcom/android/internal/policy/impl/PhoneWindowManager;Landroid/os/LocalPowerManager;)V" and add these lines (the blue ones):
Code:
.method public constructor <init>(Landroid/content/Context;Lcom/android/internal/policy/impl/PhoneWindowManager;Landroid/os/LocalPowerManager;)V
.registers 15
.parameter "context"
.parameter "callback"
.parameter "powerManager"
.prologue
.line 308
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 188
[B][COLOR="Blue"]const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z[/COLOR][/B]
const/4 v0, 0x1
- Search for "const-string v0, "power"" and add these lines above it (the blue lines):
Code:
.line 311
iput-object p3, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mRealPowerManager:Landroid/os/LocalPowerManager;
.line 312
[B][COLOR="Blue"]const/4 v0, 0x0
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z[/COLOR][/B]
const-string v0, "power"
- Search for this method ".method static synthetic access$300(Lcom/android/internal/policy/impl/KeyguardViewMediator;I)V" and add this new method above it:
Code:
.method static synthetic access$2300(Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
.registers 2
.parameter "x0"
.parameter "x1"
.prologue
.line 110
invoke-direct {p0, p1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetHidden(Z)V
return-void
.end method
[B][COLOR="Blue"].method static synthetic access$[COLOR="Red"]2400[/COLOR](Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
.registers 2
invoke-direct {p0, p1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
return-void
.end method[/COLOR][/B]
.method static synthetic access$300(Lcom/android/internal/policy/impl/KeyguardViewMediator;I)V
N.B: pay attention to $2400, that is increment to the method above it
Click to expand...
Click to collapse
- Search for the method ".method private handleHide()V" and add this line at end of this method (the blue one) just after "monitor-exit p0":
Code:
.method private handleHide()V
..
..
..
.line 1449
monitor-exit p0
[B][COLOR="Blue"]invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V[/COLOR][/B]
goto :goto_18
:catchall_45
move-exception v0
monitor-exit p0
:try_end_47
.catchall {:try_start_1 .. :try_end_47} :catchall_45
throw v0
.end method
.method private handleKeyguardDone(Z)V
- Search for the method ".method private handleNotifyScreenOff()V" and add this line (the blue one) just above "return-void":
Code:
.method private handleNotifyScreenOff()V
.registers 3
.prologue
.line 1597
monitor-enter p0
.line 1598
:try_start_1
const-string v0, "KeyguardViewMediator"
const-string v1, "handleNotifyScreenOff"
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 1599
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mKeyguardViewManager:Lcom/android/internal/policy/impl/KeyguardViewManager;
invoke-virtual {v0}, Lcom/android/internal/policy/impl/KeyguardViewManager;->onScreenTurnedOff()V
.line 1600
monitor-exit p0
.line 1601
[B][COLOR="Blue"]invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V[/COLOR][/B]
return-void
- Search for the method ".method private handleSetHidden(Z)V" and add this line (the blue one) above the defined condition in the method:
Code:
.method private handleSetHidden(Z)V
.registers 3
.parameter "isHidden"
.prologue
.line 688
monitor-enter p0
.line 689
:try_start_1
iget-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHidden:Z
if-eq v0, p1, :cond_10
.line 690
iput-boolean p1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHidden:Z
.line 691
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->updateActivityLockScreenState()V
.line 692
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustUserActivityLocked()V
.line 693
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustStatusBarLocked()V
.line 695
[B][COLOR="Blue"]invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V[/COLOR][/B]
:cond_10
monitor-exit p0
- Search for the method ".method private handleShow()V" and add the following new method above it:
Code:
[B][COLOR="Blue"].method private handleSetTorch(Z)V
.registers 8
const/4 v5, 0x0
const/4 v4, 0x1
:try_start_2
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
if-nez v1, :cond_majdi
iput-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
const/4 v1, 0x1
iput-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
:cond_[COLOR="Red"]b[/COLOR]
:goto_[COLOR="Red"]b[/COLOR]
return-void
:cond_majdi
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
if-eq v1, p1, :cond_[COLOR="Red"]b[/COLOR]
iput-boolean p1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
new-instance v0, Landroid/content/Intent;
const-string v1, "net.cactii.flash2.TOGGLE_FLASHLIGHT"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
const-string v1, "net.cactii.flash2.EXTRA_DISABLE_NOTIFICATION"
const/4 v2, 0x1
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mContext:Landroid/content/Context;
invoke-virtual {v1, v0}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V
:try_end_maj
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_maj} :catch_jdi
goto :goto_[COLOR="Red"]b[/COLOR]
:catch_jdi
move-exception v1
goto :goto_[COLOR="Red"]b[/COLOR]
.end method[/COLOR][/B]
.method private handleShow()V
N.B: pay attention to :cond_b and :goto_b that could be differ according to your ROM where b should be the exact the same first condition in this method ".method public isGlanceViewVisible()Z"
Code:
.method public isGlanceViewVisible()Z
.registers 2
.prologue
.line 666
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mKeyguardViewManager:Lcom/android/internal/policy/impl/KeyguardViewManager;
if-eqz v0, [B][COLOR="Red"]:cond_b[/COLOR][/B]
.line 667
Click to expand...
Click to collapse
- Search for method ".method private handleShow()V", then search bellow for "Landroid/os/PowerManager$WakeLock;->release()V" and add these lines bellow it (the blue ones):
Code:
.method private handleShow()V
.registers 3
.prologue
.line 1400
monitor-enter p0
.line 1401
:try_start_1
const-string v0, "KeyguardViewMediator"
...
...
...
invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->release()V
.line 1419
[B][COLOR="Blue"]const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z[/COLOR][/B]
monitor-exit p0
- Search for the method ".method private resetStateLocked()V" and add these lines (the blue ones) at the end before "return-void" line:
Code:
.method private resetStateLocked()V
.registers 4
...
...
invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
.line 809
[B][COLOR="Blue"]return-void
.end method
.method private resetTorchState()V
.registers 2
iget-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
if-eqz v0, :cond_[COLOR="Red"]8[/COLOR]
const/4 v0, 0x0
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
:cond_[COLOR="Red"]8[/COLOR][/COLOR][/B]
return-void
.end method
N.B: pay attention to :cond_8 that could be differ according to your ROM where 8 should be the exact the same first DEFINED condition in this method ".method private playSounds(Z)V"
Code:
.method private playSounds(Z)V
.registers 10
.parameter "locked"
.prologue
const/4 v5, 0x0
const/4 v4, 0x1
.line 1362
iget-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mSuppressNextLockSound:Z
if-eqz v0, :cond_9
.line 1363
iput-boolean v5, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mSuppressNextLockSound:Z
.line 1385
[B][COLOR="Red"]:cond_8[/COLOR][/B]
:goto_8
return-void
Click to expand...
Click to collapse
- Search for the method ".method public verifyUnlock(Landroid/view/WindowManagerPolicy$OnKeyguardExitResult;)V" and add this new method above it (the blue lines):
Code:
[B][COLOR="Blue"].method public setTorch(Z)V
.registers 7
const/16 v4, 0x14
const/4 v3, 0x0
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mScreenOn:Z
if-eqz v1, :cond_newa
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
invoke-virtual {v1, v4}, Landroid/os/Handler;->removeMessages(I)V
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
if-eqz p1, :cond_newb
const/4 v2, 0x1
:goto_[COLOR="Red"]11[/COLOR]
invoke-virtual {v1, v4, v2, v3}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;
move-result-object v0
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
:cond_newa
return-void
:cond_newb
move v2, v3
goto :goto_[COLOR="Red"]11[/COLOR]
.end method[/COLOR][/B]
.method public verifyUnlock(Landroid/view/WindowManagerPolicy$OnKeyguardExitResult;)V
N.B: pay attention to :goto_11 that could be differ according to your ROM where 11 should be the exact the same goto action in this method ".method public isInputRestricted()Z"
Code:
.method public isInputRestricted()Z
.registers 2
..
..
[B][COLOR="Red"]:goto_11[/COLOR][/B]
return v0
:cond_12
const/4 v0, 0x0
goto :goto_11
.end method
Click to expand...
Click to collapse
Save changes..
PhoneWindowManager.smali
All changes here, will be in this method ".method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J"; so it is better to know from which part of smali this method starts and ends in order to not touch other methods!!
- First search for the method ".method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J",
- Search for "Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z" and add these lines bellow it (the blue ones):
Code:
.method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J
.registers 56
...
...
...
...
.line 3364
:cond_2ba
if-nez v15, :cond_[B][COLOR="Red"]38c[/COLOR][/B]
.line 3365
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
[B][COLOR="Blue"]if-eqz v0, :cond_[COLOR="Red"]38c[/COLOR]
const/16 v3, 0x0[/COLOR][/B]
move/from16 v20, v0
N.B: pay attention to if-eqz v0, :cond_38c where the condition number 38c is the same as IF condition above it
Click to expand...
Click to collapse
- Search for this portion (you can search down for ".catch Landroid/os/RemoteException" to locate this portion) and add this line (the blue one):
Code:
.line 3373
invoke-interface/range {v44 .. v44}, Lcom/android/internal/statusbar/IStatusBarService;->cancelPreloadRecentApps()V
:try_end_2dd
.catch Landroid/os/RemoteException; {:try_start_2d4 .. :try_end_2dd} :catch_329
.line 3381
.end local v44 #statusbar:Lcom/android/internal/statusbar/IStatusBarService;
:cond_2dd
:goto_2dd
const/4 v3, 0x0
move-object/from16 v0, p0
iput-boolean v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
[B][COLOR="Blue"]invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->launchHomeFromHotKey()V[/COLOR][/B]
.line 3382
if-nez v36, :cond_32c
- Search down for "Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->setHomeDownEventSent()V" and add this new code after defined condition:
Code:
.line 3470
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomeKeyDoubleClickConcept:Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;
invoke-virtual {v3}, Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->setHomeDownEventSent()V
.line 3473
:cond_3a6
[B][COLOR="Blue"]new-instance v0, Ljava/io/File;
const-string v1, "/sdcard/Android"
invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v0
if-eqz v0, :cond_majdi
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v3, v0
invoke-virtual/range {v3 .. v3}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->isShowingAndNotHidden()Z
move-result v3
if-eqz v3, :cond_majdi
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v3, v0
move-object/from16 v0, v3
move v1, v15
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->setTorch(Z)V
rem-int/lit8 v3, v41, 0xf
if-nez v3, :cond_majdi
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v3, v0
invoke-virtual/range {v3 .. v3}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->pokeWakelock()V
:cond_majdi[/COLOR][/B]
const-wide/16 v3, 0x0
goto/16 :goto_8f
- Search down for "const/16 v3, 0xbb" (v3 may differ according to ROM) and do the following editing:
before:
Code:
.line 3635
:cond_[B][COLOR="Red"]536[/COLOR][/B] [B][COLOR="Green"]<-- we need to copy bellow condition over it[/COLOR][/B]
const/16 v3, 0xbb
move/from16 v0, v32
if-ne v0, v3, :cond_[B][COLOR="Red"]56f[/COLOR][/B] [B][COLOR="Green"]<-- we need to define new condition[/COLOR][/B]
.line 3637
move-object/from16 v0, p0
after:
Code:
.line 3635
:cond_[B][COLOR="Blue"]56f[/COLOR][/B]
const/16 v3, 0xbb
move/from16 v0, v32
if-ne v0, v3, :cond_[B][COLOR="Blue"]nj[/COLOR][/B]
.line 3637
move-object/from16 v0, p0
- Now we need to redefine mentioned cond_56f (it could be differ according to ROM), search UP for ".catch Landroid/content/ActivityNotFoundException;" and modify the IF-NE condition bellow it:
before:
Code:
.catch Landroid/content/ActivityNotFoundException; {:try_start_4fd .. :try_end_506} :catch_705
.line 3839
.end local v43 #shortcutIntent:Landroid/content/Intent;
:cond_506
:goto_506
const-wide/16 v3, -0x1
goto/16 :goto_8f
.line 3621
.end local v31 #kcm:Landroid/view/KeyCharacterMap;
:cond_50a
const/16 v3, 0x54
move/from16 v0, v32
if-ne v0, v3, [B][COLOR="Red"]:cond_536[/COLOR] [COLOR="Green"]<-- redefine this condition[/COLOR][/B]
.line 3622
if-eqz v15, :cond_522
after:
Code:
.catch Landroid/content/ActivityNotFoundException; {:try_start_4fd .. :try_end_506} :catch_705
.line 3839
.end local v43 #shortcutIntent:Landroid/content/Intent;
:cond_506
:goto_506
const-wide/16 v3, -0x1
goto/16 :goto_8f
.line 3621
.end local v31 #kcm:Landroid/view/KeyCharacterMap;
:cond_50a
const/16 v3, 0x54
move/from16 v0, v32
if-ne v0, v3, [B][COLOR="Blue"]:cond_56f[/COLOR][/B]
.line 3622
if-eqz v15, :cond_522
- Search down for "const/16 v3, 0xdb" (v3 may differ according to ROM) and change the condition value above it to the new condition from above mentioned edited code:
before:
Code:
.line 3654
.end local v16 #e:Landroid/os/RemoteException;
[B][COLOR="Red"]:cond_56f[/COLOR] [COLOR="Green"]<-- change it to the new condition[/COLOR][/B]
const/16 v3, 0xdb
move/from16 v0, v32
if-ne v0, v3, :cond_5a4
after:
Code:
.line 3654
.end local v16 #e:Landroid/os/RemoteException;
[B][COLOR="Blue"]:cond_nj[/COLOR][/B]
const/16 v3, 0xdb
move/from16 v0, v32
if-ne v0, v3, :cond_5a4
Save changes...
Now backsmali classsout folder to get new classes.dex file. Now Open android.policy.jar by WinRAR or 7-zip and drag and drop the new classes.dex file inside it; then push it to your device framework folder and fix permissions to chmod 644.
Download Torch.apk from attachment bellow and push it to your device app folder and fix permissions to chmod 644 as well... and viola.. lockscreen the device and do long pressing on home button to have torch flash light..:laugh:
If you could manage to shorten this tutorial by omitting unnecessary steps, then share your experience here please
thanks man
you're awesome
For those who want to make smali comparison, I attached the 3 mentioned smali before and after editing... So it will be easier to locate differences :laugh:
You can find them in the attachment bellow
wow a lot of work, and of course big thanks
your tutorials provide a real value for comunity, I have learned a lot with these.
thanks once again and keep up a great work!
p.s. waiting for someone to qoute op lol
edit: why your tutorials are not sticky threads (wondering)
Sent from my GT-N7000 using xda app-developers app
OMG ...
How you know all this???
You are boss..
Sent from my [email protected]£@×¥
my most loved app from robbie and miui roms. these however look like rocket science to me. therefore i'll leave this rocket science to the geniuses.
thank u. mcuh appreciatrd that everyone can now embed this wonderful feature into more roms.
With the steps that you have done in this mod, does long pressing the home button turn the torch on until the screen locks so that you can take your finger off the home button, or do you need to keep your finger on the home button the whole time for the torch to stay on?
daveyannihilation said:
With the steps that you have done in this mod, does long pressing the home button turn the torch on until the screen locks so that you can take your finger off the home button, or do you need to keep your finger on the home button the whole time for the torch to stay on?
Click to expand...
Click to collapse
press and hold = light on
release button = light off
sent from my G-Note
hara74 said:
press and hold = light on
release button = light off
sent from my G-Note
Click to expand...
Click to collapse
Thanks for the reply.
Is there any way of implementing the mods done in this thread: [MOD] [GUIDE] [JB BLK1] LockScreen Torch with toggle?
This actually keeps the torch on even after you release the home button, but it will turn off when the screen turns off either by timing out or pressing the lock button.
I tried to port it to Galaxy S II but I am not a master dev like majdinj so I couldn't get it to work. I am not too worried about the toggle to turn it on and off, but keeping the torch on after letting go of the home button would be great.
Thanks in advance,
Dave
sorry m8 I don't know,
maybe majdinj knows
sent from my G-Note
daveyannihilation said:
Thanks for the reply.
Is there any way of implementing the mods done in this thread: [MOD] [GUIDE] [JB BLK1] LockScreen Torch with toggle?
This actually keeps the torch on even after you release the home button, but it will turn off when the screen turns off either by timing out or pressing the lock button.
I tried to port it to Galaxy S II but I am not a master dev like majdinj so I couldn't get it to work. I am not too worried about the toggle to turn it on and off, but keeping the torch on after letting go of the home button would be great.
Thanks in advance,
Dave
Click to expand...
Click to collapse
You should pay attention to conditions buddy.. "You will not reach glory until you taste patience".. so try and try and try till you success :good:
majdinj said:
You should pay attention to conditions buddy.. "You will not reach glory until you taste patience".. so try and try and try till you success :good:
Click to expand...
Click to collapse
Thank you majdinj.
So what you're saying is, everywhere that I see a cond_ written in a method, I need to pay attention to where that cond is and what it does? Sorry, but smali code is like Swahili to me!
Thanks for your advice.
All the best,
Dave
Hi!
I'm having problem with PhoneWindowManager.smali. Most of the .line #### is not present. Should I add them? This is for Pristine ROM v4.0.
Sample.
On ".method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J"
I should add a line under;
" .line 3365
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z"
but this codes are not present;
" .line 3364
:cond_2ba
if-nez v15, :cond_38c
.line 3365
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z"
and so on. Any help please? Thanks!
Installed apk on alborak (lt5). Seems not working (even rebooted). Any idea, sir.
Sent from my GT-N7000 using xda premium
ive perfectly followed each step of yours when i push the apk and the jar file
my phone hangs on boot screen ://
im sure ive perfectly edited the files
Hi, installed apk on lt6 sweet v9. No success. This is a useful app, can you pls do something.
Sent from my GT-N7000 using xda premium
dsmas said:
Hi, installed apk on lt6 sweet v9. No success. This is a useful app, can you pls do something.
Sent from my GT-N7000 using xda premium
Click to expand...
Click to collapse
you cannot just install the apk you have to go thru the procedure in OP.
I was searching for this mod for a long time ago.. I just found it in TeamUnion ROM .. I like the ROM but after a while it drain my battery so fast.. so I decide to install one clean Stock ROM like ebyee's ROM and add some little mod like call recording and etc.. was searching for this mod but haven't ever could figure out how it works.. Thanks majdinj for posting it here :good:
Sorry for bumping this thread. I don't entirely understand the tutorial.
I believe I'm on an odex rom (where .apk and .odex are in /system/app), and I'm not sure if it'll work for me.
I've downloaded all the programs (backsmali/smali/notepad++), but I don't understand what the procedure says. What does it mean to backsmali android.policy.jar? Where do I get this android.policy.jar?
rcheung28 said:
Sorry for bumping this thread. I don't entirely understand the tutorial.
I believe I'm on an odex rom (where .apk and .odex are in /system/app), and I'm not sure if it'll work for me.
I've downloaded all the programs (backsmali/smali/notepad++), but I don't understand what the procedure says. What does it mean to backsmali android.policy.jar? Where do I get this android.policy.jar?
Click to expand...
Click to collapse
It's in /system/framework but you will also need android.policy.odex which you will need to deodex to be able to see the smali files.
There is a thread in Samsung Galaxy SII Original Android Development by sicopat here: http://forum.xda-developers.com/showthread.php?t=1208320 which states how to deodex a jar file.
You will also need all of the other jar files from /system/framework to be able to deodex it properly.
If you need a hand or some tips, just ask.
Sent from my GT-I9505 using Tapatalk 4 Beta

[Guide] Long press volume rocker to skip song tracks (update 16/6/2013)

Hello xda members,
New day and new mod to learn, isn't it?
Today I will explain to you how to be able to change sound track by long pressing volume up or down while the screen is locked using stock Music Player and Google Play Music programs..
First I would like to say thanks to:
- xperiacle: who firstly port this mod to Galaxy Note.
- grilleld: who helped me by providing android.policy.jar from xperiacle ROM, so I could locate codes for this mod (I did some codes modifications to shortening the modding process , so it will be easy and straight forward).
Click to expand...
Click to collapse
OK let's start..
Needed tools:
1) Backsmali/Smali program (Check the utility I made for that here for windows users)
2) Notepad ++ from here.
The procedure:
- Backsmali android.policy.jar
- Navigate to com/android/internal/policy/impl/ folder and open PhoneWindowManager.smali
- Search for this static field ".field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2" and add this line bellow it (the blue one):
Code:
.field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2
[B][COLOR="Blue"].field private static final LONG_PRESS_TIMEOUT:I = 0x190[/COLOR][/B]
.field static final MINI_APP_DIALOG_LAYER:I = 0x5
Here you can set the timeout for long press event of volume rocker, here it is set to 400 millisecond (0x190).
Click to expand...
Click to collapse
- Search for this field ".field private mIsVisibleSPenGestureView:Z" and add these two lines bellow it (the blue ones):
Code:
.field private mIsVisibleSPenGestureView:Z
[B][COLOR="Blue"].field mIsVolumeAction:Z
.field mIsVolumeBlocking:Z[/COLOR][/B]
.field mKeyboardTapVibePattern:[J
- Search for the field ".field private mVolumeDownKeyTriggered:Z" and add this line bellow it (the blue one):
Code:
.field private mVolumeDownKeyTriggered:Z
[B][COLOR="Blue"].field mVolumeDownLongPress:Ljava/lang/Runnable;[/COLOR][/B]
.field private final mVolumeKeyLongPressforOneTouchReport:Ljava/lang/Runnable;
- Search for the field ".field private mVolumeUpKeyTriggered:Z" and add this line bellow it (the blue one):
Code:
.field private mVolumeUpKeyTriggered:Z
[B][COLOR="Blue"].field mVolumeUpLongPress:Ljava/lang/Runnable;[/COLOR][/B]
.field mWindowManager:Landroid/view/IWindowManager;
- Search for the method ".method public constructor <init>()V" and go to the end of this method and add these lines (the blue ones) before "return-void" line:
Code:
.line 7234
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$36;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$36;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenLockTimeout:Ljava/lang/Runnable;
[B][COLOR="Blue"]new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$Skip1;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$Skip1;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$Skip2;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$Skip2;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;[/COLOR][/B]
.line 8132
return-void
.end method
- Search for the method ".method handleVolumeKey(II)V" and add these lines above "invoke-static" line (the blue ones), and add extra condition line (the blue line) above "goto" command:
Code:
.method handleVolumeKey(II)V
.registers 8
.parameter "stream"
.parameter "keycode"
.prologue
.line 5405
[B][COLOR="Blue"]move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-nez v0, :cond_c[/COLOR][/B]
invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getAudioService()Landroid/media/IAudioService;
move-result-object v0
if-nez v0, :cond_d
[B][COLOR="Blue"]:cond_c[/COLOR][/B]
:goto_[B][COLOR="Blue"]c[/COLOR][/B]
return-void
Here we should change :goto_value to same as conditions we added, so it will be :goto_c
Click to expand...
Click to collapse
- Still in the same method, search down for "Landroid/os/PowerManager$WakeLock;->release()V" and change :goto value to the same as the one in the previous:
before:
Code:
iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
goto :goto_[B][COLOR="Red"]6[/COLOR][/B]
After:
Code:
iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
goto :goto_[B][COLOR="Blue"]c[/COLOR][/B]
- There is another one..!! Search down again for "Landroid/os/PowerManager$WakeLock;->release()V" and change :goto value to the same as the one in the previous step:
Before:
Code:
iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
goto :goto_[B][COLOR="Red"]6[/COLOR][/B]
After:
Code:
iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
goto :goto_[B][COLOR="Blue"]c[/COLOR][/B]
- Now at the end of the previous method ".method handleVolumeKey(II)V" and before the next method ".method public hasNavigationBar()Z", add these two new methods:
Code:
[B][COLOR="Blue"].method handleVolumeLongPress(I)V
.registers 6
const/4 v1, 0x1
move-object/from16 v0, p0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
const/4 v1, 0x0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
const/16 v1, 0x18
if-ne p1, v1, :cond_majdi
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
:goto_nj
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
sget v2, Lcom/android/internal/policy/impl/PhoneWindowManager;->LONG_PRESS_TIMEOUT:I
int-to-long v2, v2
invoke-virtual {v1, v0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
return-void
:cond_majdi
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
goto :goto_nj
.end method
.method handleVolumeLongPressAbort()V
.registers 3
const/4 v1, 0x0
move-object/from16 v0, p0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
return-void
.end method[/COLOR][/B]
- Now search for the method ".method public interceptKeyBeforeQueueing(Landroid/view/KeyEvent;IZ)I", then search down for "Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;" and add these lines ABOVE it (the blue ones):
Code:
:cond_51c
move-object/from16 v0, p0
[B][COLOR="Blue"]iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenOnEarly:Z
if-nez v0, :cond_dinj
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z
move-result v29
if-eqz p0, :cond_dinj
move-object/from16 v0, p0
move/from16 v15, v19
invoke-virtual {v0, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress(I)V
:cond_dinj
move-object/from16 v0, p0[/COLOR][/B]
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v29, v0
- Still in the same method, and after adding the previous lines, just go down for few lines and you will see a line starts with a defined condition (:cond_), just add these lines (the blue ones) bellow that defined condition:
Code:
invoke-virtual/range {v29 .. v29}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V
goto/16 :goto_68
:cond_562
[B][COLOR="Blue"]if-nez v5, :cond_newa
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_newa
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_newa
move-object/from16 v0, p0
const/4 v3, 0x0
move/from16 v15, v19
invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_newa[/COLOR][/B]
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 v29, v0
- Now at the end of the method ".method sendCloseSystemWindows(Ljava/lang/String;)V" and above the method ".method setAttachedWindowFrames(Landroid/view/WindowManagerPolicy$WindowState;IILandroid/view/WindowManagerPolicy$WindowState;ZLandroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;I)V" add this new method:
Code:
[B][COLOR="Blue"].method protected sendMediaButtonEvent(I)V
.registers 15
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v1
new-instance v11, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v11, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
new-instance v0, Landroid/view/KeyEvent;
const/4 v5, 0x0
const/4 v7, 0x0
move-wide v3, v1
move v6, p1
invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;-><init>(JJIII)V
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v11, v4, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v11, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
new-instance v12, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v12, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
new-instance v3, Landroid/view/KeyEvent;
const/4 v8, 0x1
const/4 v10, 0x0
move-wide v4, v1
move-wide v6, v1
move v9, p1
invoke-direct/range {v3 .. v10}, Landroid/view/KeyEvent;-><init>(JJIII)V
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v12, v4, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v12, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
const/4 v8, 0x1
move-object/from16 v9, p0
iput-boolean v8, v9, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
return-void
.end method[/COLOR][/B]
Save changes..
Now add the two extra smalis resources from the attachment in com/android/internal/policy/impl folder and recompile android.policy.jar and push to your phone and fix permissions to chmod 644.
PS: for those who want to compare smalis, I also attached PhoneWindowManager.smali BEFORE and AFTER changes applied.
Click to expand...
Click to collapse
Have fun..
you are 'Mr. Guide'!!! Sharing is caring!!!
Wow, you don't have limits in innovation ^^, great work, will try to implement that on my rom ^^.
Thanks a lot majdinj
Please anybody try to do it on MIUI
Thanks
Just done and tested, it works great ^^, thanks majdinj
eybee1970 said:
you are 'Mr. Guide'!!! Sharing is caring!!!
Click to expand...
Click to collapse
Welcome eybee,,,, :laugh:
ezaechiel said:
Just done and tested, it works great ^^, thanks majdinj
Click to expand...
Click to collapse
thank you for testing
Any chance of adding in a ticker box to enable and disable this mod? Would be nice
maskerwsk said:
Any chance of adding in a ticker box to enable and disable this mod? Would be nice
Click to expand...
Click to collapse
Me too would like to,,, but I need to study more how are these things done,,, In the meanwhile enjoy the mod
Wow another great guide released .Thanks a lot :thumbup:
Sent from my GT-I9082 using Tapatalk 2
majdinj said:
Me too would like to,,, but I need to study more how are these things done,,, In the meanwhile enjoy the mod
Click to expand...
Click to collapse
I guess we'd have to start with secsettings res/xml/XXXXXX and add the ticker to the layout. Then add the corresponding methods to the smali files.
I will have a crack at this aswell as it would be nice to add enable/disable action to most mods
maskerwsk said:
I guess we'd have to start with secsettings res/xml/XXXXXX and add the ticker to the layout. Then add the corresponding methods to the smali files.
I will have a crack at this aswell as it would be nice to add enable/disable action to most mods
Click to expand...
Click to collapse
That would be great
maskerwsk said:
I guess we'd have to start with secsettings res/xml/XXXXXX and add the ticker to the layout. Then add the corresponding methods to the smali files.
I will have a crack at this aswell as it would be nice to add enable/disable action to most mods
Click to expand...
Click to collapse
I will be happy to learn that from you if possible man :laugh:
Code is updated to include timeout delay before long press event to occur..
Hi majdinj
I tried to put 5 seconds delay but it seems it doesn't work. I have same delay if I put 2 or 5 seconds and it less than a second.
Maybe I don't use the good hex format for time.
Could you tell me how to set 2 seconds delay please?
ezaechiel said:
Hi majdinj
I tried to put 5 seconds delay but it seems it doesn't work. I have same delay if I put 2 or 5 seconds and it less than a second.
Maybe I don't use the good hex format for time.
Could you tell me how to set 2 seconds delay please?
Click to expand...
Click to collapse
tbh, I don't know if it support 5 seconds or not,,,
but in general, to convert numbers to hex, grab any converter online; if you use windows PC, then open calculator --> view --> programmer, here put your delay time in millisecond in Dec format then just switch format to hex to get your number.. So for 2 seconds = 2000 milliseconds = 7d0, so you should put 0x7d0 in your script to have 2 seconds delay
majdinj said:
tbh, I don't know if it support 5 seconds or not,,,
but in general, to convert numbers to hex, grab any converter online; if you use windows PC, then open calculator --> view --> programmer, here put your delay time in millisecond in Dec format then just switch format to hex to get your number.. So for 2 seconds = 2000 milliseconds = 7d0, so you should put 0x7d0 in your script to have 2 seconds delay
Click to expand...
Click to collapse
Ok that's what I do but I can't see difference .
Thanks for your answer
EDIT : My bad, I missed a change in your tutorial , it works great now, sorry majdinj
ezaechiel said:
Ok that's what I do but I can't see difference .
Thanks for your answer
EDIT : My bad, I missed a change in your tutorial , it works great now, sorry majdinj
Click to expand...
Click to collapse
My pleasure,,
When i use the tool for uncompress android policy jar file it shows in the endd that it cant find androidpolicy classout folder
what is wrong?
jirka607 said:
When i use the tool for uncompress android policy jar file it shows in the endd that it cant find androidpolicy classout folder
what is wrong?
Click to expand...
Click to collapse
Do you use backsmali? Because you edit 1.bat with the name of android.policity.jar, run 1.bat and you'll see classout folder.
Well i put file into folder called put file here
Load it using 5 into the bat
then i press 1 and in the end there is error when i choose yes

Categories

Resources