Giter VIP home page Giter VIP logo

lollipin's Introduction

LolliPin Android Arsenal

A Lollipop material design styled android pincode library (API 14+)

To include in your project, add this to your build.gradle file:

   //Lollipin
   compile ('com.github.orangegangsters:lollipin:2.0.0@aar') {
      transitive = true
   }

Starting from version 2.1.0 we will have a different package name:

   //Lollipin
   compile ('com.github.omadahealth:lollipin:2.1.0@aar') {
      transitive = true
   }

Demo Demo

========

By

Developers: Olivier Goutay and Stoyan Dimitrov and Dae Park

Contributors: Art Beatte IV, Alex Morgan

Designers: Yassine Bentaieb

========

Security

Password protection

The password itself is not saved, only its hash using the SHA-1 algorithm. This hash is then saved on the SharedPreferences, allowing to verify that the user entered the right PinCode, without giving the possibility to retrieve it.

Introducing Fingerprint

Once the user has enabled the password, he can also use his fingerprint scanner (using Google Api, not Samsung) to unlock his device.

========

Usage

If you want an example on how to use it, you can find an example app in this repo.

========

Preparing dependencies

We are using a custom version of RippleView that contains a RippleAnimationListener. In order to be able to fetch this dependency, you need to add these lines into your main build.gradle file:

allprojects {
    repositories {
        maven{
            url "https://github.com/omadahealth/omada-nexus/raw/master/release"
        }
        jcenter()

    }
}

========

Overriding the AppLockActivity

In order to use the "Forgot" system, we let you extend the AppLockActivity class to provide your own way of handling the user behaviour in this case (logout, delete datas etc...)

public class CustomPinActivity extends AppLockActivity {
    @Override
    public void showForgotDialog() {
        //Launch your popup or anything you want here
    }
}

========

Init

Advised to be done by extending the Application, but can be done elsewhere. The method below provides a way to enable or disable the PinCode system:

========

Enabling
LockManager<CustomPinActivity> lockManager = LockManager.getInstance();
lockManager.enableAppLock(this, CustomPinActivity.class);

Once enabled, you must extend "PinActivity" for every Activity you wish to protect.

========

Disabling
LockManager<CustomPinActivity> lockManager = LockManager.getInstance();
lockManager.disableAppLock();

========

Set up the PinCode

Whenever you want the user to set up his pin code, you need to request:

Intent intent = new Intent(MainActivity.this, CustomPinActivity.class);
intent.putExtra(AppLock.EXTRA_TYPE, AppLock.ENABLE_PINLOCK);
startActivityForResult(intent, REQUEST_CODE_ENABLE);

========

Unlock system

As soon as you enable the PinCode system, the Unlock screen will appear by itself when the user resume the app after a defined timeout. Please refer to the next section to know how to customize these values.

========

Customization

Some features are customizable:

The unlock timeout:

LockManager<CustomPinActivity> lockManager = LockManager.getInstance();
lockManager.getAppLock().setTimeout(10000);

The pin length required:

public class CustomPinActivity extends AppLockActivity {

    ...
    ...

    @Override
    public int getPinLength() {
        return 5;
    }

    ...
    ...
}

The logo displayed at the top of the page:

LockManager<CustomPinActivity> lockManager = LockManager.getInstance();
lockManager.getAppLock().setLogoId(R.drawable.security_lock);

The ignored activities:

For instance you got a login activity that you want to avoid getting the lock screen, you can ignore this activity by doing:

LockManager<CustomPinActivity> lockManager = LockManager.getInstance();
lockManager.getAppLock().addIgnoredActivity(NotLockedActivity.class);

The AppLockActivity Layout:

By providing a custom layout to getContentView() you can alter how your AppLockActivity looks. However, you must include 4 required elements:

  • TextView with an id of pin_code_step_textview
  • TextView with an id of pin_code_forgot_textview
  • PinCodeRoundView with an id of pin_code_round_view
  • KeyboardView with an id of pin_code_keyboard_view
@Override
    public int getContentView() {
        return R.layout.activity_pin;
    }

The Pin Dots:

By supplying alternate drawable resources for app:lp_empty_pin_dot and app:lp_full_pin_dot you can custimize how it looks.

<com.github.orangegangsters.lollipin.lib.views.PinCodeRoundView
                android:id="@+id/pin_code_round_view"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/pin_code_round_top_margin"
                android:layout_marginBottom="@dimen/pin_code_elements_margin"
                app:lp_empty_pin_dot="@drawable/pin_empty_dot"
                app:lp_full_pin_dot="@drawable/pin_full_dot"/>

========

Credits

========

License

The MIT License (MIT)

Copyright (c) 2015 OrangeGangsters

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

lollipin's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lollipin's Issues

At least one fingerprint must be enrolle

Hi, in android 6.0 throws this error, having no mark set.

java.security.InvalidAlgorithmParameterException: java.lang.IllegalStateException: At least one
fingerprint must be enrolled to create keys requiring user authentication for every use

You could place a parameter to enable or disable fingerprint authentication?

Thanks.

Trace error:
FATAL EXCEPTION: main
Process: com.client.wittygrowth.pandco, PID: 14903
java.lang.RuntimeException: Unable to resume activity {com.client.wittygrowth.pandco/com.client.wittygrowth.pandco.ui.app.security.CustomPinActivity}: java.lang.RuntimeException: java.security.InvalidAlgorithmParameterException: java.lang.IllegalStateException: At least one fingerprint must be enrolled to create keys requiring user authentication for every use
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3103)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.RuntimeException: java.security.InvalidAlgorithmParameterException: java.lang.IllegalStateException: At least one fingerprint must be enrolled to create keys requiring user authentication for every use
at com.github.orangegangsters.lollipin.lib.managers.FingerprintUiHelper.createKey(FingerprintUiHelper.java:277)
at com.github.orangegangsters.lollipin.lib.managers.FingerprintUiHelper.initCipher(FingerprintUiHelper.java:241)
at com.github.orangegangsters.lollipin.lib.managers.FingerprintUiHelper.startListening(FingerprintUiHelper.java:140)
at com.github.orangegangsters.lollipin.lib.managers.AppLockActivity.initLayoutForFingerprint(AppLockActivity.java:148)
at com.github.orangegangsters.lollipin.lib.managers.AppLockActivity.onResume(AppLockActivity.java:82)
at com.client.wittygrowth.pandco.ui.app.security.CustomPinActivity.onResume(CustomPinActivity.java:29)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1258)
at android.app.Activity.performResume(Activity.java:6312)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3092)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481) 
at android.app.ActivityThread.-wrap11(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5417) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
Caused by: java.security.InvalidAlgorithmParameterException: java.lang.IllegalStateException: At least one fingerprint must be enrolled to create keys requiring user authentication for every use
at android.security.keystore.AndroidKeyStoreKeyGeneratorSpi.engineInit(AndroidKeyStoreKeyGeneratorSpi.java:238)
at android.security.keystore.AndroidKeyStoreKeyGeneratorSpi$AES.engineInit(AndroidKeyStoreKeyGeneratorSpi.java:53)
at javax.crypto.KeyGenerator.init(KeyGenerator.java:189)
at com.github.orangegangsters.lollipin.lib.managers.FingerprintUiHelper.createKey(FingerprintUiHelper.java:266)
at com.github.orangegangsters.lollipin.lib.managers.FingerprintUiHelper.initCipher(FingerprintUiHelper.java:241) 
at com.github.orangegangsters.lollipin.lib.managers.FingerprintUiHelper.startListening(FingerprintUiHelper.java:140) 
at com.github.orangegangsters.lollipin.lib.managers.AppLockActivity.initLayoutForFingerprint(AppLockActivity.java:148) 
at com.github.orangegangsters.lollipin.lib.managers.AppLockActivity.onResume(AppLockActivity.java:82) 
at com.client.wittygrowth.pandco.ui.app.security.CustomPinActivity.onResume(CustomPinActivity.java:29) 
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1258) 
at android.app.Activity.performResume(Activity.java:6312) 
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3092) 
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481) 
at android.app.ActivityThread.-wrap11(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5417) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
Caused by: java.lang.IllegalStateException: At least one fingerprint must be enrolled to create keys requiring user authentication for every use
at android.security.keystore.KeymasterUtils.addUserAuthArgs(KeymasterUtils.java:115)
at android.security.keystore.AndroidKeyStoreKeyGeneratorSpi.engineInit(AndroidKeyStoreKeyGeneratorSpi.java:234)
at android.security.keystore.AndroidKeyStoreKeyGeneratorSpi$AES.engineInit(AndroidKeyStoreKeyGeneratorSpi.java:53) 
at javax.crypto.KeyGenerator.init(KeyGenerator.java:189) 
at com.github.orangegangsters.lollipin.lib.managers.FingerprintUiHelper.createKey(FingerprintUiHelper.java:266) 
at com.github.orangegangsters.lollipin.lib.managers.FingerprintUiHelper.initCipher(FingerprintUiHelper.java:241) 
at com.github.orangegangsters.lollipin.lib.managers.FingerprintUiHelper.startListening(FingerprintUiHelper.java:140) 
at com.github.orangegangsters.lollipin.lib.managers.AppLockActivity.initLayoutForFingerprint(AppLockActivity.java:148) 
at com.github.orangegangsters.lollipin.lib.managers.AppLockActivity.onResume(AppLockActivity.java:82) 
at com.client.wittygrowth.pandco.ui.app.security.CustomPinActivity.onResume(CustomPinActivity.java:29) 
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1258) 
at android.app.Activity.performResume(Activity.java:6312) 
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3092) 
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481) 
at android.app.ActivityThread.-wrap11(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5417) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

