FORUMS
Remove All Ads from XDA

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

975 posts
Thanks Meter: 4,019
 
By pratyush.creed, Senior Member on 2nd July 2012, 11:36 AM
Post Reply Email Thread
Well, this a very simple guide on adding 6 lockscreen mod to your rom.


Files To be downloaded :
1. android.policy.zip
2. Lidroid-res.apk
3. Lidroid-Parts


Files to be Affected :

1. android.policy.jar
2. systemui.apk (only if you have added 14 status bar toggles before)


Steps :

-Pullout android.policy.jar from '/system/framework' (Must be Deodexed)
-Decompile it (Please dont expect a guide on how to decompile)
-Extract the android.policy.zip file
-copy the smali folder to directory where you decompiled your android.policy.jar

-Now open this file android.policy.jar.out\smali\com\android\internal\ policy\impl\KeyguardUpdateMonitor.smali and make the following changes :

-At the begining after '#annonations' search for this line "Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$AirplaneModeChangeCallback;"

after that add this line
Code:
Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;,

-Now find this line ".field private mLockscreenWallpaperDrawable:Landroid/graphics/drawable/Drawable;"

-Below it paste this line
Code:
.field private mMediaCallbacks:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;",
            ">;"
        }
    .end annotation
.end field
-Find this line ".field private mWallpaperModeValue:I"

and jus below paste this

Code:
.field private timezone:Ljava/lang/String;
-Now find this method ".method private handleSimStateChange(Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$SimArgsV"

and above it paste this :

Code:
.method private handleMediaUpdate(IILandroid/net/Uri;)V
    .locals 5
    .parameter "isPlaying"
    .parameter "isStop"
    .parameter "mediaUri"

    .prologue
    const/4 v4, 0x0

    const/4 v3, 0x1

    .line 467
    if-ne p1, v3, :cond_0

    move v0, v3

    .line 468
    .local v0, bIsPlaying:Z
    :goto_0
    if-ne p2, v3, :cond_1

    move v1, v3

    .line 470
    .local v1, bIsStop:Z
    :goto_1
    const/4 v2, 0x0

    .local v2, i:I
    :goto_2
    iget-object v3, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mMediaCallbacks:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v3

    if-ge v2, v3, :cond_2

    .line 471
    iget-object v3, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mMediaCallbacks:Ljava/util/ArrayList;

    invoke-virtual {v3, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;

    invoke-interface {v3, v0, v1, p3}, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$MediaStateCallback;->onMediaUpdated(ZZLandroid/net/Uri;)V

    .line 470
    add-int/lit8 v2, v2, 0x1

    goto :goto_2

    .end local v0           #bIsPlaying:Z
    .end local v1           #bIsStop:Z
    .end local v2           #i:I
    :cond_0
    move v0, v4

    .line 467
    goto :goto_0

    .restart local v0       #bIsPlaying:Z
    :cond_1
    move v1, v4

    .line 468
    goto :goto_1

    .line 473
    .restart local v1       #bIsStop:Z
    .restart local v2       #i:I
    :cond_2
    return-void
.end method

-Now find this line ".method public getFailedAttempts()I"

above it again paste this :
Code:
.method public getChangedTimeZone()Ljava/lang/String;
    .locals 1

    .prologue
    .line 1131
    iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->timezone:Ljava/lang/String;

    return-object v0
.end method

this one's last for this file , search for ".method public isDevicePluggedIn()Z"

and above it paste :

Code:
.method public isDeviceCharged()Z
    .locals 2

    .prologue
    .line 866
    iget v0, p0, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->mBatteryLevel:I

    const/16 v1, 0x64

    if-lt v0, v1, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method
-Now close this file and open "\smali\com\android\internal\policy\impl\LockPatte rnKeyguardView"

-Search for this method now ".method createLockScreen()Landroid/view/View;"
Find this (Jus one line below)
Code:
    .prologue
    .line 868
below it paste this :

Code:
    const/4 v2, 0x0

    const/4 v0, 0x0

    iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;

    invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "lockscreen_style_pref"

    invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v0

    const/4 v2, 0x1

    if-eq v2, v0, :cond_3

    const/4 v2, 0x2

    if-eq v2, v0, :cond_3

    const/4 v2, 0x3

    if-eq v2, v0, :cond_3

    const/4 v2, 0x4

    if-eq v2, v0, :cond_3

    const/4 v2, 0x5

    if-eq v2, v0, :cond_3

    if-eqz v0, :cond_0

    .line 869
    const/4 v2, 0x0

    const/4 v0, 0x0

    iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;

    invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "lockscreen_style_pref"

    invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v0

    const/4 v2, 0x6

    if-eq v2, v0, :cond_2

    const/4 v2, 0x7

    if-eq v2, v0, :cond_1

    :cond_0
    new-instance v0, Lcom/android/internal/policy/impl/LockScreen;

    iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;

    iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;

    iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

    iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;

    iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;

    invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V

    goto :goto_0

    :cond_1
    new-instance v0, Lcom/android/internal/policy/impl/LockScreen;

    iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;

    iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;

    iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

    iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;

    iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;

    invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V

    goto :goto_0

    :cond_2
after ':cond_2' there will be your default lockscreen so dont leave any line between them.

After the end of your default lockscreen , it might be like this
" invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/CircleLockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallbackV
"
paste this
Code:
    :goto_0
then on the next line after "return-object v0"
paste this
Code:
    :cond_3
    new-instance v0, Lcom/android/internal/policy/impl/CyanogenLockScreen;

    iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;

    iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;

    iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

    iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;

    iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;

    invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/CyanogenLockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V

    goto :goto_0
Now you may save and close the file.

Now recompile the android.policy.jar and push it to /system/framework with lidroid-res.apk .
Also Push the Lidroid-Parts.apk to '/system/app'

In case If you already have 14 toggles in the status bar adding this may affect it resulting in force closes . So to fix it follow this :

*Prooceed here only if you have 14 status bar toggles mod in your rom*

1.Decompile SystemUI.apk
2.Delete these two folders (if present) : /smali/com/lidroid & /smali/lidroid
3.Download Status_bar_fix from attachments below.
4.Extract it and copy the smali folder to your decompiled SystemUI.apk
5.Recompile and push the SystemUI.apk back to /system/app


Credits
Lidroid
- This Mod Isnt Possible without him.


Regarding any help please prefer commenting on this thread rather than sending PM's.
Attached Files
File Type: zip status_bar_fix.zip - [Click for QR Code] (60.5 KB, 1619 views)
The Following 60 Users Say Thank You to pratyush.creed For This Useful Post: [ View ] Gift pratyush.creed Ad-Free
 
 
3rd July 2012, 02:12 AM |#2  
Senior Member
Flag Bogor
Thanks Meter: 606
 
More
nice guide
The Following 2 Users Say Thank You to parudthz For This Useful Post: [ View ] Gift parudthz Ad-Free
3rd July 2012, 05:26 PM |#3  
wilfredcool007's Avatar
Senior Member
Flag Chennai
Thanks Meter: 1,328
 
Donate to Me
More
Thumbs up
Cool... Great guide... Thanks Aryan :P ^_^
The Following User Says Thank You to wilfredcool007 For This Useful Post: [ View ] Gift wilfredcool007 Ad-Free
4th July 2012, 02:25 AM |#4  
Account currently disabled
Flag Kolkata
Thanks Meter: 4,941
 
More
Does the 6 lockscreen include ICS lockscreen? And do I have to download lidroid res? I already had it in my current rom ...

Sent from my GT-S5360 using xda app-developers app
4th July 2012, 03:58 AM |#5  
ocoot's Avatar
Senior Member
Flag Semarang, Central Java
Thanks Meter: 936
 
More
advance user :|
4th July 2012, 04:15 AM |#6  
arbylaw's Avatar
Member
Flag Bekasi
Thanks Meter: 242
 
More
I can't wait for the update.
Please update soon sir
4th July 2012, 04:22 AM |#7  
pratyush.creed's Avatar
OP Senior Member
Flag Gaya,Bihar
Thanks Meter: 4,019
 
More
Quote:
Originally Posted by ocoot

advance user :|

its actually quite easy. .

Quote:
Originally Posted by AvijitGhosh82

Does the 6 lockscreen include ICS lockscreen? And do I have to download lidroid res? I already had it in my current rom ...

Sent from my GT-S5360 using xda app-developers app

Yes...the new res file contains resources for cyanogen lockscreens..
4th July 2012, 09:31 AM |#8  
Recognized Developer
Flag New Delhi
Thanks Meter: 5,264
 
Donate to Me
More
Waiting for 14 toggle fix!!

Sent from my GT-S5360 using XDA
The Following User Says Thank You to hell_lock For This Useful Post: [ View ]
5th July 2012, 02:21 PM |#9  
justkiddinghere's Avatar
Senior Member
Flag new delhi
Thanks Meter: 186
 
More
Good one thanks pratyush
5th July 2012, 04:50 PM |#10  
Account currently disabled
Flag Kolkata
Thanks Meter: 4,941
 
More
If my status bar is themed, what happens when I add lidroid res apk? Does the theme stay or go away? Thanks.
Sent from my GT-S5360 using xda app-developers app
5th July 2012, 06:12 PM |#11  
Bhocan's Avatar
Member
Flag Jakarta
Thanks Meter: 35
 
More
awesome guide siirrr... but my Status bar FC
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes