[TUTORIAL] How to add various framework mods

Status
Not open for further replies.
Search This thread

sandy7

Inactive Recognized Developer
May 28, 2012
6,214
6,843
34
bangalore
SKIP TRACK VIA VOL LONG PRESS



Requirements
1) android.policy.jar
2) APKTOOL
3) Notepad++
4)winrar or 7zip
5) and some patience. :p



1-STEP

open the android.policy.jar with winrar or 7zip archive and pull classes.dex file to ur apktool folder.

2-STEP
decompile the classes.dex using apktool
for this press shift and right mouse click to open cmd prompt..

then add the cmd in cmd prompt to decompile ..
Code:
java -jar baksmali.jar -o classout/ classes.dex

after that u will get a classout folder in apktool folder.

3-STEP
inside the classout folder navigate to com\android\internal\policy\impl\PhoneWindowManager.smali

once u open PhoneWindowManager.smali add the following lines.

Find:

Code:
.field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2

.field static final NAVIGATION_BAR_LAYER:I = 0x12

.field static final PHONE_LAYER:I = 0x3

Add the RED color highlighted lines between them


Code:
.field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2

[COLOR="Red"].field private static final LONG_PRESS_TIMEOUT:I = 0x3e8[/COLOR]

.field static final NAVIGATION_BAR_LAYER:I = 0x12

.field static final PHONE_LAYER:I = 0x3





Find:
Code:
.field mIncallPowerBehavior:I

.field mKeyboardTapVibePattern:[J

.field mKeyguard:Landroid/view/WindowManagerPolicy$WindowState;

Add the RED color highlighted lines between them
Code:
.field mIncallPowerBehavior:I

[COLOR="red"].field mIsLongPress:Z
[/COLOR]
.field mKeyboardTapVibePattern:[J

.field mKeyguard:Landroid/view/WindowManagerPolicy$WindowState;



Find:
Code:
.field private mVolumeDownKeyTriggered:Z

.field private mVolumeUpKeyTriggered:Z

.field mWindowManager:Landroid/view/IWindowManager;

.field mWindowManagerFuncs:Landroid/view/WindowManagerPolicy$WindowManagerFuncs;

Add the RED color highlighted lines between them
Code:
.field private mVolumeDownKeyTriggered:Z

[COLOR="red"].field private final mVolumeDownLongPress:Ljava/lang/Runnable;[/COLOR]

.field private mVolumeUpKeyTriggered:Z

[COLOR="red"].field private final mVolumeUpLongPress:Ljava/lang/Runnable;[/COLOR]

.field mWindowManager:Landroid/view/IWindowManager;

.field mWindowManagerFuncs:Landroid/view/WindowManagerPolicy$WindowManagerFuncs;




Find:
Code:
.line 3586
    new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$21;

    invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$21;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenLockTimeout:Ljava/lang/Runnable;
    
    return-void
.end method

Add the RED color highlighted lines between them
Code:
.line 3586
    new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$21;

    invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$21;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenLockTimeout:Ljava/lang/Runnable;
[COLOR="red"]	
    new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$23;

    invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$23;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;

    new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$24;

    invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$24;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;[/COLOR]
    
    return-void
.end method




Find:
Code:
    iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v3}, Landroid/os/PowerManager$WakeLock;->release()V

    throw v2
.end method

.method public hasNavigationBar()Z
    .registers 2

Add the RED color highlighted lines between them
Code:
    iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v3}, Landroid/os/PowerManager$WakeLock;->release()V

    throw v2
.end method

[COLOR="red"].method handleVolumeLongPress(I)V
    .registers 6
    .parameter "keycode"

    .prologue
    const/16 v1, 0x18

    if-eq p1, v1, :cond_7

    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;

    goto :goto_9

    :cond_7
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;

    :goto_9
    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
.end method

.method handleVolumeLongPressAbort()V
    .registers 3

    .prologue
    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]

.method public hasNavigationBar()Z
    .registers 2



Find:
Code:
.line 2841
    invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingScreenshotChordAction()V
	
    goto :goto_c2

   .line 2843

