5,594,805 Members 36,881 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE][How-to] Aosp Lockscreen JB

Tip us?
 
tdunham
Old
(Last edited by tdunham; 3rd February 2013 at 04:49 PM.)
#1  
tdunham's Avatar
Recognized Contributor - OP
Thanks Meter 13832
Posts: 7,046
Join Date: Jun 2008
Location: TampaBay
Cool [GUIDE][How-to] Aosp Lockscreen JB

Enable Aosp Lockscreen with toggle in Jellybean

Credits to Mirko DDD for original guide.

Android.policy.jar

/com/android/internal/policy/impl/LockPatternKeyguardView.smali

Before:

Code:
.method createLockScreen()Landroid/view/View;
    .registers 7

    .prologue
    .line 1419
    new-instance v0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;

    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/sec/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/KeyguardScreenCallback;)V

    .line 1425
    .local v0, lockView:Landroid/view/View;
    invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->initializeTransportControlView(Landroid/view/View;)V

    .line 1426
    return-object v0
.end method
After - Replace entire method:

Code:
.method createLockScreen()Landroid/view/View;
    .registers 7

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

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

    move-result-object v0

    const-string v1, "aosp_lock"

    const/4 v2, 0x0

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

    move-result v0

    if-nez v0, :cond_al
	
    new-instance v0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;

    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/sec/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/KeyguardScreenCallback;)V

    goto :goto_td

    .line 1425
    :cond_al
    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

    .local v0, lockView:Landroid/view/View;
    :goto_td
    invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->initializeTransportControlView(Landroid/view/View;)V

    .line 1426
    return-object v0
.end method
Secsettings.apk


res/values/strings.xml
Add code to strings:

Code:
    <string name="aosp_lock">AOSP Lockscreen</string>
    <string name="aosp_lock_screen">Original Jelly Bean Lockscreen</string>
res/xml/lockscreen_settings.xml

Before:

Code:
    <CheckBoxPreference android:title="@string/samsung_unlock_option_say_your_wakeup_command_to_unlock_screen" android:key="say_your_wakeup" android:summary="@string/wakeup_in_lockscreen_summary" />
    <PreferenceScreen android:title="@string/samsung_unlock_option_set_wakeup_command" android:key="set_wakeup_command">
After:

Code:
    <CheckBoxPreference android:title="@string/aosp_lock" android:key="say_your_wakeup" android:summary="@string/aosp_lock_screen" />
    <PreferenceScreen android:title="@string/samsung_unlock_option_set_wakeup_command" android:key="set_wakeup_command">
Secsettings.apk - smali edit
smali\com\android\settings\LockScreenSettings.smal i

Before:

Code:
.field private isWeatherEnabled:Z

.field private mCameraShortCut:Landroid/preference/SwitchPreferenceScreen;
After:

Code:
.field private isWeatherEnabled:Z

.field private mAospLock:Landroid/preference/CheckBoxPreference;

.field private mCameraShortCut:Landroid/preference/SwitchPreferenceScreen;
Before:

Code:
.field private mRippleEffect:Landroid/preference/CheckBoxPreference;

.field private mSayCommand:Landroid/preference/CheckBoxPreference;

.field private mWeather:Landroid/preference/SwitchPreferenceScreen;
After:

Code:
.field private mRippleEffect:Landroid/preference/CheckBoxPreference;

.field private mWeather:Landroid/preference/SwitchPreferenceScreen;
Before:

Code:
    .line 355
    :cond_f8
    iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;

    if-eqz v4, :cond_10e

    .line 356
    iget-object v7, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    const-string v8, "wake_up_lock_screen"

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

Code:
    .line 355
    :cond_f8
    iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;

    if-eqz v4, :cond_10e

    .line 356
    iget-object v7, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    const-string v8, "aosp_lock"

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

Code:
    .line 244
    const-string v9, "say_your_wakeup"

    invoke-virtual {p0, v9}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v9

    check-cast v9, Landroid/preference/CheckBoxPreference;

    iput-object v9, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;
After:

Code:
    .line 244
    const-string v9, "say_your_wakeup"

    invoke-virtual {p0, v9}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v9

    check-cast v9, Landroid/preference/CheckBoxPreference;

    iput-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
Before:

