[TUTORIAL] How to add various framework/Settings mods [Update 5/4/2013]

Search This thread

sandy7

Inactive Recognized Developer
May 28, 2012
6,214
6,843
34
bangalore
FEATURED ON XDA NEWS

Untitled.png

http://www.xda-developers.com/android/add-your-favorite-mods-on-the-sony-xperia-arc/




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



Camera Button to play/pause music

1-STEP

decompile android.policy.jar

and open com\android\internal\policy\impl\PhoneWindowManager.smali

2-STEP

in phonewindowmanager.smalli find this line

.method public interceptKeyBeforeQueueing

now at the end of this method find this and add the red marked code

Code:
.line 2794
    nop

    nop

    nop

    nop

    nop

    :sswitch_data_28a
    .sparse-switch
        0x5 -> :sswitch_61
        0x6 -> :sswitch_16c
        0x18 -> :sswitch_9a
        0x19 -> :sswitch_9a
        0x1a -> :sswitch_1ae
	[COLOR="Red"]0x1b -> :sswitch_195[/COLOR]
        0x4f -> :sswitch_236
        0x55 -> :sswitch_228
        0x56 -> :sswitch_236
        0x57 -> :sswitch_236
        0x58 -> :sswitch_236
        0x59 -> :sswitch_236
        0x5a -> :sswitch_236
        0x5b -> :sswitch_236
        0x7e -> :sswitch_228
        0x7f -> :sswitch_228
        0x82 -> :sswitch_236
        0xa4 -> :sswitch_9a
        0x400 -> :sswitch_265
    .end sparse-switch

(1b is the KEYCODE_CAMERA hex code, see docs:KEYCODE_CAMERA

so after adding that code it should look like this....

Untitled.png





now scroll few lines up to find this line...

Code:
.line 3000
    .end local v3           #ex:Landroid/os/RemoteException;
    .end local v11           #telephonyService:Lcom/android/internal/telephony/ITelephony;
	[COLOR="Blue"]:sswitch_265[/COLOR]
    if-eqz v2, :cond_27f

    if-nez v9, :cond_27f

    .line 3001
    iget-object v12, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;

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

    .line 3002
    iget-object v12, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;

    new-instance v13, Lcom/android/internal/policy/impl/PhoneWindowManager$PassVendorKey;

    new-instance v14, Landroid/view/KeyEvent;

now see the above code where marked in blue from there leave some space like this...

Untitled.png



next add these lines between the spaces

Code:
[COLOR="Red"]:sswitch_195
    if-eqz v2, :cond_195

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

    move-result v12

    if-nez v12, :cond_195

    const/16 v12, 0x55

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

    .line 901
    const/4 v12, 0x0

    iput-boolean v12, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z

    :cond_195
    goto/16 :goto_23

    .line 4000[/COLOR]


so from now its very simple remove all the spaces so it will end up look like this...

Untitled.png



once u done it save the file

3-STEP
recompile it

and flash it and enjoy the new mod..



SMALL APPS FOR CM BASED ROM


1-STEP

decompile framework-res.apk

goto res/values/strings.xml and add these lines a the end



Code:
 <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>
    <string name="permlab_smallapp">Small application overlay</string>
    <string name="permdesc_smallapp">Allows running movable small applications on top of other applications.</string>



open AndroidManifest.xml

and add the following lines
Code:
 <permission android:name="android.permission.SYSTEM_ALERT_WINDOW" android:label="@string/permlab_systemAlertWindow" android:description="@string/permdesc_systemAlertWindow" android:protectionLevel="dangerous" android:permissionGroup="android.permission-group.SYSTEM_TOOLS" />

and
Code:
 <permission android:name="com.sony.smallapp.permission.SMALLAPP" android:label="@string/permlab_smallapp" android:description="@string/permdesc_smallapp" android:protectionLevel="dangerous" />


like this shown in the pic..

Untitled.png




done recompile the framework-res.apk

2-STEP

decompile android.policy.jar

and open com\android\internal\policy\impl\PhoneWindowManager.smal

and add the red marked lines

Code:
.field static final SEARCH_BAR_LAYER:I = 0x4

.field static final SECURE_SYSTEM_OVERLAY_LAYER:I = 0x17

.field static final SEPARATE_TIMEOUT_FOR_SCREEN_SAVER:Z = false

.field static final SHOW_PROCESSES_ON_ALT_MENU:Z = false

[COLOR="red"].field static final SHOW_STARTING_ANIMATIONS:Z = true

.field static final SMALLAPP_LAYER:I = 0x3[/COLOR]

.field static final STATUS_BAR_LAYER:I = 0xf

.field static final STATUS_BAR_PANEL_LAYER:I = 0x10

.field static final STATUS_BAR_SUB_PANEL_LAYER:I = 0xe


and find these lines in the same file.

Code:
[COLOR="Blue"].method public checkAddPermission(Landroid/view/WindowManager$LayoutParams;)I
    .locals 4
    .parameter "attrs"

    .prologue
    const/4 v2, 0x0

    .line 1609
    iget v1, p1, Landroid/view/WindowManager$LayoutParams;->type:I

    .line 1611
    .local v1, type:I
    const/16 v3, 0x7d0

    if-lt v1, v3, :cond_0

    const/16 v3, 0xbb7

    if-le v1, v3, :cond_1

    .line 1643
    :cond_0
    :goto_0
    return v2

    .line 1615
    :cond_1
    const/4 v0, 0x0

    .line 1616
    .local v0, permission:Ljava/lang/String;
    sparse-switch v1, :sswitch_data_0

    .line 1635
    const-string v0, "android.permission.INTERNAL_SYSTEM_WINDOW"

    .line 1637
    :goto_1
    :sswitch_0
    if-eqz v0, :cond_0

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

    invoke-virtual {v3, v0}, Landroid/content/Context;->checkCallingOrSelfPermission(Ljava/lang/String;)I

    move-result v3

    if-eqz v3, :cond_0

    .line 1640
    const/4 v2, -0x8

    goto :goto_0

    .line 1632
    :sswitch_1
    const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"

    .line 1633
    goto :goto_1

    .line 1616
    nop

    :sswitch_data_0
    .sparse-switch
        0x7d2 -> :sswitch_1
        0x7d3 -> :sswitch_1
        0x7d5 -> :sswitch_0
        0x7d6 -> :sswitch_1
        0x7d7 -> :sswitch_1
        0x7da -> :sswitch_1
        0x7db -> :sswitch_0
        0x7dd -> :sswitch_0
        0x7e7 -> :sswitch_0
    .end sparse-switch
.end method[/COLOR]


no is the funny part replace all the above blue marked lines with the below red marked lines

Code:
[COLOR="red"].method public checkAddPermission(Landroid/view/WindowManager$LayoutParams;)I
    .locals 4
    .parameter "attrs"

    .prologue
    const/4 v2, 0x0

    .line 1115
    iget v1, p1, Landroid/view/WindowManager$LayoutParams;->type:I

    .line 1117
    .local v1, type:I
    const/16 v3, 0x7d0

    if-lt v1, v3, :cond_0

    const/16 v3, 0xbb7

    if-le v1, v3, :cond_1

    .line 1152
    :cond_0
    :goto_0
    return v2

    .line 1121
    :cond_1
    const/4 v0, 0x0

    .line 1122
    .local v0, permission:Ljava/lang/String;
    sparse-switch v1, :sswitch_data_0

    .line 1144
    const-string v0, "android.permission.INTERNAL_SYSTEM_WINDOW"

    .line 1146
    :goto_1
    :sswitch_0
    if-eqz v0, :cond_0

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

    invoke-virtual {v3, v0}, Landroid/content/Context;->checkCallingOrSelfPermission(Ljava/lang/String;)I

    move-result v3

    if-eqz v3, :cond_0

    .line 1149
    const/4 v2, -0x8

    goto :goto_0

    .line 1137
    :sswitch_1
    const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"

    .line 1138
    goto :goto_1

    .line 1141
    :sswitch_2
    const-string v0, "com.sony.smallapp.permission.SMALLAPP"

    .line 1142
    goto :goto_1

    .line 1122
    :sswitch_data_0
    .sparse-switch
        0x7d2 -> :sswitch_1
        0x7d3 -> :sswitch_1
        0x7d5 -> :sswitch_0
        0x7d6 -> :sswitch_1
        0x7d7 -> :sswitch_1
        0x7da -> :sswitch_1
        0x7db -> :sswitch_0
        0x7dd -> :sswitch_0
        0xbb5 -> :sswitch_2
        0xbb6 -> :sswitch_2
    .end sparse-switch
.end method[/COLOR]


save it..done now recompile the android.policy.jar


3-STEP

decompile framework.jar

add the whole sony folder (provided in the resources.zip attached below ) in classout/com

and recompile framework.jar

4-STEP

now u need to add some files in system/app
system/etc
system/framework

all the files are provided in resources.zip so just take them and add those files in ur flashable zip

5-STEP

once u flash the mod .u need an Slauncher app to launch the small apps...download it from google play

so its done enjoy the smalls on cm based roms..



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

if u like my tut plz press thanks

IF u like my work donate me and ATM my device is screwed have to repair it will cost more plz help me to get my device repaired by donating me
HOW TO DONATE ME
Due to some rules paypal donate button is disabled in INDIA. So any one willing to donate me please follow this :
* Login to ur paypal account
* Option "Personal payment" doesn't work for India, please set "Online purchases". and check Goods or Service (preferably service)
* Send desired payment
* Input my paypal email there : sandeeppatil781@gmail.com
* Thank you!
 

Attachments

  • format.zip
    129.1 KB · Views: 390
  • resources.zip
    1.6 KB · Views: 651
  • CM_smallapps_resorces.rar
    3.9 MB · Views: 322
Last edited:

sandy7

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

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

public.xml sample hexadecimal codes

0x70000000
0x70000001
0x70000002
0x70000003
0x70000004
0x70000005
0x70000006
0x70000007
0x70000008
0x70000009
0x7000000a
0x7000000b
0x7000000c
0x7000000d
0x7000000e
0x7000000f
0x70000010

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 and LockPatternKeyguardView.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


HOW TO ADD THE FAMOUS MAGNIFICATION GLASS TO UR FRAMEWORK..
(a big thanks to AEON WORLD)


1-STEP

decompile ur framework-res.apk

2-STEP
navigate to res/values and edit the following xml's

Dimens.xml add these lines at the end..as shown in the pic

Code:
<dimen name="magnifier_selection_handle_offset_y">44.0dip</dimen>
<dimen name="roundMagnificationRadius">55.0dip</dimen>
<dimen name="rectangularMagnificationWidth">179.0dip</dimen>
<dimen name="rectangularMagnificationHeight">74.0dip</dimen>
<dimen name="selection_handle_offset_y">42.0dip</dimen>
<dimen name="selection_handle_right_offset_x">15.0dip</dimen>
<dimen name="selection_handle_left_offset_x">7.0dip</dimen>

Untitled.png





Public.xml add the following lines as shown in pic

under public type demin

Code:
<public type="dimen" name="magnifier_selection_handle_offset_y" id="0x01050078" />
<public type="dimen" name="roundMagnificationRadius" id="0x01050079" />
 <public type="dimen" name="rectangularMagnificationWidth" id="0x0105007a" />
 <public type="dimen" name="rectangularMagnificationHeight" id="0x0105007b" />
 <public type="dimen" name="selection_handle_offset_y" id="0x0105007c" />
 <public type="dimen" name="selection_handle_right_offset_x" id="0x0105007d" />
 <public type="dimen" name="selection_handle_left_offset_x" id="0x0105007e" />

note ur hex codes should be order..

Untitled.png



under public type drawables

<public type="drawable" name="textfield_search_right_holo" id="0x010807fb" />
<public type="drawable" name="semc_magnifier_arrow_above" id="0x010807fc" />
<public type="drawable" name="semc_magnifier_arrow_left" id="0x010807fd" />
<public type="drawable" name="semc_magnifier_arrow_right" id="0x010807fe" />
<public type="drawable" name="semc_magnifier_rectangle" id="0x010807ff" />
<public type="drawable" name="semc_magnifier_round" id="0x01080800" />

again the hex codes should in order

Untitled.png



3-STEP

put the pngs which i have provided in magni_resoures.rar to drawables-hpdi folder

4-STEP

now recompile the framework-res.apk..

5-STEP
now decompile ur framewok.jar

add the following files provided in magni_resoreces.rar

copy all the files in webkit folder and paste it in classout/android/webkit folder

and copy all the files widget folder and paste it in classout/android/widget folder

wait dont recomplie yet (see next step :p )

6-STEP

now we have to compare some id's from ur public.xml and MagnifierView.smali to assign the same id's for drawables and dimes present in public.xml

Open ur both Public.xml and MagnifierView.smali at the same time and do the following

in magnifierView.smali

1- Find this line and assign <public type="drawable" name="semc_magnifier_round" id="0x010807f9" /> id here

Code:
  .line 413
  move-object/from16 v0, p0

    iget-object v3, v0, Landroid/widget/MagnifierView;->mFrames:[Landroid/graphics/drawable/Drawable;

    const/4 v4, 0x0

    const v5, 0x10[COLOR="Red"]807f9[/COLOR]

2- Find this line and assign <public type="drawable" name="semc_magnifier_rectangle" id="0x010807f8" /> id here

Code:
 .line 414
    move-object/from16 v0, p0

    iget-object v3, v0, Landroid/widget/MagnifierView;->mFrames:[Landroid/graphics/drawable/Drawable;

    const/4 v4, 0x1

    const v5, 0x10[COLOR="red"]807f8[/COLOR]

3-Find this line and assign <public type="dimen" name="roundMagnificationRadius" id="0x01050073" /> id here

Code:
.line 422
    const v3, 0x10[COLOR="red"]50073[/COLOR]

    invoke-virtual {v12, v3}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

    move-result v13

4-Find this line and assign <public type="dimen" name="rectangularMagnificationWidth" id="0x01050074" /> id here
Code:
 .line 426
    move-object/from16 v0, p0

    iget-object v3, v0, Landroid/widget/MagnifierView;->mMagnificationWidth:[I

    const/4 v4, 0x1

    const v5, 0x10[COLOR="red"]50074[/COLOR]

5-Find this line and assign <public type="dimen" name="rectangularMagnificationHeight" id="0x01050075" /> id here
Code:
.line 428
    move-object/from16 v0, p0

    iget-object v3, v0, Landroid/widget/MagnifierView;->mMagnificationHeight:[I

    const/4 v4, 0x1

    const v5, 0x10[COLOR="red"]50075[/COLOR]

6-Find this line and assign <public type="dimen" name="selection_handle_offset_y" id="0x01050076" /> id here
Code:
.line 452
    move-object/from16 v0, p0

    iget-object v3, v0, Landroid/widget/MagnifierView;->mArrowDrawables:[Landroid/graphics/drawable/Drawable;

    const/4 v4, 0x0

    const v5, 0x10[COLOR="red"]50076[/COLOR]

7-Find this line and assign <public type="dimen" name="selection_handle_right_offset_x" id="0x01050077" /> id here
Code:
.line 454
    move-object/from16 v0, p0

    iget-object v3, v0, Landroid/widget/MagnifierView;->mArrowDrawables:[Landroid/graphics/drawable/Drawable;

    const/4 v4, 0x1

    const v5, 0x10[COLOR="red"]50077[/COLOR]


8-Find this line and assign <public type="dimen" name="selection_handle_left_offset_x" id="0x01050078" /> id here

Code:
.line 456
    move-object/from16 v0, p0

    iget-object v3, v0, Landroid/widget/MagnifierView;->mArrowDrawables:[Landroid/graphics/drawable/Drawable;

    const/4 v4, 0x2

    const v5, 0x10[COLOR="red"]50078[/COLOR]


once u done it..
recompile ur framework.jar


STEP-7


now use the flashable zip i have provided to flash this mod..





PS- my way for presentation of this TUT is bad...hope u guys understand.



CREDITS:
AOEN WORLD -for resources.and initial tut
 

Attachments

  • magni_glass_flasable_zip_formate.zip
    157.7 KB · Views: 441
  • magni_resources.rar
    405.5 KB · Views: 623
Last edited:

sandy7

Inactive Recognized Developer
May 28, 2012
6,214
6,843
34
bangalore
More TUTS here

Adding options in settings.apk

well friends today iam going to show u have to add options like CPU control, panel settings , navigation bar in ur settings.apk


SO lets start

1-STEP
install the frameworks from the rom from where u are taking the settings.apk

2-STEP
hope u guys know how to decompile iam not going to explain it
so decompile the settings.apk (make sure u set the compression level 128mb)



3-STEP

once decompiled
goto res\values

1)strings.xml
add the lines at the end

creating a header name
add this line at the end
Code:
[B]<string name="header_category_advanced">[COLOR="Red"]Sandy's mod[/COLOR]</string>[/B]
note:u can change the red colored highlighted name to any thing..


for CPU control
Code:
[B]<string name="overclocktool_title">CPU control</string>[/B]

for quickpanel
Code:
[B]<string name="quickpanel_location">Quick panel</string>[/B]

for navigation bar
Code:
[B]<string name="nav_title">Navigation button</string>[/B]

for sim card option
Code:
<string name="sim_title">SIM card</string>

For sms counter
Code:
<string name="sms_title">SMS counter</string>

for lockscreen changer
Code:
<string name="lockscreen_title">Lock screen</string>

for audio effect
Code:
<string name="audio_title">Audio</string>

for LED control app
Code:
<string name="led_title">LED control</string>

so one u add all these lines in strings.xml it should look like this
Untitled.png



2)Public.xml
now add these lines at the end of <public type="string" line

for CPU control
Code:
[B]<public type="string" name="overclocktool_title" id="0x7f0b0658" />[/B]

for quickpanel
Code:
[B]<public type="string" name="quickpanel_location" id="0x7f0b065b" />[/B]

for navigation bar
Code:
[B]<public type="string" name="nav_title" id="0x7f0b065c" />[/B]

for sim card option
Code:
<public type="string" name="sim_title" id="0x7f0b062d" />

For sms counter
Code:
<public type="string" name="sms_title" id="0x7f0b062e" />

for lockscreen changer
Code:
<public type="string" name="lockscreen_title" id="0x7f0b0633" />

for audio effect
Code:
<public type="string" name="audio_title" id="0x7f0b062b" />

for LED control app
Code:
<public type="string" name="led_title" id="0x7f0b062f" />

IMP:- make sure the hex codes are in order

so one u add all these lines in public.xml it should look like this
Untitled.png


4-STEP
goto res/xml/settings_headers.xml

and add the following lines.

For add the header that u created.

Code:
[B]<header android:title="@string/header_category_advanced" />[/B]

now placing the option that u have created

for CPU control
Code:
[B]<header android:icon="@drawable/ic_overclocktool" android:title="@string/overclocktool_title">
       <intent android:targetPackage="it.sineo.android.noFrillsCPUClassic" android:action="android.intent.action.MAIN" android:targetClass="it.sineo.android.noFrillsCPUClassic.activity.MainActivity" />
    </header>[/B]

for quickpanel
Code:
[B]<header android:icon="@drawable/ic_settings_quickpanel" android:id="@id/quickpanel_location_settings" android:title="@string/quickpanel_location">
      <intent android:targetPackage="com.lidroid.quickpanel" android:targetClass="com.lidroid.quickpanel.MainActivity" />
    </header>[/B]

for navigation bar
Code:
[B]<header android:icon="@drawable/ic_nav" android:title="@string/nav_title">
      <intent android:targetPackage="cn.kyle.gn.NavBar" android:action="android.intent.action.MAIN" android:targetClass="cn.kyle.gn.NavBar.GnNavBarActivity" />
</header>[/B]

for sim card option
Code:
<header android:icon="@drawable/ic_sim" android:title="@string/sim_title">
        <intent android:targetPackage="com.gsmdev.simcard" android:action="android.intent.action.MAIN" android:targetClass="com.gsmdev.simcard.MainActivity" />
    </header>

For sms counter
Code:
<header android:icon="@drawable/ic_sms" android:title="@string/sms_title">
        <intent android:targetPackage="org.kknd.android.smscounter" android:action="android.intent.action.MAIN" android:targetClass="org.kknd.android.smscounter.SmsCounterActivity" />
    </header>

for lockscreen changer
Code:
<header android:icon="@drawable/ic_settings_lockstyle" android:title="@string/lockscreen_title">
        <intent android:targetPackage="com.gagan.style" android:targetClass="com.gagan.style.LockscreenStyleActivity" />
    </header>

for audio effect
Code:
 <header android:icon="@drawable/ic_audio" android:title="@string/audio_title">
        <intent android:targetPackage="org.nocrew.tomas.headsetnotifierfree" android:action="android.intent.action.MAIN" android:targetClass="org.nocrew.tomas.headsetnotifierfree.HeadsetNotifierActivity" />
    </header>

for LED control app
Code:
<header android:icon="@drawable/ic_led" android:title="@string/led_title">
        <intent android:targetPackage="com.koo.lightmanager" android:action="android.intent.action.MAIN" android:targetClass="com.koo.lightmanager.MainActivity" />
    </header>


so one u add all these lines in settings_headers.xml it should look like this
Untitled.png



5-STEP
now we have to add some png's for these options in settings..
i have provided the pngs in 'settings_resources.rar' attached below
add the png's in this place like this
MDPI- res\drawables-mdpi
HDPI- res\drawables-hdpi

6-STEP
recompile it new its done

7-STEP
new u need th push the settings with options apk's (like cpu OC ,panel settings ' nav bar)
i have provided the apk's in settings_resources.rar


8-STEP
now push these settings.apk and other apks using a flashable zip formate i have attached below


HOW TO ADD PER APP DPI IN DISPLAY SETTINGS


1-STEP
decompile settings.apk

open res/values/strings.xml

and add these lines at the end
Code:
<string name="dpi_enable">per app dpi</string>
    <string name="dpi_enable_summary">Tablet UI</string>
	<string name="dpi_settings">dpi settings</string>
    <string name="dpi_settings_summary">change dpi of each app</string>


2-STEP
open res/xml/display_settings.xml

and add the red marked lines..
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/display_settings"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
    <CheckBoxPreference android:title="@string/swiqi_strings_swiqi_txt" android:key="swiqi_strings_swiqi_txt" android:summary="@string/swiqi_strings_swiqi_desc_txt" />
    <com.android.settings.BrightnessPreference android:title="@string/brightness" android:key="brightness" android:dialogTitle="@string/brightness" />
    <PreferenceScreen android:title="@string/wallpaper_settings_title" android:key="wallpaper" android:fragment="com.android.settings.WallpaperTypeSettings" />
    <CheckBoxPreference android:title="@string/accelerometer_title" android:key="accelerometer" />
    <ListPreference android:persistent="false" android:entries="@array/screen_timeout_entries" android:title="@string/screen_timeout" android:key="screen_timeout" android:summary="@string/screen_timeout_summary" android:entryValues="@array/screen_timeout_values" />
    <ListPreference android:entries="@array/font_size_entries" android:title="@string/title_font_size" android:key="font_size" android:summary="@string/summary_font_size" android:dialogTitle="@string/dialog_title_font_size" android:entryValues="@array/font_size_values" />
    <CheckBoxPreference android:persistent="false" android:title="@string/notification_pulse_title" android:key="notification_pulse" />
    <PreferenceCategory android:title="@string/display_category_personalisation_title" android:key="personalisation_category">
        <PreferenceScreen android:title="@string/theme_label" android:key="theme" android:summary="@string/theme_summary" />
        <PreferenceScreen android:title="@string/lockscreen_label" android:key="lockscreen" android:summary="@string/lockscreen_summary" />
		[COLOR="red"]<PreferenceScreen android:title="@string/dpi_enable" android:key="dpi" android:summary="@string/dpi_enable_summary">
		        <intent android:targetPackage="de.robv.android.xposed.installer" android:action="android.intent.action.MAIN" android:targetClass="de.robv.android.xposed.installer.XposedInstallerActivity" />
	    </PreferenceScreen>
	    <PreferenceScreen android:title="@string/dpi_settings" android:key="dpi" android:summary="@string/dpi_settings_summary">
		        <intent android:targetPackage="de.robv.android.xposed.mods.appsettings" android:action="android.intent.action.MAIN" android:targetClass="de.robv.android.xposed.mods.appsettings.XposedModActivity" />
        </PreferenceScreen>[/COLOR]
    </PreferenceCategory>
</PreferenceScreen>

3-STEP
push the xposed apps provided in settings_resoures_new.rar to system/app

so thats it..


CREDITS
Serajr
Till-Kurpse
gagan



so thats it..hope its understandable
if u like my contributions hit the thanks button or buy me a beer (make me drunk :p)
 

Attachments

  • Settings_resources_HDPI.rar
    240.2 KB · Views: 390
  • Settings_resources_MDPI.rar
    237.2 KB · Views: 262
  • settings_flashable_zip_formate.zip
    157.3 KB · Views: 286
  • Settings_resources_new_HDPI.rar
    1.9 MB · Views: 572
  • Settings_resources_new_MDPI.rar
    1.9 MB · Views: 367
Last edited:

jader13254

Senior Member
May 25, 2012
5,928
17,917
Hamburg
[ Guide for using .13 with .587 Mods ]

Hi,
In this guide I'll show you how to use mods from the old .587 with the new. 13 ics software found here:
4.1.B.1.13 Port by Jader13254
(xperia-arc-development)

.13 has some new java code inside framework & libs, so we need to port .587 mods...
This is nooby-easy and doesn't requiere ANY coding experience...
BUT you need to know how to use apktool & java..
You need:
Apktool
Notepad++
7zip
PC

1. Download any Mod you want...
2. Get "framework.jar" out of the mod using 7zip & copy to C:\
3. open a cmd window & type "apktool d C:\framework.jar C:\framework
4. open C:\framework
5. download this and paste inside /framework (put the files from /smali inside the /smali from the C:\framework)
6. now open a cmd window
7. type "apktool b C:\framework"
8. put C:\framework\dist\framework.jar (after built complete) back inside the .zip of your mod..
9. flash it via cwm
10. done, enjoy

btw, feel free to press thanks :p
 
Last edited:

sinoboss

Senior Member
Jan 13, 2013
58
3
AW: [TUTORIAL] How to add various framework mods

I dont read all but is there a description how to go with headphones?

sorry for my little english
 

Orochixxx

Senior Member
Jul 25, 2011
600
1,249
42
KAHRAMANMARAŞ (46)
SKIP TRACK VIA VOL LONG PRESS not Work Error ???
Send Me ur Apktool ...


yenibitelemresmiqr.png



problem Solved Wrong Code


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

    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

    goto :goto_c2

   .line 2843

to

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

    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_c0

    move-object/from16 v0, p0

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

    move v12, v0

    if-nez v12, :cond_c0

    and-int/lit8 v12, v10, 0x1

    if-nez v12, :cond_c0

    const/4 v12, 0x3

    move-object/from16 v0, p0

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

    goto :goto_c0

    .line 2843
 
Last edited:

xange

Senior Member
Sep 6, 2012
295
171
Cheras, Kuala Lumpur
Hi, Sandy, I have some question here. What if the id at public.xml that is used for the following line to add small app are like these:
<public type="string" name="permlab_smallapp" id="0x01040552" />
<public type="string" name="permdesc_smallapp" id="0x01040553" />
<public type="string" name="permlab_external_lockscreen" id="0x01040554" />
<public type="string" name="permdesc_external_lockscreen" id="0x01040555" />
<public type="string" name="permlab_externalTaskSwitcher" id="0x01040556" />
<public type="string" name="permdesc_externalTaskSwitcher" id="0x01040557" />
should I edit those smali at the small app apk and framework.jar? which line should be changed? I'm from Optimax, the framework of that ROM last string id ends at 0x01040551, so I cant use the lines provided by you or else fail recompile as the co-exist of the id.
mind to teach me how to do it?
 

sandy7

Inactive Recognized Developer
May 28, 2012
6,214
6,843
34
bangalore
Hi, Sandy, I have some question here. What if the id at public.xml that is used for the following line to add small app are like these:
<public type="string" name="permlab_smallapp" id="0x01040552" />
<public type="string" name="permdesc_smallapp" id="0x01040553" />
<public type="string" name="permlab_external_lockscreen" id="0x01040554" />
<public type="string" name="permdesc_external_lockscreen" id="0x01040555" />
<public type="string" name="permlab_externalTaskSwitcher" id="0x01040556" />
<public type="string" name="permdesc_externalTaskSwitcher" id="0x01040557" />
should I edit those smali at the small app apk and framework.jar? which line should be changed? I'm from Optimax, the framework of that ROM last string id ends at 0x01040551, so I cant use the lines provided by you or else fail recompile as the co-exist of the id.
mind to teach me how to do it?
well no need edit any smali's just add the smali's i have provided in resources.zip in framework.jar..

well about public.xml
u are telling that the last id ends at 0x01040551 so the next id's will be like this
0x01040552
0x01040553
0x01040554
0x01040555
0x01040556
0x01040557
0x01040558
0x01040559
0x0104055a
0x0104055b


and so on

and if ur adding only small apps u dont need these lines..
<public type="string" name="permlab_external_lockscreen" id="0x01040554" />
<public type="string" name="permdesc_external_lockscreen" id="0x01040555" />

these are for lockscreen
 
  • Like
Reactions: shprakash

pathaniya

Senior Member
May 28, 2010
685
73
Sandy, you are no less than a God to me, I have always wanted to learn and know,
the volume key hack/mod. Could you tell me it's possible on any version of Android, (from Donut to JB) also would it work on OEM's. Like am on stock Galaxy Note 2 would it work?
OR if i go back to X10i stock would it work? Or are there other formalities?
 
  • Like
Reactions: freakzapster

Ghostfreak NB

Senior Member
Aug 11, 2012
4,591
2,858
Mumbai
Re: [TUTORIAL] How to add various framework mods

Sandy :thumbup::thumbup: bro you made my day!
Hope I can learn some things from this tut!
Hope you find time to add some more mod guides! :p

Sent from my MT11i using xda premium
 
  • Like
Reactions: freakzapster

sandy7

Inactive Recognized Developer
May 28, 2012
6,214
6,843
34
bangalore
Re: [TUTORIAL] How to add various framework mods

Sandy, you are no less than a God to me, I have always wanted to learn and know,
the volume key hack/mod. Could you tell me it's possible on any version of Android, (from Donut to JB) also would it work on OEM's. Like am on stock Galaxy Note 2 would it work?
OR if i go back to X10i stock would it work? Or are there other formalities?

Should be the same..any how upload ur android.policy.jar ill go through it...and see if it has any changes..


Sent from my SK17i using XDA Premium HD app
 

sandy7

Inactive Recognized Developer
May 28, 2012
6,214
6,843
34
bangalore
Re: [TUTORIAL] How to add various framework mods

Sandy :thumbup::thumbup: bro you made my day!
Hope I can learn some things from this tut!
Hope you find time to add some more mod guides! :p

Sent from my MT11i using xda premium

Hope u like it..
Yes back to kill all apps tut is in process..will add soon.

Sent from my SK17i using XDA Premium HD app
 

Ghostfreak NB

Senior Member
Aug 11, 2012
4,591
2,858
Mumbai
Re: [TUTORIAL] How to add various framework mods

Hope u like it..
Yes back to kill all apps tut is in process..will add soon.

Sent from my SK17i using XDA Premium HD app

No doubting that + you kept your word bro!
You'd told I'd be making a guide when we'd talked over pm!
:D
Will require your help! Hope you'd
Help me and not get offended! (final exams are near so not much chance before that,but once its over! I'd be the 1st one to trouble you, just kiddin ')


Sent from my MT11i using xda premium
 

pathaniya

Senior Member
May 28, 2010
685
73
Sandy would it be too much to ask if you can incorporate download links in your original posts. Since google so so much to offer, too many links to go through.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 72




    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



    Camera Button to play/pause music

    1-STEP

    decompile android.policy.jar

    and open com\android\internal\policy\impl\PhoneWindowManager.smali

    2-STEP

    in phonewindowmanager.smalli find this line

    .method public interceptKeyBeforeQueueing

    now at the end of this method find this and add the red marked code

    Code:
    .line 2794
        nop
    
        nop
    
        nop
    
        nop
    
        nop
    
        :sswitch_data_28a
        .sparse-switch
            0x5 -> :sswitch_61
            0x6 -> :sswitch_16c
            0x18 -> :sswitch_9a
            0x19 -> :sswitch_9a
            0x1a -> :sswitch_1ae
    	[COLOR="Red"]0x1b -> :sswitch_195[/COLOR]
            0x4f -> :sswitch_236
            0x55 -> :sswitch_228
            0x56 -> :sswitch_236
            0x57 -> :sswitch_236
            0x58 -> :sswitch_236
            0x59 -> :sswitch_236
            0x5a -> :sswitch_236
            0x5b -> :sswitch_236
            0x7e -> :sswitch_228
            0x7f -> :sswitch_228
            0x82 -> :sswitch_236
            0xa4 -> :sswitch_9a
            0x400 -> :sswitch_265
        .end sparse-switch

    (1b is the KEYCODE_CAMERA hex code, see docs:KEYCODE_CAMERA

    so after adding that code it should look like this....

    Untitled.png





    now scroll few lines up to find this line...

    Code:
    .line 3000
        .end local v3           #ex:Landroid/os/RemoteException;
        .end local v11           #telephonyService:Lcom/android/internal/telephony/ITelephony;
    	[COLOR="Blue"]:sswitch_265[/COLOR]
        if-eqz v2, :cond_27f
    
        if-nez v9, :cond_27f
    
        .line 3001
        iget-object v12, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
    
        invoke-virtual {v12}, Landroid/os/PowerManager$WakeLock;->acquire()V
    
        .line 3002
        iget-object v12, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
    
        new-instance v13, Lcom/android/internal/policy/impl/PhoneWindowManager$PassVendorKey;
    
        new-instance v14, Landroid/view/KeyEvent;

    now see the above code where marked in blue from there leave some space like this...

    Untitled.png



    next add these lines between the spaces

    Code:
    [COLOR="Red"]:sswitch_195
        if-eqz v2, :cond_195
    
        invoke-virtual {p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isScreenOnEarly()Z
    
        move-result v12
    
        if-nez v12, :cond_195
    
        const/16 v12, 0x55
    
        invoke-virtual {p0, v12}, Lcom/android/internal/policy/impl/PhoneWindowManager;->sendMediaButtonEvent(I)V
    
        .line 901
        const/4 v12, 0x0
    
        iput-boolean v12, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
    
        :cond_195
        goto/16 :goto_23
    
        .line 4000[/COLOR]


    so from now its very simple remove all the spaces so it will end up look like this...

    Untitled.png



    once u done it save the file

    3-STEP
    recompile it

    and flash it and enjoy the new mod..



    SMALL APPS FOR CM BASED ROM


    1-STEP

    decompile framework-res.apk

    goto res/values/strings.xml and add these lines a the end



    Code:
     <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>
        <string name="permlab_smallapp">Small application overlay</string>
        <string name="permdesc_smallapp">Allows running movable small applications on top of other applications.</string>



    open AndroidManifest.xml

    and add the following lines
    Code:
     <permission android:name="android.permission.SYSTEM_ALERT_WINDOW" android:label="@string/permlab_systemAlertWindow" android:description="@string/permdesc_systemAlertWindow" android:protectionLevel="dangerous" android:permissionGroup="android.permission-group.SYSTEM_TOOLS" />

    and
    Code:
     <permission android:name="com.sony.smallapp.permission.SMALLAPP" android:label="@string/permlab_smallapp" android:description="@string/permdesc_smallapp" android:protectionLevel="dangerous" />


    like this shown in the pic..

    Untitled.png




    done recompile the framework-res.apk

    2-STEP

    decompile android.policy.jar

    and open com\android\internal\policy\impl\PhoneWindowManager.smal

    and add the red marked lines

    Code:
    .field static final SEARCH_BAR_LAYER:I = 0x4
    
    .field static final SECURE_SYSTEM_OVERLAY_LAYER:I = 0x17
    
    .field static final SEPARATE_TIMEOUT_FOR_SCREEN_SAVER:Z = false
    
    .field static final SHOW_PROCESSES_ON_ALT_MENU:Z = false
    
    [COLOR="red"].field static final SHOW_STARTING_ANIMATIONS:Z = true
    
    .field static final SMALLAPP_LAYER:I = 0x3[/COLOR]
    
    .field static final STATUS_BAR_LAYER:I = 0xf
    
    .field static final STATUS_BAR_PANEL_LAYER:I = 0x10
    
    .field static final STATUS_BAR_SUB_PANEL_LAYER:I = 0xe


    and find these lines in the same file.

    Code:
    [COLOR="Blue"].method public checkAddPermission(Landroid/view/WindowManager$LayoutParams;)I
        .locals 4
        .parameter "attrs"
    
        .prologue
        const/4 v2, 0x0
    
        .line 1609
        iget v1, p1, Landroid/view/WindowManager$LayoutParams;->type:I
    
        .line 1611
        .local v1, type:I
        const/16 v3, 0x7d0
    
        if-lt v1, v3, :cond_0
    
        const/16 v3, 0xbb7
    
        if-le v1, v3, :cond_1
    
        .line 1643
        :cond_0
        :goto_0
        return v2
    
        .line 1615
        :cond_1
        const/4 v0, 0x0
    
        .line 1616
        .local v0, permission:Ljava/lang/String;
        sparse-switch v1, :sswitch_data_0
    
        .line 1635
        const-string v0, "android.permission.INTERNAL_SYSTEM_WINDOW"
    
        .line 1637
        :goto_1
        :sswitch_0
        if-eqz v0, :cond_0
    
        .line 1638
        iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
    
        invoke-virtual {v3, v0}, Landroid/content/Context;->checkCallingOrSelfPermission(Ljava/lang/String;)I
    
        move-result v3
    
        if-eqz v3, :cond_0
    
        .line 1640
        const/4 v2, -0x8
    
        goto :goto_0
    
        .line 1632
        :sswitch_1
        const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"
    
        .line 1633
        goto :goto_1
    
        .line 1616
        nop
    
        :sswitch_data_0
        .sparse-switch
            0x7d2 -> :sswitch_1
            0x7d3 -> :sswitch_1
            0x7d5 -> :sswitch_0
            0x7d6 -> :sswitch_1
            0x7d7 -> :sswitch_1
            0x7da -> :sswitch_1
            0x7db -> :sswitch_0
            0x7dd -> :sswitch_0
            0x7e7 -> :sswitch_0
        .end sparse-switch
    .end method[/COLOR]


    no is the funny part replace all the above blue marked lines with the below red marked lines

    Code:
    [COLOR="red"].method public checkAddPermission(Landroid/view/WindowManager$LayoutParams;)I
        .locals 4
        .parameter "attrs"
    
        .prologue
        const/4 v2, 0x0
    
        .line 1115
        iget v1, p1, Landroid/view/WindowManager$LayoutParams;->type:I
    
        .line 1117
        .local v1, type:I
        const/16 v3, 0x7d0
    
        if-lt v1, v3, :cond_0
    
        const/16 v3, 0xbb7
    
        if-le v1, v3, :cond_1
    
        .line 1152
        :cond_0
        :goto_0
        return v2
    
        .line 1121
        :cond_1
        const/4 v0, 0x0
    
        .line 1122
        .local v0, permission:Ljava/lang/String;
        sparse-switch v1, :sswitch_data_0
    
        .line 1144
        const-string v0, "android.permission.INTERNAL_SYSTEM_WINDOW"
    
        .line 1146
        :goto_1
        :sswitch_0
        if-eqz v0, :cond_0
    
        .line 1147
        iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
    
        invoke-virtual {v3, v0}, Landroid/content/Context;->checkCallingOrSelfPermission(Ljava/lang/String;)I
    
        move-result v3
    
        if-eqz v3, :cond_0
    
        .line 1149
        const/4 v2, -0x8
    
        goto :goto_0
    
        .line 1137
        :sswitch_1
        const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"
    
        .line 1138
        goto :goto_1
    
        .line 1141
        :sswitch_2
        const-string v0, "com.sony.smallapp.permission.SMALLAPP"
    
        .line 1142
        goto :goto_1
    
        .line 1122
        :sswitch_data_0
        .sparse-switch
            0x7d2 -> :sswitch_1
            0x7d3 -> :sswitch_1
            0x7d5 -> :sswitch_0
            0x7d6 -> :sswitch_1
            0x7d7 -> :sswitch_1
            0x7da -> :sswitch_1
            0x7db -> :sswitch_0
            0x7dd -> :sswitch_0
            0xbb5 -> :sswitch_2
            0xbb6 -> :sswitch_2
        .end sparse-switch
    .end method[/COLOR]


    save it..done now recompile the android.policy.jar


    3-STEP

    decompile framework.jar

    add the whole sony folder (provided in the resources.zip attached below ) in classout/com

    and recompile framework.jar

    4-STEP

    now u need to add some files in system/app
    system/etc
    system/framework

    all the files are provided in resources.zip so just take them and add those files in ur flashable zip

    5-STEP

    once u flash the mod .u need an Slauncher app to launch the small apps...download it from google play

    so its done enjoy the smalls on cm based roms..



    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

    if u like my tut plz press thanks

    IF u like my work donate me and ATM my device is screwed have to repair it will cost more plz help me to get my device repaired by donating me
    HOW TO DONATE ME
    Due to some rules paypal donate button is disabled in INDIA. So any one willing to donate me please follow this :
    * Login to ur paypal account
    * Option "Personal payment" doesn't work for India, please set "Online purchases". and check Goods or Service (preferably service)
    * Send desired payment
    * Input my paypal email there : sandeeppatil781@gmail.com
    * Thank you!
    54
    How to add xperia S/T lockscreen ,small apps ,magnification glass

    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

    public.xml sample hexadecimal codes

    0x70000000
    0x70000001
    0x70000002
    0x70000003
    0x70000004
    0x70000005
    0x70000006
    0x70000007
    0x70000008
    0x70000009
    0x7000000a
    0x7000000b
    0x7000000c
    0x7000000d
    0x7000000e
    0x7000000f
    0x70000010

    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 and LockPatternKeyguardView.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


    HOW TO ADD THE FAMOUS MAGNIFICATION GLASS TO UR FRAMEWORK..
    (a big thanks to AEON WORLD)


    1-STEP

    decompile ur framework-res.apk

    2-STEP
    navigate to res/values and edit the following xml's

    Dimens.xml add these lines at the end..as shown in the pic

    Code:
    <dimen name="magnifier_selection_handle_offset_y">44.0dip</dimen>
    <dimen name="roundMagnificationRadius">55.0dip</dimen>
    <dimen name="rectangularMagnificationWidth">179.0dip</dimen>
    <dimen name="rectangularMagnificationHeight">74.0dip</dimen>
    <dimen name="selection_handle_offset_y">42.0dip</dimen>
    <dimen name="selection_handle_right_offset_x">15.0dip</dimen>
    <dimen name="selection_handle_left_offset_x">7.0dip</dimen>

    Untitled.png





    Public.xml add the following lines as shown in pic

    under public type demin

    Code:
    <public type="dimen" name="magnifier_selection_handle_offset_y" id="0x01050078" />
    <public type="dimen" name="roundMagnificationRadius" id="0x01050079" />
     <public type="dimen" name="rectangularMagnificationWidth" id="0x0105007a" />
     <public type="dimen" name="rectangularMagnificationHeight" id="0x0105007b" />
     <public type="dimen" name="selection_handle_offset_y" id="0x0105007c" />
     <public type="dimen" name="selection_handle_right_offset_x" id="0x0105007d" />
     <public type="dimen" name="selection_handle_left_offset_x" id="0x0105007e" />

    note ur hex codes should be order..

    Untitled.png



    under public type drawables

    <public type="drawable" name="textfield_search_right_holo" id="0x010807fb" />
    <public type="drawable" name="semc_magnifier_arrow_above" id="0x010807fc" />
    <public type="drawable" name="semc_magnifier_arrow_left" id="0x010807fd" />
    <public type="drawable" name="semc_magnifier_arrow_right" id="0x010807fe" />
    <public type="drawable" name="semc_magnifier_rectangle" id="0x010807ff" />
    <public type="drawable" name="semc_magnifier_round" id="0x01080800" />

    again the hex codes should in order

    Untitled.png



    3-STEP

    put the pngs which i have provided in magni_resoures.rar to drawables-hpdi folder

    4-STEP

    now recompile the framework-res.apk..

    5-STEP
    now decompile ur framewok.jar

    add the following files provided in magni_resoreces.rar

    copy all the files in webkit folder and paste it in classout/android/webkit folder

    and copy all the files widget folder and paste it in classout/android/widget folder

    wait dont recomplie yet (see next step :p )

    6-STEP

    now we have to compare some id's from ur public.xml and MagnifierView.smali to assign the same id's for drawables and dimes present in public.xml

    Open ur both Public.xml and MagnifierView.smali at the same time and do the following

    in magnifierView.smali

    1- Find this line and assign <public type="drawable" name="semc_magnifier_round" id="0x010807f9" /> id here

    Code:
      .line 413
      move-object/from16 v0, p0
    
        iget-object v3, v0, Landroid/widget/MagnifierView;->mFrames:[Landroid/graphics/drawable/Drawable;
    
        const/4 v4, 0x0
    
        const v5, 0x10[COLOR="Red"]807f9[/COLOR]

    2- Find this line and assign <public type="drawable" name="semc_magnifier_rectangle" id="0x010807f8" /> id here

    Code:
     .line 414
        move-object/from16 v0, p0
    
        iget-object v3, v0, Landroid/widget/MagnifierView;->mFrames:[Landroid/graphics/drawable/Drawable;
    
        const/4 v4, 0x1
    
        const v5, 0x10[COLOR="red"]807f8[/COLOR]

    3-Find this line and assign <public type="dimen" name="roundMagnificationRadius" id="0x01050073" /> id here

    Code:
    .line 422
        const v3, 0x10[COLOR="red"]50073[/COLOR]
    
        invoke-virtual {v12, v3}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
    
        move-result v13

    4-Find this line and assign <public type="dimen" name="rectangularMagnificationWidth" id="0x01050074" /> id here
    Code:
     .line 426
        move-object/from16 v0, p0
    
        iget-object v3, v0, Landroid/widget/MagnifierView;->mMagnificationWidth:[I
    
        const/4 v4, 0x1
    
        const v5, 0x10[COLOR="red"]50074[/COLOR]

    5-Find this line and assign <public type="dimen" name="rectangularMagnificationHeight" id="0x01050075" /> id here
    Code:
    .line 428
        move-object/from16 v0, p0
    
        iget-object v3, v0, Landroid/widget/MagnifierView;->mMagnificationHeight:[I
    
        const/4 v4, 0x1
    
        const v5, 0x10[COLOR="red"]50075[/COLOR]

    6-Find this line and assign <public type="dimen" name="selection_handle_offset_y" id="0x01050076" /> id here
    Code:
    .line 452
        move-object/from16 v0, p0
    
        iget-object v3, v0, Landroid/widget/MagnifierView;->mArrowDrawables:[Landroid/graphics/drawable/Drawable;
    
        const/4 v4, 0x0
    
        const v5, 0x10[COLOR="red"]50076[/COLOR]

    7-Find this line and assign <public type="dimen" name="selection_handle_right_offset_x" id="0x01050077" /> id here
    Code:
    .line 454
        move-object/from16 v0, p0
    
        iget-object v3, v0, Landroid/widget/MagnifierView;->mArrowDrawables:[Landroid/graphics/drawable/Drawable;
    
        const/4 v4, 0x1
    
        const v5, 0x10[COLOR="red"]50077[/COLOR]


    8-Find this line and assign <public type="dimen" name="selection_handle_left_offset_x" id="0x01050078" /> id here

    Code:
    .line 456
        move-object/from16 v0, p0
    
        iget-object v3, v0, Landroid/widget/MagnifierView;->mArrowDrawables:[Landroid/graphics/drawable/Drawable;
    
        const/4 v4, 0x2
    
        const v5, 0x10[COLOR="red"]50078[/COLOR]


    once u done it..
    recompile ur framework.jar


    STEP-7


    now use the flashable zip i have provided to flash this mod..





    PS- my way for presentation of this TUT is bad...hope u guys understand.



    CREDITS:
    AOEN WORLD -for resources.and initial tut
    45
    More TUTS here

    Adding options in settings.apk

    well friends today iam going to show u have to add options like CPU control, panel settings , navigation bar in ur settings.apk


    SO lets start

    1-STEP
    install the frameworks from the rom from where u are taking the settings.apk

    2-STEP
    hope u guys know how to decompile iam not going to explain it
    so decompile the settings.apk (make sure u set the compression level 128mb)



    3-STEP

    once decompiled
    goto res\values

    1)strings.xml
    add the lines at the end

    creating a header name
    add this line at the end
    Code:
    [B]<string name="header_category_advanced">[COLOR="Red"]Sandy's mod[/COLOR]</string>[/B]
    note:u can change the red colored highlighted name to any thing..


    for CPU control
    Code:
    [B]<string name="overclocktool_title">CPU control</string>[/B]

    for quickpanel
    Code:
    [B]<string name="quickpanel_location">Quick panel</string>[/B]

    for navigation bar
    Code:
    [B]<string name="nav_title">Navigation button</string>[/B]

    for sim card option
    Code:
    <string name="sim_title">SIM card</string>

    For sms counter
    Code:
    <string name="sms_title">SMS counter</string>

    for lockscreen changer
    Code:
    <string name="lockscreen_title">Lock screen</string>

    for audio effect
    Code:
    <string name="audio_title">Audio</string>

    for LED control app
    Code:
    <string name="led_title">LED control</string>

    so one u add all these lines in strings.xml it should look like this
    Untitled.png



    2)Public.xml
    now add these lines at the end of <public type="string" line

    for CPU control
    Code:
    [B]<public type="string" name="overclocktool_title" id="0x7f0b0658" />[/B]

    for quickpanel
    Code:
    [B]<public type="string" name="quickpanel_location" id="0x7f0b065b" />[/B]

    for navigation bar
    Code:
    [B]<public type="string" name="nav_title" id="0x7f0b065c" />[/B]

    for sim card option
    Code:
    <public type="string" name="sim_title" id="0x7f0b062d" />

    For sms counter
    Code:
    <public type="string" name="sms_title" id="0x7f0b062e" />

    for lockscreen changer
    Code:
    <public type="string" name="lockscreen_title" id="0x7f0b0633" />

    for audio effect
    Code:
    <public type="string" name="audio_title" id="0x7f0b062b" />

    for LED control app
    Code:
    <public type="string" name="led_title" id="0x7f0b062f" />

    IMP:- make sure the hex codes are in order

    so one u add all these lines in public.xml it should look like this
    Untitled.png


    4-STEP
    goto res/xml/settings_headers.xml

    and add the following lines.

    For add the header that u created.

    Code:
    [B]<header android:title="@string/header_category_advanced" />[/B]

    now placing the option that u have created

    for CPU control
    Code:
    [B]<header android:icon="@drawable/ic_overclocktool" android:title="@string/overclocktool_title">
           <intent android:targetPackage="it.sineo.android.noFrillsCPUClassic" android:action="android.intent.action.MAIN" android:targetClass="it.sineo.android.noFrillsCPUClassic.activity.MainActivity" />
        </header>[/B]

    for quickpanel
    Code:
    [B]<header android:icon="@drawable/ic_settings_quickpanel" android:id="@id/quickpanel_location_settings" android:title="@string/quickpanel_location">
          <intent android:targetPackage="com.lidroid.quickpanel" android:targetClass="com.lidroid.quickpanel.MainActivity" />
        </header>[/B]

    for navigation bar
    Code:
    [B]<header android:icon="@drawable/ic_nav" android:title="@string/nav_title">
          <intent android:targetPackage="cn.kyle.gn.NavBar" android:action="android.intent.action.MAIN" android:targetClass="cn.kyle.gn.NavBar.GnNavBarActivity" />
    </header>[/B]

    for sim card option
    Code:
    <header android:icon="@drawable/ic_sim" android:title="@string/sim_title">
            <intent android:targetPackage="com.gsmdev.simcard" android:action="android.intent.action.MAIN" android:targetClass="com.gsmdev.simcard.MainActivity" />
        </header>

    For sms counter
    Code:
    <header android:icon="@drawable/ic_sms" android:title="@string/sms_title">
            <intent android:targetPackage="org.kknd.android.smscounter" android:action="android.intent.action.MAIN" android:targetClass="org.kknd.android.smscounter.SmsCounterActivity" />
        </header>

    for lockscreen changer
    Code:
    <header android:icon="@drawable/ic_settings_lockstyle" android:title="@string/lockscreen_title">
            <intent android:targetPackage="com.gagan.style" android:targetClass="com.gagan.style.LockscreenStyleActivity" />
        </header>

    for audio effect
    Code:
     <header android:icon="@drawable/ic_audio" android:title="@string/audio_title">
            <intent android:targetPackage="org.nocrew.tomas.headsetnotifierfree" android:action="android.intent.action.MAIN" android:targetClass="org.nocrew.tomas.headsetnotifierfree.HeadsetNotifierActivity" />
        </header>

    for LED control app
    Code:
    <header android:icon="@drawable/ic_led" android:title="@string/led_title">
            <intent android:targetPackage="com.koo.lightmanager" android:action="android.intent.action.MAIN" android:targetClass="com.koo.lightmanager.MainActivity" />
        </header>


    so one u add all these lines in settings_headers.xml it should look like this
    Untitled.png



    5-STEP
    now we have to add some png's for these options in settings..
    i have provided the pngs in 'settings_resources.rar' attached below
    add the png's in this place like this
    MDPI- res\drawables-mdpi
    HDPI- res\drawables-hdpi

    6-STEP
    recompile it new its done

    7-STEP
    new u need th push the settings with options apk's (like cpu OC ,panel settings ' nav bar)
    i have provided the apk's in settings_resources.rar


    8-STEP
    now push these settings.apk and other apks using a flashable zip formate i have attached below


    HOW TO ADD PER APP DPI IN DISPLAY SETTINGS


    1-STEP
    decompile settings.apk

    open res/values/strings.xml

    and add these lines at the end
    Code:
    <string name="dpi_enable">per app dpi</string>
        <string name="dpi_enable_summary">Tablet UI</string>
    	<string name="dpi_settings">dpi settings</string>
        <string name="dpi_settings_summary">change dpi of each app</string>


    2-STEP
    open res/xml/display_settings.xml

    and add the red marked lines..
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <PreferenceScreen android:title="@string/display_settings"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
        <CheckBoxPreference android:title="@string/swiqi_strings_swiqi_txt" android:key="swiqi_strings_swiqi_txt" android:summary="@string/swiqi_strings_swiqi_desc_txt" />
        <com.android.settings.BrightnessPreference android:title="@string/brightness" android:key="brightness" android:dialogTitle="@string/brightness" />
        <PreferenceScreen android:title="@string/wallpaper_settings_title" android:key="wallpaper" android:fragment="com.android.settings.WallpaperTypeSettings" />
        <CheckBoxPreference android:title="@string/accelerometer_title" android:key="accelerometer" />
        <ListPreference android:persistent="false" android:entries="@array/screen_timeout_entries" android:title="@string/screen_timeout" android:key="screen_timeout" android:summary="@string/screen_timeout_summary" android:entryValues="@array/screen_timeout_values" />
        <ListPreference android:entries="@array/font_size_entries" android:title="@string/title_font_size" android:key="font_size" android:summary="@string/summary_font_size" android:dialogTitle="@string/dialog_title_font_size" android:entryValues="@array/font_size_values" />
        <CheckBoxPreference android:persistent="false" android:title="@string/notification_pulse_title" android:key="notification_pulse" />
        <PreferenceCategory android:title="@string/display_category_personalisation_title" android:key="personalisation_category">
            <PreferenceScreen android:title="@string/theme_label" android:key="theme" android:summary="@string/theme_summary" />
            <PreferenceScreen android:title="@string/lockscreen_label" android:key="lockscreen" android:summary="@string/lockscreen_summary" />
    		[COLOR="red"]<PreferenceScreen android:title="@string/dpi_enable" android:key="dpi" android:summary="@string/dpi_enable_summary">
    		        <intent android:targetPackage="de.robv.android.xposed.installer" android:action="android.intent.action.MAIN" android:targetClass="de.robv.android.xposed.installer.XposedInstallerActivity" />
    	    </PreferenceScreen>
    	    <PreferenceScreen android:title="@string/dpi_settings" android:key="dpi" android:summary="@string/dpi_settings_summary">
    		        <intent android:targetPackage="de.robv.android.xposed.mods.appsettings" android:action="android.intent.action.MAIN" android:targetClass="de.robv.android.xposed.mods.appsettings.XposedModActivity" />
            </PreferenceScreen>[/COLOR]
        </PreferenceCategory>
    </PreferenceScreen>

    3-STEP
    push the xposed apps provided in settings_resoures_new.rar to system/app

    so thats it..


    CREDITS
    Serajr
    Till-Kurpse
    gagan



    so thats it..hope its understandable
    if u like my contributions hit the thanks button or buy me a beer (make me drunk :p)
    18
    [ Guide for using .13 with .587 Mods ]

    Hi,
    In this guide I'll show you how to use mods from the old .587 with the new. 13 ics software found here:
    4.1.B.1.13 Port by Jader13254
    (xperia-arc-development)

    .13 has some new java code inside framework & libs, so we need to port .587 mods...
    This is nooby-easy and doesn't requiere ANY coding experience...
    BUT you need to know how to use apktool & java..
    You need:
    Apktool
    Notepad++
    7zip
    PC

    1. Download any Mod you want...
    2. Get "framework.jar" out of the mod using 7zip & copy to C:\
    3. open a cmd window & type "apktool d C:\framework.jar C:\framework
    4. open C:\framework
    5. download this and paste inside /framework (put the files from /smali inside the /smali from the C:\framework)
    6. now open a cmd window
    7. type "apktool b C:\framework"
    8. put C:\framework\dist\framework.jar (after built complete) back inside the .zip of your mod..
    9. flash it via cwm
    10. done, enjoy

    btw, feel free to press thanks :p
    11
    Re: [TUTORIAL] How to add various framework/Settings mods [Update 24/2/2013]

    New tut coming up in few hours....
    Camera button press for paly/pause music when screen is off...

    EDIT: Camera button press for paly/pause music when screen is off... tut added in 1st post ...happy learning..

    if u like my work plz press thanks

    or buy me a beer (see OP for instructions for donating me)

    Sent from my SK17i using XDA Premium HD app