[MOD][HOW-TO] Quick Unlock on Pin/Password with toggle

Search This thread

loserskater

Inactive Recognized Developer
Jun 6, 2008
2,160
4,434
Palmdale, CA
This will allow the PIN and Password unlock screens to be unlock as soon as the correct pin/password is input without having to press the enter key to submit.

**UPDATE** Updated for Lollipop
Thanks to @tdunham for updating this guide for 4.4.2. See here: http://xdaforums.com/showpost.php?p=54905593&postcount=54


We're going to be working with the following two files:
SecSettings.apk
android.policy.jar



KEY
REMOVE what's in BLUE
ADD what's in RED



SecSettings.apk
Navigate to /res/values/strings.xml
Add the following to the end of the file
Code:
    <string name="quick_unlock_title">Quick Unlock</string>
    <string name="quick_unlock_summary">Unlock as soon as correct pin is entered</string>
Navigate to /xml/security_settings_password.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
  xmlns:android="http://schemas.android.com/apk/res/android">
    <PreferenceScreen android:persistent="false" android:title="@string/unlock_set_unlock_launch_picker_title" android:key="unlock_set_or_change" android:summary="@string/unlock_set_unlock_mode_password" />
    <SwitchPreferenceScreen android:title="@string/dualclock_settings_title" android:key="dualclock_settings" android:summary="@string/dualclock_settings_summary" android:fragment="com.android.settings.dualclock.DualClockSetting" />
    <CheckBoxPreference android:title="@string/with_cicle_title" android:key="with_circle" android:summary="@string/with_cicle_summary" android:defaultValue="false" />
    <PreferenceScreen android:title="@string/lock_screen_options" android:key="lock_screen_options" android:summary="@string/lock_screen_options_summary" android:fragment="com.android.settings.LockScreenSettings" />
    <CheckBoxPreference android:title="@string/quick_note_title" android:key="quick_note" android:summary="@string/quick_note_summary" android:defaultValue="false" />
    <ListPreference android:persistent="false" android:entries="@array/lock_after_timeout_entries" android:title="@string/lock_after_timeout" android:key="lock_after_timeout" android:summary="@string/lock_after_timeout_summary" android:entryValues="@array/lock_after_timeout_values" />
    <CheckBoxPreference android:title="@string/lockpattern_settings_enable_power_button_instantly_locks" android:key="power_button_instantly_locks" />
    [COLOR="Red"]<CheckBoxPreference android:title="@string/quick_unlock_title" android:key="quick_unlock" android:summary="@string/quick_unlock_summary" />[/COLOR]
    <PreferenceScreen android:title="@string/owner_info_settings_title" android:key="owner_info_settings" android:summary="@string/owner_info_settings_summary" android:fragment="com.android.settings.OwnerInfoSettings" />
</PreferenceScreen>

Navigate to /xml/security_settings_pin.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
  xmlns:android="http://schemas.android.com/apk/res/android">
    <PreferenceScreen android:persistent="false" android:title="@string/unlock_set_unlock_launch_picker_title" android:key="unlock_set_or_change" android:summary="@string/unlock_set_unlock_mode_pin" />
    <SwitchPreferenceScreen android:title="@string/dualclock_settings_title" android:key="dualclock_settings" android:summary="@string/dualclock_settings_summary" android:fragment="com.android.settings.dualclock.DualClockSetting" />
    <CheckBoxPreference android:title="@string/with_cicle_title" android:key="with_circle" android:summary="@string/with_cicle_summary" android:defaultValue="false" />
    <PreferenceScreen android:title="@string/lock_screen_options" android:key="lock_screen_options" android:summary="@string/lock_screen_options_summary" android:fragment="com.android.settings.LockScreenSettings" />
    <CheckBoxPreference android:title="@string/quick_note_title" android:key="quick_note" android:summary="@string/quick_note_summary" android:defaultValue="false" />
    <ListPreference android:persistent="false" android:entries="@array/lock_after_timeout_entries" android:title="@string/lock_after_timeout" android:key="lock_after_timeout" android:summary="@string/lock_after_timeout_summary" android:entryValues="@array/lock_after_timeout_values" />
    <CheckBoxPreference android:title="@string/lockpattern_settings_enable_power_button_instantly_locks" android:key="power_button_instantly_locks" />
    <CheckBoxPreference android:title="@string/lockpattern_settings_enable_tactile_feedback_title" android:key="unlock_tactile_feedback" />
    [COLOR="red"]<CheckBoxPreference android:title="@string/quick_unlock_title" android:key="quick_unlock" android:summary="@string/quick_unlock_summary" />[/COLOR]
    <PreferenceScreen android:title="@string/owner_info_settings_title" android:key="owner_info_settings" android:summary="@string/owner_info_settings_summary" android:fragment="com.android.settings.OwnerInfoSettings" />
</PreferenceScreen>

Navigate to /smali/com/android/settings/LockscreenMenuSettings.smali
Code:
.field private mPowerButtonInstantlyLocks:Landroid/preference/CheckBoxPreference;

.field private mQuicknote:Landroid/preference/CheckBoxPreference;

[COLOR="red"].field private mQuickUnlock:Landroid/preference/CheckBoxPreference;[/COLOR]

.field private mSignatureVerificationLevel:Landroid/preference/ListPreference;

.field private mTactileFeedback:Landroid/preference/CheckBoxPreference;

.method private createPreferenceHierarchy()Landroid/preference/PreferenceScreen;
WAIT!
WAIT!
You need to grab some ID's. Luckily they're already available so no need to compile, etc.!
There's only two.
Code:
    :cond_5
    const-string v4, "quick_note"

    invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v4

    check-cast v4, Landroid/preference/CheckBoxPreference;

    iput-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;

    .line 203
    iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;

    if-eqz v4, :cond_6

    const v4, 0x7f07004f

    if-eq v2, v4, :cond_6

    .line 205
    iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z

    .line 208
    :cond_6
   [COLOR="red"] const-string v4, "quick_unlock"

    invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v4

    check-cast v4, Landroid/preference/CheckBoxPreference;

    iput-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;

    .line 203
    iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;

    if-eqz v4, :cond_next

    const v4, 0x7f070051    # type="xml" name="security_settings_password"

    if-eq v2, v4, :cond_next
    
    const v4, 0x7f070054    # type="xml" name="security_settings_pin"

    if-eq v2, v4, :cond_next

    .line 205
    iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
    
    :cond_next[/COLOR]
    const-string v4, "visiblesignature"

    invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v4

    check-cast v4, Landroid/preference/CheckBoxPreference;

    iput-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mVisibleSignature:Landroid/preference/CheckBoxPreference;
WAIT!
WAIT!
Did you replace those two ID's in that last section? Good. Let's continue.

.method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
Code:
:cond_8
    const-string v5, "quick_note"

    invoke-virtual {v5, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_a

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

    move-result-object v5

    const-string v6, "lock_screen_quick_note"

    iget-object v7, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;

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

    move-result v7

    if-eqz v7, :cond_9

    move v3, v4

    :cond_9
    invoke-static {v5, v6, v3}, Landroid/provider/Settings$Secure;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 :goto_0

    .line 504
    :cond_a
    [COLOR="red"]const-string v5, "quick_unlock"

    invoke-virtual {v5, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_next

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

    move-result-object v5

    const-string v6, "quick_unlock"

    iget-object v7, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;

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

    move-result v7

    if-eqz v7, :cond_quick

    move v3, v4

    :cond_quick
    invoke-static {v5, v6, v3}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 :goto_0

    .line 504
    :cond_next[/COLOR]
    const-string v3, "visiblesignature"

    invoke-virtual {v3, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_b

.method public onResume()V
Code:
    :cond_2
    iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;

    if-eqz v1, :cond_3

    .line 438
    iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;

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

    move-result-object v4

    const-string v5, "lock_screen_quick_note"

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

    move-result v4

    if-eqz v4, :cond_8

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

    .line 440
    :cond_3
    [COLOR="red"]iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;

    if-eqz v1, :cond_next

    .line 438
    iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;

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

    move-result-object v4

    const-string v5, "quick_unlock"

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

    move-result v4

    if-eqz v4, :cond_quick

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

    .line 440
    :cond_next[/COLOR]
    iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mVisibleSignature:Landroid/preference/CheckBoxPreference;

    if-eqz v1, :cond_4

    .line 441
    iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mVisibleSignature:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v0}, Lcom/android/internal/widget/LockPatternUtils;->isVisibleSignatureEnabled()Z

    move-result v2

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

Code:
    :cond_7
    move v1, v3

    .line 434
    goto :goto_0

    :cond_8
    move v2, v3

    .line 438
    goto :goto_1
    
    [COLOR="red"]:cond_quick
    move v2, v3

    goto :goto_quick[/COLOR]
.end method

That's it for SecSettings. Compile.
 
Last edited:

loserskater

Inactive Recognized Developer
Jun 6, 2008
2,160
4,434
Palmdale, CA
android.policy.jar
4.1.x


Navigate to /smali/com/android/internal/policy/impl/PasswordUnlockScreen.smali
Code:
.field private mPwdPolicy:Landroid/app/enterprise/PasswordPolicy;

.field private mResuming:Z

[COLOR="Red"].field private mQuickUnlock:Z[/COLOR]

.field private final mStatusViewManager:Lcom/android/internal/policy/impl/KeyguardStatusViewManager;

.field private final mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;

.method public constructor <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
Code:
    iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;

    const/16 v2, 0x81

    invoke-virtual {v1, v2}, Landroid/widget/EditText;->setInputType(I)V

    .line 250
    :goto_4
    iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;

    new-instance v2, Lcom/android/internal/policy/impl/PasswordUnlockScreen$4;

    invoke-direct {v2, p0}, Lcom/android/internal/policy/impl/PasswordUnlockScreen$4;-><init>(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)V

    invoke-virtual {v1, v2}, Landroid/widget/EditText;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 255
    [COLOR="red"]iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mContext:Landroid/content/Context;

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

    move-result-object v1
    
    const/4 v3, 0x0

    const-string v9, "quick_unlock"

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

    move-result v1
    
    const/4 v2, 0x1
    
    if-ne v1, v2, :cond_quick

    move v1, v2

    :goto_quick
    iput-boolean v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mQuickUnlock:Z[/COLOR]
    
    iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;

    new-instance v2, Lcom/android/internal/policy/impl/PasswordUnlockScreen$5;

    invoke-direct {v2, p0}, Lcom/android/internal/policy/impl/PasswordUnlockScreen$5;-><init>(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)V

    invoke-virtual {v1, v2}, Landroid/widget/EditText;->addTextChangedListener(Landroid/text/TextWatcher;)V

Code:
    new-instance v1, Lcom/android/internal/policy/impl/PasswordUnlockScreen$2;

    invoke-direct {v1, p0}, Lcom/android/internal/policy/impl/PasswordUnlockScreen$2;-><init>(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)V

    invoke-virtual {v10, v1}, Landroid/view/View;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V

    goto/16 :goto_3

    .line 181
    .end local v10           #pinDelete:Landroid/view/View;
    :cond_f
    const/4 v1, 0x0

    goto :goto_5
    
    [COLOR="red"]:cond_quick
    move v1, v3

    goto :goto_quick[/COLOR]

    .line 242
    :cond_10
    iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;

    invoke-static {}, Landroid/text/method/DigitsKeyListener;->getInstance()Landroid/text/method/DigitsKeyListener;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/EditText;->setKeyListener(Landroid/text/method/KeyListener;)V

    .line 243
    iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;

    const/16 v2, 0x12

    invoke-virtual {v1, v2}, Landroid/widget/EditText;->setInputType(I)V

    goto/16 :goto_4
.end method

Add the following methods:
Code:
.method static synthetic access$100(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)Landroid/widget/EditText;
    .locals 1
    .parameter "x0"

    .prologue
    .line 76
    iget-object v0, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;

    return-object v0
.end method

[COLOR="Red"].method static synthetic access$1000(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 76
    iget-boolean v0, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mQuickUnlock:Z

    return v0
.end method

.method static synthetic access$1100(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)Lcom/android/internal/widget/LockPatternUtils;
    .locals 1
    .parameter "x0"

    .prologue
    .line 76
    iget-object v0, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

    return-object v0
.end method[/COLOR]

.method static synthetic access$200(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
    .locals 1
    .parameter "x0"

    .prologue
    .line 76
    iget-object v0, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;

    return-object v0
.end method

Now download the zip attached to this post and extract to the root of your project.
Compile and enjoy!


4.3

Navigate to smali/com/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView.smali
Add the following in red:
Code:
.field protected mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

.field protected mPasswordEntry:Landroid/widget/TextView;

[COLOR="Red"].field private mQuickUnlock:Z[/COLOR]

Add the following method in red:
Code:
    .method static synthetic access$300(Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;)Landroid/widget/Button;
    .locals 1
    .parameter "x0"

    .prologue
    .line 68
    iget-object v0, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mEmergencyButton:Landroid/widget/Button;

    return-object v0
.end method

[COLOR="red"].method static synthetic access$400(Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 42
    iget-boolean v0, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mQuickUnlock:Z

    return v0
.end method[/COLOR]

.method protected onFinishInflate()V

Make sure this is larger than 3
Code:
.method protected onFinishInflate()V
   [COLOR="Red"] .locals 4[/COLOR]

Code:
    .line 176
    iget-object v1, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mPasswordEntry:Landroid/widget/TextView;

    new-instance v2, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView$1;

    invoke-direct {v2, p0}, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView$1;-><init>(Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;)V

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    [COLOR="red"]iget-object v1, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mContext:Landroid/content/Context;

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

    move-result-object v1

    const-string v2, "quick_unlock"

    const/4 v3, 0x0

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

    move-result v1

    if-eqz v1, :cond_quick

    const/4 v1, 0x1

    :goto_0
    iput-boolean v1, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mQuickUnlock:Z[/COLOR]

    .line 182
    iget-object v1, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mPasswordEntry:Landroid/widget/TextView;

    new-instance v2, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView$2;

    invoke-direct {v2, p0}, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView$2;-><init>(Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;)V

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->addTextChangedListener(Landroid/text/TextWatcher;)V

Code:
    :cond_2
    return-void
    
    [COLOR="red"]:cond_quick
    const/4 v1, 0x0
    
    goto :goto_0[/COLOR]
.end method
 

Attachments

  • Quick_Unlock_android.policy_4.3.zip
    2.3 KB · Views: 897
Last edited:

upndwn4par

Inactive Recognized Developer
Jan 22, 2012
3,640
10,375
New Jersey
Awesome stuff my man!

(P.S. I think you might have a toggle problem. ;))

Edit:
Works perfect. :good:
 
Last edited:
  • Like
Reactions: Ali7000

matrixzone

Senior Member
Mar 19, 2012
3,534
3,584
Thanks man for this feature. For me this will be the killer feature on Touchwiz ROM. Do we need decomplie the APK and JAR file mentioned in the OP. I am bad in coding
 

lmike6453

Senior Member
Dec 17, 2010
721
319
Eagleville PA
Many thanks for this! do you know if it will work on a galaxy note 2 tw based 4.1.2 rom? no worries if not, i will try later and let you guys know
 

lmike6453

Senior Member
Dec 17, 2010
721
319
Eagleville PA
I'm trying to follow your guide but I am getting a compile error at the end and I think I'm lost on this part that you explain...

---------------------------------------------------------------------------------------------------------------------
.method private createPreferenceHierarchy()Landroid/preference/PreferenceScreen;
WAIT!
WAIT!
You need to grab some ID's. Luckily they're already available so no need to compile, etc.!
There's only two.

Code:
:cond_5
const-string v4, "quick_note"

invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

move-result-object v4

check-cast v4, Landroid/preference/CheckBoxPreference;

iput-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;

.line 203
iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;

if-eqz v4, :cond_6

const v4, 0x7f07004f

if-eq v2, v4, :cond_6

.line 205
iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;

invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z

.line 208
:cond_6
const-string v4, "quick_unlock"

invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

move-result-object v4

check-cast v4, Landroid/preference/CheckBoxPreference;

iput-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;

.line 203
iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;

if-eqz v4, :cond_next

const v4, 0x7f070051 # type="xml" name="security_settings_password"

if-eq v2, v4, :cond_next

const v4, 0x7f070054 # type="xml" name="security_settings_pin"

if-eq v2, v4, :cond_next

.line 205
iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;

invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z

:cond_next

const-string v4, "visiblesignature"

invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

move-result-object v4

check-cast v4, Landroid/preference/CheckBoxPreference;

iput-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mVisibleSignature:Landroid/preference/CheckBoxPreference;

WAIT!
WAIT!
Did you replace those two ID's in that last section? Good. Let's continue.
-----------------------------------------------------------------------------------------------------------------

I was just adding the red. What do you mean by grabbing ID's and replacing ID's? Specific thing that's not universal that I have to figure out?(sorry for ignorance, i'm not a developer/experienced with coding)
 
Last edited:

loserskater

Inactive Recognized Developer
Jun 6, 2008
2,160
4,434
Palmdale, CA
I'm trying to follow your guide but I am getting a compile error at the end and I think I'm lost on this part that you explain...

I was just adding the red. What do you mean by grabbing ID's and replacing ID's? Specific thing that's not universal that I have to figure out?(sorry for ignorance, i'm not a developer/experienced with coding)

Look in the code for lines that have the #
Code:
    const v4, [COLOR="Red"]0x7f070051[/COLOR] # type="xml" name="security_settings_password"
Now search in /res/values/public.xml for what's after the #
You should see something like
Code:
<public type="xml" name="security_settings_pattern" id="[COLOR="red"]0x7f070051[/COLOR]" />
Now look back at the line in the smali and replace the 0x7fxxxxxx with what is in your public.xml (Match what's in red)
 

hednik

Senior Member
May 31, 2012
1,529
708
Fort Worth
Look in the code for lines that have the #
Code:
    const v4, [COLOR="Red"]0x7f070051[/COLOR] # type="xml" name="security_settings_password"
Now search in /res/values/public.xml for what's after the #
You should see something like
Code:
<public type="xml" name="security_settings_pattern" id="[COLOR="red"]0x7f070051[/COLOR]" />
Now look back at the line in the smali and replace the 0x7fxxxxxx with what is in your public.xml (Match what's in red)

Loser,

He has a point as the way you explain about the part in getting the id's is a bit different than I've seen in others. I had to do a double take to make sure I was understanding the wording.

I love this mod though...so simple but negates out the "ok" step to make it seem more fluid
 
  • Like
Reactions: lmike6453

upndwn4par

Inactive Recognized Developer
Jan 22, 2012
3,640
10,375
New Jersey
Remember that doing these mods is not for everyone. Loser is very kind to even bother explaining how to match the ids (or anything else for that matter). Most devs post the mod and don't offer any support. Everyone should try not to bother him too much.
 

hednik

Senior Member
May 31, 2012
1,529
708
Fort Worth
Remember that doing these mods is not for everyone. Loser is very kind to even bother explaining how to match the ids (or anything else for that matter). Most devs post the mod and don't offer any support. Everyone should try not to bother him too much.

Just trying to see where the guy was coming from. I myself probably didn't even come across how I meant to. I wasn't complaining.

So if I'm not "good enough" I don't need to post ?
 

lmike6453

Senior Member
Dec 17, 2010
721
319
Eagleville PA
Look in the code for lines that have the #
Code:
    const v4, [COLOR="Red"]0x7f070051[/COLOR] # type="xml" name="security_settings_password"
Now search in /res/values/public.xml for what's after the #
You should see something like
Code:
<public type="xml" name="security_settings_pattern" id="[COLOR="red"]0x7f070051[/COLOR]" />
Now look back at the line in the smali and replace the 0x7fxxxxxx with what is in your public.xml (Match what's in red)

Many thanks for the reply and guidance! I can understand how annoying dumb questions can get and I hope that mine does not discourage ya in any way.

Always know that ppl in my shoes that are just "getting my feet wet" appreciate it that much more since your guides for such useful MODS are a rarity among developers as upndwn4par explained.

I will give it another go and post back my findings for TW based 4.1.2 ROM for Galaxy Note 2 that I'll be attempting it for :good:
 
Last edited:

upndwn4par

Inactive Recognized Developer
Jan 22, 2012
3,640
10,375
New Jersey
Just trying to see where the guy was coming from. I myself probably didn't even come across how I meant to. I wasn't complaining.

So if I'm not "good enough" I don't need to post ?
That was not directed at you buddy, but everyone in general.

Just reminding everyone that these are dev level mods.
 

loserskater

Inactive Recognized Developer
Jun 6, 2008
2,160
4,434
Palmdale, CA
I post these guides in hopes that people will attempt to get into learning how they work instead of just copy and pasting the guide. I know smali is a crazy foreign language to most people and it is a very steep learning curve, but anybody that sees these guides and starts seeing patterns, and then attempt to do their own mods is a great success to me.

You're right that the ID section is vague, but I'm hoping that people have done enough mods that they will understand what is meant. It's just one of those things that I don't want to post in every how-to. I have mulitple guides that explain how to get IDs that I don't see the point in posting it over and over. I also don't mind answering people that have issues with getting ID's (as you can see in my previous post) so it's not that big of an issue.

And I don't mind being bothered as long as it's in my thread and not a PM. I'm MUCH more likely to help if you post in the thread. It also allows other users to help out if they've come across the issue you're having which helps me out a lot.
 
Last edited:

darth_mickrig

Senior Member
May 5, 2012
158
96
Hi Loserskater,

I'm trying to apply the mod to the Galaxy S2. When i apply the changes to SecSettings.apk, I get an error:
Code:
I: Smaling...
[3177,16] Label "cond_quick" is not defined.
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
: C:\Users\Do Khac Minh Duc\Desktop\apktool\SecSettings\smali\com\android\settin
gs\LockscreenMenuSettings.smali
        at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)

        at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)

        at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:66)
        at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:50)
        at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:37)
        at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:257)
        at brut.androlib.Androlib.buildSources(Androlib.java:214)
        at brut.androlib.Androlib.build(Androlib.java:205)
        at brut.androlib.Androlib.build(Androlib.java:176)
        at brut.apktool.Main.cmdBuild(Main.java:228)
        at brut.apktool.Main.main(Main.java:79)
Can you please tell me, what I'm doing wrong? I have already changed line references to match the S2 smali.
I'll attach the publics.xml and LockscreenMenuSettings.smali.

Thanks for your response in advance!
 

Attachments

  • Quick_Unlock.zip
    66.5 KB · Views: 57
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 23
    This will allow the PIN and Password unlock screens to be unlock as soon as the correct pin/password is input without having to press the enter key to submit.

    **UPDATE** Updated for Lollipop
    Thanks to @tdunham for updating this guide for 4.4.2. See here: http://xdaforums.com/showpost.php?p=54905593&postcount=54


    We're going to be working with the following two files:
    SecSettings.apk
    android.policy.jar



    KEY
    REMOVE what's in BLUE
    ADD what's in RED



    SecSettings.apk
    Navigate to /res/values/strings.xml
    Add the following to the end of the file
    Code:
        <string name="quick_unlock_title">Quick Unlock</string>
        <string name="quick_unlock_summary">Unlock as soon as correct pin is entered</string>
    Navigate to /xml/security_settings_password.xml
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <PreferenceScreen
      xmlns:android="http://schemas.android.com/apk/res/android">
        <PreferenceScreen android:persistent="false" android:title="@string/unlock_set_unlock_launch_picker_title" android:key="unlock_set_or_change" android:summary="@string/unlock_set_unlock_mode_password" />
        <SwitchPreferenceScreen android:title="@string/dualclock_settings_title" android:key="dualclock_settings" android:summary="@string/dualclock_settings_summary" android:fragment="com.android.settings.dualclock.DualClockSetting" />
        <CheckBoxPreference android:title="@string/with_cicle_title" android:key="with_circle" android:summary="@string/with_cicle_summary" android:defaultValue="false" />
        <PreferenceScreen android:title="@string/lock_screen_options" android:key="lock_screen_options" android:summary="@string/lock_screen_options_summary" android:fragment="com.android.settings.LockScreenSettings" />
        <CheckBoxPreference android:title="@string/quick_note_title" android:key="quick_note" android:summary="@string/quick_note_summary" android:defaultValue="false" />
        <ListPreference android:persistent="false" android:entries="@array/lock_after_timeout_entries" android:title="@string/lock_after_timeout" android:key="lock_after_timeout" android:summary="@string/lock_after_timeout_summary" android:entryValues="@array/lock_after_timeout_values" />
        <CheckBoxPreference android:title="@string/lockpattern_settings_enable_power_button_instantly_locks" android:key="power_button_instantly_locks" />
        [COLOR="Red"]<CheckBoxPreference android:title="@string/quick_unlock_title" android:key="quick_unlock" android:summary="@string/quick_unlock_summary" />[/COLOR]
        <PreferenceScreen android:title="@string/owner_info_settings_title" android:key="owner_info_settings" android:summary="@string/owner_info_settings_summary" android:fragment="com.android.settings.OwnerInfoSettings" />
    </PreferenceScreen>

    Navigate to /xml/security_settings_pin.xml
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <PreferenceScreen
      xmlns:android="http://schemas.android.com/apk/res/android">
        <PreferenceScreen android:persistent="false" android:title="@string/unlock_set_unlock_launch_picker_title" android:key="unlock_set_or_change" android:summary="@string/unlock_set_unlock_mode_pin" />
        <SwitchPreferenceScreen android:title="@string/dualclock_settings_title" android:key="dualclock_settings" android:summary="@string/dualclock_settings_summary" android:fragment="com.android.settings.dualclock.DualClockSetting" />
        <CheckBoxPreference android:title="@string/with_cicle_title" android:key="with_circle" android:summary="@string/with_cicle_summary" android:defaultValue="false" />
        <PreferenceScreen android:title="@string/lock_screen_options" android:key="lock_screen_options" android:summary="@string/lock_screen_options_summary" android:fragment="com.android.settings.LockScreenSettings" />
        <CheckBoxPreference android:title="@string/quick_note_title" android:key="quick_note" android:summary="@string/quick_note_summary" android:defaultValue="false" />
        <ListPreference android:persistent="false" android:entries="@array/lock_after_timeout_entries" android:title="@string/lock_after_timeout" android:key="lock_after_timeout" android:summary="@string/lock_after_timeout_summary" android:entryValues="@array/lock_after_timeout_values" />
        <CheckBoxPreference android:title="@string/lockpattern_settings_enable_power_button_instantly_locks" android:key="power_button_instantly_locks" />
        <CheckBoxPreference android:title="@string/lockpattern_settings_enable_tactile_feedback_title" android:key="unlock_tactile_feedback" />
        [COLOR="red"]<CheckBoxPreference android:title="@string/quick_unlock_title" android:key="quick_unlock" android:summary="@string/quick_unlock_summary" />[/COLOR]
        <PreferenceScreen android:title="@string/owner_info_settings_title" android:key="owner_info_settings" android:summary="@string/owner_info_settings_summary" android:fragment="com.android.settings.OwnerInfoSettings" />
    </PreferenceScreen>

    Navigate to /smali/com/android/settings/LockscreenMenuSettings.smali
    Code:
    .field private mPowerButtonInstantlyLocks:Landroid/preference/CheckBoxPreference;
    
    .field private mQuicknote:Landroid/preference/CheckBoxPreference;
    
    [COLOR="red"].field private mQuickUnlock:Landroid/preference/CheckBoxPreference;[/COLOR]
    
    .field private mSignatureVerificationLevel:Landroid/preference/ListPreference;
    
    .field private mTactileFeedback:Landroid/preference/CheckBoxPreference;

    .method private createPreferenceHierarchy()Landroid/preference/PreferenceScreen;
    WAIT!
    WAIT!
    You need to grab some ID's. Luckily they're already available so no need to compile, etc.!
    There's only two.
    Code:
        :cond_5
        const-string v4, "quick_note"
    
        invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
    
        move-result-object v4
    
        check-cast v4, Landroid/preference/CheckBoxPreference;
    
        iput-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;
    
        .line 203
        iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;
    
        if-eqz v4, :cond_6
    
        const v4, 0x7f07004f
    
        if-eq v2, v4, :cond_6
    
        .line 205
        iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;
    
        invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
    
        .line 208
        :cond_6
       [COLOR="red"] const-string v4, "quick_unlock"
    
        invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
    
        move-result-object v4
    
        check-cast v4, Landroid/preference/CheckBoxPreference;
    
        iput-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;
    
        .line 203
        iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;
    
        if-eqz v4, :cond_next
    
        const v4, 0x7f070051    # type="xml" name="security_settings_password"
    
        if-eq v2, v4, :cond_next
        
        const v4, 0x7f070054    # type="xml" name="security_settings_pin"
    
        if-eq v2, v4, :cond_next
    
        .line 205
        iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;
    
        invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
        
        :cond_next[/COLOR]
        const-string v4, "visiblesignature"
    
        invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
    
        move-result-object v4
    
        check-cast v4, Landroid/preference/CheckBoxPreference;
    
        iput-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mVisibleSignature:Landroid/preference/CheckBoxPreference;
    WAIT!
    WAIT!
    Did you replace those two ID's in that last section? Good. Let's continue.

    .method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
    Code:
    :cond_8
        const-string v5, "quick_note"
    
        invoke-virtual {v5, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
    
        move-result v5
    
        if-eqz v5, :cond_a
    
        .line 503
        invoke-virtual {p0}, Lcom/android/settings/LockscreenMenuSettings;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v5
    
        const-string v6, "lock_screen_quick_note"
    
        iget-object v7, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;
    
        invoke-virtual {v7}, Landroid/preference/CheckBoxPreference;->isChecked()Z
    
        move-result v7
    
        if-eqz v7, :cond_9
    
        move v3, v4
    
        :cond_9
        invoke-static {v5, v6, v3}, Landroid/provider/Settings$Secure;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
    
        goto/16 :goto_0
    
        .line 504
        :cond_a
        [COLOR="red"]const-string v5, "quick_unlock"
    
        invoke-virtual {v5, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
    
        move-result v5
    
        if-eqz v5, :cond_next
    
        .line 503
        invoke-virtual {p0}, Lcom/android/settings/LockscreenMenuSettings;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v5
    
        const-string v6, "quick_unlock"
    
        iget-object v7, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;
    
        invoke-virtual {v7}, Landroid/preference/CheckBoxPreference;->isChecked()Z
    
        move-result v7
    
        if-eqz v7, :cond_quick
    
        move v3, v4
    
        :cond_quick
        invoke-static {v5, v6, v3}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
    
        goto/16 :goto_0
    
        .line 504
        :cond_next[/COLOR]
        const-string v3, "visiblesignature"
    
        invoke-virtual {v3, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
    
        move-result v3
    
        if-eqz v3, :cond_b

    .method public onResume()V
    Code:
        :cond_2
        iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;
    
        if-eqz v1, :cond_3
    
        .line 438
        iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;
    
        invoke-virtual {p0}, Lcom/android/settings/LockscreenMenuSettings;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v4
    
        const-string v5, "lock_screen_quick_note"
    
        invoke-static {v4, v5, v3}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v4
    
        if-eqz v4, :cond_8
    
        :goto_1
        invoke-virtual {v1, v2}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
    
        .line 440
        :cond_3
        [COLOR="red"]iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;
    
        if-eqz v1, :cond_next
    
        .line 438
        iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;
    
        invoke-virtual {p0}, Lcom/android/settings/LockscreenMenuSettings;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v4
    
        const-string v5, "quick_unlock"
    
        invoke-static {v4, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v4
    
        if-eqz v4, :cond_quick
    
        :goto_quick
        invoke-virtual {v1, v2}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
    
        .line 440
        :cond_next[/COLOR]
        iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mVisibleSignature:Landroid/preference/CheckBoxPreference;
    
        if-eqz v1, :cond_4
    
        .line 441
        iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mVisibleSignature:Landroid/preference/CheckBoxPreference;
    
        invoke-virtual {v0}, Lcom/android/internal/widget/LockPatternUtils;->isVisibleSignatureEnabled()Z
    
        move-result v2
    
        invoke-virtual {v1, v2}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    Code:
        :cond_7
        move v1, v3
    
        .line 434
        goto :goto_0
    
        :cond_8
        move v2, v3
    
        .line 438
        goto :goto_1
        
        [COLOR="red"]:cond_quick
        move v2, v3
    
        goto :goto_quick[/COLOR]
    .end method

    That's it for SecSettings. Compile.
    12
    android.policy.jar
    4.1.x


    Navigate to /smali/com/android/internal/policy/impl/PasswordUnlockScreen.smali
    Code:
    .field private mPwdPolicy:Landroid/app/enterprise/PasswordPolicy;
    
    .field private mResuming:Z
    
    [COLOR="Red"].field private mQuickUnlock:Z[/COLOR]
    
    .field private final mStatusViewManager:Lcom/android/internal/policy/impl/KeyguardStatusViewManager;
    
    .field private final mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;

    .method public constructor <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
    Code:
        iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;
    
        const/16 v2, 0x81
    
        invoke-virtual {v1, v2}, Landroid/widget/EditText;->setInputType(I)V
    
        .line 250
        :goto_4
        iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;
    
        new-instance v2, Lcom/android/internal/policy/impl/PasswordUnlockScreen$4;
    
        invoke-direct {v2, p0}, Lcom/android/internal/policy/impl/PasswordUnlockScreen$4;-><init>(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)V
    
        invoke-virtual {v1, v2}, Landroid/widget/EditText;->setOnClickListener(Landroid/view/View$OnClickListener;)V
    
        .line 255
        [COLOR="red"]iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mContext:Landroid/content/Context;
    
        invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v1
        
        const/4 v3, 0x0
    
        const-string v9, "quick_unlock"
    
        invoke-static {v1, v9, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v1
        
        const/4 v2, 0x1
        
        if-ne v1, v2, :cond_quick
    
        move v1, v2
    
        :goto_quick
        iput-boolean v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mQuickUnlock:Z[/COLOR]
        
        iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;
    
        new-instance v2, Lcom/android/internal/policy/impl/PasswordUnlockScreen$5;
    
        invoke-direct {v2, p0}, Lcom/android/internal/policy/impl/PasswordUnlockScreen$5;-><init>(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)V
    
        invoke-virtual {v1, v2}, Landroid/widget/EditText;->addTextChangedListener(Landroid/text/TextWatcher;)V

    Code:
        new-instance v1, Lcom/android/internal/policy/impl/PasswordUnlockScreen$2;
    
        invoke-direct {v1, p0}, Lcom/android/internal/policy/impl/PasswordUnlockScreen$2;-><init>(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)V
    
        invoke-virtual {v10, v1}, Landroid/view/View;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V
    
        goto/16 :goto_3
    
        .line 181
        .end local v10           #pinDelete:Landroid/view/View;
        :cond_f
        const/4 v1, 0x0
    
        goto :goto_5
        
        [COLOR="red"]:cond_quick
        move v1, v3
    
        goto :goto_quick[/COLOR]
    
        .line 242
        :cond_10
        iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;
    
        invoke-static {}, Landroid/text/method/DigitsKeyListener;->getInstance()Landroid/text/method/DigitsKeyListener;
    
        move-result-object v2
    
        invoke-virtual {v1, v2}, Landroid/widget/EditText;->setKeyListener(Landroid/text/method/KeyListener;)V
    
        .line 243
        iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;
    
        const/16 v2, 0x12
    
        invoke-virtual {v1, v2}, Landroid/widget/EditText;->setInputType(I)V
    
        goto/16 :goto_4
    .end method

    Add the following methods:
    Code:
    .method static synthetic access$100(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)Landroid/widget/EditText;
        .locals 1
        .parameter "x0"
    
        .prologue
        .line 76
        iget-object v0, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;
    
        return-object v0
    .end method
    
    [COLOR="Red"].method static synthetic access$1000(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)Z
        .locals 1
        .parameter "x0"
    
        .prologue
        .line 76
        iget-boolean v0, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mQuickUnlock:Z
    
        return v0
    .end method
    
    .method static synthetic access$1100(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)Lcom/android/internal/widget/LockPatternUtils;
        .locals 1
        .parameter "x0"
    
        .prologue
        .line 76
        iget-object v0, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
    
        return-object v0
    .end method[/COLOR]
    
    .method static synthetic access$200(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
        .locals 1
        .parameter "x0"
    
        .prologue
        .line 76
        iget-object v0, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
    
        return-object v0
    .end method

    Now download the zip attached to this post and extract to the root of your project.
    Compile and enjoy!


    4.3

    Navigate to smali/com/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView.smali
    Add the following in red:
    Code:
    .field protected mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
    
    .field protected mPasswordEntry:Landroid/widget/TextView;
    
    [COLOR="Red"].field private mQuickUnlock:Z[/COLOR]

    Add the following method in red:
    Code:
        .method static synthetic access$300(Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;)Landroid/widget/Button;
        .locals 1
        .parameter "x0"
    
        .prologue
        .line 68
        iget-object v0, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mEmergencyButton:Landroid/widget/Button;
    
        return-object v0
    .end method
    
    [COLOR="red"].method static synthetic access$400(Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;)Z
        .locals 1
        .parameter "x0"
    
        .prologue
        .line 42
        iget-boolean v0, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mQuickUnlock:Z
    
        return v0
    .end method[/COLOR]

    .method protected onFinishInflate()V

    Make sure this is larger than 3
    Code:
    .method protected onFinishInflate()V
       [COLOR="Red"] .locals 4[/COLOR]

    Code:
        .line 176
        iget-object v1, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mPasswordEntry:Landroid/widget/TextView;
    
        new-instance v2, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView$1;
    
        invoke-direct {v2, p0}, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView$1;-><init>(Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;)V
    
        invoke-virtual {v1, v2}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
    
        [COLOR="red"]iget-object v1, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mContext:Landroid/content/Context;
    
        invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v1
    
        const-string v2, "quick_unlock"
    
        const/4 v3, 0x0
    
        invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v1
    
        if-eqz v1, :cond_quick
    
        const/4 v1, 0x1
    
        :goto_0
        iput-boolean v1, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mQuickUnlock:Z[/COLOR]
    
        .line 182
        iget-object v1, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mPasswordEntry:Landroid/widget/TextView;
    
        new-instance v2, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView$2;
    
        invoke-direct {v2, p0}, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView$2;-><init>(Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;)V
    
        invoke-virtual {v1, v2}, Landroid/widget/TextView;->addTextChangedListener(Landroid/text/TextWatcher;)V

    Code:
        :cond_2
        return-void
        
        [COLOR="red"]:cond_quick
        const/4 v1, 0x0
        
        goto :goto_0[/COLOR]
    .end method
    8
    Quick Unlock on Pin/Password with toggle - KitKat 4.4.2

    This guide is a supplement to the OP guide created by LoserSkater.
    Our edits are in Keyguard.apk, that is what this guide is based on.
    Note:
    DO NOT make any changes to KeyguardAbsKeyInputView.smali yet.
    We're going to do things a little differently in this guide.

    Keyguard.apk smali edits
    First, let's check to see if we are using the correct file:
    Decompile Keyguard.apk and Navigate to:
    \smali\com\android\keyguard\KeyguardAbsKeyInputView$3.smali
    Look for this method:
    Code:
    .method public afterTextChanged(Landroid/text/Editable;)V

    If it has it, great! If not, this guide may not work. Ask for assistance.
    Overwrite the file with the one attached to this post and make these edits to the four lines in BLUE.
    (This file is the core mod but we are commenting out the lines required for the toggle for now to test and make sure it works first then reverting the change later.)
    \smali\com\android\keyguard\KeyguardAbsKeyInputView$3.smali
    Code:
    .method public afterTextChanged(Landroid/text/Editable;)V
    .
    .
    .
    .
        :cond_0
        [COLOR="Blue"]# [/COLOR]iget-object v1, p0, Lcom/android/keyguard/KeyguardAbsKeyInputView$3;->this$0:Lcom/android/keyguard/KeyguardAbsKeyInputView;
    
        #getter for: Lcom/android/keyguard/KeyguardAbsKeyInputView;->mQuickUnlock:Z
        [COLOR="Blue"]# [/COLOR]invoke-static {v1}, Lcom/android/keyguard/KeyguardAbsKeyInputView;->access$400(Lcom/android/keyguard/KeyguardAbsKeyInputView;)Z
    
        [COLOR="Blue"]# [/COLOR]move-result v1
    
        [COLOR="Blue"]# [/COLOR]if-eqz v1, :cond_1
    
        .line 131

    Recompile and test Keyguard.apk. If it works, then you can undo the changes to those 4 lines and we will do the rest of the toggle in Keyguard.apk.
    \smali\com\android\keyguard\KeyguardAbsKeyInputView.smali
    New line in BLUE:
    Code:
    .field protected mPasswordEntry:Landroid/widget/TextView;
    
    [COLOR="Blue"].field private mQuickUnlock:Z
    [/COLOR]
    .field protected mPwdPolicy:Landroid/app/enterprise/PasswordPolicy;
    Add new method in BLUE:
    Code:
    .method static synthetic access$300(Lcom/android/keyguard/KeyguardAbsKeyInputView;)Landroid/widget/Button;
        .locals 1
    
        iget-object v0, p0, Lcom/android/keyguard/KeyguardAbsKeyInputView;->mEmergencyButton:Landroid/widget/Button;
    
        return-object v0
    .end method
    
    [COLOR="Blue"].method static synthetic access$400(Lcom/android/keyguard/KeyguardAbsKeyInputView;)Z
        .locals 1
        .parameter "x0"
    
        .prologue
        .line 42
        iget-boolean v0, p0, Lcom/android/keyguard/KeyguardAbsKeyInputView;->mQuickUnlock:Z
    
        return v0
    .end method
    [/COLOR]
    .method private disableDevicePermanently()V
    Add new lines in BLUE:
    Code:
    .method protected onFinishInflate()V
    .
    .
    .
    .
        new-instance v3, Lcom/android/keyguard/KeyguardAbsKeyInputView$2;
    
        invoke-direct {v3, p0}, Lcom/android/keyguard/KeyguardAbsKeyInputView$2;-><init>(Lcom/android/keyguard/KeyguardAbsKeyInputView;)V
    
        invoke-virtual {v2, v3}, Landroid/view/View;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V
    
        iget-object v1, p0, Landroid/view/View;->mContext:Landroid/content/Context;
    
       [COLOR="Blue"] invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v1
    
        const-string v2, "quick_unlock"
    
        const/4 v3, 0x0
    
        invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v2
    
        if-eqz v2, :cond_quick
    
        const/4 v3, 0x1
    
        :cond_quick
        iput-boolean v3, p0, Lcom/android/keyguard/KeyguardAbsKeyInputView;->mQuickUnlock:Z
    [/COLOR]
        iget-object v2, p0, Lcom/android/keyguard/KeyguardAbsKeyInputView;->mPasswordEntry:Landroid/widget/TextView;
    
        new-instance v3, Lcom/android/keyguard/KeyguardAbsKeyInputView$3;
    
        invoke-direct {v3, p0}, Lcom/android/keyguard/KeyguardAbsKeyInputView$3;-><init>(Lcom/android/keyguard/KeyguardAbsKeyInputView;)V

    That's it for Keyguard.apk.
    The SecSettings.apk guide from the OP can now be completed to finish off the toggle (which is accessed from Lockscreen Settings).
    Cheers - TD
    6
    I post these guides in hopes that people will attempt to get into learning how they work instead of just copy and pasting the guide. I know smali is a crazy foreign language to most people and it is a very steep learning curve, but anybody that sees these guides and starts seeing patterns, and then attempt to do their own mods is a great success to me.

    You're right that the ID section is vague, but I'm hoping that people have done enough mods that they will understand what is meant. It's just one of those things that I don't want to post in every how-to. I have mulitple guides that explain how to get IDs that I don't see the point in posting it over and over. I also don't mind answering people that have issues with getting ID's (as you can see in my previous post) so it's not that big of an issue.

    And I don't mind being bothered as long as it's in my thread and not a PM. I'm MUCH more likely to help if you post in the thread. It also allows other users to help out if they've come across the issue you're having which helps me out a lot.
    5
    Awesome stuff my man!

    (P.S. I think you might have a toggle problem. ;))

    I love me some toggles!