From 6117fc0f99d7b8dd89699083b2a02b91c119d569 Mon Sep 17 00:00:00 2001 From: Javier Varona Date: Thu, 26 Jul 2018 22:58:12 -0400 Subject: [PATCH] - Added Pocket Security Functionality (still in progress...) --- app/build.gradle | 3 + app/src/main/AndroidManifest.xml | 24 ++++ .../activities/IntroActivity.java | 1 + .../activities/PocketRequestActivity.java | 130 ++++++++++++++++++ .../activities/SettingsActivity.java | 14 +- .../application/CrystalSecurityMonitor.java | 25 ++++ .../fragments/SecuritySettingsFragment.java | 120 ++++++++++++++++ .../crystalwallet/models/GeneralSetting.java | 2 + .../crystalwallet/util/yubikey/Algorithm.java | 58 ++++++++ .../crystalwallet/util/yubikey/OathType.java | 16 +++ .../res/layout/activity_pocket_request.xml | 18 +++ .../res/layout/fragment_security_settings.xml | 9 +- app/src/main/res/xml/tech.xml | 13 ++ build.gradle | 2 + 14 files changed, 429 insertions(+), 6 deletions(-) create mode 100644 app/src/main/java/cy/agorise/crystalwallet/activities/PocketRequestActivity.java create mode 100644 app/src/main/java/cy/agorise/crystalwallet/util/yubikey/Algorithm.java create mode 100644 app/src/main/java/cy/agorise/crystalwallet/util/yubikey/OathType.java create mode 100644 app/src/main/res/layout/activity_pocket_request.xml create mode 100644 app/src/main/res/xml/tech.xml diff --git a/app/build.gradle b/app/build.gradle index aab91fa..af4f2be 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' android { compileSdkVersion 27 @@ -79,4 +80,6 @@ dependencies { implementation 'id.zelory:compressor:2.1.0' implementation 'com.vincent.filepicker:MultiTypeFilePicker:1.0.7' implementation 'com.andrognito.patternlockview:patternlockview:1.0.0' + implementation 'commons-codec:commons-codec:1.11' + } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6aed77d..0563193 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,6 +6,7 @@ + + + + + + + + + + @@ -60,6 +76,14 @@ android:name=".activities.SettingsActivity" android:theme="@style/AppTheme.NoActionBar" android:windowSoftInputMode="adjustPan"> + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_security_settings.xml b/app/src/main/res/layout/fragment_security_settings.xml index d3ae66f..c24b050 100644 --- a/app/src/main/res/layout/fragment_security_settings.xml +++ b/app/src/main/res/layout/fragment_security_settings.xml @@ -68,7 +68,7 @@ android:layout_width="match_parent" android:layout_height="140dp" android:background="@color/lightGray" - android:visibility="gone" + android:visibility="visible" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> @@ -102,15 +102,14 @@ android:text="@string/user_name_password_placeholder" app:layout_constraintTop_toBottomOf="@id/tvPocketSecurity" app:layout_constraintStart_toStartOf="@id/tvPocketSecurity"/> - + \ No newline at end of file diff --git a/app/src/main/res/xml/tech.xml b/app/src/main/res/xml/tech.xml new file mode 100644 index 0000000..c0e872f --- /dev/null +++ b/app/src/main/res/xml/tech.xml @@ -0,0 +1,13 @@ + + + + android.nfc.tech.MifareUltralight + android.nfc.tech.Ndef + android.nfc.tech.NfcA + + + android.nfc.tech.MifareClassic + android.nfc.tech.Ndef + android.nfc.tech.NfcA + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 217e861..ea873b3 100644 --- a/build.gradle +++ b/build.gradle @@ -5,9 +5,11 @@ buildscript { jcenter() google() } + ext.kotlin_version = '1.2.51' dependencies { classpath 'com.android.tools.build:gradle:3.1.3' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }