• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[APP][Mar28] SmartLockScreen for Android - Now works in Lollipop!

Search This thread

aravindsagar

Senior Member
Feb 14, 2012
331
310
Champaign, IL
SmartLockScreen​
Make your lockscreen smarter than ever before!​
For Jellybean, KitKat and Lollipop devices

The Idea
The main idea behind this app can be considered as an extended version of 'Smart Lock' introduced by Google in Lollipop. The development of this app started before Google announced L during I/O 14, though.
We are in different environments at different times, and might prefer different security levels in each environment.​
2rmw4qp.png
Using this app, you can define different environments and assign different passwords to each of them.
App will detect environment changes automatically and presents you the assigned password whenever you want to unlock the phone!

_​
What's an Environment?
Wi-Fi networks, Bluetooth devices and Location areas (geofences) can be used to define environments.
Specifying multiple parameters for an environment checks for all of them.​
2wluamb.png
Assigning a password to an environment is done at the time of creating an environment. Support for more password types are coming in the future.​

_​
There's more!
  • Lollipop style lockscreen with notifications for Jellybean and KitKat (can be disabled)
  • Restricted profiles - Set up restricted profiles for your friends/family and limit access to apps. You can assign a different password to each restricted profile (password, pin, pattern or none).
  • Intelligent environment overlap resolution. But you always have the option to override it manually.
  • Material Design, and smooth animations. (See screenshots below)

_​
Some details
  • The app uses admin privileges to set system password, so it comes with the security of Stock lock screen
  • Pattern lock is supported. If you have root, stock pattern lock will be used. Please see Post #3 for more details. If you do not have root, a built-in pattern library is used (it still sets a user-defined master password in the background so that lockscreen is actually secure). But this built-in pattern is not guaranteed to work in every device.
  • The core functionality is working, but this is still a work in progress. Please report bugs, crashes etc in this thread. Logcat will be highly appreciated!

_​
Source Code

The source code is Licensed under the Apache License, Version 2.0. Link to Github repository: https://github.com/aravindsagar/SmartLockScreen/

_​

_​
FAQs

1. My screen froze while on lock screen. How to recover?
Ans: Try rebooting the phone by long pressing power button. Upon reboot, try master password first, if it does not work, try passwords which you've set for different environments. Try to reproduce the problem, and send us a logcat. :)

2. How to uninstall the app?
Ans: First open SmartLockScreen Settings, delete all environments, and set passphrase for unknown environment as None. Then go to Settings -> Security -> Device Administrators, uncheck SmartLockScreen there. Now uninstall the app just like any other app. Please come back to this thread and post why you uninstalled it, what's missing/what's bothering you.

3. Can you add fingerprint sensor support?
Ans: I'm looking into it. Till Lollipop, there's no standard API or structure for fingerprint sensors, so parts of the implementation will have to be device specific or manufacturer specific. That being said, I'm trying to add support to Samsung devices first.
Also, things should improve with Android M, since fingerprint APIs will become standardized with it.

FAQs will be updated when certain questions get frequently asked.​

_​
Credits
Developed by
Aravind Sagar, V Priyan


This is our first ever app, so it did take some time for learning and implementing everything properly. Sincere thanks to:



XDA:DevDB Information
SmartLockScreen for Android, App for all devices (see above for details)

Contributors
aravindsagar, priyanmuthu

Version Information
Status: Alpha v3.0
 
Last edited:

aravindsagar

Senior Member
Feb 14, 2012
331
310
Champaign, IL
Examples, Screenshots, and Reviews

Tutorial made by WonderHowTo.com(old version of the app is used)

_
Configuring environments

Let's consider some examples.

Say you want to set phone password as none automatically whenever your bluetooth headset is connected to it. Just go to manage environments screen, click the '+' button on top right, give a name and hint for the environment, click checkbox on Bluetooth card, select your bluetooth device after clicking the button that appears. Go down to passphrase card, choose none. Click done button at the top. That's it!

Whenever you are not connected to the headset, phone password will automatically change to Unknown Environment password(if you have set it) or the master password, if you haven't set password specifically for unknown environment.

Let's consider another scenario, you want no security at home, pattern at work, and a pin elsewhere. Just add 2 environments corresponding to home and work. You can use Wi-Fi or Location or both to identify the environment. Remember that if you set both Wi-Fi and Location, it'll check for both; i.e. you have to be connected to the Wi-Fi network, as well as in the particular area defined. If you want to detect in either case, just make 2 separate environments, 1 with Wi-Fi and 1 with location, and give the same passphrase in both.

Any number of environments can be added. You can set any passphrase for any environment, including unknown environment. You build the configuration that works best for you.


_
Configuring restricted profiles
Suppose you want to share your phone with your child, and make sure that (s)he can access only certain games which you have downloaded for her. Go to SmartLockScreen Settings, click the item which shows the current user, click 'Add new profile', and give it a name. Now click on the new profile (it must have appeared in that list). You'll see 2 new options in the Nav drawer now. Click allowed apps and click on the games which you want to allow, plus the launcher app you're using currently. Now go to set passphrase and set a suitable passphrase. You can set none if anyone anytime can unlock your phone using that profile, or you can set something else as well.
To switch profiles, just turn off the screen and turn it back on. Click on the user icon which appears at the top right corner. List of profiles will appear. Click on the desired profile to switch to. The screen will turn off and on again so that the password change will take effect.


_
Screenshots

screenshot_lockscreen.png
screenshot_nav_drawer.png


More screenshots:

screenshot_manage_environments.png
screenshot_add_environment.png


screenshot_edit_environment.png
screenshot_pattern_lock.png


screenshot_select_location.png
screenshot_user_selector.png


screenshot_nav_drawer_restricted.png
screenshot_allowed_apps.png


screenshot_about.png
screenshot_general_settings.png


_
A review of the app at AndroTrends
xoqjro.png

_
Why these permissions?
HTML:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.pvsagar.smartlockscreen" >
    <!-- Location can be used as a variable determining the current location, hence Location permission is required -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

    <!-- Bluetooth devices are also used to determine present environment -->
    <uses-permission android:name="android.permission.BLUETOOTH" />

    <!-- Current Wifi networks are also used to determine present environment -->
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

    <!-- To switch on Wifi when User wants to enter an environment with a wifi network attached to it -->
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />

    <!-- The following three permissions are used by Maps, on which location selection and searching is possible -->
    <!-- Internet permission is also used for checking for updates -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <!-- To start the service automatically after boot -->
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <!-- Required for restricting access to certain apps. This allows SmartLockScreen to determine the app open currently-->
    <uses-permission android:name="android.permission.GET_TASKS" />

    <!-- For running environment detection and password setting in the background when phone is locked -->
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <!-- Used to draw lockscreen over the Android lock screen -->
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

    <!-- Required to expand the status bar programmatically -->
    <uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />

    <!-- Required to dismiss the lockscreen overlay during calls -->
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

    <!-- Following 2 permissions are required to read the owner info from Contacts -->
    <uses-permission android:name="android.permission.READ_PROFILE" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    ...
</manifest>
 
Last edited:

aravindsagar

Senior Member
Feb 14, 2012
331
310
Champaign, IL
Instructions, Downloads, Changelogs, Known Bugs etc

Important - Please read carefully
If you choose to use 'System pattern lock (Requires root)' - this option can be found in General Settings->Pattern Type if you have root access - please be careful.
This feature has been tested in AOSP ROMs only. Please make a nandroid backup, or at least Ti backups, especially if you're on a custom skin of Android like TouchWiz.
I request everyone to test this feature and report success/failure so that any problems which could arise can be fixed quickly


