[APP] Better Keyguard 1.4 (MIUI style misuse prevention)

Search This thread

Chillmann

Senior Member
Jul 14, 2012
259
73
Better Keyguard​


The app is for People who dont use any security-lockscreen (like Pin, Pattern or Face unlock) and just like the fastest way to reach the homescreen after turning the device on. Many Roms allow to disable the key guard completly. So u see the homescreen right after turning on the device. But this way, unwanted misuse can happen, by accidentelly wakeing up the phone, while carrying it in your pocket.
Because of this and because iam not using a MIUI-Rom anymore (which had the very same feature), i set up a Tasker profile, which enables the proximity sensor for 1 sec, every time the display is turned on. If the sensor is not covered in that moment, nothing further will happen, if it is, the display will be turned off right away.
Later I decided to export this Profile as app via App Factory (Tasker Plugin), because I thought others would like such a feature too.

The app passed tests on my Galaxy SII (AOSP: Android 4.2.2) and on a Xperia Z (Stock Rom: Android 4.1.2) from a buddy of mine.

After Installation
1. Of course, to turn the screen off, u need to enable BK as device-admin.
2. To test: Press power button to turn off the display, keep the proximity sensor covered (usually located in right or left upper corner of the phone) while pressing the power button again to turn the display on. If its turned off again within 1 second, the test can be considered passed.
3. Note: On the Xperia Z (and some other devices), i noticed that any Lockscreen/Keyguard has to be disabled to make the App work. (It seems that the proxy sensor is not working in lockscreen)

Since Iam no programmer and the fact, that this is a Tasker-Project, my abilities for improvements or Bugfixing are very limited. Maybe some1 will pickup the idea and write a REAL app of this kind. Ofc only if the Chinese have not yet patented their MIUI-feature. :laugh:

I uploaded the Tasker-Project-Files as well.

Just would like to know ur thoughts about this.


Changelog:

  • 1.0 - First release
  • 1.1 - Added a UI allowing to adjust some options (show/hide notification, try to disable built in keyguard, launch on boot: Always, Never, Remember last state)
    - Toggling the state shows now a tiny flash message
  • 1.2 - Added option to show a warning message before display goes off. If the sensor is uncovered quick enough, display will stay on and the warning message will be dismissed.
    (disadvantages: Tasker provides only 2 relevant massage types for that purpose. One can be dismissed by the back key, which is bad for devices with capacitive buttons, since these buttons are not locked while the warning message is shown. So I decided to go with the second type, which is not dismissable by the back key, but also not overlapping the status bar, so it is still expandable).
    2nd: Somehow this version is not working along with lockscreen at all. So, if you want to see a warning message before screen goes off, u need to disable any kind of lockscreen (even normal swipe).
    If you want to use it along with a lockscreen, you need to try it with Bk 1.1 or 1.0
  • 1.3 - Added an option to show the warning message over lockscreen (only if the app is working in lockscreen at all and u need to tell it, if u are using a lockscreen or not)
    Removed because of no further advantage.
  • 1.4 - Slightly reworked UI with new Szene-elements from latest Tasker version (Checkbox and Drop-down menu). This version equals 1.1 in functionality, since i thought the app was inflated too much with stuff that actually didnt work correctly. Furthermore i also used the latest version of App-Factory to create the app, since "Pent" (the dev of Tasker) released at least two updates for Tasker and the App-Factory plugin since i uploaded BK_1.2. So this one might work more reliable now.

Here the UI



Field tests revealed that a enabled keyguard (normal swipe lockscreen or whatever) prevents Bk from working properly in some cases. If Your Rom doesnt allow to disable the key guard, try the new disable built in keyguard option. If your Rom does allow it, use the native setting to disable the lockscreen rather than Bk ones.


Reuploaded the first release, becuase the file had a Tasker created filename (Better_keyguard.4.apk) and did not reflect the actual version number.


Best regards

Chillmann
 

Attachments

  • Better_keyguard_1.0.apk
    977.3 KB · Views: 1,502
  • Better_keyguard_1.0.prj.xml.txt
    7.8 KB · Views: 237
  • Better_keyguard_1.1.apk
    982.3 KB · Views: 245
  • Better_keyguard_1.1.prj.xml.txt
    29.8 KB · Views: 66
  • Better_keyguard_1.2.apk
    983.9 KB · Views: 266
  • Better_keyguard_1.2.prj.xml.txt
    41.7 KB · Views: 121
  • Better_keyguard_1.4.apk
    963 KB · Views: 4,968
  • Better_keyguard_1.4.prj.xml.txt
    30.3 KB · Views: 1,304
