diff --git a/README.MD b/README.MD index 5e0e1a0..86dcf46 100644 --- a/README.MD +++ b/README.MD @@ -54,7 +54,7 @@ yourself ;) Add this library to your gradle config ```groovy -implementation 'com.redmadrobot:pinkman:1.0.1' +implementation 'com.redmadrobot:pinkman:1.0.2' ``` Create an instance of the `Pinkman` class (use a DI please) and diff --git a/pinkman/library.properties b/pinkman/library.properties index e57c6c5..8c968fa 100644 --- a/pinkman/library.properties +++ b/pinkman/library.properties @@ -1,5 +1,5 @@ lib_name=pinkman -lib_version=1.0.1 +lib_version=1.0.2 lib_description=PINkman is a library to help implementing an authentication by a PIN code in a secure manner lib_vcs=https://github.com/RedMadRobot/PINkman.git lib_issue_tracker=https://github.com/RedMadRobot/PINkman/issues diff --git a/pinkman/src/main/java/com/redmadrobot/pinkman/Pinkman.kt b/pinkman/src/main/java/com/redmadrobot/pinkman/Pinkman.kt index c934e84..80b5284 100644 --- a/pinkman/src/main/java/com/redmadrobot/pinkman/Pinkman.kt +++ b/pinkman/src/main/java/com/redmadrobot/pinkman/Pinkman.kt @@ -1,6 +1,7 @@ package com.redmadrobot.pinkman import android.content.Context +import android.content.pm.PackageManager import android.os.Build import android.security.keystore.KeyGenParameterSpec import android.security.keystore.KeyProperties.* @@ -37,7 +38,12 @@ class Pinkman( .apply { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { setUnlockedDeviceRequired(true) - setIsStrongBoxBacked(true) + + val hasStrongBox = applicationContext + .packageManager + .hasSystemFeature(PackageManager.FEATURE_STRONGBOX_KEYSTORE) + + setIsStrongBoxBacked(hasStrongBox) } }.build()