Code:
    .line 247
    iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getResources()Landroid/content/res/Resources;

    move-result-object v10

    const v11, 0x7f090d9b

    invoke-virtual {v10, v11}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v9, v10}, Landroid/preference/CheckBoxPreference;->setSummary(Ljava/lang/CharSequence;)V
After:

Code:
    .line 247
    iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getResources()Landroid/content/res/Resources;

    move-result-object v10

    const v11, 0x7f090d9b

    invoke-virtual {v10, v11}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v9, v10}, Landroid/preference/CheckBoxPreference;->setSummary(Ljava/lang/CharSequence;)V
Before:

Code:
    .line 278
    iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;

    if-eqz v9, :cond_2dc

    .line 279
    invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;

    move-result-object v9

    iget-object v10, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v9, v10}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
After:

Code:
    .line 278
    iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;

    if-eqz v9, :cond_2dc

    .line 279
    # invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;

    # move-result-object v9

    # iget-object v10, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;

    # invoke-virtual {v9, v10}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
Before:

Code:
    .line 283
    :cond_2e5
    const/4 v9, 0x0

    invoke-static {v9}, Lcom/android/settings/Utils;->isTablet(Landroid/content/Context;)Z

    move-result v9

    if-nez v9, :cond_2f6

    iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;

    if-eqz v9, :cond_305

    if-eqz v7, :cond_305

    iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mCameraShortCut:Landroid/preference/SwitchPreferenceScreen;
After:

Code:
    .line 283
    :cond_2e5
    const/4 v9, 0x0

    invoke-static {v9}, Lcom/android/settings/Utils;->isTablet(Landroid/content/Context;)Z

    move-result v9

    if-nez v9, :cond_2f6

    iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;

    if-eqz v9, :cond_305

    if-eqz v7, :cond_305

    iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mCameraShortCut:Landroid/preference/SwitchPreferenceScreen;
Before:

Code:
    .line 286
    :cond_305
    iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mCameraShortCut:Landroid/preference/SwitchPreferenceScreen;

    if-nez v9, :cond_31e

    iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;

    if-nez v9, :cond_31e

    if-nez v7, :cond_31e
After:

Code:
    .line 286
    :cond_305
    iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mCameraShortCut:Landroid/preference/SwitchPreferenceScreen;

    if-nez v9, :cond_31e

    iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;

    if-nez v9, :cond_31e

    if-nez v7, :cond_31e
Before:

Code:
    .line 392
    :cond_b3
    iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_1e

    .line 393
    invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    const-string v5, "wake_up_lock_screen"

    iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v6
After:

Code:
    .line 392
    :cond_b3
    iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_1e

    .line 393
    invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v4

    const-string v5, "aosp_lock"

    iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v6
Before:

Code:
    .line 306
    :cond_1e
    iget-object v2, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;

    if-eqz v2, :cond_27

    .line 307
    iget-object v2, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v2, v1}, Landroid/preference/CheckBoxPreference;->setEnabled(Z)V
After:

Code:
    .line 306
    :cond_1e
    iget-object v2, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;

    if-eqz v2, :cond_27

    .line 307
    iget-object v2, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v2, v1}, Landroid/preference/CheckBoxPreference;->setEnabled(Z)V
Hint: When you get through with this section, search for mSayCommand. All occurrences should have been replaced. If you missed one go back and fix it.
The Following 23 Users Say Thank You to tdunham For This Useful Post: [ Click to Expand ]
 
_dan
Old
#2  
Senior Member
Thanks Meter 1068
Posts: 602
Join Date: Nov 2011
Location: NJ

 
DONATE TO ME
I tried this guide and failed ah I'll try again tomorrow. Thanks!
 
prguzman1978
Old
#3  
prguzman1978's Avatar
Senior Member
Thanks Meter 186
Posts: 869
Join Date: Jul 2008
Location: Tiverton, Rhode Island
Default Re: [GUIDE][How-to] Aosp Lockscreen JB

Nice another cool mod will add when I get home.

Sent from my SPH-D710 using xda premium
Device: GS4-SPH-L710
Rom: BeanStalk-Latest
Kernel: KT4.4-AOSP
Recovery: Philz Recovery CWM 6.0.4.5
 
prguzman1978
Old
#4  
prguzman1978's Avatar
Senior Member
Thanks Meter 186
Posts: 869
Join Date: Jul 2008
Location: Tiverton, Rhode Island
Hey Tdunham is this mod for stock jellybean?
Device: GS4-SPH-L710
Rom: BeanStalk-Latest
Kernel: KT4.4-AOSP
Recovery: Philz Recovery CWM 6.0.4.5
 
tdunham
Old
#5  
tdunham's Avatar
Recognized Contributor - OP
Thanks Meter 13832
Posts: 7,046
Join Date: Jun 2008
Location: TampaBay
Quote:
Originally Posted by prguzman1978 View Post
Hey Tdunham is this mod for stock jellybean?
Yes, stock based 4.1.2 TW Jellybean.
The Following 3 Users Say Thank You to tdunham For This Useful Post: [ Click to Expand ]
 
prguzman1978
Old
#6  
prguzman1978's Avatar
Senior Member
Thanks Meter 186
Posts: 869
Join Date: Jul 2008
Location: Tiverton, Rhode Island
Default Re: [GUIDE][How-to] Aosp Lockscreen JB

For some reason the first line 1419 I can't find it I tried looking for it and no luck.

Sent from my SPH-D710 using xda premium
Device: GS4-SPH-L710
Rom: BeanStalk-Latest
Kernel: KT4.4-AOSP
Recovery: Philz Recovery CWM 6.0.4.5
 
tdunham
Old
#7  
tdunham's Avatar
Recognized Contributor - OP
Thanks Meter 13832
Posts: 7,046
Join Date: Jun 2008
Location: TampaBay
I corrected that replacement method for spacing issue. The method didn't copy and paste correctly and the spacing of a couple of lines weren't right.

What file do you have open? The entire method is supposed to be replaced.
The Following 2 Users Say Thank You to tdunham For This Useful Post: [ Click to Expand ]
 
prguzman1978
Old
(Last edited by prguzman1978; 3rd February 2013 at 04:09 PM.)
#8  
prguzman1978's Avatar
Senior Member
Thanks Meter 186
Posts: 869
Join Date: Jul 2008
Location: Tiverton, Rhode Island
Default Re: [GUIDE][How-to] Aosp Lockscreen JB

Quote:
Originally Posted by tdunham View Post
I corrected that replacement method for spacing issue. The method didn't copy and paste correctly and the spacing of a couple of lines weren't right.

What file do you have open? The entire method is supposed to be replaced.
I'm looking in android.policy.jar, in the mentioned path
/com/android/internal/policy/impl/LockPatternKeyguardView.smali
Sent from my SPH-D710 using xda premium
Device: GS4-SPH-L710
Rom: BeanStalk-Latest
Kernel: KT4.4-AOSP
Recovery: Philz Recovery CWM 6.0.4.5
 
tdunham
Old
(Last edited by tdunham; 3rd February 2013 at 04:28 PM.)
#9  
tdunham's Avatar
Recognized Contributor - OP
Thanks Meter 13832
Posts: 7,046
Join Date: Jun 2008
Location: TampaBay
Quote:
Originally Posted by prguzman1978 View Post
I'm looking in android.policy.jar, in the mentioned path
/com/android/internal/policy/impl/LockPatternKeyguardView.smali
.line 1419 is there.
You should only be using notepad+ to open the file to do edits.
But searching in notepad+ won't work if the options aren't set right.

Edit: I found this out the hard way a couple of times. If you accidentally change any of the checkboxes, the search doesn't work anymore. Or at least not the way it should.
Attached Thumbnails
Click image for larger version

Name:	notepad+.jpg
Views:	901
Size:	56.8 KB
ID:	1700702  
The Following 2 Users Say Thank You to tdunham For This Useful Post: [ Click to Expand ]
 
prguzman1978
Old
#10  
prguzman1978's Avatar
Senior Member
Thanks Meter 186
Posts: 869
Join Date: Jul 2008
Location: Tiverton, Rhode Island
Default Re: [GUIDE][How-to] Aosp Lockscreen JB

Quote:
Originally Posted by tdunham View Post
.line 1419 is there.
You should only be using notepad+ to open the file to do edits.
But searching in notepad+ won't work if the options aren't set right.

Edit: I found this out the hard way a couple of times. If you accidentally change any of the checkboxes, the search doesn't work anymore. Or at least not the way it should.
Nice when I get home I will try these settings out, and I am using notepad too.

Sent from my SPH-D710 using xda premium
Device: GS4-SPH-L710
Rom: BeanStalk-Latest
Kernel: KT4.4-AOSP
Recovery: Philz Recovery CWM 6.0.4.5

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes