android / security-samples Goto Github PK
View Code? Open in Web Editor NEWMultiple samples showing the best practices in security APIs on Android.
License: Apache License 2.0
Multiple samples showing the best practices in security APIs on Android.
License: Apache License 2.0
STEPS TO REPRODUCE:
EXPECTED RESULTS:
As above description 3.1
OBSERVED RESULTS:
As above description 3.2
Work FINE:
Asus Zenfone6: Android 10
Google Pixel 3: Android 11
NG:
HTC U11: Android 9
OPPO A3: Android 8.0.1
Samsung A8+: Android 9
Asus Zenfone3: Android 8
More detail from Logcat:
2020-08-04 11:47:07.131 413-413/? E/Fido: [FingerprintUiHelper] Fingerprint authentication is not available
2020-08-04 11:47:07.132 413-413/? D/AndroidRuntime: Shutting down VM
2020-08-04 11:47:07.143 413-413/? I/GCore-Chimera-Crash: ChgKB2Fkc19mZHIQuL23ChiBAiCA56-OrwYKUwoJY29udGFpbm
VyEPjQzmAYQCCQopP_-zoqA3BheSoOdmlzaW9uLmJhcmNvZGUq
C3Zpc2lvbi5mYWNlKgp2aXNpb24uaWNhKgp2aXNpb24ub2NyCh
oKBm5lYXJieRCDx8HHBxiBAiCQibnToKzNAyAA
GCore-Chimera-Crash
2020-08-04 11:47:07.143 413-418/? I/art: Do partial code cache collection, code=59KB, data=61KB
2020-08-04 11:47:07.144 413-418/? I/art: After code cache collection, code=49KB, data=48KB
2020-08-04 11:47:07.144 413-418/? I/art: Increasing code cache capacity to 256KB
2020-08-04 11:47:07.146 413-413/? I/DeviceDrDatabaseHelper: Cleaning stale data from database!
2020-08-04 11:47:07.161 413-413/? W/DeviceDoctorHandler: Crash Hash: cd892641a62411098665ad95ac93c7c604ec07a8
2020-08-04 11:47:07.169 413-413/? W/DeviceDoctorHandler: Shushing crash.
2020-08-04 11:47:07.169 413-413/? E/DeviceDoctorHandler: FATAL EXCEPTION: main
Process: com.google.android.gms.ui, PID: 413
java.lang.IllegalStateException: Fragment already added: TmpXDialogFragmentProxy{b13b127} (3c415164-0f37-4294-957c-feb8a1738651) fragment_fingerprint_or_lock_screen}
at en.a(:com.google.android.gms@[email protected] (040400-320008519):3)
at eh.f(:com.google.android.gms@[email protected] (040400-320008519):1)
at eh.a(:com.google.android.gms@[email protected] (040400-320008519):65)
at eh.a(:com.google.android.gms@[email protected] (040400-320008519):9)
at eh.a(:com.google.android.gms@[email protected] (040400-320008519):263)
at ea.run(:com.google.android.gms@[email protected] (040400-320008519):0)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Issue by br00
Wednesday Oct 12, 2016 at 07:50 GMT
Originally opened as googlearchive/android-FingerprintDialog#39
Hi,
To make it crash do this:
The issue is that are missing some checks when you call dismiss()
@OverRide
public void onAuthenticated() {
// Callback from FingerprintUiHelper. Let the activity know that authentication was
// successful.
mActivity.onPurchased(true /* withFingerprint */, mCryptoObject);
dismiss();
}
I suggest to put
Activity anActivity = getActivity();
if (getDialog() != null && getDialog().isShowing() && isResumed() && anActivity != null && !anActivity.isFinishing()) {
dismiss();
}
or you can use dismissAllowingStateLoss()
Issue by fandango-
Monday Jan 29, 2018 at 16:56 GMT
Originally opened as google/android-key-attestation#2
Previously, the first certificate was not being verified in the loop
fandango- included the following code: https://github.com/google/android-key-attestation/pull/2/commits
Issue by zolbayars
Friday Jun 09, 2017 at 08:37 GMT
Originally opened as googlearchive/android-FingerprintDialog#47
The app is throwing an IllegalStateException on following physical devices with registered fingerprints:
I tried these without success:
What should I do?
Stacktrace:
06-09 16:24:59.682 6873-6873/com.example.android.fingerprintdialog E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.android.fingerprintdialog, PID: 6873
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.fingerprintdialog/com.example.android.fingerprintdialog.MainActivity}: 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.performLaunchActivity(ActivityThread.java:3319)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
at android.app.ActivityThread.access$1100(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7331)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
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.example.android.fingerprintdialog.MainActivity.createKey(MainActivity.java:269)
at com.example.android.fingerprintdialog.MainActivity.onCreate(MainActivity.java:152)
at android.app.Activity.performCreate(Activity.java:6904)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
at android.app.ActivityThread.access$1100(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7331)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
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.example.android.fingerprintdialog.MainActivity.createKey(MainActivity.java:265)
at com.example.android.fingerprintdialog.MainActivity.onCreate(MainActivity.java:152)
at android.app.Activity.performCreate(Activity.java:6904)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
at android.app.ActivityThread.access$1100(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7331)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
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.example.android.fingerprintdialog.MainActivity.createKey(MainActivity.java:265)
at com.example.android.fingerprintdialog.MainActivity.onCreate(MainActivity.java:152)
at android.app.Activity.performCreate(Activity.java:6904)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
at android.app.ActivityThread.access$1100(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7331)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Issue by sairajkishore
Monday Aug 07, 2017 at 21:53 GMT
Originally opened as googlearchive/android-FingerprintDialog#50
java.lang.IllegalStateException: Binder has been finalized!
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:628)
at android.security.IKeystoreService$Stub$Proxy.abort(IKeystoreService.java:1387)
at android.security.KeyStore.abort(KeyStore.java:879)
at android.security.keystore.AndroidKeyStoreCipherSpiBase.finalize(AndroidKeyStoreCipherSpiBase.java:744)
at android.security.keystore.AndroidKeyStoreUnauthenticatedAESCipherSpi$CBC$PKCS7Padding.finalize(AndroidKeyStoreUnauthenticatedAESCipherSpi.java)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:222)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:209)
at java.lang.Thread.run(Thread.java:762)
Issue by moisesvs
Friday Dec 11, 2015 at 10:36 GMT
Originally opened as googlearchive/android-FingerprintDialog#23
I am checking the source code of the fingerprintDialog and I saw the method checkPassword in the FingerprintAuthenticationDialogFragment class but this method isn't working because only checked if the password isn't empty and nothing else.
My question is: This method should check the pin code of the phone, no?
Regards
Issue by debbiefu
Tuesday Jul 12, 2016 at 08:06 GMT
Originally opened as googlearchive/android-DirectBoot#7
07-12 03:24:22.197 492 526 E Parcel : Class not found when unmarshalling: com.example.android.directboot.alarms.Alarm
07-12 03:24:22.197 492 526 E Parcel : java.lang.ClassNotFoundException: com.example.android.directboot.alarms.Alarm
07-12 03:24:22.197 492 526 E Parcel : at java.lang.Class.classForName(Native Method)
07-12 03:24:22.197 492 526 E Parcel : at java.lang.Class.forName(Class.java:400)
07-12 03:24:22.197 492 526 E Parcel : at android.os.Parcel.readParcelableCreator(Parcel.java:2490)
07-12 03:24:22.197 492 526 E Parcel : at android.os.Parcel.readParcelable(Parcel.java:2444)
07-12 03:24:22.197 492 526 E Parcel : at android.os.Parcel.readValue(Parcel.java:2347)
07-12 03:24:22.197 492 526 E Parcel : at android.os.Parcel.readArrayMapInternal(Parcel.java:2700)
07-12 03:24:22.197 492 526 E Parcel : at android.os.BaseBundle.unparcel(BaseBundle.java:269)
07-12 03:24:22.197 492 526 E Parcel : at android.os.Bundle.putAll(Bundle.java:226)
07-12 03:24:22.197 492 526 E Parcel : at android.content.Intent.fillIn(Intent.java:8171)
07-12 03:24:22.197 492 526 E Parcel : at com.android.server.am.PendingIntentRecord.sendInner(PendingIntentRecord.java:240)
07-12 03:24:22.197 492 526 E Parcel : at com.android.server.am.PendingIntentRecord.sendWithResult(PendingIntentRecord.java:209)
07-12 03:24:22.197 492 526 E Parcel : at com.android.server.am.ActivityManagerService.sendIntentSender(ActivityManagerService.java:7084)
07-12 03:24:22.197 492 526 E Parcel : at android.app.PendingIntent.send(PendingIntent.java:806)
07-12 03:24:22.197 492 526 E Parcel : at com.android.server.AlarmManagerService$DeliveryTracker.deliverLocked(AlarmManagerService.java:2984)
07-12 03:24:22.197 492 526 E Parcel : at com.android.server.AlarmManagerService.deliverAlarmsLocked(AlarmManagerService.java:2424)
07-12 03:24:22.197 492 526 E Parcel : at com.android.server.AlarmManagerService$AlarmThread.run(AlarmManagerService.java:2543)
07-12 03:24:22.197 492 526 E Parcel : Caused by: java.lang.ClassNotFoundException: com.example.android.directboot.alarms.Alarm
07-12 03:24:22.197 492 526 E Parcel : at java.lang.Class.classForName(Native Method)
07-12 03:24:22.197 492 526 E Parcel : at java.lang.BootClassLoader.findClass(ClassLoader.java:1346)
07-12 03:24:22.197 492 526 E Parcel : at java.lang.BootClassLoader.loadClass(ClassLoader.java:1406)
07-12 03:24:22.197 492 526 E Parcel : at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
07-12 03:24:22.197 492 526 E Parcel : ... 16 more
07-12 03:24:22.197 492 526 E Parcel : Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
--------- beginning of crash
07-12 03:24:22.204 3178 3215 E AndroidRuntime: FATAL EXCEPTION: IntentService[com.example.android.directboot.alarms.AlarmIntentService]
07-12 03:24:22.204 3178 3215 E AndroidRuntime: Process: com.example.android.directboot, PID: 3178
07-12 03:24:22.204 3178 3215 E AndroidRuntime: java.lang.NullPointerException: Attempt to read from field 'int com.example.android.directboot.alarms.Alarm.hour' on a null object reference
07-12 03:24:22.204 3178 3215 E AndroidRuntime: at com.example.android.directboot.alarms.AlarmIntentService.onHandleIntent(AlarmIntentService.java:54)
07-12 03:24:22.204 3178 3215 E AndroidRuntime: at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:67)
07-12 03:24:22.204 3178 3215 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
07-12 03:24:22.204 3178 3215 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
07-12 03:24:22.204 3178 3215 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:61)
Issue by Mohammad2416
Monday Dec 17, 2018 at 08:02 GMT
Originally opened as googlearchive/android-FingerprintDialog#53
change compile
with implementation
change to api 28
and fix google()
Mohammad2416 included the following code: https://github.com/googlesamples/android-FingerprintDialog/pull/53/commits
Issue by biomassives
Wednesday Jul 12, 2017 at 06:00 GMT
Originally opened as googlearchive/android-DirectBoot#9
biomassives included the following code: https://github.com/googlesamples/android-DirectBoot/pull/9/commits
Issue by andris95
Thursday Mar 16, 2017 at 08:16 GMT
Originally opened as googlearchive/android-FingerprintDialog#45
Hello! In this sample project there is comment like this:
Now the protection level of USE_FINGERPRINT permission is normal instead of dangerous.
But it is not true, in my project I am using compilseSdkVersion and targetSdkVersion 25.0.2.
And for example, to check if the device has a fingerprint sensor, i call this method:
if (!mFingerprintManager.isHardwareDetected())
and it says
if (!mFingerprintManager.isHardwareDetected())
Issue by AndroidDeveloperLB
Tuesday Aug 02, 2016 at 05:27 GMT
Originally opened as googlearchive/android-FingerprintDialog#34
I do have a fingerprint scanner on my Nexus 5x.
I just didn't set my lock screen to use it.
Why can't I have a fingerprint set for use on apps, yet not on the lock screen?
Issue by AkashMen10
Thursday Apr 21, 2016 at 12:15 GMT
Originally opened as googlearchive/android-FingerprintDialog#27
Build failed with below error:
Error:(43, 9) error: cannot find symbol method library()
Error:(44, 9) error: cannot find symbol method injects()
Error:(44, 19) error: illegal initializer for
Error:Execution failed for task ':compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Issue by fkirc
Thursday Jul 18, 2019 at 11:02 GMT
Originally opened as googlearchive/android-FingerprintDialog#58
To make it easier for the newcomers:
This library is deprecated since the release of the androidx library for the BiometricPrompt
API.
If you want to combine the BiometricPrompt API with a symmetric key,
then you can have a look at this fully functional Kotlin implementation:
https://github.com/fkirc/secure-zip-notes/
Issue by jiazhao2048
Monday Sep 05, 2016 at 10:12 GMT
Originally opened as googlearchive/android-FingerprintDialog#35
Hi, I test this app on Nexus5x and Samsung s6. It both fail to detect that a new fingerprint is enrolled.
What I was do:
It works out of expect and the new fingerprint also "purchase" successfully.
If the app is designed to work like this.So, how can I detect the change of fingerprint catalog? I need the user to re-input the password when the fingerprint cataglog is changed because of the security requirement.
Glad to see your reply soon. Thanks!
---can be deleted---
Useless summary for the curious:
I was wondering how to remove registered WebAuthn accounts. It turns out they can be overwritten by the software, or they can be removed by removing the fingerprints/screen lock. I merely got confused by the software I used (didn't actually delete the account server-side, so re-registering didn't work).
---can be deleted---
Issue by Lyonshare
Thursday Jun 14, 2018 at 21:45 GMT
Originally opened as googlearchive/android-FingerprintDialog#52
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':Application:javaPreCompileDebug'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor. Please add them to the annotationProcessor configuration.
Issue by Anushak5248
Tuesday Jun 16, 2015 at 08:11 GMT
Originally opened as googlearchive/android-FingerprintDialog#5
Hi,
I want to know about the biometric fingerprint so, when Im run this application Im unable to install. It shows me below error
pkg: /data/local/tmp/com.example.android.fingerprintdialog
Failure [INSTALL_FAILED_OLDER_SDK]
Even I have changed build .gradle file
compileSdkVersion "android-MNC"
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 15
maxSdkVersion 17
versionCode 1
versionName "1.0"
}
I want to check the functionality but im unable to get apk file
Please help me on this
Issue by AndroidDeveloperLB
Saturday Nov 07, 2015 at 23:38 GMT
Originally opened as googlearchive/android-FingerprintDialog#20
For example, if finger 1 is scanned do something, and if finger 2 is scanned, do something else?
Readme says FIDO can only run on API 26 an above, but the sample is setting minSdkVersion to 15.
Issue by divegeek
Wednesday Feb 01, 2017 at 06:42 GMT
Originally opened as google/android-key-attestation#1
divegeek included the following code: https://github.com/google/android-key-attestation/pull/1/commits
Issue by repitch
Thursday Nov 03, 2016 at 09:09 GMT
Originally opened as googlearchive/android-FingerprintDialog#41
Problem appears only on some devices:
Location:
MainActivity#initCipher(Cipher cipher, String keyName)
line 165
when calling cipher.init(Cipher.ENCRYPT_MODE, key);
i got android.security.keystore.UserNotAuthenticatedException: User not authenticated
Issue by doffi88
Tuesday Nov 08, 2016 at 09:38 GMT
Originally opened as googlearchive/android-FingerprintDialog#42
hy guys, sorry for my english , I have this problem when I close authentication dialog and app go in background
D/AbstractTracker: Event success
E/System: Uncaught exception thrown by finalizer
E/System: java.lang.IllegalStateException: Binder has been finalized!
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:536)
at android.security.IKeystoreService$Stub$Proxy.abort(IKeystoreService.java:1302)
at android.security.KeyStore.abort(KeyStore.java:496)
at android.security.keystore.AndroidKeyStoreCipherSpiBase.finalize(AndroidKeyStoreCipherSpiBase.java:680)
at android.security.keystore.AndroidKeyStoreUnauthenticatedAESCipherSpi$CBC$PKCS7Padding.finalize(AndroidKeyStoreUnauthenticatedAESCipherSpi.java:73)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:219)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:197)
at java.lang.Thread.run(Thread.java:818)
how can I resolve this issue?
thanks in advance
Issue by ruscles
Monday Jul 03, 2017 at 14:18 GMT
Originally opened as googlearchive/android-FingerprintDialog#48
Hi,
I have an app that is developed to run inside the Android Enterprise container (for corporate devices). The fingerprint authentication from this sample works perfectly when the app is installed outside the enterprise container. However, when the app is running inside the container, it is unable to detect any fingerprints that the user registered outside the container (on the normal device).
It fails at this piece (line 137 of MainActivity):
if (!fingerprintManager.hasEnrolledFingerprints()) {
// User hasn't enrolled any fingerprints to authenticate with
Toast.makeText(this, "Go to 'Settings -> Security -> Fingerprint' and register at least one fingerprint", Toast.LENGTH_LONG).show();
return;
}
Is there a way to detect registered fingerprints outside the Enterprise container from an app that is running inside the container? I have tested this on an S7, S8, and Pixel. Thanks!
Hi
Is there a solution to backup and restore the encrypted file ans hared pref
Thank you
The getRegisterIntent and getSignIntent methods are deprecated in com.google.android.gms:play-services-fido:18.1.0. So I think it is better to update this FIDO sample application.
Release Note
https://developers.google.com/android/guides/releases
Fido2ApiClient
https://developers.google.com/android/reference/com/google/android/gms/fido/fido2/Fido2ApiClient
Issue by TheNephilim88
Monday Nov 30, 2015 at 20:18 GMT
Originally opened as googlearchive/android-FingerprintDialog#21
The initCipher()-method checks if lockscreen has been disabled or new fingerprints have been enrolled.
For this it checks if a KeyPermanentlyInvalidatedException will be thrown or not. If it wil lbe thrown, any of above reasons apply.
But this does not seem to trigger all the time. It only triggers randomly on my device (Nexus 5X) after adding new fingerprints.
Most of the time I get normal fingerprint-authentication dialog and it works as nothing has been changed. Only very few times I get "A new fingerprint was added to this device"-message to reauthenticate.
Can anyone tell me why this is not triggering all the time when new fingerprints have been enrolled? Is this a bug or a feature? :D
Is it possible to check for fingerprint-changes in another way?
Issue by zrtian
Wednesday Dec 21, 2016 at 07:55 GMT
Originally opened as googlearchive/android-FingerprintDialog#43
Can realize the function of fingerprint puncher
Issue by alex-townsend
Tuesday May 24, 2016 at 19:11 GMT
Originally opened as googlearchive/android-FingerprintDialog#30
The dialog fragment for the fingerprint authentication does not survive rotation, despite having setRetainInstanceState(true) set. This appears to be because the CancellationSignal does not emit the cancellation before the dialog fragment is recreated and resumed again -- mSelfCancelled = false then, causing mCallback.onError() to be called and to close the newly created dialog fragment to be dismissed.
Flow looks something like this (user selects Purchase to start):
So it looks like the cancellation is not sent quickly enough on a rotation, causing the fragment created after the rotation to receive that cancellation message, which then closes the dialog fragment.
Issue by DimaArts
Tuesday Nov 01, 2016 at 09:03 GMT
Originally opened as googlearchive/android-FingerprintDialog#40
On samsung galaxy note 4 i have an registered fingerprint, but the app does not see it. Maybe samsung supports only their API.
Issue by psikosen
Friday Jul 22, 2016 at 00:11 GMT
Originally opened as googlearchive/android-FingerprintDialog#32
In the FileLocker app, a master key is generated with the function getOrCreate(..)
. I assume this generates one global key for the app.
Is this key destroyed on upgrade? On uninstall? Can we rotate it? Should we?
I'm also curious what the mechanism is to stop hackers calling this same function to get the master key?
private fun encryptFile() {
val title = binding.titleEditText.text.toString()
val body = binding.bodyEditText.text.toString()
if (title.isBlank()) return
try {
deleteFile(existingFileTitle)
val encryptedFile = getEncryptedFile(title)
encryptedFile.openFileOutput().use { output ->
output.write(body.toByteArray())
}
} catch (e: Exception) {
e.printStackTrace()
showSnackbar(R.string.error_unable_to_save_file)
}
}
should change deleteFile(existingFileTitle) to deleteFile(title )
Issue by onedaybegin
Wednesday May 16, 2018 at 09:12 GMT
Originally opened as googlearchive/android-FingerprintDialog#51
When i start the app and then complete the fingerprint verification(successed),then i close the app,then i see the log that MainActivity leaked.
Issue by jimmysuncpt
Thursday Jan 03, 2019 at 07:30 GMT
Originally opened as googlearchive/android-FingerprintDialog#54
There are crashes in some Meizu phones, such as M5 note, PRO 7 Plus and so on. The system version is Android 7.0. The log is:
java.util.concurrent.TimeoutException: android.security.keystore.AndroidKeyStoreUnauthenticatedAESCipherSpi$CBC$PKCS7Padding.finalize(AndroidKeyStoreUnauthenticatedAESCipherSpi.java) timed out after 20 seconds
at android.os.BinderProxy.transactNative(BinderProxy.java)
at android.os.BinderProxy.transact(BinderProxy.java:626)
at android.security.IKeystoreService$Stub$Proxy.abort(IKeystoreService.java:1341)
at android.security.KeyStore.abort(KeyStore.java:538)
at android.security.keystore.AndroidKeyStoreCipherSpiBase.finalize(AndroidKeyStoreCipherSpiBase.java:744)
at android.security.keystore.AndroidKeyStoreUnauthenticatedAESCipherSpi$CBC$PKCS7Padding.finalize(AndroidKeyStoreUnauthenticatedAESCipherSpi.java)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:239)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:226)
at java.lang.Thread.run(Thread.java:761)
How to fix it?
Issue by Lavanya-Kasina
Tuesday Mar 26, 2019 at 11:16 GMT
Originally opened as googlearchive/android-FingerprintDialog#56
Is there any way to authenticate with device password when no fingerprints are present.
Issue by Ghostish
Monday Aug 01, 2016 at 01:49 GMT
Originally opened as googlearchive/android-FingerprintDialog#33
I was testing the sample app at Nexux 5x emulator.
When I restart the app after rebooting the emulator, it crashed.
In android monitor it read:
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
That's so weird . I checked the return value of mFingerprintManager.hasEnrolledFingerprints()
,which was true. But the exception still was thrown during the createKey()
.
Issue by naveeniiitbsr
Tuesday Aug 01, 2017 at 13:39 GMT
Originally opened as googlearchive/android-FingerprintDialog#49
Do you have any idea about using that use password component along with fingerprint
Issue by emjei
Thursday Jul 12, 2018 at 05:50 GMT
Originally opened as googlearchive/android-DirectBoot#10
Make DirectBoot sample great again.
emjei included the following code: https://github.com/googlesamples/android-DirectBoot/pull/10/commits
Set "minifyEnabled" to true(no problem if set false) before running release apk, there would be a FC:
2020-05-18 13:10:21.228 1992-1992/com.my.app E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.my.app, PID: 1992
java.lang.ExceptionInInitializerError
at androidx.security.crypto.EncryptedSharedPreferences$PrefKeyEncryptionScheme.<clinit>(:146)
at c.c.d.f.i.g.<clinit>(:35)
at c.c.d.f.i.g.a(:110)
at c.c.d.f.f.l(:148)
at c.c.d.f.f.m(:120)
at c.c.d.f.f.a(:63)
at com.my.app.MyApp$a.a(:69)
at d.a.a.onCreate(:181)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1190)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6609)
at android.app.ActivityThread.access$1400(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1892)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:228)
at android.app.ActivityThread.main(ActivityThread.java:7589)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:953)
Caused by: java.lang.RuntimeException: Field keySize_ for c.b.c.a.g.ja not found. Known fields are [public int c.b.c.a.g.ja.g, public static final c.b.c.a.g.ja c.b.c.a.g.ja.e, public static volatile c.b.e.ea c.b.c.a.g.ja.f]
at c.b.e.Y.a(:608)
at c.b.e.Y.a(:502)
at c.b.e.Y.a(:221)
at c.b.e.N.a(:85)
at c.b.e.N.a(:71)
at c.b.e.ga.a(:93)
at c.b.e.ga.a(:107)
at com.google.protobuf.GeneratedMessageLite.l(:171)
at com.google.protobuf.GeneratedMessageLite$a.d(:391)
at com.google.protobuf.GeneratedMessageLite$a.c(:399)
at c.b.c.a.c.e.a(:45)
at c.b.c.a.c.e.<clinit>(:38)
at androidx.security.crypto.EncryptedSharedPreferences$PrefKeyEncryptionScheme.<clinit>(:146)
at c.c.d.f.i.g.<clinit>(:35)
at c.c.d.f.i.g.a(:110)
at c.c.d.f.f.l(:148)
at c.c.d.f.f.m(:120)
at c.c.d.f.f.a(:63)
at com.my.app.MyApp$a.a(:69)
at d.a.a.onCreate(:181)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1190)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6609)
at android.app.ActivityThread.access$1400(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1892)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:228)
at android.app.ActivityThread.main(ActivityThread.java:7589)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:953)
I tried:
-keep class androidx.security.crypto.** {*;}
-keep public enum androidx.security.crypto.EncryptedSharedPreferences$** {
**[] $VALUES;
public *;
}
but not working.
Issue by DirajHS
Monday Jun 13, 2016 at 09:20 GMT
Originally opened as googlearchive/android-DirectBoot#6
I am seeing this FATAL exception after boot saying:
java.lang.RuntimeException: Unable to instantiate receiver com.example.android.directboot.BootBroadcastReceiver: java.lang.ClassNotFoundException: Didn't find class "com.example.android.directboot.BootBroadcastReceiver" on path: DexPathList
BiometricPrompt.AuthenticationResult only provide following value
AUTHENTICATION_RESULT_TYPE_UNKNOWN,
AUTHENTICATION_RESULT_TYPE_DEVICE_CREDENTIAL,
AUTHENTICATION_RESULT_TYPE_BIOMETRIC
But from AUTHENTICATION_RESULT_TYPE_BIOMETRIC cant identify whether face or finger print or iris.
Usecase : my application only support finger print. Since Fingerprint only in strong authentication(class 3) now i can use, but safer side when any of other (fingerprint , iris) meet class 3 specification in future i need to show error message on success scenario.
Issue by ravi6342
Tuesday Jul 16, 2019 at 13:14 GMT
Originally opened as googlearchive/android-FingerprintDialog#57
The app is not running on the device which does't have a fingerprint sensor. The app is crashing when i try to authenticate with the password and at the same time the password entered by me is not matching the system password and is letting me in the app with any letters.
Issue by mice777
Tuesday Mar 14, 2017 at 21:24 GMT
Originally opened as googlearchive/android-FingerprintDialog#44
This sample is somehow incomplete:
I think that basic principles of AndroidKeyStore and FingerprintManager are somehow mixed to show that finger scanning works, but result is strange. All I get is "password entered or your finger recognized".
I'd expect that symetric key is created once if it's already not in keystore.
Then possibly encrypt user-entered password with the key, and save it to a file. Next time when fingerprint is used, decrypt saved encrypted password, and use it same way as if user entered it manually.
So user has choice to use fast path with finger, or slower path by typing password.
Issue by Lucashuang0802
Wednesday Jan 23, 2019 at 09:11 GMT
Originally opened as googlearchive/android-FingerprintDialog#55
Got an exception like this by using the standard approach to authenticate via fingerprint:
private void generateKey() throws Exception {
try {
keyStore = KeyStore.getInstance("AndroidKeyStore");
keyGenerator = KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore");
keyStore.load(null);
keyGenerator.init(new KeyGenParameterSpec.Builder(KEY_NAME, KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT)
.setBlockModes(KeyProperties.BLOCK_MODE_CBC)
.setUserAuthenticationRequired(true)
.setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_PKCS7)
.build());
keyGenerator.generateKey();
} catch (KeyStoreException
| NoSuchAlgorithmException
| NoSuchProviderException
| InvalidAlgorithmParameterException
| CertificateException
| IOException exc) {
exc.printStackTrace();
throw new Exception(exc);
}
}
private boolean initCipher() {
try {
cipher = Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" + KeyProperties.BLOCK_MODE_CBC + "/" + KeyProperties.ENCRYPTION_PADDING_PKCS7);
} catch (NoSuchAlgorithmException | NoSuchPaddingException e) {
throw new RuntimeException("Failed to get Cipher", e);
}
try {
keyStore.load(null);
SecretKey key = (SecretKey) keyStore.getKey(KEY_NAME, null);
cipher.init(Cipher.ENCRYPT_MODE, key);
return true;
} catch (KeyPermanentlyInvalidatedException e) {
return false;
} catch (KeyStoreException | CertificateException
| UnrecoverableKeyException | IOException
| NoSuchAlgorithmException | InvalidKeyException e) {
throw new RuntimeException("Failed to init Cipher", e);
}
}
Caused by java.security.InvalidKeyException: Only SecretKey is supported
at com.android.org.conscrypt.OpenSSLCipher.checkAndSetEncodedKey(OpenSSLCipher.java:436)
at com.android.org.conscrypt.OpenSSLCipher.engineInit(OpenSSLCipher.java:261)
at javax.crypto.Cipher.tryTransformWithProvider(Cipher.java:2668)
at javax.crypto.Cipher.tryCombinations(Cipher.java:2575)
at javax.crypto.Cipher$SpiAndProviderUpdater.updateAndGetSpiAndProvider(Cipher.java:2480)
at javax.crypto.Cipher.chooseProvider(Cipher.java:567)
at javax.crypto.Cipher.init(Cipher.java:831)
at javax.crypto.Cipher.init(Cipher.java:772)
Issue by terrancelaw93
Tuesday Sep 06, 2016 at 04:49 GMT
Originally opened as googlearchive/android-FingerprintDialog#36
Issue by BulatMukhutdinov
Monday Jul 22, 2019 at 10:01 GMT
Originally opened as googlearchive/android-FingerprintDialog#59
When dealing with AES encryption we would get KeyPermanentlyInvalidatedException if new fingerprint was added.
Is it possible to detect fingerprints enrolments with asymmetric keys (RSA)?
I have tried but no success so far
Issue by yashasvigirdhar
Tuesday Jun 06, 2017 at 07:14 GMT
Originally opened as googlearchive/android-FingerprintDialog#46
After going through the sample,
I am still curious about what is the use of passing cryptoObject
to authenticate
api of FingerprintManager
.
If we see the code here, it stores the reference to cryptoObject
in a field which it uses only at one place : to create the AuthenticationResult
when authenticatin succeeds (see here).
Also, apart from this, it uses the cryptoObject's getOpId
method to set some sessionId
that it passes to authenticate
api of IFingerprintService
.
What's this OpId
? I guess this is the thing that makes all difference, but I've no clue what it is and can't seem to find any documentation :-/
This question has been asked here, here and here but I didn't find a good answer in all the places.
Issue by kazixma
Tuesday Sep 06, 2016 at 06:33 GMT
Originally opened as googlearchive/android-DirectBoot#8
When I set alarm clock and alarm manager don't work in time that I set. It has delay about 3-10 minutes.
Hi,
I see encrypted file able to decrypt in app is fine.
I want to know, how to open the encrypted file generated in app on Windows 10 PC using same password given Android app.
Please help on it.
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.