Connot inflate class

Hi, i want to try this awesome library, but i had a little problem and it says that can not inflate KeyboarView, don't know why and it is my first issue that i write on github so, i can put the error that shows up:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jonaxel.example.pindots/com.jonaxel.example.pindots.CustomPinActivity}: android.view.InflateException: Binary XML file line #69: Error inflating class com.github.orangegangsters.lollipin.lib.views.KeyboardView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2198)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
at android.app.ActivityThread.access$800(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5086)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #69: Error inflating class com.github.orangegangsters.lollipin.lib.views.KeyboardView

Pin change without having to enter it again

Is it possible to let the user change the pin without having to enter it again? Every activity is secured with a pin so to change the pin the user must have already entered it once.

Thanks!

Gradle is unable to sync the ripple library 1.2.3.2-OG

Hi,
Gradle is unable to find correct library for the Ripple effect, LolliPin library is using:
com.github.traex.rippleeffect:ripple:1.2.3.2-OG
but the latest version of traex library is only 1.2.3, which miss RippleAnimationListener, is this version some dev snapshot, not available on jcentral?
Thanks

reset pin

Once a pin is setup how can you reset it so the user does not have to enter their pin to choose a new one?

Sample APK

Could you add a sample APK in the repo please?

No resource identifier found for attribute

I get the following error when trying to use the lib. I just added the gradle dependency without adding actual code.

[my folders]/app/build/intermediates/exploded-aar/com.github.orangegangsters/lollipin/1.0.2/res/layout/view_keyboard_button.xml
Error:(2) No resource identifier found for attribute 'rv_rippleDuration' in package '[my.package.name]'
Error:(2) No resource identifier found for attribute 'rv_ripplePadding' in package '[my.package.name]'

It doesn't work when the first time I set the password

here are my step:
1.click"Enable", set my password
2.press back button to exit
3.press recent button and swipe to clear LolliPin demo progress
4.launch LolliPin demo again , click"Check", and input the password
what I see was that the keyboard shocked which means password was wrong
5.exit demo, clear demo progress, and repeat step 1,2,3,4
and this time it works

so, what cause it and could it be fixed ?

Check for pin code

How can I check that the code has been entered?
I want to add a check when the user opens the application - if the PIN code has been entered - it opens a window to confirm - if the pin code is not yet - it opens a window for creating

Only use timeout when app is in background?

It seems that the timeout behavior for this library is per activity: so even if I'm inside my app, and the user has already unlocked by entering the correct pin, if the user spends some time (greater than the timeout time) on an activity, and then navigates to another activity, which is protected by the library, he gets prompted for the passcode again, which is poor user experience.

Is there a way to start the clock for the timeout only once the user has left the app? (vs tracking timeout per activity)

Support Library Support is Gone

Support for the support library v7 was added in this commit, but then the changes that enabled it were removed in this commit. Specifically, PinAcitivity was changed to extend from Activity again rather than AppCompatActivity. Since the commit message doesn't mention anything about removing the support library, I'm thinking that it might not have been intentional.

I can make a pull request to reenable the support library, but I wanted to make sure it wasn't intentionally removed before I start.

Error

I am getting the following error

\app\build\intermediates\ exploded-aar\com.github.orangegangsters\lollipin\1.2.1\res\layout\view_keyboard_button.xml

Error:(2) No resource identifier found for attribute 'rv_centered' in package 'com.example.findmychild'
Error:(2) No resource identifier found for attribute 'rv_rippleDuration' in package 'com.example.findmychild'
Error:(2) No resource identifier found for attribute 'rv_ripplePadding' in package 'com.example.findmychild'
Error:(2) No resource identifier found for attribute 'rv_color' in package 'com.example.findmychild'

You can help me solve?

ic_launcher.png icons causing conflicts with latest gradle android tool

When I set my android project to use the latest version of the gradle build tool (1.2.3) I receive errors, stating that ic_launcher.png is a Duplicate. Even after renaming my icons, the issue persists.

Libraries don't need launcher icons. The test app will fall back to the android defaults if they don't exist. Could those be removed?

At least one fingerprint must be enrolled to create keys requiring user authentication for every use

Hi friend, this error occurs after you set the password in the android emulator.

In android emulator API 23 x86

java.lang.RuntimeException: Unable to resume activity {com.client.tecnocreaciones.pandco/com.client.CustomPinActivity}: java.lang.RuntimeException: java.security.InvalidAlgorithmParameterException: java.lang.IllegalStateException: At least one fingerprint must be enrolled to create keys requiring user authentication for every use

Caused by: java.lang.RuntimeException: java.security.InvalidAlgorithmParameterException: java.lang.IllegalStateException: At least one fingerprint must be enrolled to create keys requiring user authentication for every use

Make the Library more generic , without using Ripple and Ldialogs

Congrats for your work.

I have used your library with some modifications in order for it not to use the Ripple and Ldialogs libraries but a more generic, button click oriented approach cause I needed a different design as a whole and to not have the extra libraries in my app.

Is there any existing implementation on this aspect? Can you propose anything

KeyboardView does not layout correctly

Since the KeyBoardView's layout: view_keyboard.xml's RelativeLayout is set to match_parent in height you are not able to centre the pin lock view on the screen and as such on very large screens you get an "ugly" look.

With match_parent
with_match_parent

With wrap_content
with_wrap_content

Unnecessary locking of the AppLockActivity

Hi! I encountered some strange (in my opinion) behavior. When I'm starting the AppLockActivity to change pin-code or disable I need to enter pincode first to enter this activity. I think this is unnecessary, because If I already in place from where I starting this activity means I was able to pass the lock previously.
I think check at line 313 of AppLockImpl is not needed:

 @Override
    public boolean shouldLockSceen(Activity activity) {
...
        // already unlock
        if (activity instanceof AppLockActivity) {
            AppLockActivity ala = (AppLockActivity) activity;
            if (ala.getType() == AppLock.UNLOCK_PIN) { // THIS ONE
                Log.d(TAG, "already unlock activity");
                return false;
            }
        }
...

What do you think?

Multisession with locking pin.

Hello it would be good to keep in the "SharedPreferences" multiple keys associated with a username.

Example:

Intent intent = new Intent(this, CustomPinActivity.class);
intent.putExtra(AppLock.EXTRA_USERNAME, "username");
intent.putExtra(AppLock.EXTRA_TYPE, AppLock.ENABLE_PINLOCK);
startActivity(intent);

No resource identifier found for attributes

Hey there,

I just can't get around these errors below. Could you please send me some tips?

Error:(2) No resource identifier found for attribute 'rv_centered' in package 'my.package.example'
Error:(2) No resource identifier found for attribute 'rv_rippleDuration' in package 'my.package.example'
Error:(2) No resource identifier found for attribute 'rv_ripplePadding' in package 'my.package.example'
Error:(2) No resource identifier found for attribute 'rv_color' in package 'my.package.example'

When i add "compile 'com.github.traex.rippleeffect:library:1.2.4' it compiles, but i'm still unable to use PinActivity.

Passcode not verified

When called in another activity, it does not unlock and constantly says wrong passcode..!! :( :( :( :( :(

[Request] Additional documentation on expected usage

It would be really helpful if someone could update the readme file to show some better examples of using this library. It appears to have some very specific expectations as to how it should be used, and I haven't yet been able to piece together what those are.

All I'm looking for is a better explanation for what the various calls do, and how they should be utilized. Does enableApplock automatically show the lock screen on app open? Or do I need to do that check? disableAppLock doesn't appear to clear out any old PINs, but I don't see a method to do so otherwise. In my app, the PIN is optional based on a preference setting, but toggling the PIN on, setting it, toggling it off, then toggling it back on again, results in the app asking for the old PIN (which never works).

But since the documentation is so sparse and the sample app does nothing but show off the API calls, I have no idea what the expected flow should really be.

Suggestion to add transitive = true in the README

Hi guys, thanks for the library!
Tried it and was not able to compile first because of the error with the dependency to the rippleView. Solved by adding the transitive = true to the dependency:

    //Lollipin
    compile ('com.github.orangegangsters:lollipin:1.9.1@aar') {
        transitive = true
    }

as recommended here.

I think it can be helpful to add it to the README file.

Crash in Android 6.0 (RippleEffect "Underflow in restore - more restores than saves")

I got a crash of lollipin in android 6.0.

Fatal Exception: java.lang.IllegalStateException
Underflow in restore - more restores than saves

android.graphics.Canvas.native_restore (Canvas.java)
android.graphics.Canvas.restore (Canvas.java:540)
com.andexert.library.RippleView.draw (RippleView.java:159)

I think it is due to the error of RippleEffect (traex/RippleEffect#74)

Since lollipin uses a custom version of RippleEffect, maybe it should be fix here?
(https://github.com/OrangeGangsters/RippleEffect)

Thank you very much!

tv_typeface Error

Error:(29) No resource identifier found for attribute 'tv_typeface' in package 'Mypackage'
Error:(2) No resource identifier found for attribute 'rv_centered' in package 'Mypackage'

'Error inflating class' in my app

Hi, thanx for awesome lib.
But i receive this error in my application.
But, example application is work.

07-04 19:01:40.992    3055-3055/test.noblecode.idealistmobile E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to start activity ComponentInfo{test.noblecode.idealistmobile/test.noblecode.idealistmobile.activity.CustomPinActivity}: android.view.InflateException: Binary XML file line #71: Error inflating class com.github.orangegangsters.lollipin.lib.views.KeyboardView
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2351)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2403)
            at android.app.ActivityThread.access$600(ActivityThread.java:165)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
            at android.os.Handler.dispatchMessage(Handler.java:107)
            at android.os.Looper.loop(Looper.java:194)
            at android.app.ActivityThread.main(ActivityThread.java:5370)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.view.InflateException: Binary XML file line #71: Error inflating class com.github.orangegangsters.lollipin.lib.views.KeyboardView
            at android.view.LayoutInflater.createView(LayoutInflater.java:613)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:274)
            at android.app.Activity.setContentView(Activity.java:1881)
            at com.github.orangegangsters.lollipin.lib.managers.AppLockActivity.onCreate(AppLockActivity.java:57)
            at android.app.Activity.performCreate(Activity.java:5122)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2315)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2403)
            at android.app.ActivityThread.access$600(ActivityThread.java:165)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
            at android.os.Handler.dispatchMessage(Handler.java:107)
            at android.os.Looper.loop(Looper.java:194)
            at android.app.ActivityThread.main(ActivityThread.java:5370)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.reflect.InvocationTargetException
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
            at android.view.LayoutInflater.createView(LayoutInflater.java:587)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:274)
            at android.app.Activity.setContentView(Activity.java:1881)
            at com.github.orangegangsters.lollipin.lib.managers.AppLockActivity.onCreate(AppLockActivity.java:57)
            at android.app.Activity.performCreate(Activity.java:5122)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2315)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2403)
            at android.app.ActivityThread.access$600(ActivityThread.java:165)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
            at android.os.Handler.dispatchMessage(Handler.java:107)
            at android.os.Looper.loop(Looper.java:194)
            at android.app.ActivityThread.main(ActivityThread.java:5370)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.view.InflateException: Binary XML file line #14: Error inflating class com.github.orangegangsters.lollipin.lib.views.KeyboardButtonView
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
            at com.github.orangegangsters.lollipin.lib.views.KeyboardView.initializeView(KeyboardView.java:48)
            at com.github.orangegangsters.lollipin.lib.views.KeyboardView.<init>(KeyboardView.java:39)
            at com.github.orangegangsters.lollipin.lib.views.KeyboardView.<init>(KeyboardView.java:32)
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
            at android.view.LayoutInflater.createView(LayoutInflater.java:587)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:274)
            at android.app.Activity.setContentView(Activity.java:1881)
            at com.github.orangegangsters.lollipin.lib.managers.AppLockActivity.onCreate(AppLockActivity.java:57)
            at android.app.Activity.performCreate(Activity.java:5122)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2315)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2403)
            at android.app.ActivityThread.access$600(ActivityThread.java:165)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
            at android.os.Handler.dispatchMessage(Handler.java:107)
            at android.os.Looper.loop(Looper.java:194)
            at android.app.ActivityThread.main(ActivityThread.java:5370)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.github.orangegangsters.lollipin.lib.views.KeyboardButtonView" on path: DexPathList[[zip file "/data/app/test.noblecode.idealistmobile-2.apk"],nativeLibraryDirectories=[/data/app-lib/test.noblecode.idealistmobile-2, /vendor/lib, /system/lib]]
            at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
            at android.view.LayoutInflater.createView(LayoutInflater.java:552)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
            at com.github.orangegangsters.lollipin.lib.views.KeyboardView.initializeView(KeyboardView.java:48)
            at com.github.orangegangsters.lollipin.lib.views.KeyboardView.<init>(KeyboardView.java:39)
            at com.github.orangegangsters.lollipin.lib.views.KeyboardView.<init>(KeyboardView.java:32)
            at java.lang.reflect.Constructor.constructNative(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
            at android.view.LayoutInflater.createView(LayoutInflater.java:587)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:274)
            at android.app.Activity.setContentView(Activity.java:1881)
            at com.github.orangegangsters.lollipin.lib.managers.AppLockActivity.onCreate(AppLockActivity.java:57)
            at android.app.Activity.performCreate(Activity.java:5122)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2315)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2403)
            at android.app.ActivityThread.access$600(ActivityThread.java:165)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
            at android.os.Handler.dispatchMessage(Handler.java:107)
            at android.os.Looper.loop(Looper.java:194)
            at android.app.ActivityThread.main(ActivityThread.java:5370)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
            at dalvik.system.NativeStart.main(Native Method)

Compiling Error

Not Able to Compile com.github.traex.rippleeffect:ripple:1.3.1-OG dependency..!! :( :(

PinActionBarActivity not working

I tried it with my own app and with the sample app provided by simply changing PinActivity to PinActionBarActivity. It just opens without showing the Pin screen.

One possible error I noticed:

return (mAppLocker != null && (PinActivity.hasListeners() || PinFragmentActivity.hasListeners()));

shouldn't this be:

return (mAppLocker != null && (PinActivity.hasListeners() || PinFragmentActivity.hasListeners() || PinActionBarActivity.hasListeners()));

But this doesn't help.

Thanks!

Suggestion: Method to check if the application is already locked.

It would be interesting to have a method that lets you know if the application is already locked, to prevent lock twice.

Example:
LockManager lockManager = LockManager.getInstance();
lockManager.getAppLock().isLocked();

if(lockManager.getAppLock().isLocked() == false){
lockManager.getAppLock().shouldLockSceen(this);
intent2.putExtra(AppLock.EXTRA_TYPE, AppLock.UNLOCK_PIN);
startActivityForResult(intent2, 1000);
}

Thanks...

couple errors rippleview related...

/home/creator/AndroidStudioProjects/la/app/build/intermediates/exploded-aar/
com.github.orangegangsters/lollipin/1.0.2/res/layout/view_keyboard_button.xml

Error Code:
    1
  Output:
    /home/creator/AndroidStudioProjects/la/app/build/intermediates/res/MYAPP/release/layout
/view_keyboard_button.xml:2: error: No resource identifier found for attribute 'rv_centered' in
 package 'com.myapps.default'

    /home/creator/AndroidStudioProjects/la/app/build/intermediates/res/MYAPP//release/layout
/view_keyboard_button.xml:2: error: No resource identifier found for attribute 'rv_rippleDuration' in 
package 'com.myapps.default'

    /home/creator/AndroidStudioProjects/la/app/build/intermediates/res/MYAPP//release/layout
/view_keyboard_button.xml:2: error: No resource identifier found for attribute 'rv_ripplePadding' in 
package 'com.myapps.default'

    /home/creator/AndroidStudioProjects/la/app/build/intermediates/res/MYAPP//release/layout
/view_keyboard_button.xml:2: error: No resource identifier found for attribute 'rv_color' in package 
'com.myapps.default'
allprojects {
    repositories {
        mavenCentral()
        jcenter()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
        maven{
            url "https://github.com/omadahealth/omada-nexus/raw/master/release"
        }
        flatDir{
            dirs 'libs'
        }




    }

Ignore Fragments?

Anyway to extend this feature to fragments....

 The ignored activities: For instance you got a login activity 
that you want to avoid getting the lock screen, you can ignore this activity by doing:

LockManager<CustomPinActivity> lockManager = LockManager.getInstance();
lockManager.getAppLock().addIgnoredActivity(NotLockedActivity.class);

FATAL EXCEPTION

I am facing following exception while try to run sample application in the Nexus 7 and Nexus 5X

02-12 18:07:53.822 28057-28057/com.github.orangegangsters.lollipin E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.github.orangegangsters.lollipin, PID: 28057
java.lang.IllegalStateException: Underflow in restore - more restores than saves
at android.graphics.Canvas.native_restore(Native Method)
at android.graphics.Canvas.restore(Canvas.java:540)
at com.andexert.library.RippleView.draw(RippleView.java:159)
at android.view.View.updateDisplayListIfDirty(View.java:15174)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15134)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15134)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15134)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15134)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15134)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15134)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15134)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15134)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15134)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:281)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:287)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:322)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2615)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2434)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2067)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:606)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Help me to resolve this exception.

AppLockActivity can be bypassed by simply terminating the app

If the app is force closed while the CustomPinCodeActivity (subclass of AppLockActivity) is being shown. AppLockImpl.setLastActiveMillis() is called. The next time the app is launched AppLockImpl.shouldLockScreen() returns false due to the timeout check logic. Maybe I'm missing something very simple and not configuring it properly, but I can easily bypass the lock by doing this.

ezgif com-resize

PINs not persisted across new installation of App

During development, any time a new build is pushed to the device, any stored PIN is broken and no longer unlocks the app.

Unsure if this is the same case for an updated version from play store, though I would expect that to be the case...

Salt issue

Hey there,

I've got not much time to look up into that problem but i just wanted to let you know - there must be something wrong with storing generated salt or something, because SHA-1 of correctly entered PIN (after defining&confirming correctly, then second app launch) does never match the one entered before on my test device.

Possible wrong location of the PinActionBarActivity

I tried to add the PinActionBarActivity to my MainActivity, but Android Studio can't seem to find it... I only have PinActivity and PinFragmentActivity. I think the PinActionBarActivity belongs in the main lib folder rather than in views...

Thanks!

"typeface" conflicts with support libraries

use of the "app:typeface" attribute for custom views is clashing with other libraries who use the same attribute name.

This is a known issue with the platform and with the build tools that these clashes cause issues. The recommended fix is that libraries prefix their attribute names with initials to avoid collisions, e.g. "app:lp_typeface"

example here: rengwuxian/MaterialEditText#122

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.