_
System Requirements
  • Android 4.1+
  • Latest Google Play Services
  • Notifications in lock screen works only in 4.3+, as of now. We're working to bring them to lower versions as well
  • Doesn't work in MIUI. We would like to get testers who can work with us to sort out the issues with MIUI
  • Testing has been done mainly on AOSP based ROMs (mainly a Nexus 4 and Nexus 5). The app might crash or not work as expected in certain manufacturer versions of Android. We haven't seen this behavior anywhere yet, but we would like to find out, and sort out the issues.

_
Installation Instructions
Important: The basic initialization steps haven't been compiled into a proper set up wizard when app first runs, so please follow these instructions carefully.
  1. Download the apk (see below) and install it.
  2. Go to Settings -> Security and change password to none. This is done so that unlock becomes simple whenever password is set to none by the app.
  3. Install the apk file. See downloads to get the apk file.
  4. For Android 4.3+, Go to Settings -> Security -> Notification Access and select SmartLockScreen.
  5. Open SmartLockScreen settings. You'll be prompted to set a master passphrase, and activate Device Admin for that app, after which you'll be taken to Main Settings screen. Master passphrase can only be password/pin for security, and it'll be used by default on unknown environments. You can set a different password for unknown environment though, from Manage Environments screen. Add different environments using '+' menu item in Manage Environments screen.
  6. Click on the user name to see list of profiles. Click add new profile option in the list to add restricted profiles. Once you select a restricted profile from the list, the options available will change accordingly and you can set which apps are allowed for that profile and what passphrase should be used for that profile.
    [size=+1]For more help on configuring the app, see post #2[/size]

_
Download
A note to people who reshare this app elsewhere: Please don't directly link to the apk, please link to this thread so that users will receive important information and updates
The apk file is attached to this post.
Alternate download link: http://bit.ly/1KUB84X
If you have alpha 1.5 or above, go to About -> Check for updates. Click on update available button, and download.


_
Change log
Alpha v3.0
  • Lollipop support
  • Changed the implementation of root pattern lock. Should be more reliable now.
  • Miscellaneous fixes

Complete changelog here: http://goo.gl/rwroFI

_
Upcoming features
  • Blacklisting apps from showing notifications in lockscreen
  • Ability to show/hide pattern while unlocking
  • Automatic screen on and off
  • Notifications backward compatibility
  • Auto detect all environment variables in Add Environment screen
  • You tell us...

_
Known issues
  • Pattern lock does not keep track of incorrect attempts (in non-root mode).
  • Location has a tendency to fail, especially indoors. Setting a larger radius can help in such cases.
  • Slight delay in unlock after entering pattern, in certain situations - Doesn't happen if you have root, and has System pattern enabled.
_
Disclaimer
Use this app at your own risk. This software is distributed "as is", without any warranty, and the developers cannot be held responsible for any damages or consequences arising because of that.
That being said, I'll be happy to help anyone out, if you run into problems, or want any sort of assistance. Feel free to post the issues you encounter, in this thread.
 

Attachments

  • SmartLockScreen_alpha3.0.apk
    12.2 MB · Views: 5,456
Last edited:

aravindsagar

Senior Member
Feb 14, 2012
331
310
Champaign, IL
I set the new enviroment. If I choose none or pin or password, then it asks me them correctly, but if I choose the pattern then it asks me the master password.
thanks!
Do you see an overlay showing the time, before you're entering your password? If not, drawing overlays doesn't seem to be working. Can you please tell me your android version, and ROM, if its not stock?
 

morphius88

Senior Member
Dec 12, 2010
206
38
OnePlus 8T
Sony Xperia 1 III
Installed and seems to be working
Tested so far: Set environment "Work" to activate when I am connected to their wifi. No security - Works no problem. When I set patter, pin or password, my previous lockscreen shows up after I swipe up to unlock. Then I have to swipe up again. Then the security (pin, password, Pattern) comes up and once entered I get on my home screen (or whatever app I left off at). I am using Viper Rom 6..2.1 (Android 4.4.2) on HTC One M7.
Same stuff happens with unknown environment. When set to none, one swipe up goes to where I left off.

Is that a design flaw in Android or does your app activate the stock lockscreen?

Btw love how everything looks. One thing that is kind of annoying is showing me as a notification what environment I am in. Did you mean to design it like that or no? Basically I like to have a clean screen when there are no notifications. I can swipe it away but it comes back after turn off and turn back on the screen.
 
  • Like
Reactions: aravindsagar

aravindsagar

Senior Member
Feb 14, 2012
331
310
Champaign, IL
Installed and seems to be working
Tested so far: Set environment "Work" to activate when I am connected to their wifi. No security - Works no problem. When I set patter, pin or password, my previous lockscreen shows up after I swipe up to unlock. Then I have to swipe up again. Then the security (pin, password, Pattern) comes up and once entered I get on my home screen (or whatever app I left off at). I am using Viper Rom 6..2.1 (Android 4.4.2) on HTC One M7.
Same stuff happens with unknown environment. When set to none, one swipe up goes to where I left off.

Is that a design flaw in Android or does your app activate the stock lockscreen?

Btw love how everything looks. One thing that is kind of annoying is showing me as a notification what environment I am in. Did you mean to design it like that or no? Basically I like to have a clean screen when there are no notifications. I can swipe it away but it comes back after turn off and turn back on the screen.
Thanks a lot for the detailed feedback.:)
That is a design flaw in Android, I'd have to say. If the phone should be truly secure, the password should be set as system password. But then, in certain implementations of Android, along with it, comes an additional screen, like the one on HTC. This doesn't happen in AOSP actually, at least till KitKat. I'm thinking of ways to solve this problem.. Initial thoughts suggest that the app should provide an option to disable the lock screen overlay showing the notifications.

Regarding the persistent notification, we'll add an option to turn that off. :)
 
Last edited:

morphius88

Senior Member
Dec 12, 2010
206
38
OnePlus 8T
Sony Xperia 1 III
Thanks a lot for the detailed feedback.:)
That is a design flaw in Android, I'd have to say. If the phone should be truly secure, the password should be set as system password. But then, in certain implementations of Android, along with it, comes an additional screen, like the one on HTC. This doesn't happen in AOSP actually, at least till KitKat. I'm thinking of ways to solve this problem.. Initial thoughts suggest that the app should provide an option to disable the lock screen overlay showing the notifications.

Regarding the persistent notification, we'll add an option to turn that off. :)

Wow thanks for a quick reply. I will set up no security for the places where I spend most of my day. And for the rest, I will just deal with it for now. Will let you know if there are any other issues. Thanks


Sent from planet Mars using HTC One

---------- Post added at 12:49 PM ---------- Previous post was at 12:27 PM ----------

Swiping left freezes my phone completely. It gets about half way in the animation and freezes. Turning off and on does not fix it. A restart goes back to normal but I tried swiping again and it froze again. No security set in current environment. Swiping right works fine and the dialer shows up after a second or two. Again, Using HTC One M7 with Viper Rom (Android 4.4.2).
 
  • Like
Reactions: aravindsagar

aravindsagar

Senior Member
Feb 14, 2012
331
310
Champaign, IL
Wow thanks for a quick reply. I will set up no security for the places where I spend most of my day. And for the rest, I will just deal with it for now. Will let you know if there are any other issues. Thanks


Sent from planet Mars using HTC One

---------- Post added at 12:49 PM ---------- Previous post was at 12:27 PM ----------

Swiping left freezes my phone completely. It gets about half way in the animation and freezes. Turning off and on does not fix it. A restart goes back to normal but I tried swiping again and it froze again. No security set in current environment. Swiping right works fine and the dialer shows up after a second or two. Again, Using HTC One M7 with Viper Rom (Android 4.4.2).
Duly noted. Will fix in next version.
 

aravindsagar

