Skip to content
Snippets Groups Projects
Commit 2e5ac943 authored by Janik Besendorf's avatar Janik Besendorf
Browse files

Includes BiometricsAPI

parent 7f5db258
No related branches found
No related tags found
No related merge requests found
......@@ -29,10 +29,10 @@ android {
}
dependencies {
implementation 'androidx.biometric:biometric:1.0.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
......
......@@ -19,8 +19,12 @@
</activity>
</application>
<uses-feature android:name="android.hardware.fingerprint"
android:required="false"
/>
<uses-feature android:name="android.hardware.biometrics"
android:required="false"/>
<!--Required so Google Play won't prevent app installation when a fingerprint sensor isn't present-->
<uses-permission
android:name="android.permission.USE_FINGERPRINT" />
android:name="android.permission.USE_FINGERPRINT"/>
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
</manifest>
\ No newline at end of file
......@@ -20,6 +20,8 @@
package com.besendorf.androidsecurityscanner;
import android.annotation.SuppressLint;
import androidx.biometric.BiometricManager;
//import androidx.biometric.BiometricPrompt;
import android.hardware.fingerprint.FingerprintManager;
import android.os.Build;
import android.os.Bundle;
......@@ -44,6 +46,8 @@ import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import javax.crypto.KeyGenerator;
import static android.hardware.biometrics.BiometricManager.Authenticators.BIOMETRIC_STRONG;
public class MainActivity extends AppCompatActivity {
private TextView reportTextView;
......@@ -77,6 +81,7 @@ public class MainActivity extends AppCompatActivity {
json.put("ro.boot.veritymode",getProp("ro.boot.veritymode")); //unklar
json.put("KeyStore",keyStorePresence());
json.put("Strongbox", isStrongbox());
json.put("FingerprintQuality", fingerprintQuality());
} catch (JSONException e) {
e.printStackTrace();
}
......@@ -99,6 +104,16 @@ public class MainActivity extends AppCompatActivity {
}
return false;
}
private String fingerprintQuality(){
if (BiometricManager.from(this).canAuthenticate(BIOMETRIC_STRONG))
return "STRONG";
if (BiometricManager.from(this).canAuthenticate(BIOMETRIC_WEAK))
return "WEAK";
if (BiometricManager.from(this).canAuthenticate(BIOMETRIC_CREDENTIAL))
return "CREDENTIAL";
return null;
}
private boolean keyStorePresence(){
// to check for KeyStore presence we try to get an Instance of KeyStore and if we get the Exception we return false
......
......@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath 'com.android.tools.build:gradle:4.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
......
#Tue Nov 03 16:27:54 CET 2020
#Tue Jan 19 20:33:34 CET 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment