[Mod][CM10] Xperia Z lockscreen for CM10

Search This thread

Top Liked Posts

  • There are no posts matching your filters.
  • 23
    Xperia Z Lockscreen for CM10

    The Xperia Z lockscreen is now working on CM10 on the X10!

    Tested and working well with CM10 v9.4 by scritch007

    screen1.png
    screen2.png

    screen3.png
    screen4.png



    Downloads
    For CM10 users:
    Download for CM10
    or
    Download for CM10 with Settings
    (Allows you to change the wallpaper from the settings menu)

    For Slimbean Users:
    Download for Slimbean
    or
    Download for Slimbean with Settings
    (Allows you to change the wallpaper from the settings menu)

    Installation
    To install, make a backup then:
    simply flash via CWM.

    Bugs
    Blurry "Swipe to unlock" text
    Download This Fix (Thanks to Vasishta Reddy)

    Cannot change wallpaper
    You can only use Xperia wallpapers for now (unless you edit default_wallpaper.jpg in UxpNxtLockscreen.apk) - get it in This Post

    Guide
    If the above versions don't work for your phone/ROM, I've written a quick guide with all the tools you need to get this lockscreen working on your CM10 rom.
    Just check my post Here

    Credits
    Major credit to emwno - they managed to integrate the lockscreen into CM10.
    Please head over to the original thread and thank them!

    Uninstall
    To uninstall, just flash This in cwm (works for CM10 only)​
    6
    If u could tell (show) me what i should edit i wiil be thankful as i like xperia z lockscreen style
    Sure, I'll try to make this as simple as possible!

    Guide
    1. Firstly, download and extract the attached file to a new folder.
    (Inside the folder you should have 6 files)

    2. Now copy your android.policy.jar from /system/framework on your phone into the same folder

    3. Use 7zip or similar to extract classes.dex from that file into the folder

    4. Open command prompt (Windows key + "r", type cmd and press enter)

    3. Now browse to the folder where you just extracted the files - for instance, if i made a folder called "Lockscreen" on my desktop I'd type:
    cd C:\users\ben\desktop\lockscreen\

    4. Now type java -jar baksmali-1.3.3.jar -o classout/ classes.dex and press enter
    This should extract the odex file to a folder called "classout" within the folder you created

    5. Open the classout folder and browse to com/android/internal/policy/impl

    6. Copy both "ExtendedKeyguardScreen.smali" and "ExternalLockScreen.smali" from the attached archive to this location

    7. Now open the file called LockPatternKeyguardView.smali
    There are a few changes that need to be made to this file:
    7.1 Firstly find the lines
    Code:
    .field mInfoCallback:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$InfoCallbackImpl;
    
    .field private mIsVerifyUnlockOnly:Z

    and add the highlighted line between them
    Code:
    .field mInfoCallback:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor$InfoCallbackImpl;
    
    [COLOR="Red"].field private mIsExternallyLoadedLockScreenEnabled:Z[/COLOR]
    
    .field private mIsVerifyUnlockOnly:Z

    7.2 Now scroll down and find the method that starts with
    Code:
    # virtual methods
    .method public cleanUp()V
        .registers 3
    
        .prologue
        const/4 v1, 0x0

    select from the # all the way to after the second time you see the line .end method
    (we want to replace the public_cleanUp() and createLockScreen() functions - it should be around 140 lines of code!)

    7.3 Delete the selected lines and replace with the following
    Code:
    # virtual methods
    .method public cleanUp()V
        .registers 3
    
        .prologue
        const/4 v1, 0x0
    
        const/4 v0, 0x0
    
        iput-boolean v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mIsExternallyLoadedLockScreenEnabled:Z
    
        .line 812
        iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockScreen:Landroid/view/View;
    
        if-eqz v0, :cond_1d
    
        .line 813
        iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockScreen:Landroid/view/View;
    
        check-cast v0, Lcom/android/internal/policy/impl/KeyguardScreen;
    
        invoke-interface {v0}, Lcom/android/internal/policy/impl/KeyguardScreen;->onPause()V
    
        .line 814
        iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockScreen:Landroid/view/View;
    
        check-cast v0, Lcom/android/internal/policy/impl/KeyguardScreen;
    
        invoke-interface {v0}, Lcom/android/internal/policy/impl/KeyguardScreen;->cleanUp()V
    
        .line 815
        iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockScreen:Landroid/view/View;
    
        invoke-virtual {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->removeView(Landroid/view/View;)V
    
        .line 816
        iput-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockScreen:Landroid/view/View;
    
        .line 818
        :cond_1d
        iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUnlockScreen:Landroid/view/View;
    
        if-eqz v0, :cond_36
    
        .line 819
        iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUnlockScreen:Landroid/view/View;
    
        check-cast v0, Lcom/android/internal/policy/impl/KeyguardScreen;
    
        invoke-interface {v0}, Lcom/android/internal/policy/impl/KeyguardScreen;->onPause()V
    
        .line 820
        iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUnlockScreen:Landroid/view/View;
    
        check-cast v0, Lcom/android/internal/policy/impl/KeyguardScreen;
    
        invoke-interface {v0}, Lcom/android/internal/policy/impl/KeyguardScreen;->cleanUp()V
    
        .line 821
        iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUnlockScreen:Landroid/view/View;
    
        invoke-virtual {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->removeView(Landroid/view/View;)V
    
        .line 822
        iput-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUnlockScreen:Landroid/view/View;
    
        .line 824
        :cond_36
        iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
    
        invoke-virtual {v0, p0}, Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;->removeCallback(Ljava/lang/Object;)V
    
        .line 825
        iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mBiometricUnlock:Lcom/android/internal/policy/impl/BiometricSensorUnlock;
    
        if-eqz v0, :cond_44
    
        .line 826
        iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mBiometricUnlock:Lcom/android/internal/policy/impl/BiometricSensorUnlock;
    
        invoke-interface {v0}, Lcom/android/internal/policy/impl/BiometricSensorUnlock;->cleanUp()V
    
        .line 828
        :cond_44
        return-void
    .end method
    
    .method createLockScreen()Landroid/view/View;
        .registers 7
    
        .prologue
        iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
    
        iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
    
        invoke-static {v1, v2}, Lcom/android/internal/policy/impl/ExternalLockScreen;->getLockScreen(Landroid/content/Context;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)Landroid/view/View;
    
        move-result-object v0
    
        .local v0, lockView:Landroid/view/View;
        if-eqz v0, :cond_24
    
        const/4 v1, 0x1
    
        :goto_b
        iput-boolean v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mIsExternallyLoadedLockScreenEnabled:Z
    
        .line 1038
        iget-boolean v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mIsExternallyLoadedLockScreenEnabled:Z
    
        if-nez v1, :cond_20
    
        .line 917
        new-instance v0, Lcom/android/internal/policy/impl/LockScreen;
    
        .end local v0           #lockView:Landroid/view/View;
        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
    
        .line 923
        .restart local v0       #lockView:Landroid/view/View;
        :cond_20
        invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->initializeTransportControlView(Landroid/view/View;)V
    
        .line 924
        return-object v0
    
        :cond_24
        const/4 v1, 0x0
    
        goto :goto_b
    .end method

    8. Now delete your original classes.dex file

    9. Go back to command prompt and type java -jar smali-1.3.3.jar classout -o classes.dex - this should create a new classes.dex file

    10. Now use 7zip again but the time take the newly created classes.dex file and copy (and replace) it back into your original android.policy.jar

    11. Finally download my original lockscreen zip Here and replace the android.policy.jar in /system/framework with your new version

    12. Flash the zip and reboot your phone! You should now have the Xperia Z Lockscreen!


    Hope that helps - let me know if you have problems, I can try and upload screenshots if you're really stuck!
    3
    when I select the option to change wallpaper from the new settings option you had added, I select the album app.
    After this i select my preferred wallpaper and crop it.
    Since i get promted again i select the same wallpaper and crop it to the same size.
    But, If i follow the above wallpaper nothing happens and the lockscreen wallpaper does not change.
    If someone manages to change the wallpaper please report it.

    P.S. this is the same thing i did in the slimbean rom and i got the same result.

    Thanks, I've uploaded a new version. Download it from here (for CM10 only) - (If this gives an error, see post below)

    The main lockscreen apk has been replaced with a direct port from the Xperia Z. The "Xperia Wallpapers" app is now working, so you should be able to set the lockscreen background using it.
    I've tested it with CM10 v9.4 and it works everytime. You can See it working here (sorry for laggy recording)

    Please note - I've also moved the "Xperia Z Lockscreen" settings into the "Lockscreen" option.

    Can you let me know whether changing the lockscreen wallpaper works using the "Xperia Wallpapers" app?
    2
    Lockscreen words(swipe up or down to unlock) blur layout fixed . :)