Senior Member
Feb 14, 2012
331
310
Champaign, IL
Swiping left freezes my phone completely. It gets about half way in the animation and freezes. Turning off and on does not fix it. A restart goes back to normal but I tried swiping again and it froze again. No security set in current environment. Swiping right works fine and the dialer shows up after a second or two. Again, Using HTC One M7 with Viper Rom (Android 4.4.2).
Would it be too much to ask for a logcat? :) Intent to open camera on HTC devices must be different. It'll be solved in next version.
Edit: On second thoughts, it might be the absence of a "secure" camera module in Sense. Didn't think that devices might not have it. I'll add the fix right away. Unfortunately I won't be able to upload a new version until Sunday, I'm preparing for my GRE (on Saturday).
 
Last edited:

morphius88

Senior Member
Dec 12, 2010
206
38
OnePlus 8T
Sony Xperia 1 III
Would it be too much to ask for a logcat? :) Intent to open camera on HTC devices must be different. It'll be solved in next version.
Edit: On second thoughts, it might be the absence of a "secure" camera module in Sense. Didn't think that devices might not have it. I'll add the fix right away. Unfortunately I won't be able to upload a new version until Sunday, I'm preparing for my GRE (on Saturday).

Heres a log cat plus a screenshot of how the freeze looks like (Phone still lets me take a screenshot with the physical buttons).
I have no idea how to read a logcat :(

EDIT: I dont mind waiting. This is not important to me as I mainly want the notifications. The dialer and camera are pluses. Your test is way more important and you should focus on that right now. Good luck on the test.

Edit 2: Attached a second logcat generated by app "alogcat"

IAAcoZL.png
 

Attachments

  • logcat2.txt
    496.7 KB · Views: 8
  • alogcat.2014-10-29-13-34-54-0400.txt
    64 KB · Views: 8
Last edited:
  • Like
Reactions: aravindsagar
N

NOOK!E

Guest
This app is exactly what I've been looking for, except one small detail - it doesn't support my device's Android version!

Darn, why does nobody make apps for 2.1 anymore?

Oops, I know the answer - it's outdated and old. But still, it's not fun having a device that can use so few apps. :(

Oh yeah, it's the Nook Simple Touch with GlowLight, by the way.
 

aravindsagar

Senior Member
Feb 14, 2012
331
310
Champaign, IL
This app is exactly what I've been looking for, except one small detail - it doesn't support my device's Android version!

Darn, why does nobody make apps for 2.1 anymore?

Oops, I know the answer - it's outdated and old. But still, it's not fun having a device that can use so few apps. :(

Oh yeah, it's the Nook Simple Touch with GlowLight, by the way.
While developing, we tried to make it support the lowest version of android possible, but there were certain apis absent in ICS and below which we simply couldn't do without. But in the future, I'll try and reduce the min android version.
 
N

NOOK!E

Guest
While developing, we tried to make it support the lowest version of android possible, but there were certain apis absent in ICS and below which we simply couldn't do without. But in the future, I'll try and reduce the min android version.

Ah, that makes sense. Sorry if I appear "noobish" in this department, I don't develop apps. :)

And thanks for attempting to meet my wishes. Good customer service is always important.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 37
    SmartLockScreen​
    Make your lockscreen smarter than ever before!​
    For Jellybean, KitKat and Lollipop devices

    The Idea
    The main idea behind this app can be considered as an extended version of 'Smart Lock' introduced by Google in Lollipop. The development of this app started before Google announced L during I/O 14, though.
    We are in different environments at different times, and might prefer different security levels in each environment.​
    2rmw4qp.png
    Using this app, you can define different environments and assign different passwords to each of them.
    App will detect environment changes automatically and presents you the assigned password whenever you want to unlock the phone!

    _​
    What's an Environment?
    Wi-Fi networks, Bluetooth devices and Location areas (geofences) can be used to define environments.
    Specifying multiple parameters for an environment checks for all of them.​
    2wluamb.png
    Assigning a password to an environment is done at the time of creating an environment. Support for more password types are coming in the future.​

    _​
    There's more!
    • Lollipop style lockscreen with notifications for Jellybean and KitKat (can be disabled)
    • Restricted profiles - Set up restricted profiles for your friends/family and limit access to apps. You can assign a different password to each restricted profile (password, pin, pattern or none).
    • Intelligent environment overlap resolution. But you always have the option to override it manually.
    • Material Design, and smooth animations. (See screenshots below)

    _​
    Some details
    • The app uses admin privileges to set system password, so it comes with the security of Stock lock screen
    • Pattern lock is supported. If you have root, stock pattern lock will be used. Please see Post #3 for more details. If you do not have root, a built-in pattern library is used (it still sets a user-defined master password in the background so that lockscreen is actually secure). But this built-in pattern is not guaranteed to work in every device.
    • The core functionality is working, but this is still a work in progress. Please report bugs, crashes etc in this thread. Logcat will be highly appreciated!

    _​
    Source Code

    The source code is Licensed under the Apache License, Version 2.0. Link to Github repository: https://github.com/aravindsagar/SmartLockScreen/

    _​

    _​
    FAQs

    1. My screen froze while on lock screen. How to recover?
    Ans: Try rebooting the phone by long pressing power button. Upon reboot, try master password first, if it does not work, try passwords which you've set for different environments. Try to reproduce the problem, and send us a logcat. :)

    2. How to uninstall the app?
    Ans: First open SmartLockScreen Settings, delete all environments, and set passphrase for unknown environment as None. Then go to Settings -> Security -> Device Administrators, uncheck SmartLockScreen there. Now uninstall the app just like any other app. Please come back to this thread and post why you uninstalled it, what's missing/what's bothering you.

    3. Can you add fingerprint sensor support?
    Ans: I'm looking into it. Till Lollipop, there's no standard API or structure for fingerprint sensors, so parts of the implementation will have to be device specific or manufacturer specific. That being said, I'm trying to add support to Samsung devices first.
    Also, things should improve with Android M, since fingerprint APIs will become standardized with it.

    FAQs will be updated when certain questions get frequently asked.​

    _​
    Credits
    Developed by
    Aravind Sagar, V Priyan


    This is our first ever app, so it did take some time for learning and implementing everything properly. Sincere thanks to:



    XDA:DevDB Information
    SmartLockScreen for Android, App for all devices (see above for details)

    Contributors
    aravindsagar, priyanmuthu

    Version Information
    Status: Alpha v3.0
    4
    Examples, Screenshots, and Reviews

    Tutorial made by WonderHowTo.com(old version of the app is used)

    _
    Configuring environments

    Let's consider some examples.

    Say you want to set phone password as none automatically whenever your bluetooth headset is connected to it. Just go to manage environments screen, click the '+' button on top right, give a name and hint for the environment, click checkbox on Bluetooth card, select your bluetooth device after clicking the button that appears. Go down to passphrase card, choose none. Click done button at the top. That's it!

    Whenever you are not connected to the headset, phone password will automatically change to Unknown Environment password(if you have set it) or the master password, if you haven't set password specifically for unknown environment.

    Let's consider another scenario, you want no security at home, pattern at work, and a pin elsewhere. Just add 2 environments corresponding to home and work. You can use Wi-Fi or Location or both to identify the environment. Remember that if you set both Wi-Fi and Location, it'll check for both; i.e. you have to be connected to the Wi-Fi network, as well as in the particular area defined. If you want to detect in either case, just make 2 separate environments, 1 with Wi-Fi and 1 with location, and give the same passphrase in both.

    Any number of environments can be added. You can set any passphrase for any environment, including unknown environment. You build the configuration that works best for you.


    _
    Configuring restricted profiles
    Suppose you want to share your phone with your child, and make sure that (s)he can access only certain games which you have downloaded for her. Go to SmartLockScreen Settings, click the item which shows the current user, click 'Add new profile', and give it a name. Now click on the new profile (it must have appeared in that list). You'll see 2 new options in the Nav drawer now. Click allowed apps and click on the games which you want to allow, plus the launcher app you're using currently. Now go to set passphrase and set a suitable passphrase. You can set none if anyone anytime can unlock your phone using that profile, or you can set something else as well.
    To switch profiles, just turn off the screen and turn it back on. Click on the user icon which appears at the top right corner. List of profiles will appear. Click on the desired profile to switch to. The screen will turn off and on again so that the password change will take effect.


    _
    Screenshots

    screenshot_lockscreen.png
    screenshot_nav_drawer.png


    More screenshots:

    screenshot_manage_environments.png
    screenshot_add_environment.png


    screenshot_edit_environment.png
    screenshot_pattern_lock.png


    screenshot_select_location.png
    screenshot_user_selector.png


    screenshot_nav_drawer_restricted.png
    screenshot_allowed_apps.png


    screenshot_about.png
    screenshot_general_settings.png


    _
    A review of the app at AndroTrends
    xoqjro.png

    _
    Why these permissions?
    HTML:
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.pvsagar.smartlockscreen" >
        <!-- Location can be used as a variable determining the current location, hence Location permission is required -->
        <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
        <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    
        <!-- Bluetooth devices are also used to determine present environment -->
        <uses-permission android:name="android.permission.BLUETOOTH" />
    
        <!-- Current Wifi networks are also used to determine present environment -->
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    
        <!-- To switch on Wifi when User wants to enter an environment with a wifi network attached to it -->
        <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    
        <!-- The following three permissions are used by Maps, on which location selection and searching is possible -->
        <!-- Internet permission is also used for checking for updates -->
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    
        <!-- To start the service automatically after boot -->
        <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    
        <!-- Required for restricting access to certain apps. This allows SmartLockScreen to determine the app open currently-->
        <uses-permission android:name="android.permission.GET_TASKS" />
    
        <!-- For running environment detection and password setting in the background when phone is locked -->
        <uses-permission android:name="android.permission.WAKE_LOCK" />
    
        <!-- Used to draw lockscreen over the Android lock screen -->
        <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    
        <!-- Required to expand the status bar programmatically -->
        <uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
    
        <!-- Required to dismiss the lockscreen overlay during calls -->
        <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    
        <!-- Following 2 permissions are required to read the owner info from Contacts -->
        <uses-permission android:name="android.permission.READ_PROFILE" />
        <uses-permission android:name="android.permission.READ_CONTACTS" />
        ...
    </manifest>
    3
    Instructions, Downloads, Changelogs, Known Bugs etc

    Important - Please read carefully
    If you choose to use 'System pattern lock (Requires root)' - this option can be found in General Settings->Pattern Type if you have root access - please be careful.
    This feature has been tested in AOSP ROMs only. Please make a nandroid backup, or at least Ti backups, especially if you're on a custom skin of Android like TouchWiz.
    I request everyone to test this feature and report success/failure so that any problems which could arise can be fixed quickly


    _
    System Requirements
    • Android 4.1+
    • Latest Google Play Services
    • Notifications in lock screen works only in 4.3+, as of now. We're working to bring them to lower versions as well
    • Doesn't work in MIUI. We would like to get testers who can work with us to sort out the issues with MIUI
    • Testing has been done mainly on AOSP based ROMs (mainly a Nexus 4 and Nexus 5). The app might crash or not work as expected in certain manufacturer versions of Android. We haven't seen this behavior anywhere yet, but we would like to find out, and sort out the issues.

    _
    Installation Instructions
    Important: The basic initialization steps haven't been compiled into a proper set up wizard when app first runs, so please follow these instructions carefully.
    1. Download the apk (see below) and install it.
    2. Go to Settings -> Security and change password to none. This is done so that unlock becomes simple whenever password is set to none by the app.
    3. Install the apk file. See downloads to get the apk file.
    4. For Android 4.3+, Go to Settings -> Security -> Notification Access and select SmartLockScreen.
    5. Open SmartLockScreen settings. You'll be prompted to set a master passphrase, and activate Device Admin for that app, after which you'll be taken to Main Settings screen. Master passphrase can only be password/pin for security, and it'll be used by default on unknown environments. You can set a different password for unknown environment though, from Manage Environments screen. Add different environments using '+' menu item in Manage Environments screen.
    6. Click on the user name to see list of profiles. Click add new profile option in the list to add restricted profiles. Once you select a restricted profile from the list, the options available will change accordingly and you can set which apps are allowed for that profile and what passphrase should be used for that profile.
      [size=+1]For more help on configuring the app, see post #2[/size]

    _
    Download
    A note to people who reshare this app elsewhere: Please don't directly link to the apk, please link to this thread so that users will receive important information and updates
    The apk file is attached to this post.
    Alternate download link: http://bit.ly/1KUB84X
    If you have alpha 1.5 or above, go to About -> Check for updates. Click on update available button, and download.


    _
    Change log
    Alpha v3.0
    • Lollipop support
    • Changed the implementation of root pattern lock. Should be more reliable now.
    • Miscellaneous fixes

    Complete changelog here: http://goo.gl/rwroFI

    _
    Upcoming features
    • Blacklisting apps from showing notifications in lockscreen
    • Ability to show/hide pattern while unlocking
    • Automatic screen on and off
    • Notifications backward compatibility
    • Auto detect all environment variables in Add Environment screen
    • You tell us...

    _
    Known issues
    • Pattern lock does not keep track of incorrect attempts (in non-root mode).
    • Location has a tendency to fail, especially indoors. Setting a larger radius can help in such cases.
    • Slight delay in unlock after entering pattern, in certain situations - Doesn't happen if you have root, and has System pattern enabled.
    _
    Disclaimer
    Use this app at your own risk. This software is distributed "as is", without any warranty, and the developers cannot be held responsible for any damages or consequences arising because of that.
    That being said, I'll be happy to help anyone out, if you run into problems, or want any sort of assistance. Feel free to post the issues you encounter, in this thread.
    2
    Installed and seems to be working
    Tested so far: Set environment "Work" to activate when I am connected to their wifi. No security - Works no problem. When I set patter, pin or password, my previous lockscreen shows up after I swipe up to unlock. Then I have to swipe up again. Then the security (pin, password, Pattern) comes up and once entered I get on my home screen (or whatever app I left off at). I am using Viper Rom 6..2.1 (Android 4.4.2) on HTC One M7.
    Same stuff happens with unknown environment. When set to none, one swipe up goes to where I left off.

    Is that a design flaw in Android or does your app activate the stock lockscreen?

    Btw love how everything looks. One thing that is kind of annoying is showing me as a notification what environment I am in. Did you mean to design it like that or no? Basically I like to have a clean screen when there are no notifications. I can swipe it away but it comes back after turn off and turn back on the screen.
    Thanks a lot for the detailed feedback.:)
    That is a design flaw in Android, I'd have to say. If the phone should be truly secure, the password should be set as system password. But then, in certain implementations of Android, along with it, comes an additional screen, like the one on HTC. This doesn't happen in AOSP actually, at least till KitKat. I'm thinking of ways to solve this problem.. Initial thoughts suggest that the app should provide an option to disable the lock screen overlay showing the notifications.

    Regarding the persistent notification, we'll add an option to turn that off. :)
    1
    Lockscreen system.ui stop working every unlock

    Hello, I have a Sony Xperia E3 D2212 using this nitrogen 4.7 ROM http://forum.xda-developers.com/xperia-e3/development/nitrogen-rom-t3087808 and this fkn awesome kernel http://forum.xda-developers.com/xperia-e3/development/kernel-hybrid-kernel-xperia-e3-t3167759, so I install that smart lockscreen and everytime I "unlock" the phone, system.ui stopped working. I have to format all data. Thanks for this.