How to make reduce 4 dots for pattern lock to 3 dots required as minimium to unlock.

jatanshah

Member
Apr 16, 2013
46
5
0
4 dots are minimium to use for pattern lock. I want to reduce it to 3 or even 2. Not talking about 3x3 pattern grid but the number of dots used to unlock.

Sent from my Moto G using xda app-developers app
 
  • Like
Reactions: Harsh.gundecha

S0bes

Senior Member
Jan 1, 2012
870
967
133
a small how-to
Keyguard\smali\com\android\keyguard\KeyguardPatternView$UnlockPatternListener.smali
Code:
.line 279
    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v8

    const/4 v9, 0x4

    if-lt v8, v9, :cond_3

    move v5, v6
where const/4 v9 sets minimum number of dots.
So, I changed it to 2.
And the same thing with Settings\smali\com\android\settings\ChooseLockPattern$ChooseLockPatternFragment$1.smali
Code:
.line 165
    :cond_4
    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v0

    const/4 v1, 0x4

    if-ge v0, v1, :cond_5
Here is my modified Keyguard.apk and Settings.apk from 4.4.4 retail.en.US
 

Attachments

Harsh.gundecha

Senior Member
Dec 1, 2013
151
29
0
21.1702° N, 72.8311° E
G 2nd gen??

a small how-to
Keyguard\smali\com\android\keyguard\KeyguardPatternView$UnlockPatternListener.smali
Code:
.line 279
    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v8

    const/4 v9, 0x4

    if-lt v8, v9, :cond_3

    move v5, v6
where const/4 v9 sets minimum number of dots.
So, I changed it to 2.
And the same thing with Settings\smali\com\android\settings\ChooseLockPattern$ChooseLockPatternFragment$1.smali
Code:
.line 165
    :cond_4
    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v0

    const/4 v1, 0x4

    if-ge v0, v1, :cond_5
Here is my modified Keyguard.apk and Settings.apk from 4.4.4 retail.en.US
@S0bes
will this same thing work on moto g 2nd gen xt 1068 running stock 4.4.4 retaildsdsallen? :D
TIA
 
Last edited:

Harsh.gundecha

Senior Member
Dec 1, 2013
151
29
0
21.1702° N, 72.8311° E
only if you'll edit your files. btw no need for keyguard.apk. you should edit only settings.apk.
if you take my .apk file from moto G 1st gen 90% that you will see settings FC
@S0bes
1) i also assumed that putting the apk would not work and that's why i didn't even tries that way of doing it.
so now i will have to do it manually (of course with YOUR help).
2) here by info. that i have what i mean by smali is that classes.dex file(correct me if i am wrong) and FYI let me tell you that there's no "Settings\smali\com\android" instead i have google folder in place of android folder.
i hope we will be still do it anyhow.
TIA
sorry as my 8 thanks of today are over will thank you later ☺

=============================================================================================================
EDIT:-

my bad, got till the code and also to the 165th line now just please help me to clearly understand what i exactly need to change? and also let me know that the code above is ORIGINAL or MODIFIED ??
TIA

below is code of settings apk in case you need a look ☺

Code:
 .line 165
    :cond_50
    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v0

    const/4 v1, 0x4

    if-ge v0, v1, :cond_5f
 
Last edited:

S0bes

Senior Member
Jan 1, 2012
870
967
133
@S0bes
1) i also assumed that putting the apk would not work and that's why i didn't even tries that way of doing it.
so now i will have to do it manually (of course with YOUR help).
2) here by info. that i have what i mean by smali is that classes.dex file(correct me if i am wrong) and FYI let me tell you that there's no "Settings\smali\com\android" instead i have google folder in place of android folder.
i hope we will be still do it anyhow.
TIA
sorry as my 8 thanks of today are over will thank you later ☺

=============================================================================================================
EDIT:-

my bad, got till the code and also to the 165th line now just please help me to clearly understand what i exactly need to change? and also let me know that the code above is ORIGINAL or MODIFIED ??
TIA

below is code of settings apk in case you need a look ☺

Code:
 .line 165
    :cond_50
    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v0

    const/4 v1, 0x4

    if-ge v0, v1, :cond_5f
Change 0x4 to 0x1
 
  • Like
Reactions: Harsh.gundecha

iMessa

Member
Sep 26, 2014
46
2
0
I have APK Studio but in my SecSettings.apk (theres no Settings.apk on my phone) i can't find smali. I tried Your Settings.apk and smali is there. How can i do it then? Thank You!
 

S0bes

Senior Member
Jan 1, 2012
870
967
133
I have APK Studio but in my SecSettings.apk (theres no Settings.apk on my phone) i can't find smali. I tried Your Settings.apk and smali is there. How can i do it then? Thank You!
smali - app is deodexed
no smali - there's an .odex file of .apk should be
to get smali folder inside apk you should deodex it. there're a lot of guides for different android versions available on xda
 

iMessa

Member
Sep 26, 2014
46
2
0
smali - app is deodexed
no smali - there's an .odex file of .apk should be
to get smali folder inside apk you should deodex it. there're a lot of guides for different android versions available on xda
So i should deodex .apk, edit it and then install it?

Edit: When i try to deodex with Quick Deodex Tool it says "Framework not found" and framework is there i pasted it from phone.
When i use Universal Deodexer V5, everything is done but finished app is same like original (no smali) and log says:

Everything is Ok
1 file(s) copied.
DEODEXING COMPLETE!


================COMPLETED DEODEXING===============
===================DEODEXED 1 of 1===============
Done checking 100%
FAILED : SecSettings.apk
 
Last edited:

iMessa

Member
Sep 26, 2014
46
2
0
I did it with Ultimate Deodexer but i don't have line 165. I edited 187 coz it looks like yours but still asks for minimal 4 dots..What should i do? I need this very bad.
 

S0bes

Senior Member
Jan 1, 2012
870
967
133
@S0bes
It still requires 4 dots to be joined any idea why?
do i have to clear cache or edit odex file?
TIA
1)if your firmware is odexed then you have to replace odexed .apk with deodexed one and delete standalone .odex file from this folder (or even completely delete arm folder if you're on LL)
may be you should clear dalvik cache as well.
2)if you've completely deodexed your firmware and all apk and jar files on your phone have .dex file inside you should delete all standalone odex files from entire system. It means that you should delete .odex files from each folder inside /system/app and /system/priv-app/ and also delete boot.oat and boot.(forgot how to name it may be boot.art) from /system/framework or system/framework/arm because .oat file consist of .dex files.

if it still requires 4 dots, then pull out settings.apk from the phone and decompile it so you will see if the changes that you've made are still here cause may be you did smth wrong when you were building modified .apk file
 
  • Like
Reactions: Harsh.gundecha

Harsh.gundecha

Senior Member
Dec 1, 2013
151
29
0
21.1702° N, 72.8311° E
1)if your firmware is odexed then you have to replace odexed .apk with deodexed one and delete standalone .odex file from this folder (or even completely delete arm folder if you're on LL)
may be you should clear dalvik cache as well.
2)if you've completely deodexed your firmware and all apk and jar files on your phone have .dex file inside you should delete all standalone odex files from entire system. It means that you should delete .odex files from each folder inside /system/app and /system/priv-app/ and also delete boot.oat and boot.(forgot how to name it may be boot.art) from /system/framework or system/framework/arm because .oat file consist of .dex files.

if it still requires 4 dots, then pull out settings.apk from the phone and decompile it so you will see if the changes that you've made are still here cause may be you did smth wrong when you were building modified .apk file
@S0bes
i am on stock kk and as there also exists .odex files for all system apps so i guess its odexed (its moto g2 xt1068) stock ROM??(correct me if i am wrong)
so does it mean i will have to do all this deleting odex and some cleanup from system??
sorry if such noobish question irritates. xd
TIA
 

S0bes

Senior Member
Jan 1, 2012
870
967
133
@S0bes
i am on stock kk and as there also exists .odex files for all system apps so i guess its odexed (its moto g2 xt1068) stock ROM??(correct me if i am wrong)
so does it mean i will have to do all this deleting odex and some cleanup from system??
sorry if such noobish question irritates. xd
TIA
yep, your rom is odexed and all you need is to delete settings.odex, replace settings.apk with modified !deodexed! one and may be clear dalvik cache (also set perm-s to the file after replacing).
if still system requires 4 dots then pull out your settings.apk, decompile it and share
 
  • Like
Reactions: Harsh.gundecha
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone