aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidevinavil <davidevinavil@gmail.com>2017-01-13 02:06:08 +0100
committerdavidevinavil <davidevinavil@gmail.com>2017-01-14 16:19:58 +0100
commit9de7deb166d1f785daa2e3e5945b2df662bd70ac (patch)
tree3fc0ffabe5256453e242d41cdc9dc727233f4baa
parent8ca30a0f4d27f77651489076970c26d56f90c854 (diff)
add ifaa source
Change-Id: I4a09f809df6234dc190ec20094ea60a814fa3c56
-rw-r--r--org.ifaa.android.manager/Android.mk26
-rw-r--r--org.ifaa.android.manager/src/org/ifaa/android/manager/IFAAManager.java23
-rw-r--r--org.ifaa.android.manager/src/org/ifaa/android/manager/IFAAManagerFactory.java64
3 files changed, 113 insertions, 0 deletions
diff --git a/org.ifaa.android.manager/Android.mk b/org.ifaa.android.manager/Android.mk
new file mode 100644
index 0000000..5818bb7
--- /dev/null
+++ b/org.ifaa.android.manager/Android.mk
@@ -0,0 +1,26 @@
+#
+# Copyright (C) 2016 The CyanogenMod Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_MODULE := org.ifaa.android.manager
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_JAVA_LIBRARY)
diff --git a/org.ifaa.android.manager/src/org/ifaa/android/manager/IFAAManager.java b/org.ifaa.android.manager/src/org/ifaa/android/manager/IFAAManager.java
new file mode 100644
index 0000000..5a945c3
--- /dev/null
+++ b/org.ifaa.android.manager/src/org/ifaa/android/manager/IFAAManager.java
@@ -0,0 +1,23 @@
+package org.ifaa.android.manager;
+
+import android.content.Context;
+import android.hardware.fingerprint.FingerprintManager;
+import android.os.Build;
+
+public abstract class IFAAManager
+{
+ static
+ {
+ System.loadLibrary("ifaa_jni");
+ }
+
+ public abstract String getDeviceModel();
+
+ public abstract int getSupportBIOTypes(Context paramContext);
+
+ public abstract int getVersion();
+
+ public native byte[] processCmd(Context paramContext, byte[] paramArrayOfByte);
+
+ public abstract int startBIOManager(Context paramContext, int paramInt);
+}
diff --git a/org.ifaa.android.manager/src/org/ifaa/android/manager/IFAAManagerFactory.java b/org.ifaa.android.manager/src/org/ifaa/android/manager/IFAAManagerFactory.java
new file mode 100644
index 0000000..a747b13
--- /dev/null
+++ b/org.ifaa.android.manager/src/org/ifaa/android/manager/IFAAManagerFactory.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2016 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.ifaa.android.manager;
+
+import android.content.ActivityNotFoundException;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+
+public class IFAAManagerFactory extends IFAAManager {
+ private static final int ACTIVITY_START_FAILED = -1;
+ private static final int ACTIVITY_START_SUCCESS = 0;
+ private static final int BIOTypeFingerprint = 1;
+ private static final int BIOTypeIris = 2;
+ private static final String TAG = "IFAAManagerFactory";
+ public static IFAAManagerFactory mIFAAManagerFactory = null;
+
+ public int getSupportBIOTypes(Context context) {
+ return BIOTypeFingerprint;
+ }
+
+ public int startBIOManager(Context context, int authType) {
+ try {
+ Intent intent = new Intent();
+ intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
+ intent.setComponent(new ComponentName("com.android.settings", "com.android.settings.Settings$SecuritySettingsActivity"));
+ context.startActivity(intent);
+ } catch (ActivityNotFoundException e) {
+ e.printStackTrace();
+ } catch (Throwable th) {
+ }
+ return ACTIVITY_START_SUCCESS;
+ }
+
+ public String getDeviceModel() {
+ return "ZUK-Z2131";
+ }
+
+ public int getVersion() {
+ return BIOTypeFingerprint;
+ }
+
+ public static IFAAManager getIFAAManager(Context context, int authType) {
+ if (mIFAAManagerFactory != null) {
+ return mIFAAManagerFactory;
+ }
+ mIFAAManagerFactory = new IFAAManagerFactory();
+ return mIFAAManagerFactory;
+ }
+}