Last edited:

Chillmann

Senior Member
Jul 14, 2012
259
73
OK 9 views so far. But i would realy appreciate a response of any kind ;)
No matter if its "... well done, working as intended" or "... fu, its chewing up all my battery"

Please, just give a response!


Thx in advance

Chillmann
 

aryan1312

Senior Member
Sep 23, 2012
266
305
Mumbai
i tried and test it "DO NOTHING nothing at all" jst stay @ notification saying BK is active ( i have activated system administration) probably describing how it work and what it does will be more useful some screenshot.
I am on Slimbean 4.2.2 build 4
Samsung galaxy s2 GT-I9100
 

Chillmann

Senior Member
Jul 14, 2012
259
73
Hi aryan1312,


many thx for responding!

I rewrote the introduction to better underline the app's purpose and added a "After installation" annotation with instructions of how to test the functionality.

Since the app got no menu, there would be nothing to show in a screenshot. Ill try to put a youtube video online soon, that will show what it does.

i tried and test it "DO NOTHING nothing at all" jst stay @ notification saying BK is active ( i have activated system administration) probably

I hope u just didnt know how to test it, because u got the very same set up as i do (sgs2 on slim beam 4.2.2+dori9.14). Would be quite strange, if its not working even with same hardware + software. On my phone, i allways notice a weak red glow coming from the proximity sensor, if its active. (during a call or if a sensor related Tasker-profile is running) Maybe u watch out for that glow right after turning on the display. That would indicate the app's functionality too.


Best regards

Chillmann
 
Last edited:
  • Like
Reactions: aryan1312

aryan1312

Senior Member
Sep 23, 2012
266
305
Mumbai
Hi aryan1312,


many thx for responding!

I rewrote the introduction to better underline the app's purpose and added a "After installation" annotation with instructions of how to test the functionality.

Since the app got no menu, there would be nothing to show in a screenshot. Ill try to put a youtube video online soon, that will show what it does.



I hope u just didnt know how to test it, because u got the very same set up as i do (sgs2 on slim beam 4.2.2+dori9.14). Would be quite strange, if its not working even with same hardware + software. On my phone, i allways notice a weak red glow coming from the proximity sensor, if its active. (during a call or if a sensor related Tasker-profile is running) Maybe u watch out for that glow right after turning on the display. That would indicate the app's functionality too.


Best regards

Chillmann
Thanks for giving the description more accurately. Now i have better understanding of how it work. previously i was using slide2wake (dori function) i think that y it is not workin, will try with power button now

Edit: Work absolutely fine, even with slide2wake and PIN lock :)
don't think it will affect much battery performance since it activate proximity sensor for jst 1 sec

Great work
 
Last edited:
  • Like
Reactions: Raghuvanshi1

olokos

Recognized Developer
  • Oct 16, 2011
    2,940
    2,477
    Warsaw
    What if I have no proximity sensor? Can it work? Nah, just kidding :D it's a nice app but I'd really would like it if it's notification could be swiped away and if there would be a warning like in the miui because now it's more like miui idea not like a miui style. I'm still going to use this app and tell my friend which also has similar problem about this app ;)

    Sent from my R800i using xda premium
     
    • Like
    Reactions: Chillmann

    olokos

    Recognized Developer
  • Oct 16, 2011
    2,940
    2,477
    Warsaw
    After I've watched a movie it suddenly stopped working... I've even relaunched it and nothing... I guess that reboot will help me.

    Sent from my R800i using xda premium
     

    Chillmann

    Senior Member
    Jul 14, 2012
    259
    73
    Hi olokos,

    thx for testing!

    What if I have no proximity sensor? Can it work? Nah, just kidding :D it's a nice app but I'd really would like it if it's notification could be swiped away and if there would be a warning like in the miui because now it's more like miui idea not like a miui style. I'm still going to use this app and tell my friend which also has similar problem about this app ;)

    Sent from my R800i using xda premium

    I added a option to enable a warning message before screen goes off. To the non permanent notification, sorry but I can't see the advantage. Why not disable the notification completely?


    After I've watched a movie it suddenly stopped working... I've even relaunched it and nothing... I guess that reboot will help me.

    Sent from my R800i using xda premium

    Nope, it didn't. Actually it's not working at all now...

    Sent from my R800i using xda premium


    uhm, thats really strange. At 1st I thought it was androids memory management who threw Bk out of the cache. But even not working after reboot is bad. As stated in the OP, iam no programmer, so I have neither a clue why it stopped working, nor I know how to fix it :(
    I think it has something to do with the way, Tasker exports profiles into apps.
    U can try to delete app data (if not already removed) to get it working again. But if it keeps stopping to work, deleting data is no real solution.
    Iam sorry I did no long time testing prior to posting here. During quick tests I recognized, that Bk wouldn't show the option menu by pressing the app icon after Tasker performed one of its tasks. Removing Bk from recents app list did fix that. But this is completely different to ur experience.
    I hope it is a very rarely occurring bug or related only to few devices. Otherwise the app would be unusable. :crying:


    Hopefully

    Chillmann
     
    • Like
    Reactions: olokos

    olokos

    Recognized Developer
  • Oct 16, 2011
    2,940
    2,477
    Warsaw
    After disabling swipe unlock in JB it is working but when JB screen lock is working normally, your app is not working... I'm not using any other key lock (pattern, pin) or anything. I just have to swipe to unlock. If you are going to fix it then I promise I'll spread the word :)

    Sent from outer space using RPG
     

    Chillmann

    Senior Member
    Jul 14, 2012
    259
    73
    After disabling swipe unlock in JB it is working but when JB screen lock is working normally, your app is not working... I'm not using any other key lock (pattern, pin) or anything. I just have to swipe to unlock. If you are going to fix it then I promise I'll spread the word :)

    Sent from outer space using RPG

    Hi olokos,

    well, in order to make a message appear over the lockscreen, i had to use the 3rd message type, which tasker provides. I never thought it would be relevent, since it doesnt block any input. Unfortunetly, that makes this feature to an eye candy without further purpose.
    As I stated in the "After installation" paragraph, i found out that some roms prevent the proximity sensor from working in lockscreen. After updating my own decive to slim bean 4.2.2 build5, Bk stopped working in lockscreen too.
    In order to use the warning message over lockscreen, u need to test the functionality without the "show warning" option. If it works and ur display is turned off as intended, u can enable "show warning". But u also have to tell the app wether a lockscreen is in use or not.


    hope its fitting ur desire a little more now ;)

    Edit: found out that it wasn't my rom preventing the sensor from working in lockscreen, but its not working since Bk 1.2 :(
    So, if you want to see a warning message before screen goes off, u need to disable any kind of lockscreen (even normal swipe).
    If you want to use it along with a lockscreen, you need to use Bk 1.1
    Sorry i couldn't turn it into real MUI style :/


    Chillmann
     
    Last edited:

    SGS-II

    Senior Member
    Sep 13, 2011
    62
    6
    Works on my galaxy s4 stock rom 4.2.2. Works only without a lock screen though. Using v1.4 of better keyguard. The UI is in a mess refer to screenshot.
    Screenshot_2014-04-29-23-39-21.png
     
    • Like
    Reactions: Chillmann

    Chillmann

    Senior Member
    Jul 14, 2012
    259
    73
    THX for testing! Well ur S4 got some more Pixel than my old S2 ^^
    Ill try to rework the UI next time I can get my hands on a high resolution device in order to test different settings for UI creation.


    Greets

    Chillmann

    Sent from my GT-I9100 using XDA Free mobile app
     

    Hordon

    Senior Member
    Dec 26, 2011
    158
    39
    Budapest
    Better Keyguard​


    The app is for People who dont use any security-lockscreen (like Pin, Pattern or Face unlock) and just like the fastest way to reach the homescreen after turning the device on. Many Roms allow to disable the key guard completly. So u see the homescreen right after turning on the device. But this way, unwanted misuse can happen, by accidentelly wakeing up the phone, while carrying it in your pocket.
    Because of this and because iam not using a MIUI-Rom anymore (which had the very same feature), i set up a Tasker profile, which enables the proximity sensor for 1 sec, every time the display is turned on. If the sensor is not covered in that moment, nothing further will happen, if it is, the display will be turned off right away.
    Later I decided to export this Profile as app via App Factory (Tasker Plugin), because I thought others would like such a feature too.

    The app passed tests on my Galaxy SII (AOSP: Android 4.2.2) and on a Xperia Z (Stock Rom: Android 4.1.2) from a buddy of mine.

    After Installation
    1. Of course, to turn the screen off, u need to enable BK as device-admin.
    2. To test: Press power button to turn off the display, keep the proximity sensor covered (usually located in right or left upper corner of the phone) while pressing the power button again to turn the display on. If its turned off again within 1 second, the test can be considered passed.
    3. Note: On the Xperia Z (and some other devices), i noticed that any Lockscreen/Keyguard has to be disabled to make the App work. (It seems that the proxy sensor is not working in lockscreen)

    Since Iam no programmer and the fact, that this is a Tasker-Project, my abilities for improvements or Bugfixing are very limited. Maybe some1 will pickup the idea and write a REAL app of this kind. Ofc only if the Chinese have not yet patented their MIUI-feature. :laugh:

    I uploaded the Tasker-Project-Files as well.

    Just would like to know ur thoughts about this.


    Changelog:

    • 1.0 - First release
    • 1.1 - Added a UI allowing to adjust some options (show/hide notification, try to disable built in keyguard, launch on boot: Always, Never, Remember last state)
      - Toggling the state shows now a tiny flash message
    • 1.2 - Added option to show a warning message before display goes off. If the sensor is uncovered quick enough, display will stay on and the warning message will be dismissed.
      (disadvantages: Tasker provides only 2 relevant massage types for that purpose. One can be dismissed by the back key, which is bad for devices with capacitive buttons, since these buttons are not locked while the warning message is shown. So I decided to go with the second type, which is not dismissable by the back key, but also not overlapping the status bar, so it is still expandable).
      2nd: Somehow this version is not working along with lockscreen at all. So, if you want to see a warning message before screen goes off, u need to disable any kind of lockscreen (even normal swipe).
      If you want to use it along with a lockscreen, you need to try it with Bk 1.1 or 1.0
    • 1.3 - Added an option to show the warning message over lockscreen (only if the app is working in lockscreen at all and u need to tell it, if u are using a lockscreen or not)
      Removed because of no further advantage.
    • 1.4 - Slightly reworked UI with new Szene-elements from latest Tasker version (Checkbox and Drop-down menu). This version equals 1.1 in functionality, since i thought the app was inflated too much with stuff that actually didnt work correctly. Furthermore i also used the latest version of App-Factory to create the app, since "Pent" (the dev of Tasker) released at least two updates for Tasker and the App-Factory plugin since i uploaded BK_1.2. So this one might work more reliable now.

    Here the UI



    Field tests revealed that a enabled keyguard (normal swipe lockscreen or whatever) prevents Bk from working properly in some cases. If Your Rom doesnt allow to disable the key guard, try the new disable built in keyguard option. If your Rom does allow it, use the native setting to disable the lockscreen rather than Bk ones.


    Reuploaded the first release, becuase the file had a Tasker created filename (Better_keyguard.4.apk) and did not reflect the actual version number.


    Best regards

    Chillmann

    Hi,

    I just find your app. I really need n app like this, but it doesn't want to work for mi ( for test i cover the sensors and try to use the screen and i can). Is it compatible with kitkat based roms? I have a N4. Can you suggest another test method if mine is useless?
     

    TangerineTractor

    Senior Member
    Sep 8, 2006
    1,024
    211
    Just to let you know, I'vee take your idea and modified it.
    SOme newer devices with tap-on screens can be triggered in your pocket. This app works, but it doesn't work if you have a standard slide lock screen - so I modified tasker to check for screen unlock andd proximity, rather than screen on and proximity... then if your device turns on in your pocket and then tries to unlock, it will go off again - this works around it not working with a lock screen.
     
    • Like
    Reactions: Chillmann

    Top Liked Posts

    • There are no posts matching your filters.
    • 11
      Better Keyguard​


      The app is for People who dont use any security-lockscreen (like Pin, Pattern or Face unlock) and just like the fastest way to reach the homescreen after turning the device on. Many Roms allow to disable the key guard completly. So u see the homescreen right after turning on the device. But this way, unwanted misuse can happen, by accidentelly wakeing up the phone, while carrying it in your pocket.
      Because of this and because iam not using a MIUI-Rom anymore (which had the very same feature), i set up a Tasker profile, which enables the proximity sensor for 1 sec, every time the display is turned on. If the sensor is not covered in that moment, nothing further will happen, if it is, the display will be turned off right away.
      Later I decided to export this Profile as app via App Factory (Tasker Plugin), because I thought others would like such a feature too.

      The app passed tests on my Galaxy SII (AOSP: Android 4.2.2) and on a Xperia Z (Stock Rom: Android 4.1.2) from a buddy of mine.

      After Installation
      1. Of course, to turn the screen off, u need to enable BK as device-admin.
      2. To test: Press power button to turn off the display, keep the proximity sensor covered (usually located in right or left upper corner of the phone) while pressing the power button again to turn the display on. If its turned off again within 1 second, the test can be considered passed.
      3. Note: On the Xperia Z (and some other devices), i noticed that any Lockscreen/Keyguard has to be disabled to make the App work. (It seems that the proxy sensor is not working in lockscreen)

      Since Iam no programmer and the fact, that this is a Tasker-Project, my abilities for improvements or Bugfixing are very limited. Maybe some1 will pickup the idea and write a REAL app of this kind. Ofc only if the Chinese have not yet patented their MIUI-feature. :laugh:

      I uploaded the Tasker-Project-Files as well.

      Just would like to know ur thoughts about this.


      Changelog:

      • 1.0 - First release
      • 1.1 - Added a UI allowing to adjust some options (show/hide notification, try to disable built in keyguard, launch on boot: Always, Never, Remember last state)
        - Toggling the state shows now a tiny flash message
      • 1.2 - Added option to show a warning message before display goes off. If the sensor is uncovered quick enough, display will stay on and the warning message will be dismissed.
        (disadvantages: Tasker provides only 2 relevant massage types for that purpose. One can be dismissed by the back key, which is bad for devices with capacitive buttons, since these buttons are not locked while the warning message is shown. So I decided to go with the second type, which is not dismissable by the back key, but also not overlapping the status bar, so it is still expandable).
        2nd: Somehow this version is not working along with lockscreen at all. So, if you want to see a warning message before screen goes off, u need to disable any kind of lockscreen (even normal swipe).
        If you want to use it along with a lockscreen, you need to try it with Bk 1.1 or 1.0
      • 1.3 - Added an option to show the warning message over lockscreen (only if the app is working in lockscreen at all and u need to tell it, if u are using a lockscreen or not)
        Removed because of no further advantage.
      • 1.4 - Slightly reworked UI with new Szene-elements from latest Tasker version (Checkbox and Drop-down menu). This version equals 1.1 in functionality, since i thought the app was inflated too much with stuff that actually didnt work correctly. Furthermore i also used the latest version of App-Factory to create the app, since "Pent" (the dev of Tasker) released at least two updates for Tasker and the App-Factory plugin since i uploaded BK_1.2. So this one might work more reliable now.

      Here the UI



      Field tests revealed that a enabled keyguard (normal swipe lockscreen or whatever) prevents Bk from working properly in some cases. If Your Rom doesnt allow to disable the key guard, try the new disable built in keyguard option. If your Rom does allow it, use the native setting to disable the lockscreen rather than Bk ones.


      Reuploaded the first release, becuase the file had a Tasker created filename (Better_keyguard.4.apk) and did not reflect the actual version number.


      Best regards

      Chillmann
      2
      i tried and test it "DO NOTHING nothing at all" jst stay @ notification saying BK is active ( i have activated system administration) probably describing how it work and what it does will be more useful some screenshot.
      I am on Slimbean 4.2.2 build 4
      Samsung galaxy s2 GT-I9100
      2
      Hey bro i have shared ur post link to slimbean post wish u dont have issue with it ... if any problem plz inform i wil remove the link :fingers-crossed:
      2
      After disabling swipe unlock in JB it is working but when JB screen lock is working normally, your app is not working... I'm not using any other key lock (pattern, pin) or anything. I just have to swipe to unlock. If you are going to fix it then I promise I'll spread the word :)

      Sent from outer space using RPG

      Hi olokos,

      well, in order to make a message appear over the lockscreen, i had to use the 3rd message type, which tasker provides. I never thought it would be relevent, since it doesnt block any input. Unfortunetly, that makes this feature to an eye candy without further purpose.
      As I stated in the "After installation" paragraph, i found out that some roms prevent the proximity sensor from working in lockscreen. After updating my own decive to slim bean 4.2.2 build5, Bk stopped working in lockscreen too.
      In order to use the warning message over lockscreen, u need to test the functionality without the "show warning" option. If it works and ur display is turned off as intended, u can enable "show warning". But u also have to tell the app wether a lockscreen is in use or not.


      hope its fitting ur desire a little more now ;)

      Edit: found out that it wasn't my rom preventing the sensor from working in lockscreen, but its not working since Bk 1.2 :(
      So, if you want to see a warning message before screen goes off, u need to disable any kind of lockscreen (even normal swipe).
      If you want to use it along with a lockscreen, you need to use Bk 1.1
      Sorry i couldn't turn it into real MUI style :/


      Chillmann
      1
      Good idea checking for lock screen :thumbup:
      Did you share your work somewhere?

      Best regards, Chillmann

      Sent from my GT-I9100 using XDA Free mobile app