• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

[APP][ALPHA][MATERIAL]SmartLockScreen for Android

[size=+2]SmartLockScreen - Bringing Lollipop smartness and more to Jellybean and KitKat devices[/size]

Code:
Disclaimer:
This app is in alpha stage. Though safe for daily use (none of the testers have got locked out of their phones), 
rooted phone is recommended for testing, so that system password can be reset via adb. 
Even if the previous sentence scares you, do read on, and if you find it interesting, 
follow this thread and try out the app when it reaches Beta stage
(It'll not take much time).
-----------------------------------------------------------------------------
[size=+1]Looking for alpha testers. Feedback will be much appreciated![/size]
-----------------------------------------------------------------------------
[size=+2]Introduction[/size]
Make your phone lock smarter! Automatically change and remove passwords based on your current 'Environment'.

Convert Wi-Fi networks, Bluetooth Devices or Location areas into trust agents, and let them do the phone unlocking for you!
That is just 1 method of using the app. Possibilities are endless!

Also brings Lollipop style lockscreen notifications.

[size=+2]Features[/size]
  • Define environments - Each environment can be a combination of any of Bluetooth devices, Wi-Fi network and Location.
  • Set passphrase for each environment. The app detects environment changes and changes the passphrase automatically in the background.
    How is this useful? Consider this: Say you define environment home, which says Home is when the phone is connected to Home Wi-Fi (you can use location also, or both together). For environment home, set password as none. And for unknown environment, you can set, say, a pattern lock. So whenever you are at home, you can unlock the phone easily, but when outside, it'll set a lock and prevent unauthorized usage by others.
    Another scenario is adding an environment which checks for your bluetooth headset. Phone is automatically secured when you move away, and unlocks automatically when you come back to it.
    These are just indicative. Possibilities are endless!
  • Notifications in lock screen - Lollipop style! It's not totally there yet, it's an ongoing work. Swipe up/down to unlock, left for camera, right for dialer.
  • Intelligent environment overlap resolution. But you always have the option to override it manually.
  • Material Design, and smooth animations. (See screenshots below)
  • More features are coming soon! See Features to be implemented section

[size=+2]Screenshots[/size]
screenshot_nav_drawer.png
screenshot_lockscreen.png
screenshot_add_environment.png
screenshot_edit_environment.png
screenshot_manage_environments.png
screenshot_pattern_lock.png
screenshot_select_location.png

[size=+2]Requirements[/size]
  • Android 4.1+
  • Latest Google Play Services
  • Doesn't work properly in Lollipop (yet?)
  • 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.

[size=+2]Installation instructions[/size]
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. 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.
  2. Install the apk file. See downloads to get the apk file.
  3. For Android 4.3+, Go to Settings -> Security -> Notification Access and select SmartLockScreen.
  4. 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 unknwon 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.
    [size=+1]For more help on configuring the app, see post #2[/size]

[size=+2]Downloads[/size]
Download link: http://aravindsagar.github.io/SmartLockScreen/downloads/SmartLockScreen_alpha1.apk

Somehow, attaching the apk file in this post failed. I'll try again and update the post if it's successful.

[size=+2]Notes[/size]
  • The app uses Admin privileges to change password in background. So all the security which comes with stock Android lock screen comes with this.
  • Please use this thread to report bugs, crashes, feature requests etc. Logcat will be highly appreciated. :)
  • Some options in the app are not functional yet. Work in progress!

[size=+2]Upcoming features[/size]
  • Restricted profiles
  • Automatic screen on and off
  • Notifications backward compatibility
  • You tell us...

[size=+2]Known Issues/Missing features[/size]
  • Pattern lock does not keep track of incorrect attempts.
  • Location has a tendency to fail, especially indoors. Setting a larger radius can help in such cases.
  • Animations in lock screen overlay needs to be refined.
  • Auto detect all environment variables in Add Environment screen
  • Slight delay in unlock after entering pattern, in certain situations.

[size=+2]Source[/size]
The project is hosted in GitHub. It's a private repo for now. We're planning to make it public after the app reached Beta stage, along with adding a suitable open source license. Links will be posted here once we do that.

[size=+2]FAQs[/size]
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?
First go to Settings -> Security -> Device Administrators, uncheck SmartLockScreen there. Then open SmartLockScreen Settings, delete all environments, and set passphrase for unknown environment as None. Now uninstall the app just like any other app.

FAQs will be updated when certain questions get frequently asked.

[size=+2]Credits[/size]
This is our first ever app, so it did take some time for learning and implementing everything properly. Sincere thanks to:


Contributors
Aravind Sagar, V Priyan

Version Information
Status: Alpha
 
[size=+2]Configuring the app[/size]
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.

[size=+2]Why these permissions?[/size]
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 -->
    <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>
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones