From 0aa675041c5650e327f9243ba18cbb5b8aa90a46 Mon Sep 17 00:00:00 2001 From: Reuben Mangubat Date: Fri, 29 Jan 2021 17:10:22 +0800 Subject: [PATCH] Change minSDK Version to 21 (Android 5) instead of 26 (Android 8) --- app/build.gradle | 6 +++--- .../org/idpass/smartscanner/result/IDPassResultActivity.kt | 6 ------ .../org/idpass/smartscanner/lib/SmartScannerActivity.kt | 2 +- .../org/idpass/smartscanner/lib/idpasslite/IDPassManager.kt | 6 +++--- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0b786beb..90186752 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,7 +14,7 @@ android { defaultConfig { applicationId "org.idpass.smartscanner" - minSdkVersion 26 + minSdkVersion 21 targetSdkVersion 30 versionName androidGitVersion.name() versionCode androidGitVersion.code() @@ -76,8 +76,8 @@ dependencies { // ID PASS Smart Scanner implementation project(path: ':core-lib') //ID PASS lite - implementation project(path: ':idpass-lite') - implementation 'com.google.protobuf:protobuf-lite:3.0.1' + implementation 'com.google.protobuf:protobuf-lite:3.0.0' + implementation 'org.idpass:idpass-lite-java-android:0.1@aar' // SmartScanner API Intent Call Out implementation project(path: ':smartscanner-android-api') } \ No newline at end of file diff --git a/app/src/main/java/org/idpass/smartscanner/result/IDPassResultActivity.kt b/app/src/main/java/org/idpass/smartscanner/result/IDPassResultActivity.kt index 8183f761..cda30322 100755 --- a/app/src/main/java/org/idpass/smartscanner/result/IDPassResultActivity.kt +++ b/app/src/main/java/org/idpass/smartscanner/result/IDPassResultActivity.kt @@ -30,7 +30,6 @@ import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.Toolbar import org.idpass.lite.Card -import org.idpass.lite.android.IDPassLite import org.idpass.lite.exceptions.CardVerificationException import org.idpass.lite.exceptions.InvalidCardException import org.idpass.lite.exceptions.InvalidKeyException @@ -69,11 +68,6 @@ class IDPassResultActivity : AppCompatActivity(), View.OnClickListener { supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setHomeButtonEnabled(true) supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_close) - // load ID Pass Lite models - val loaded = IDPassLite.loadModels(cacheDir, assets) - if (!loaded) { - Log.d("${SmartScannerActivity.TAG}/SmartScanner", "ID PASS Lite: Load models Failure") - } // Display ID PASS Lite Result intent.getByteArrayExtra(RESULT)?.let { displayResult(it) diff --git a/core-lib/src/main/java/org/idpass/smartscanner/lib/SmartScannerActivity.kt b/core-lib/src/main/java/org/idpass/smartscanner/lib/SmartScannerActivity.kt index 872afeb6..3c356bbc 100644 --- a/core-lib/src/main/java/org/idpass/smartscanner/lib/SmartScannerActivity.kt +++ b/core-lib/src/main/java/org/idpass/smartscanner/lib/SmartScannerActivity.kt @@ -192,7 +192,7 @@ class SmartScannerActivity : BaseActivity(), OnClickListener { ) } if (mode == Modes.IDPASS_LITE.value) { - val loaded = IDPassLite.loadModels(cacheDir, assets) + val loaded = IDPassLite.initialize(cacheDir, assets) if (!loaded) Log.d("${TAG}/SmartScanner", "ID PASS Lite: Load models Failure") analyzer = IDPassLiteAnalyzer( activity = this, diff --git a/core-lib/src/main/java/org/idpass/smartscanner/lib/idpasslite/IDPassManager.kt b/core-lib/src/main/java/org/idpass/smartscanner/lib/idpasslite/IDPassManager.kt index 7e54d876..3e7b5343 100644 --- a/core-lib/src/main/java/org/idpass/smartscanner/lib/idpasslite/IDPassManager.kt +++ b/core-lib/src/main/java/org/idpass/smartscanner/lib/idpasslite/IDPassManager.kt @@ -26,7 +26,7 @@ import org.api.proto.Certificates import org.api.proto.KeySet import org.idpass.lite.Card import org.idpass.lite.IDPassReader -import org.idpass.lite.android.IDPassLite +import org.idpass.lite.android.IDPassLiteHelper import org.idpass.lite.exceptions.CardVerificationException import org.idpass.lite.exceptions.InvalidCardException import org.idpass.lite.exceptions.InvalidKeyException @@ -40,8 +40,8 @@ object IDPassManager { fun getIDPassReader(): IDPassReader { // Initialize needed ks and rootcert from demo key values - val keysetbuf = IDPassLite.generateAndroidKeyset() - val rootcertbuf = IDPassLite.generateAndroidRootcert() + val keysetbuf = IDPassLiteHelper.generateAndroidKeyset() + val rootcertbuf = IDPassLiteHelper.generateAndroidRootcert() val ks = KeySet.parseFrom(keysetbuf) val rootcert = Certificates.parseFrom(rootcertbuf) // Initialize reader with ks and rootcert