diff --git a/CHANGELOG.md b/CHANGELOG.md index 19ea7123b53b5ca747df9207cddc387d1fc960fb..945c0018037872b93b31ae92281efe8657e0805c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to this project will be documented in this file. +## [2.2.5] - 19 Oct, 2023 + +- 🔐 Added enhanced security measures +- Added `withClientHash` method, which is mandatory if using withEntryType(AUTH) + +## [2.2.4] - 20 Sep, 2023 + +- 🔨 Horizontal and landscape orientation bug on edge cases fixed. + ## [2.2.3] - 25 Aug, 2023 - Dev base url changed to [devmyid.uz](https://devmyid.uz/). @@ -92,7 +101,7 @@ All notable changes to this project will be documented in this file. - 🔥 Added new `withOrganizationDetails(value: OrganizationDetails)` method. You can customize the SDK, for it to match your organization's brand - book. [Usage](README.md#custom-organization-details) + book. [Usage](CUSTOMIZATION.md) - 🌟 Added `comparison` value to the `MyIdResult` object on successful identification. ### Fixes @@ -109,4 +118,4 @@ All notable changes to this project will be documented in this file. ### Fixes -- 🔨 `Image's size must be lower than 1600 kb`. This bug fixed. +- 🔨 `Image's size must be lower than 1600 kb`. This bug fixed. \ No newline at end of file diff --git a/README.md b/README.md index 1f725970ff01d87cb776dde5d61ab14ea53a5ab8..69d09383fcd79213ec2c5aa246977acfaa489c8c 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ - [Changelog](CHANGELOG.md) - [Getting started](#getting-started) - - [Before you begin](#11-before-you-begin) - - [Setup MyID Android SDK](#12-setup-myid-android-sdk) - - [Permissions](#13-permissions) + - [Before you begin](#11-before-you-begin) + - [Setup MyID Android SDK](#12-setup-myid-android-sdk) + - [Permissions](#13-permissions) - [Usage](#usage) - - [Methods](#11-methods) - - [Handling callbacks](#12-handling-callbacks) + - [Methods](#11-methods) + - [Handling callbacks](#12-handling-callbacks) - [SDK error codes](#sdk-error-codes) - [UI customization](CUSTOMIZATION.md) @@ -45,7 +45,7 @@ repositories { } dependencies { - implementation("uz.myid.sdk.capture:myid-capture-sdk:2.2.3") + implementation("uz.myid.sdk.capture:myid-capture-sdk:2.2.5") } ``` @@ -81,6 +81,7 @@ class ExampleActivity : AppCompatActivity(), MyIdResultListener { ) val myIdConfig = MyIdConfig.builder(clientId = /* Your client id */) + .withClientHash(/* Your clientHash */, /* Your clientHashId */) .withPassportData(passportData) .withBirthDate(dateOfBirth) .withSdkHash(sdkHash) @@ -129,6 +130,7 @@ class ExampleActivity : AppCompatActivity(), MyIdResultListener { ) val myIdConfig = MyIdConfig.builder(clientId = /* Your client id */) + .withClientHash(/* Your clientHash */, /* Your clientHashId */) .withPassportData(passportData) .withBirthDate(dateOfBirth) .withSdkHash(sdkHash) @@ -159,6 +161,7 @@ class ExampleActivity : AppCompatActivity(), MyIdResultListener { Method | Notes | Default --- | --- | --- +`withClientHash(clientHash: String, clientHashId: String)` | Provided by MyID sales team | Mandatory, if using withEntryType(MyIdEntryType.AUTH) `withPassportData(value: String)` | Passport serial number or PINFL data | Optional `withBirthDate(value: String)` | Date of birth in. Format: `dd.MM.yyyy` | Optional `withSdkHash(value: String)` | 32 characters long string | Optional @@ -202,24 +205,24 @@ and **[ELLIPSE](images/screen04.jpg)** types. ```kotlin val myIdResultListener: MyIdResultListener = object : MyIdResultListener { - override fun onSuccess(result: MyIdResult) { - // Get face bitmap and result code + override fun onSuccess(result: MyIdResult) { + // Get face bitmap and result code - val bitmap = result.bitmap - val code = result.code - val comparison = result.comparison - } + val bitmap = result.bitmap + val code = result.code + val comparison = result.comparison + } - override fun onUserExited() { - // User left the SDK - } + override fun onUserExited() { + // User left the SDK + } - override fun onError(e: MyIdException) { - // Get error message and code: + override fun onError(e: MyIdException) { + // Get error message and code: - val message = e.message - val code = e.code - } + val message = e.message + val code = e.code + } } ``` @@ -266,4 +269,4 @@ reference. | 101 | Непредвиденная ошибка | 102 | Доступ к камере запрещен | 103 | Ошибка при получении данных с сервера -| 120 | Размытое фото обнаружено в SDK +| 120 | Размытое фото обнаружено в SDK \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 172888c7583d793a4a9ac0999979150103f0b9b2..fea732f4e89c11eafb5fdf1b774ebac288156b6c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,23 +5,19 @@ plugins { android { namespace "uz.myid.sdk.sample" - compileSdk 33 + compileSdk 34 defaultConfig { applicationId "uz.myid.sdk.sample" + targetSdk 34 minSdk 21 versionCode 1 - versionName "1.0.0" + versionName "1.0" } buildTypes { - debug { - minifyEnabled false - proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" - } release { minifyEnabled true - shrinkResources true proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" } } @@ -37,7 +33,7 @@ android { } dependencies { - implementation("com.google.android.material:material:1.9.0") + implementation("com.google.android.material:material:1.10.0") - implementation("uz.myid.sdk.capture:myid-capture-sdk:2.2.3") + implementation("uz.myid.sdk.capture:myid-capture-sdk:2.2.5") } \ No newline at end of file diff --git a/app/src/main/java/uz/myid/sdk/sample/MainActivity.kt b/app/src/main/java/uz/myid/sdk/sample/MainActivity.kt index 9d43339783d65be98c09fedc0d8060304f9d3822..d67d302848973c6a9eb5367004f4022cee7b4598 100644 --- a/app/src/main/java/uz/myid/sdk/sample/MainActivity.kt +++ b/app/src/main/java/uz/myid/sdk/sample/MainActivity.kt @@ -3,18 +3,28 @@ package uz.myid.sdk.sample import android.os.Bundle import android.widget.EditText import androidx.appcompat.app.AppCompatActivity -import uz.myid.android.sdk.capture.* -import uz.myid.android.sdk.capture.model.* +import uz.myid.android.sdk.capture.MyIdClient +import uz.myid.android.sdk.capture.MyIdConfig +import uz.myid.android.sdk.capture.MyIdException +import uz.myid.android.sdk.capture.MyIdResult +import uz.myid.android.sdk.capture.MyIdResultListener +import uz.myid.android.sdk.capture.model.MyIdBuildMode +import uz.myid.android.sdk.capture.model.MyIdCameraShape +import uz.myid.android.sdk.capture.model.MyIdEntryType +import uz.myid.android.sdk.capture.model.MyIdImageFormat +import uz.myid.android.sdk.capture.model.MyIdOrganizationDetails +import uz.myid.android.sdk.capture.model.MyIdResidentType +import uz.myid.android.sdk.capture.model.MyIdResolution +import uz.myid.android.sdk.capture.takeUserResult import uz.myid.sdk.sample.databinding.ActivityMainBinding -import java.util.* +import java.util.Locale class MainActivity : AppCompatActivity(), MyIdResultListener { private val binding by lazy { ActivityMainBinding.inflate(layoutInflater) } - private val myIdClient = MyIdClient() + private val client = MyIdClient() - private var clientId = "" private var buildMode = MyIdBuildMode.PRODUCTION private var entryType = MyIdEntryType.AUTH private var residency = MyIdResidentType.RESIDENT @@ -28,8 +38,6 @@ class MainActivity : AppCompatActivity(), MyIdResultListener { setContentView(binding.root) with(binding) { - inputClientId.setText(clientId) - radioGroupLang.setOnCheckedChangeListener { _, checkedId -> locale = when (checkedId) { R.id.radioUz -> Locale("uz") @@ -57,8 +65,6 @@ class MainActivity : AppCompatActivity(), MyIdResultListener { } else { MyIdBuildMode.DEBUG } - - inputClientId.setText(clientId) } radioGroupShape.setOnCheckedChangeListener { _, checkedId -> shape = if (checkedId == R.id.radioCircle) { @@ -110,7 +116,11 @@ class MainActivity : AppCompatActivity(), MyIdResultListener { phoneNumber = binding.inputPhoneNumber.value ) - val myIdConfig = MyIdConfig.builder(binding.inputClientId.value) + val config = MyIdConfig.builder(binding.inputClientId.value) + .withClientHash( + clientHash = binding.inputClientHash.value, + clientHashId = binding.inputClientHashId.value, + ) .withPassportData(binding.inputPassportData.value) .withBirthDate(binding.inputDate.value) .withSdkHash(binding.inputSdkHash.value) @@ -127,7 +137,7 @@ class MainActivity : AppCompatActivity(), MyIdResultListener { .withPhoto(binding.checkboxWithPhoto.isChecked) .build() - val intent = myIdClient.createIntent(this, myIdConfig) + val intent = client.createIntent(this, config) result.launch(intent) } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index a4bad87b28c4d6bf49e66cc71a9fca4d9ee6cb6c..a02dd18978a11a99a94e67ddcdf602369d2c1346 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -29,6 +29,42 @@ android:textAppearance="@style/TextAppearance.Material3.BodyLarge" /> + + + + + + + + + + Birth date Circle Client ID + Client hash + Client hash ID Dev Ellipse English External id Face Image + Manual + Non resident Phone number Passport or PINFL Prod + Resident Result image Russian Scan face data + Sdk hash Threshold Uzbek With photo Without photo - Sdk hash - Manual - Resident - Non resident