Add the RED color highlighted lines between them
Code:
.line 2841
    invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingScreenshotChordAction()V

    [COLOR="red"]invoke-virtual {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
	
    invoke-virtual {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z

    move-result v12

    if-eqz v12, :cond_c2

    move-object/from16 v0, p0

    iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsLongPress:Z

    move v12, v0

    if-nez v12, :cond_c2

    and-int/lit8 v12, v10, 0x1

    if-nez v12, :cond_c2

    const/4 v12, 0x3

    move-object/from16 v0, p0

    invoke-virtual {v0, v12, v8}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
[/COLOR]
    goto :goto_c2

   .line 2843




Find:
Code:
    .line 2853
    invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingScreenshotChordAction()V

    goto/16 :goto_c2

    .line 2879

Add the RED color highlighted lines between them
Code:
   .line 2853
    invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingScreenshotChordAction()V

[COLOR="Red"]    invoke-virtual {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V

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

    move-result v12

    if-eqz v12, :cond_c2

    move-object/from16 v0, p0

    iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsLongPress:Z

    move v12, v0

    if-nez v12, :cond_c2

    and-int/lit8 v12, v10, 0x1

    if-nez v12, :cond_c2

    const/4 v12, 0x3

    move-object/from16 v0, p0

    invoke-virtual {v0, v12, v8}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V[/COLOR]

    goto/16 :goto_c2

    .line 2879





Find:
Code:
 if-nez v12, :cond_23

    .line 2894
    const/4 v12, 0x3

    invoke-virtual {p0, v12, v8}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V

    goto/16 :goto_23

    .line 2902

Add the RED color highlighted lines between them
Code:
 if-nez v12, :cond_23

    .line 2894
    const/4 v12, 0x3
    [COLOR="red"]const/4 v7, 0x0[/COLOR]

    invoke-virtual {p0, v12, v8}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
	
    [COLOR="red"]move v0, v7

    move-object/from16 v1, p0

    iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsLongPress:Z

    move-object/from16 v0, p0

    invoke-virtual {v0, v8}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress(I)V
[/COLOR]
    goto/16 :goto_23

    .line 2902




Find:
Code:
.method sendCloseSystemWindows(Ljava/lang/String;)V
    .registers 3
    .parameter "reason"

    .prologue
    .line 3246
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;

    invoke-static {v0, p1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->sendCloseSystemWindows(Landroid/content/Context;Ljava/lang/String;)V

    .line 3247
    return-void
.end method

.method setAttachedWindowFrames(Landroid/view/WindowManagerPolicy$WindowState;IILandroid/view/WindowManagerPolicy$WindowState;ZLandroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;)V
    .registers 12
    .parameter "win"

Add the RED color highlighted lines between them
Code:
.method sendCloseSystemWindows(Ljava/lang/String;)V
    .registers 3
    .parameter "reason"

    .prologue
    .line 3246
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;

    invoke-static {v0, p1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->sendCloseSystemWindows(Landroid/content/Context;Ljava/lang/String;)V

    .line 3247
    return-void
.end method

[COLOR="red"].method protected sendFMBroadcast(Landroid/content/Intent;)V
    .registers 3
    .parameter "intent"

    .prologue
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;

    invoke-virtual {v0, p1}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V

    return-void
.end method

.method protected sendMediaButtonEvent(I)V
    .registers 15
    .parameter "code"

    .prologue
    invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

    move-result-wide v1

    .local v1, eventtime:J
    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

    .local v11, downIntent:Landroid/content/Intent;
    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

    .local v0, downEvent:Landroid/view/KeyEvent;
    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

    .local v12, upIntent:Landroid/content/Intent;
    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

    .local v3, upEvent:Landroid/view/KeyEvent;
    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

    return-void
.end method[/COLOR]

.method setAttachedWindowFrames(Landroid/view/WindowManagerPolicy$WindowState;IILandroid/view/WindowManagerPolicy$WindowState;ZLandroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;)V
    .registers 12
    .parameter "win"




4-STEP
add the following smali files in classoutcom\android\internal\policy\impl
PhoneWindowManager$23.smali
PhoneWindowManager$24.smali

(i have provided these two files in resources.zip attached below this post)


5-STEP
recompiling
come back to apktool main folder.and in the cmd prompt type this cmd to recompile..

Code:
java -Xmx512M -jar smali.jar classout/ -o new-classes.dex

and once its recompiled rename the new-classes.dex to classes.dex

and open the android.policy.jar with winrar archive drag the newly recompiled classes.dex into the archive and select compression level to store.

and ur done..


6-STEP
push the android.policy.jar into system/framework..

flash it via cwm using a flashable zip (i have also provided a flashable zip formate see attachment)

and u have a working skip to track in ur rom



Hope it helps u guys

if u guys are having trouble making it ...make a req to me ill make one for u when iam free..

ps-when it comes to making a thread iam really bad at it plz co-operate :p
 

Attachments

  • format.zip
    129.1 KB · Views: 19
  • resources.zip
    1.6 KB · Views: 17

sandy7

Inactive Recognized Developer
May 28, 2012
6,214
6,843
34
bangalore
How to add xperia S/T lockscreen and small apps

Xperia S/T Lockscreen TUT


requirements.
framework-res.apk
android.policy.jar
notpad++
winrar
knowledge of how to decompile and recompile


If u guys want a good tut for de/recompiling here is good guide by my good friend Stanlin salu
http://xdaforums.com/showthread.php?t=2011254


1-STEP
decompile framework-res.apk
navigate to res/values

and open strings.xml

here add these two at the end (see pic for reference.) and save it
Code:
 <string name="permlab_external_lockscreen">xperia lockscreen</string>
 <string name="permdesc_external_lockscreen">xperia loxkscreen</string>

Untitled.png




2-STEP
in the same values folder
open public.xml
and these strings just below the line show in the below pic and save it
Code:
<public type="string" name="permlab_external_lockscreen" id="0x01040525" />
<public type="string" name="permdesc_external_lockscreen" id="0x01040526" />

Untitled.png


IMPORTANT
0x01040525 ,0x01040526 these are called hex codes and should in a proper order
for ex from the above codes the last 4 hex codes should in this way
0x01040524
0x01040525
0x01040526
0x01040527

a little info about hex codes
hex codes starts from 0-9 and a-f and so one
so they must in the order according to it.

3-STEP
come back to main framework-res folder
and open AndroidManifest.xml

and add these line just below line shown in the pic and save it
Code:
<permission android:label="@string/permlab_external_lockscreen" android:name="com.sonyericsson.permission.EXTERNAL_LOCKSCREEN" android:protectionLevel="signatureOrSystem" android:description="@string/permdesc_external_lockscreen" />

Untitled.png


4-STEP
recompile the framework-res.apk

5-STEP
decompile android.policy.jar
navigate to com\android\internal\policy\impl\
and add this ExternalLockScreen.smali file there (smali file is provided by in the resources zip attached in this post)

and recompile it back

6-STEP
i have attached a flashable zip for format in this post below
put the following files it
uxpnxtlockscreen.apk (provided in resorces zip by me)
settings.apk (which supports XS LS , which can be found easily in this forum) (or may be later ill tell how to add them in ur settings)
android.policy.jar
framework-res.apk

zip and flash it..and ur done ...






HOW TO ADD SMALL APPS


1-STEP
Decompile framework-res.apk
and navigate to res/values/strings.xml

and add these 4 lines at the end as shown in the pic. and save it
Code:
<string name="permlab_smallapp">Small application overlay</string>
<string name="permdesc_smallapp">Allows running movable small applications on top of other applications.</string>
<string name="permlab_externalTaskSwitcher">Start as an external task switcher</string>
 <string name="permdesc_externalTaskSwitcher">Allows the application to be an external task switcher replacing the native task switcher</string>
Untitled.png



2-STEP

in the same values folder open public.xml

and add these 4 lines below the line shown in the pic and save it
Code:
<public type="string" name="permlab_smallapp" id="0x01040550" />
<public type="string" name="permdesc_smallapp" id="0x01040551" />
<public type="string" name="permlab_externalTaskSwitcher" id="0x01040552" />
<public type="string" name="permdesc_externalTaskSwitcher" id="0x01040553" />
Untitled.png



3-STEP
come back to main framework-res folder
and open AndroidManifest.xml

now add this line as shown in the pic
Code:
<permission android:label="@string/permlab_externalTaskSwitcher" android:name="com.sonymobile.permission.EXTERNAL_TASK_SWITCHER" android:protectionLevel="signatureOrSystem" android:description="@string/permdesc_externalTaskSwitcher" />
Untitled.png


and this line as shown in pic .and save it
Code:
 <permission android:label="@string/permlab_smallapp" android:name="com.sony.smallapp.permission.SMALLAPP" android:protectionLevel="dangerous" android:description="@string/permdesc_smallapp" />
Untitled.png


Now recompile the framework-res.apk


4-STEP
decompile framework.jar

and the whole sony folder which consists of small apps samli (i have provided in small apps resources.zip )

recompile it
done

5-STEP
u need some framework files and some permissions files ( provided in resources.zip)
1-etc/permissions
2- small app framework jar file
3-small apps supported services.
4-the small apps

6-STEP
now all mods are ready only thing need is small apps (which i have provided in small apps resources.zip)
and also make u use the small apps supported susyemUI.apk (which can be found in this forum)

put all these files in the flashable zip formate i have provided below..
and enjoy ur small apps



CREDITS:
AOEN WORLD -for resources.
 
Last edited:

Abhinav1997

Inactive Recognized Developer / Retired Forum Mod
Jul 29, 2012
2,590
5,306
I'll try this on xperia nexus and let u know asap.... :)
Regards,
AJ

Sent from my Xperia Mini Pro using Tapatalk 2
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 23
    SKIP TRACK VIA VOL LONG PRESS



    Requirements
    1) android.policy.jar
    2) APKTOOL
    3) Notepad++
    4)winrar or 7zip
    5) and some patience. :p



    1-STEP

    open the android.policy.jar with winrar or 7zip archive and pull classes.dex file to ur apktool folder.

    2-STEP
    decompile the classes.dex using apktool
    for this press shift and right mouse click to open cmd prompt..

    then add the cmd in cmd prompt to decompile ..
    Code:
    java -jar baksmali.jar -o classout/ classes.dex

    after that u will get a classout folder in apktool folder.

    3-STEP
    inside the classout folder navigate to com\android\internal\policy\impl\PhoneWindowManager.smali

    once u open PhoneWindowManager.smali add the following lines.

    Find:

    Code:
    .field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2
    
    .field static final NAVIGATION_BAR_LAYER:I = 0x12
    
    .field static final PHONE_LAYER:I = 0x3

    Add the RED color highlighted lines between them


    Code:
    .field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2
    
    [COLOR="Red"].field private static final LONG_PRESS_TIMEOUT:I = 0x3e8[/COLOR]
    
    .field static final NAVIGATION_BAR_LAYER:I = 0x12
    
    .field static final PHONE_LAYER:I = 0x3





    Find:
    Code:
    .field mIncallPowerBehavior:I
    
    .field mKeyboardTapVibePattern:[J
    
    .field mKeyguard:Landroid/view/WindowManagerPolicy$WindowState;

    Add the RED color highlighted lines between them
    Code:
    .field mIncallPowerBehavior:I
    
    [COLOR="red"].field mIsLongPress:Z
    [/COLOR]
    .field mKeyboardTapVibePattern:[J
    
    .field mKeyguard:Landroid/view/WindowManagerPolicy$WindowState;



    Find:
    Code:
    .field private mVolumeDownKeyTriggered:Z
    
    .field private mVolumeUpKeyTriggered:Z
    
    .field mWindowManager:Landroid/view/IWindowManager;
    
    .field mWindowManagerFuncs:Landroid/view/WindowManagerPolicy$WindowManagerFuncs;

    Add the RED color highlighted lines between them
    Code:
    .field private mVolumeDownKeyTriggered:Z
    
    [COLOR="red"].field private final mVolumeDownLongPress:Ljava/lang/Runnable;[/COLOR]
    
    .field private mVolumeUpKeyTriggered:Z
    
    [COLOR="red"].field private final mVolumeUpLongPress:Ljava/lang/Runnable;[/COLOR]
    
    .field mWindowManager:Landroid/view/IWindowManager;
    
    .field mWindowManagerFuncs:Landroid/view/WindowManagerPolicy$WindowManagerFuncs;




    Find:
    Code:
    .line 3586
        new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$21;
    
        invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$21;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
    
        iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenLockTimeout:Ljava/lang/Runnable;
        
        return-void
    .end method

    Add the RED color highlighted lines between them
    Code:
    .line 3586
        new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$21;
    
        invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$21;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
    
        iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenLockTimeout:Ljava/lang/Runnable;
    [COLOR="red"]	
        new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$23;
    
        invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$23;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
    
        iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
    
        new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$24;
    
        invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$24;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
    
        iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;[/COLOR]
        
        return-void
    .end method




    Find:
    Code:
        iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
    
        invoke-virtual {v3}, Landroid/os/PowerManager$WakeLock;->release()V
    
        throw v2
    .end method
    
    .method public hasNavigationBar()Z
        .registers 2

    Add the RED color highlighted lines between them
    Code:
        iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
    
        invoke-virtual {v3}, Landroid/os/PowerManager$WakeLock;->release()V
    
        throw v2
    .end method
    
    [COLOR="red"].method handleVolumeLongPress(I)V
        .registers 6
        .parameter "keycode"
    
        .prologue
        const/16 v1, 0x18
    
        if-eq p1, v1, :cond_7
    
        iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
    
        goto :goto_9
    
        :cond_7
        iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
    
        :goto_9
        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
    .end method
    
    .method handleVolumeLongPressAbort()V
        .registers 3
    
        .prologue
        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]
    
    .method public hasNavigationBar()Z
        .registers 2



    Find:
    Code:
    .line 2841
        invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingScreenshotChordAction()V
    	
        goto :goto_c2
    
       .line 2843

    Add the RED color highlighted lines between them
    Code:
    .line 2841
        invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingScreenshotChordAction()V
    
        [COLOR="red"]invoke-virtual {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
    	
        invoke-virtual {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z
    
        move-result v12
    
        if-eqz v12, :cond_c2
    
        move-object/from16 v0, p0
    
        iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsLongPress:Z
    
        move v12, v0
    
        if-nez v12, :cond_c2
    
        and-int/lit8 v12, v10, 0x1
    
        if-nez v12, :cond_c2
    
        const/4 v12, 0x3
    
        move-object/from16 v0, p0
    
        invoke-virtual {v0, v12, v8}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
    [/COLOR]
        goto :goto_c2
    
       .line 2843




    Find:
    Code:
        .line 2853
        invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingScreenshotChordAction()V
    
        goto/16 :goto_c2
    
        .line 2879

    Add the RED color highlighted lines between them
    Code:
       .line 2853
        invoke-direct {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingScreenshotChordAction()V
    
    [COLOR="Red"]    invoke-virtual {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
    
        invoke-virtual {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z
    
        move-result v12
    
        if-eqz v12, :cond_c2
    
        move-object/from16 v0, p0
    
        iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsLongPress:Z
    
        move v12, v0
    
        if-nez v12, :cond_c2
    
        and-int/lit8 v12, v10, 0x1
    
        if-nez v12, :cond_c2
    
        const/4 v12, 0x3
    
        move-object/from16 v0, p0
    
        invoke-virtual {v0, v12, v8}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V[/COLOR]
    
        goto/16 :goto_c2
    
        .line 2879





    Find:
    Code:
     if-nez v12, :cond_23
    
        .line 2894
        const/4 v12, 0x3
    
        invoke-virtual {p0, v12, v8}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
    
        goto/16 :goto_23
    
        .line 2902

    Add the RED color highlighted lines between them
    Code:
     if-nez v12, :cond_23
    
        .line 2894
        const/4 v12, 0x3
        [COLOR="red"]const/4 v7, 0x0[/COLOR]
    
        invoke-virtual {p0, v12, v8}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
    	
        [COLOR="red"]move v0, v7
    
        move-object/from16 v1, p0
    
        iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsLongPress:Z
    
        move-object/from16 v0, p0
    
        invoke-virtual {v0, v8}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress(I)V
    [/COLOR]
        goto/16 :goto_23
    
        .line 2902




    Find:
    Code:
    .method sendCloseSystemWindows(Ljava/lang/String;)V
        .registers 3
        .parameter "reason"
    
        .prologue
        .line 3246
        iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
    
        invoke-static {v0, p1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->sendCloseSystemWindows(Landroid/content/Context;Ljava/lang/String;)V
    
        .line 3247
        return-void
    .end method
    
    .method setAttachedWindowFrames(Landroid/view/WindowManagerPolicy$WindowState;IILandroid/view/WindowManagerPolicy$WindowState;ZLandroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;)V
        .registers 12
        .parameter "win"

    Add the RED color highlighted lines between them
    Code:
    .method sendCloseSystemWindows(Ljava/lang/String;)V
        .registers 3
        .parameter "reason"
    
        .prologue
        .line 3246
        iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
    
        invoke-static {v0, p1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->sendCloseSystemWindows(Landroid/content/Context;Ljava/lang/String;)V
    
        .line 3247
        return-void
    .end method
    
    [COLOR="red"].method protected sendFMBroadcast(Landroid/content/Intent;)V
        .registers 3
        .parameter "intent"
    
        .prologue
        iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
    
        invoke-virtual {v0, p1}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V
    
        return-void
    .end method
    
    .method protected sendMediaButtonEvent(I)V
        .registers 15
        .parameter "code"
    
        .prologue
        invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
    
        move-result-wide v1
    
        .local v1, eventtime:J
        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
    
        .local v11, downIntent:Landroid/content/Intent;
        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
    
        .local v0, downEvent:Landroid/view/KeyEvent;
        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
    
        .local v12, upIntent:Landroid/content/Intent;
        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
    
        .local v3, upEvent:Landroid/view/KeyEvent;
        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
    
        return-void
    .end method[/COLOR]
    
    .method setAttachedWindowFrames(Landroid/view/WindowManagerPolicy$WindowState;IILandroid/view/WindowManagerPolicy$WindowState;ZLandroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;)V
        .registers 12
        .parameter "win"




    4-STEP
    add the following smali files in classoutcom\android\internal\policy\impl
    PhoneWindowManager$23.smali
    PhoneWindowManager$24.smali

    (i have provided these two files in resources.zip attached below this post)


    5-STEP
    recompiling
    come back to apktool main folder.and in the cmd prompt type this cmd to recompile..

    Code:
    java -Xmx512M -jar smali.jar classout/ -o new-classes.dex

    and once its recompiled rename the new-classes.dex to classes.dex

    and open the android.policy.jar with winrar archive drag the newly recompiled classes.dex into the archive and select compression level to store.

    and ur done..


    6-STEP
    push the android.policy.jar into system/framework..

    flash it via cwm using a flashable zip (i have also provided a flashable zip formate see attachment)

    and u have a working skip to track in ur rom



    Hope it helps u guys

    if u guys are having trouble making it ...make a req to me ill make one for u when iam free..

    ps-when it comes to making a thread iam really bad at it plz co-operate :p
    14
    How to add xperia S/T lockscreen and small apps

    Xperia S/T Lockscreen TUT


    requirements.
    framework-res.apk
    android.policy.jar
    notpad++
    winrar
    knowledge of how to decompile and recompile


    If u guys want a good tut for de/recompiling here is good guide by my good friend Stanlin salu
    http://xdaforums.com/showthread.php?t=2011254


    1-STEP
    decompile framework-res.apk
    navigate to res/values

    and open strings.xml

    here add these two at the end (see pic for reference.) and save it
    Code:
     <string name="permlab_external_lockscreen">xperia lockscreen</string>
     <string name="permdesc_external_lockscreen">xperia loxkscreen</string>

    Untitled.png




    2-STEP
    in the same values folder
    open public.xml
    and these strings just below the line show in the below pic and save it
    Code:
    <public type="string" name="permlab_external_lockscreen" id="0x01040525" />
    <public type="string" name="permdesc_external_lockscreen" id="0x01040526" />

    Untitled.png


    IMPORTANT
    0x01040525 ,0x01040526 these are called hex codes and should in a proper order
    for ex from the above codes the last 4 hex codes should in this way
    0x01040524
    0x01040525
    0x01040526
    0x01040527

    a little info about hex codes
    hex codes starts from 0-9 and a-f and so one
    so they must in the order according to it.

    3-STEP
    come back to main framework-res folder
    and open AndroidManifest.xml

    and add these line just below line shown in the pic and save it
    Code:
    <permission android:label="@string/permlab_external_lockscreen" android:name="com.sonyericsson.permission.EXTERNAL_LOCKSCREEN" android:protectionLevel="signatureOrSystem" android:description="@string/permdesc_external_lockscreen" />

    Untitled.png


    4-STEP
    recompile the framework-res.apk

    5-STEP
    decompile android.policy.jar
    navigate to com\android\internal\policy\impl\
    and add this ExternalLockScreen.smali file there (smali file is provided by in the resources zip attached in this post)

    and recompile it back

    6-STEP
    i have attached a flashable zip for format in this post below
    put the following files it
    uxpnxtlockscreen.apk (provided in resorces zip by me)
    settings.apk (which supports XS LS , which can be found easily in this forum) (or may be later ill tell how to add them in ur settings)
    android.policy.jar
    framework-res.apk

    zip and flash it..and ur done ...






    HOW TO ADD SMALL APPS


    1-STEP
    Decompile framework-res.apk
    and navigate to res/values/strings.xml

    and add these 4 lines at the end as shown in the pic. and save it
    Code:
    <string name="permlab_smallapp">Small application overlay</string>
    <string name="permdesc_smallapp">Allows running movable small applications on top of other applications.</string>
    <string name="permlab_externalTaskSwitcher">Start as an external task switcher</string>
     <string name="permdesc_externalTaskSwitcher">Allows the application to be an external task switcher replacing the native task switcher</string>
    Untitled.png



    2-STEP

    in the same values folder open public.xml

    and add these 4 lines below the line shown in the pic and save it
    Code:
    <public type="string" name="permlab_smallapp" id="0x01040550" />
    <public type="string" name="permdesc_smallapp" id="0x01040551" />
    <public type="string" name="permlab_externalTaskSwitcher" id="0x01040552" />
    <public type="string" name="permdesc_externalTaskSwitcher" id="0x01040553" />
    Untitled.png



    3-STEP
    come back to main framework-res folder
    and open AndroidManifest.xml

    now add this line as shown in the pic
    Code:
    <permission android:label="@string/permlab_externalTaskSwitcher" android:name="com.sonymobile.permission.EXTERNAL_TASK_SWITCHER" android:protectionLevel="signatureOrSystem" android:description="@string/permdesc_externalTaskSwitcher" />
    Untitled.png


    and this line as shown in pic .and save it
    Code:
     <permission android:label="@string/permlab_smallapp" android:name="com.sony.smallapp.permission.SMALLAPP" android:protectionLevel="dangerous" android:description="@string/permdesc_smallapp" />
    Untitled.png


    Now recompile the framework-res.apk


    4-STEP
    decompile framework.jar

    and the whole sony folder which consists of small apps samli (i have provided in small apps resources.zip )

    recompile it
    done

    5-STEP
    u need some framework files and some permissions files ( provided in resources.zip)
    1-etc/permissions
    2- small app framework jar file
    3-small apps supported services.
    4-the small apps

    6-STEP
    now all mods are ready only thing need is small apps (which i have provided in small apps resources.zip)
    and also make u use the small apps supported susyemUI.apk (which can be found in this forum)

    put all these files in the flashable zip formate i have provided below..
    and enjoy ur small apps



    CREDITS:
    AOEN WORLD -for resources.
    7
    Making a back to kill all tutorial...will add soon..

    Sent from my SK17i using XDA Premium HD app
    3
    hmm

    might need also
    3
    Wow nice :thumbup: request for hold back to kill app
    hehe


    Sent from my WT19i using Tapatalk 2
    no iam not adding back to kill tut...bcz its more complicated (even iam trying to understand it day by day) no req will be taken for back to kill