├── .github
└── ISSUE_TEMPLATE
│ └── config.yml
├── .gitignore
├── BasicSample
├── app
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── regula
│ │ │ └── facesamplekotlin
│ │ │ └── ExampleInstrumentedTest.kt
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── assets
│ │ │ ├── layer.json
│ │ │ └── notification.json
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── regula
│ │ │ │ └── facesamplekotlin
│ │ │ │ ├── CategoryAdapter.kt
│ │ │ │ ├── CategoryDataProvider.kt
│ │ │ │ ├── DetectFacesActivity.kt
│ │ │ │ ├── FaceImageQualityActivity.kt
│ │ │ │ ├── MainActivity.kt
│ │ │ │ ├── MatchFacesActivity.kt
│ │ │ │ ├── category
│ │ │ │ ├── CategoryItem.kt
│ │ │ │ ├── HeaderItem.kt
│ │ │ │ └── ICategoryItem.kt
│ │ │ │ ├── detection
│ │ │ │ ├── FaceImageResultItem.kt
│ │ │ │ ├── FaceQualityResultAdapter.kt
│ │ │ │ ├── FaceQualityResultItem.kt
│ │ │ │ ├── GroupQualityResultItem.kt
│ │ │ │ ├── IFaceQualityItem.kt
│ │ │ │ └── fragment
│ │ │ │ │ ├── FaceImageQualityFragment.kt
│ │ │ │ │ └── FaceImageQualityResultFragment.kt
│ │ │ │ ├── items
│ │ │ │ ├── basic
│ │ │ │ │ ├── DetectFacesRequestItem.kt
│ │ │ │ │ ├── FaceCaptureDefaultItem.kt
│ │ │ │ │ ├── FaceImageQualityRequestItem.kt
│ │ │ │ │ ├── LivenessDefaultItem.kt
│ │ │ │ │ └── MatchFacesRequestItem.kt
│ │ │ │ ├── configuration
│ │ │ │ │ ├── FaceCaptureConfigurationItem.kt
│ │ │ │ │ └── LivenessScreenConfigurationItem.kt
│ │ │ │ ├── customization
│ │ │ │ │ ├── HideCloseButtonItem.kt
│ │ │ │ │ ├── HideFlashButtonItem.kt
│ │ │ │ │ ├── HideNotificationViewItem.kt
│ │ │ │ │ ├── LivenessNotificationItem.kt
│ │ │ │ │ ├── NotificationViewPositionItem.kt
│ │ │ │ │ └── UICustomizationItem.kt
│ │ │ │ ├── features
│ │ │ │ │ ├── FaceCaptureCameraPositionItem.kt
│ │ │ │ │ ├── FaceSdkDeinitItem.kt
│ │ │ │ │ ├── FaceSdkInitItem.kt
│ │ │ │ │ ├── LivenessAttemptsCountItem.kt
│ │ │ │ │ ├── LivenessDisableStepItem.kt
│ │ │ │ │ ├── LivenessLandscapePortraitItem.kt
│ │ │ │ │ └── LivenessSessionIdItem.kt
│ │ │ │ ├── fragments
│ │ │ │ │ ├── HideNotificationViewFragment.kt
│ │ │ │ │ └── NotificationViewPositionFragment.kt
│ │ │ │ └── other
│ │ │ │ │ ├── LocalizationItem.kt
│ │ │ │ │ ├── NetworkInterceptorItem.kt
│ │ │ │ │ └── VideoCompletionItem.kt
│ │ │ │ └── util
│ │ │ │ ├── FaceCaptureResponseUtil.kt
│ │ │ │ ├── LivenessResponseUtil.kt
│ │ │ │ ├── RandomColors.kt
│ │ │ │ └── ResizeTransformation.kt
│ │ └── res
│ │ │ ├── drawable-nodpi
│ │ │ ├── detect_face1.jpeg
│ │ │ ├── detect_face2.jpeg
│ │ │ ├── detect_face3.jpeg
│ │ │ ├── detect_face4.jpeg
│ │ │ ├── face_image_quality1.jpeg
│ │ │ ├── face_image_quality2.jpeg
│ │ │ ├── face_image_quality3.jpeg
│ │ │ └── face_image_quality4.jpeg
│ │ │ ├── drawable-v24
│ │ │ ├── ic_launcher_foreground.xml
│ │ │ └── rounded_button_corner.xml
│ │ │ ├── drawable
│ │ │ ├── button_drawable.xml
│ │ │ ├── button_drawable_pressed.xml
│ │ │ ├── close_button.xml
│ │ │ ├── custom_button_drawable.xml
│ │ │ ├── done_button.xml
│ │ │ ├── flash_light_off.png
│ │ │ ├── flash_light_on.png
│ │ │ ├── hind_view_background.xml
│ │ │ ├── ic_emotions.xml
│ │ │ ├── ic_launcher_background.xml
│ │ │ ├── ic_launcher_foreground.xml
│ │ │ ├── ic_light.xml
│ │ │ ├── ic_looks_1.xml
│ │ │ ├── ic_looks_2.xml
│ │ │ ├── ic_looks_3.xml
│ │ │ ├── notification_background_white.xml
│ │ │ ├── notification_view_background_dark.xml
│ │ │ ├── notification_view_background_white.xml
│ │ │ ├── rounded_background.xml
│ │ │ └── swap_button.xml
│ │ │ ├── font
│ │ │ ├── roboto.ttf
│ │ │ └── roboto_italic.ttf
│ │ │ ├── layout
│ │ │ ├── activity_detect_faces.xml
│ │ │ ├── activity_face_quality.xml
│ │ │ ├── activity_main.xml
│ │ │ ├── activity_match_faces.xml
│ │ │ ├── custom_liveness_processing_layout.xml
│ │ │ ├── custom_liveness_retry_layout.xml
│ │ │ ├── custom_liveness_verified.xml
│ │ │ ├── fragment_face_quality.xml
│ │ │ ├── fragment_face_quality_result.xml
│ │ │ ├── fragment_image.xml
│ │ │ ├── item_element.xml
│ │ │ ├── item_header_image.xml
│ │ │ ├── item_header_title.xml
│ │ │ └── reg_toolbar_buttons_custom.xml
│ │ │ ├── menu
│ │ │ └── menu.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── values-night
│ │ │ ├── colors.xml
│ │ │ └── themes.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── themes.xml
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── regula
│ │ └── facesamplekotlin
│ │ └── ExampleUnitTest.kt
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── BasicSampleJava
├── .gitignore
├── app
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── regula
│ │ │ └── facesample
│ │ │ └── ExampleInstrumentedTest.java
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── assets
│ │ │ └── layer.json
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── regula
│ │ │ │ └── facesample
│ │ │ │ ├── MainActivity.java
│ │ │ │ ├── MatchFacesActivity.java
│ │ │ │ ├── adapter
│ │ │ │ └── CategoryAdapter.java
│ │ │ │ ├── data
│ │ │ │ └── CategoryDataProvider.java
│ │ │ │ ├── items
│ │ │ │ ├── CategoryItem.java
│ │ │ │ ├── ICategoryItem.java
│ │ │ │ ├── basic
│ │ │ │ │ ├── FaceCaptureDefaultItem.java
│ │ │ │ │ ├── LivenessDefaultItem.java
│ │ │ │ │ └── MatchFacesRequestItem.java
│ │ │ │ ├── customization
│ │ │ │ │ ├── AdvancedCustomItem.java
│ │ │ │ │ ├── BasicCustomItem.java
│ │ │ │ │ ├── ButtonsColorItem.java
│ │ │ │ │ ├── FlashButtonItem.java
│ │ │ │ │ ├── HideCloseButtonItem.java
│ │ │ │ │ ├── HideFlashButtonItem.java
│ │ │ │ │ ├── HideNotificationViewItem.java
│ │ │ │ │ ├── LivenessProcessingCustomItem.java
│ │ │ │ │ ├── NotificationViewItem.java
│ │ │ │ │ ├── NotificationViewPositionItem.java
│ │ │ │ │ ├── OverlayCustomItem.java
│ │ │ │ │ ├── SwapButtonItem.java
│ │ │ │ │ ├── UICustomizationItem.java
│ │ │ │ │ └── fragment
│ │ │ │ │ │ ├── AdvancedCustomUiFragment.java
│ │ │ │ │ │ ├── BasicCustomUiFragment.java
│ │ │ │ │ │ ├── ButtonsColorFragment.java
│ │ │ │ │ │ ├── FlashButtonFragment.java
│ │ │ │ │ │ ├── HideNotificationViewFragment.java
│ │ │ │ │ │ ├── LivenessProcessingCustomFragment.java
│ │ │ │ │ │ ├── NotificationViewFragment.java
│ │ │ │ │ │ ├── NotificationViewPositionFragment.java
│ │ │ │ │ │ └── SwapButtonFragment.java
│ │ │ │ ├── features
│ │ │ │ │ ├── FaceCaptureCameraPositionItem.java
│ │ │ │ │ ├── FaceSdkDeinitItem.java
│ │ │ │ │ ├── FaceSdkInitItem.java
│ │ │ │ │ ├── LivenessAttemptsCountItem.java
│ │ │ │ │ ├── LivenessDisableStepItem.java
│ │ │ │ │ └── LivenessSessionIdItem.java
│ │ │ │ └── other
│ │ │ │ │ ├── LocalizationItem.java
│ │ │ │ │ ├── NetworkInterceptorItem.java
│ │ │ │ │ └── VideoCompletionItem.java
│ │ │ │ └── util
│ │ │ │ ├── FaceCaptureResponseUtil.java
│ │ │ │ └── LivenessResponseUtil.java
│ │ └── res
│ │ │ ├── drawable-v24
│ │ │ └── ic_launcher_foreground.xml
│ │ │ ├── drawable
│ │ │ ├── close_button.xml
│ │ │ ├── done_button.xml
│ │ │ ├── flash_light_off.png
│ │ │ ├── flash_light_on.png
│ │ │ ├── hind_view_background.xml
│ │ │ ├── ic_launcher_background.xml
│ │ │ ├── notification_view_background_dark.xml
│ │ │ ├── notification_view_background_white.xml
│ │ │ ├── rounded_background.xml
│ │ │ ├── rounded_button_corner.xml
│ │ │ └── swap_button.xml
│ │ │ ├── layout
│ │ │ ├── activity_main.xml
│ │ │ ├── activity_match_faces.xml
│ │ │ ├── custom_hint_view_appearance.xml
│ │ │ ├── custom_liveness_processing.xml
│ │ │ ├── custom_liveness_processing_layout.xml
│ │ │ ├── custom_liveness_retry_layout.xml
│ │ │ ├── custom_liveness_verified.xml
│ │ │ ├── custom_toolbar_appearance.xml
│ │ │ ├── item_element.xml
│ │ │ ├── item_header_title.xml
│ │ │ └── reg_toolbar_buttons_custom.xml
│ │ │ ├── menu
│ │ │ └── menu.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── values-night
│ │ │ ├── colors.xml
│ │ │ └── themes.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── themes.xml
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── regula
│ │ └── facesample
│ │ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── CertificatePinningSample
├── README.md
├── app
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── regula
│ │ │ └── facesamplekotlin
│ │ │ └── MainActivity.kt
│ │ └── res
│ │ ├── drawable-v24
│ │ ├── ic_launcher_foreground.xml
│ │ └── rounded_button_corner.xml
│ │ ├── drawable
│ │ ├── ic_launcher_background.xml
│ │ └── ic_launcher_foreground.xml
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── values-night
│ │ ├── colors.xml
│ │ └── themes.xml
│ │ ├── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── themes.xml
│ │ └── xml
│ │ └── network_security_config.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── FaceSearchSample
├── .gitignore
├── app
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── regula
│ │ │ └── facepersonsearch
│ │ │ ├── Common.java
│ │ │ ├── CreateActivity.java
│ │ │ ├── FaceSearchApp.java
│ │ │ ├── GroupsActivity.java
│ │ │ ├── ItemPositionAdapter.java
│ │ │ ├── ItemsAdapter.java
│ │ │ ├── PersonImageFragment.java
│ │ │ ├── PersonImageRecyclerViewAdapter.java
│ │ │ ├── PersonsActivity.java
│ │ │ └── SearchActivity.java
│ │ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ ├── add_btn.xml
│ │ ├── ic_launcher_background.xml
│ │ └── search_btn.xml
│ │ ├── layout
│ │ ├── activity_create.xml
│ │ ├── activity_items_list.xml
│ │ ├── activity_search.xml
│ │ ├── fragment_item.xml
│ │ ├── fragment_item_list.xml
│ │ ├── group_create_update.xml
│ │ └── image_vh.xml
│ │ ├── menu
│ │ ├── menu.xml
│ │ └── menu_reset.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-anydpi-v33
│ │ └── ic_launcher.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── values-night
│ │ └── themes.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── themes.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── OfflineMatchFaceSample
├── .gitignore
├── app
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── regula
│ │ │ └── facesamplekotlin
│ │ │ └── ExampleInstrumentedTest.kt
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── regula
│ │ │ │ └── facesamplekotlin
│ │ │ │ ├── FileUtil.kt
│ │ │ │ ├── MatchFacesActivity.kt
│ │ │ │ └── ResizeTransformation.kt
│ │ └── res
│ │ │ ├── drawable-v24
│ │ │ ├── ic_launcher_foreground.xml
│ │ │ └── rounded_button_corner.xml
│ │ │ ├── drawable
│ │ │ ├── ic_launcher_background.xml
│ │ │ └── ic_launcher_foreground.xml
│ │ │ ├── layout
│ │ │ ├── activity_match_faces.xml
│ │ │ └── fragment_image.xml
│ │ │ ├── menu
│ │ │ └── menu.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── values-night
│ │ │ ├── colors.xml
│ │ │ └── themes.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── themes.xml
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── regula
│ │ └── facesamplekotlin
│ │ └── ExampleUnitTest.kt
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
└── README.md
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: Submit a request
4 | url: https://support.regulaforensics.com/hc/requests/new?utm_source=github
5 | about: Submit any requests to Regula Support Team
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .idea/
3 | .gradle
4 | /local.properties
5 | .DS_Store
6 | /build
7 | /captures
8 | .externalNativeBuild
9 | .cxx
10 | local.properties
11 |
--------------------------------------------------------------------------------
/BasicSample/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/BasicSample/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'kotlin-android'
4 | }
5 |
6 | android {
7 | compileSdk 32
8 |
9 | defaultConfig {
10 | applicationId "com.regula.facesamplekotlin"
11 | minSdk 21
12 | targetSdk 32
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 |
26 | buildFeatures {
27 | viewBinding true
28 | }
29 | }
30 |
31 | dependencies {
32 | testImplementation 'junit:junit:4.+'
33 | androidTestImplementation 'androidx.test.ext:junit:1.1.2'
34 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
35 |
36 | implementation 'androidx.appcompat:appcompat:1.4.1'
37 | implementation 'com.google.android.material:material:1.5.0'
38 | implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
39 | implementation "androidx.recyclerview:recyclerview:1.2.1"
40 | implementation "androidx.core:core-ktx:1.7.0"
41 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
42 |
43 | implementation ('com.regula.face:api:6.3.+@aar'){
44 | transitive = true
45 | }
46 |
47 | implementation ('com.regula.face.core:basic:6.3.+@aar')
48 | }
49 |
--------------------------------------------------------------------------------
/BasicSample/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/BasicSample/app/src/androidTest/java/com/regula/facesamplekotlin/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.regula.facesamplekotlin", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
16 |
19 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/assets/notification.json:
--------------------------------------------------------------------------------
1 | {
2 | "objects": [
3 | {
4 | "label": {
5 | "text": "",
6 | "fontStyle": "normal",
7 | "fontColor": "#FF000000",
8 | "background": "#FFFF8080",
9 | "fontSize": 16,
10 | "fontName": "Arial",
11 | "alignment": "center",
12 | "borderRadius": 5,
13 | "padding": {
14 | "start": 8,
15 | "end": 8,
16 | "top": 8,
17 | "bottom": 8
18 | },
19 | "margin": {
20 | "top": 20
21 | },
22 | "position": {
23 | "h": 1
24 | }
25 | }
26 | }
27 | ],
28 | "version": "1.0"
29 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/FaceImageQualityActivity.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin
2 |
3 | import android.os.Bundle
4 | import androidx.appcompat.app.AppCompatActivity
5 | import com.regula.facesamplekotlin.detection.fragment.FaceImageQualityFragment
6 | import com.regula.facesdk.detection.response.DetectFacesResponse
7 |
8 | class FaceImageQualityActivity : AppCompatActivity() {
9 |
10 | lateinit var response: DetectFacesResponse
11 |
12 | override fun onCreate(savedInstanceState: Bundle?) {
13 | super.onCreate(savedInstanceState)
14 | setContentView(R.layout.activity_face_quality)
15 | if (savedInstanceState == null) {
16 | supportFragmentManager.beginTransaction()
17 | .replace(R.id.container, FaceImageQualityFragment())
18 | .commitNow()
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin
2 |
3 | import android.os.Bundle
4 | import android.util.Log
5 | import android.widget.Toast
6 | import androidx.appcompat.app.AppCompatActivity
7 | import androidx.recyclerview.widget.LinearLayoutManager
8 | import com.regula.facesamplekotlin.CategoryDataProvider.Companion.getCategoryData
9 | import com.regula.facesamplekotlin.databinding.ActivityMainBinding
10 | import com.regula.facesdk.FaceSDK
11 | import com.regula.facesdk.exception.InitException
12 |
13 | class MainActivity : AppCompatActivity() {
14 |
15 | @Transient
16 | private lateinit var binding: ActivityMainBinding
17 |
18 | override fun onCreate(savedInstanceState: Bundle?) {
19 | super.onCreate(savedInstanceState)
20 |
21 | binding = ActivityMainBinding.inflate(layoutInflater)
22 | setContentView(binding.root)
23 |
24 | binding.recyclerView.layoutManager = LinearLayoutManager(this)
25 | binding.recyclerView.adapter = CategoryAdapter(this, getCategoryData())
26 |
27 | FaceSDK.Instance().initialize(this) { status: Boolean, e: InitException? ->
28 | if (!status) {
29 | Toast.makeText(
30 | this@MainActivity,
31 | "Init finished with error: " + if (e != null) e.message else "",
32 | Toast.LENGTH_LONG
33 | ).show()
34 | return@initialize
35 | }
36 | Log.d("MainActivity", "FaceSDK init completed successfully")
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/category/CategoryItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.category
2 |
3 | import android.content.Context
4 |
5 |
6 | abstract class CategoryItem : ICategoryItem {
7 | abstract fun onItemSelected(context: Context)
8 | abstract val description: String
9 |
10 | override fun isHeader(): Boolean {
11 | return false
12 | }
13 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/category/HeaderItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.category
2 |
3 | class HeaderItem(override val title: String) : ICategoryItem {
4 |
5 | override fun isHeader(): Boolean {
6 | return true
7 | }
8 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/category/ICategoryItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.category
2 |
3 | interface ICategoryItem {
4 | val title: String
5 | fun isHeader(): Boolean
6 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/detection/FaceImageResultItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.detection
2 |
3 |
4 | class FaceImageResultItem(private val image: String?) :
5 | IFaceQualityItem {
6 |
7 | override fun getTitle(): String {
8 | return ""
9 | }
10 |
11 | override fun getImage(): String? {
12 | return image
13 | }
14 |
15 | override fun isHeader(): Boolean {
16 | return false
17 | }
18 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/detection/FaceQualityResultItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.detection
2 |
3 | import com.regula.facesdk.detection.response.ImageQualityResult
4 | import com.regula.facesdk.enums.ImageQualityResultStatus
5 |
6 |
7 | class FaceQualityResultItem(private val result : ImageQualityResult?, private val image: String?) :
8 | IFaceQualityItem {
9 |
10 |
11 | constructor(result: ImageQualityResult) : this(
12 | result,
13 | null
14 | )
15 |
16 | override fun getTitle(): String {
17 | var status = "➖"
18 | if(result?.status == ImageQualityResultStatus.IMAGE_QUALITY_RESULT_STATUS_TRUE) {
19 | status = "✅ "
20 | } else if(result?.status == ImageQualityResultStatus.IMAGE_QUALITY_RESULT_STATUS_FALSE){
21 | status = "❌ "
22 | }
23 | return status + result?.name?.value
24 | }
25 |
26 | fun getDescription(): String {
27 | val value = "Value: " + result?.value
28 | val expectedRange = "\nExpected range: [" + result?.range?.min + " : " + result?.range?.max + "]"
29 | return value + expectedRange
30 | }
31 |
32 | override fun getImage(): String? {
33 | return image
34 | }
35 |
36 | override fun isHeader(): Boolean {
37 | return false
38 | }
39 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/detection/GroupQualityResultItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.detection
2 |
3 | import com.regula.facesdk.enums.ImageQualityGroupName
4 |
5 | class GroupQualityResultItem(
6 | val id: Int,
7 | val compliantCount: Int,
8 | val totalCount: Int,
9 | ) : IFaceQualityItem {
10 |
11 | override fun getImage(): String? {
12 | return null
13 | }
14 |
15 | override fun getTitle(): String {
16 | var status = " ✅ "
17 | if (totalCount != compliantCount) {
18 | status = " ❌ "
19 | }
20 |
21 | return getGroupName() + status + "$compliantCount/$totalCount"
22 | }
23 |
24 | override fun isHeader(): Boolean {
25 | return true
26 | }
27 |
28 | private fun getGroupName(): String {
29 | when (id) {
30 | ImageQualityGroupName.IMAGE_CHARACTERISTICS.value -> return "Image characteristics"
31 | ImageQualityGroupName.HEAD_SIZE_AND_POSITION.value -> return "Head size and position"
32 | ImageQualityGroupName.FACE_QUALITY.value -> return "Face quality"
33 | ImageQualityGroupName.EYES_CHARACTERISTICS.value -> return "Eyes characteristics"
34 | ImageQualityGroupName.SHADOWS_AND_LIGHTNING.value -> return "Shadows and lightning"
35 | ImageQualityGroupName.POSE_AND_EXPRESSION.value -> return "Pose and expression"
36 | ImageQualityGroupName.HEAD_OCCLUSION.value -> return "Head occlusion"
37 | ImageQualityGroupName.BACKGROUND.value -> return "Background"
38 | }
39 | return "unknown"
40 | }
41 |
42 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/detection/IFaceQualityItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.detection
2 |
3 | interface IFaceQualityItem {
4 | fun getImage(): String?
5 | fun getTitle(): String
6 | fun isHeader(): Boolean
7 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/basic/DetectFacesRequestItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.basic
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import com.regula.facesamplekotlin.DetectFacesActivity
6 | import com.regula.facesamplekotlin.category.CategoryItem
7 |
8 | class DetectFacesRequestItem : CategoryItem() {
9 |
10 | override fun onItemSelected(context: Context) {
11 | val intent = Intent(context, DetectFacesActivity::class.java)
12 | context.startActivity(intent)
13 | }
14 |
15 | override val title: String
16 | get() = "Face Detection"
17 |
18 | override val description: String
19 | get() = "Analyzes images, recognizes faces in them, and returns cropped and aligned portraits of the detected people"
20 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/basic/FaceCaptureDefaultItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.basic
2 |
3 | import android.content.Context
4 | import com.regula.facesamplekotlin.category.CategoryItem
5 | import com.regula.facesamplekotlin.util.FaceCaptureResponseUtil
6 | import com.regula.facesdk.FaceSDK
7 |
8 | class FaceCaptureDefaultItem : CategoryItem() {
9 |
10 | override fun onItemSelected(context: Context) {
11 | FaceSDK.Instance().presentFaceCaptureActivity(context) { response ->
12 | // ... check response.image for capture result
13 | FaceCaptureResponseUtil.response(context, response)
14 | }
15 | }
16 |
17 | override val title: String
18 | get() = "FaceCapture"
19 |
20 | override val description: String
21 | get() = "Automatically captures face photo"
22 |
23 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/basic/FaceImageQualityRequestItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.basic
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import com.regula.facesamplekotlin.FaceImageQualityActivity
6 | import com.regula.facesamplekotlin.category.CategoryItem
7 |
8 | class FaceImageQualityRequestItem : CategoryItem() {
9 |
10 | override fun onItemSelected(context: Context) {
11 | val intent = Intent(context, FaceImageQualityActivity::class.java)
12 | context.startActivity(intent)
13 | }
14 |
15 | override val title: String
16 | get() = "Face Image Quality"
17 |
18 | override val description: String
19 | get() = "Checks whether a photo portrait meets certain standards"
20 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/basic/LivenessDefaultItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.basic
2 |
3 | import android.content.Context
4 | import com.regula.facesamplekotlin.category.CategoryItem
5 | import com.regula.facesamplekotlin.util.LivenessResponseUtil
6 | import com.regula.facesdk.FaceSDK
7 | import com.regula.facesdk.model.results.LivenessResponse
8 |
9 | class LivenessDefaultItem : CategoryItem() {
10 |
11 | override fun onItemSelected(context: Context) {
12 | FaceSDK.Instance().startLiveness(context) { livenessResponse: LivenessResponse -> LivenessResponseUtil.response(context, livenessResponse) }
13 | }
14 |
15 | override val title: String
16 | get() = "Liveness"
17 |
18 | override val description: String
19 | get() = "Detects if a person on camera is alive"
20 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/basic/MatchFacesRequestItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.basic
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import com.regula.facesamplekotlin.MatchFacesActivity
6 | import com.regula.facesamplekotlin.category.CategoryItem
7 |
8 | class MatchFacesRequestItem : CategoryItem() {
9 |
10 | override fun onItemSelected(context: Context) {
11 | val intent = Intent(context, MatchFacesActivity::class.java)
12 | context.startActivity(intent)
13 | }
14 |
15 | override val title: String
16 | get() = "MatchFacesRequest"
17 |
18 | override val description: String
19 | get() = "Checks the likelihood that two faces belong to the same person"
20 |
21 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/customization/HideCloseButtonItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.customization
2 |
3 | import android.content.Context
4 | import com.regula.facesamplekotlin.category.CategoryItem
5 | import com.regula.facesamplekotlin.util.FaceCaptureResponseUtil
6 | import com.regula.facesdk.FaceSDK
7 | import com.regula.facesdk.configuration.FaceCaptureConfiguration
8 | import com.regula.facesdk.model.results.FaceCaptureResponse
9 |
10 | class HideCloseButtonItem : CategoryItem() {
11 |
12 | override fun onItemSelected(context: Context) {
13 | val configuration = FaceCaptureConfiguration.Builder()
14 | .setCloseButtonEnabled(false)
15 | .build()
16 | FaceSDK.Instance().presentFaceCaptureActivity(
17 | context, configuration
18 | ) { faceCaptureResponse: FaceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse) }
19 | }
20 |
21 | override val title: String
22 | get() = "Hide close button"
23 |
24 | override val description: String
25 | get() = "Hide close button using default UI"
26 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/customization/HideFlashButtonItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.customization
2 |
3 | import android.content.Context
4 | import com.regula.facesamplekotlin.category.CategoryItem
5 | import com.regula.facesamplekotlin.util.FaceCaptureResponseUtil
6 | import com.regula.facesdk.FaceSDK
7 | import com.regula.facesdk.configuration.FaceCaptureConfiguration
8 | import com.regula.facesdk.model.results.FaceCaptureResponse
9 |
10 | class HideFlashButtonItem : CategoryItem() {
11 |
12 | override fun onItemSelected(context: Context) {
13 | val configuration = FaceCaptureConfiguration.Builder()
14 | .setTorchButtonEnabled(false)
15 | .setCameraId(0)
16 | .build()
17 | FaceSDK.Instance().presentFaceCaptureActivity(
18 | context, configuration
19 | ) { faceCaptureResponse: FaceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse) }
20 | }
21 |
22 | override val title: String
23 | get() = "Hide flash button"
24 |
25 | override val description: String
26 | get() = "Hide flash button using default UI"
27 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/customization/HideNotificationViewItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.customization
2 |
3 | import android.content.Context
4 | import com.regula.facesamplekotlin.category.CategoryItem
5 | import com.regula.facesamplekotlin.items.fragments.HideNotificationViewFragment
6 | import com.regula.facesamplekotlin.util.FaceCaptureResponseUtil
7 | import com.regula.facesdk.FaceSDK
8 | import com.regula.facesdk.configuration.FaceCaptureConfiguration
9 | import com.regula.facesdk.model.results.FaceCaptureResponse
10 |
11 | class HideNotificationViewItem : CategoryItem() {
12 |
13 | override fun onItemSelected(context: Context) {
14 | val configuration = FaceCaptureConfiguration.Builder()
15 | .setCameraSwitchEnabled(true)
16 | .registerUiFragmentClass(HideNotificationViewFragment::class.java)
17 | .build()
18 | FaceSDK.Instance().presentFaceCaptureActivity(
19 | context, configuration
20 | ) { faceCaptureResponse: FaceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse) }
21 | }
22 |
23 | override val title: String
24 | get() = "Hide notification text view"
25 |
26 | override val description: String
27 | get() = "Hide notification text view using default UI fragment"
28 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/customization/NotificationViewPositionItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.customization
2 |
3 | import android.content.Context
4 | import com.regula.facesamplekotlin.category.CategoryItem
5 | import com.regula.facesamplekotlin.items.fragments.NotificationViewPositionFragment
6 | import com.regula.facesamplekotlin.util.LivenessResponseUtil
7 | import com.regula.facesdk.FaceSDK
8 | import com.regula.facesdk.configuration.LivenessConfiguration
9 | import com.regula.facesdk.model.results.LivenessResponse
10 |
11 | class NotificationViewPositionItem : CategoryItem() {
12 |
13 | override fun onItemSelected(context: Context) {
14 | val configuration = LivenessConfiguration.Builder()
15 | .registerUiFragmentClass(NotificationViewPositionFragment::class.java)
16 | .build()
17 | FaceSDK.Instance().startLiveness(
18 | context, configuration
19 | ) { livenessResponse: LivenessResponse -> LivenessResponseUtil.response(context, livenessResponse) }
20 | }
21 |
22 | override val title: String
23 | get() = "Notification text view position"
24 |
25 | override val description: String
26 | get() = "Change notification view position using default UI"
27 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/features/FaceCaptureCameraPositionItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.features
2 |
3 | import android.content.Context
4 | import com.regula.facesamplekotlin.category.CategoryItem
5 | import com.regula.facesamplekotlin.util.FaceCaptureResponseUtil
6 | import com.regula.facesdk.FaceSDK
7 | import com.regula.facesdk.configuration.FaceCaptureConfiguration
8 | import com.regula.facesdk.model.results.FaceCaptureResponse
9 |
10 | class FaceCaptureCameraPositionItem : CategoryItem() {
11 |
12 | override fun onItemSelected(context: Context) {
13 | val configuration = FaceCaptureConfiguration.Builder()
14 | .setCameraSwitchEnabled(true)
15 | .setCameraId(0)
16 | .build()
17 | FaceSDK.Instance().presentFaceCaptureActivity(
18 | context, configuration
19 | ) { faceCaptureResponse: FaceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse) }
20 | }
21 |
22 | override val title: String
23 | get() = "Face Capture camera position"
24 |
25 | override val description: String
26 | get() = "Changes default camera position to back"
27 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/features/FaceSdkDeinitItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.features
2 |
3 | import android.content.Context
4 | import com.regula.facesamplekotlin.category.CategoryItem
5 | import com.regula.facesdk.FaceSDK
6 |
7 | class FaceSdkDeinitItem : CategoryItem() {
8 |
9 | override fun onItemSelected(context: Context) {
10 | FaceSDK.Instance().deinitialize()
11 | }
12 |
13 | override val title: String
14 | get() = "Deinitialization SDK"
15 |
16 | override val description: String
17 | get() = "Deinitialization FaceSDK resources"
18 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/features/FaceSdkInitItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.features
2 |
3 | import android.content.Context
4 | import com.regula.facesamplekotlin.category.CategoryItem
5 | import com.regula.facesdk.FaceSDK
6 | import com.regula.facesdk.exception.InitException
7 |
8 | class FaceSdkInitItem : CategoryItem() {
9 |
10 | override fun onItemSelected(context: Context) {
11 | FaceSDK.Instance().initialize(
12 | context
13 | ) { status: Boolean, exception: InitException? -> }
14 | }
15 |
16 | override val title: String
17 | get() = "Initialization SDK"
18 |
19 | override val description: String
20 | get() = "Initialization FaceSDK resources"
21 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/features/LivenessAttemptsCountItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.features
2 |
3 | import android.content.Context
4 | import com.regula.facesamplekotlin.category.CategoryItem
5 | import com.regula.facesamplekotlin.util.LivenessResponseUtil
6 | import com.regula.facesdk.FaceSDK
7 | import com.regula.facesdk.configuration.LivenessConfiguration
8 | import com.regula.facesdk.model.results.LivenessResponse
9 |
10 | class LivenessAttemptsCountItem : CategoryItem() {
11 |
12 | override fun onItemSelected(context: Context) {
13 | val configuration = LivenessConfiguration.Builder()
14 | .setAttemptsCount(2)
15 | .build()
16 | FaceSDK.Instance().startLiveness(
17 | context, configuration
18 | ) { livenessResponse: LivenessResponse -> LivenessResponseUtil.response(context, livenessResponse) }
19 | }
20 |
21 | override val title: String
22 | get() = "Limit Liveness attempts count"
23 |
24 | override val description: String
25 | get() = "Liveness is limited to the number of retries"
26 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/features/LivenessDisableStepItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.features
2 |
3 | import android.content.Context
4 | import com.regula.facesamplekotlin.category.CategoryItem
5 | import com.regula.facesamplekotlin.util.LivenessResponseUtil
6 | import com.regula.facesdk.FaceSDK
7 | import com.regula.facesdk.configuration.LivenessConfiguration
8 | import com.regula.facesdk.enums.LivenessSkipStep
9 | import com.regula.facesdk.model.results.LivenessResponse
10 |
11 | class LivenessDisableStepItem : CategoryItem() {
12 |
13 | override fun onItemSelected(context: Context) {
14 | val configuration = LivenessConfiguration.Builder()
15 | .setSkipStep(LivenessSkipStep.ONBOARDING_STEP, LivenessSkipStep.SUCCESS_STEP)
16 | .build()
17 | FaceSDK.Instance().startLiveness(
18 | context, configuration
19 | ) { livenessResponse: LivenessResponse -> LivenessResponseUtil.response(context, livenessResponse) }
20 | }
21 |
22 | override val title: String
23 | get() = "Skip Onbording & Success steps"
24 |
25 | override val description: String
26 | get() = "Liveness will not show onboarding & success screens"
27 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/features/LivenessSessionIdItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.features
2 |
3 | import android.content.Context
4 | import com.regula.facesamplekotlin.category.CategoryItem
5 | import com.regula.facesamplekotlin.util.LivenessResponseUtil
6 | import com.regula.facesdk.FaceSDK
7 | import com.regula.facesdk.configuration.LivenessConfiguration
8 | import com.regula.facesdk.model.results.LivenessResponse
9 | import java.util.*
10 |
11 | class LivenessSessionIdItem : CategoryItem() {
12 |
13 | override fun onItemSelected(context: Context) {
14 | val configuration = LivenessConfiguration.Builder()
15 | .setTag(UUID.randomUUID().toString())
16 | .build()
17 | FaceSDK.Instance().startLiveness(
18 | context, configuration
19 | ) { livenessResponse: LivenessResponse -> LivenessResponseUtil.response(context, livenessResponse) }
20 | }
21 |
22 | override val title: String
23 | get() = "Liveness Session Tag"
24 |
25 | override val description: String
26 | get() = "Set up session tag for liveness"
27 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/fragments/HideNotificationViewFragment.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.fragments
2 |
3 | import android.view.View
4 | import android.widget.TextView
5 | import com.regula.facesdk.fragment.FaceDefaultUiFragment
6 |
7 | class HideNotificationViewFragment : FaceDefaultUiFragment() {
8 |
9 | override fun getNotificationView(view: View): TextView? {
10 | val textView: TextView = super.getNotificationView(view)
11 | textView.visibility = View.INVISIBLE
12 | return textView
13 | }
14 |
15 | override fun setNotificationStatusText(s: String?) {
16 | // ignore any new status
17 | }
18 |
19 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/fragments/NotificationViewPositionFragment.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.fragments
2 |
3 | import android.graphics.RectF
4 | import androidx.constraintlayout.widget.Guideline
5 | import com.regula.facesamplekotlin.R
6 | import com.regula.facesdk.fragment.FaceDefaultUiFragment
7 |
8 | class NotificationViewPositionFragment : FaceDefaultUiFragment() {
9 |
10 | override fun onFaceAreaViewPositionUpdated(rect: RectF) {
11 | val view = view ?: return
12 | var topMargin = rect.top.toInt()
13 | topMargin += (rect.height() * 0.4).toInt()
14 | val notificationGuideline: Guideline = view.findViewById(R.id.topNotificationGuideline)
15 | notificationGuideline.setGuidelinePercent(-1f)
16 | notificationGuideline.setGuidelineBegin(topMargin)
17 | }
18 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/other/LocalizationItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.other
2 |
3 | import android.content.Context
4 | import com.regula.facesamplekotlin.category.CategoryItem
5 | import com.regula.facesdk.FaceSDK
6 | import com.regula.facesdk.model.results.LivenessResponse
7 |
8 | class LocalizationItem : CategoryItem() {
9 |
10 | override fun onItemSelected(context: Context) {
11 | // uncomment in res/values/strings.xml:
12 | // hint.fit resource
13 |
14 | //This is another approach of customizing localization by overriding strings in callback
15 |
16 | // uncomment in res/values/strings.xml:
17 | // hint.fit resource
18 |
19 |
20 | //This is another approach of customizing localization by overriding strings in callback
21 | FaceSDK.Instance().setLocalizationCallback { stringId ->
22 | if (stringId.equals("livenessGuide.head"))
23 | return@setLocalizationCallback "this is custom selfie time string string"
24 | null
25 | }
26 |
27 | FaceSDK.Instance().startLiveness(context) {
28 | FaceSDK.Instance().setLocalizationCallback {
29 | null
30 | }
31 | }
32 | }
33 |
34 | override val title: String
35 | get() = "Custom localization"
36 |
37 | override val description: String
38 | get() = "Localization hook example"
39 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/other/NetworkInterceptorItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.other
2 |
3 | import android.content.Context
4 | import com.regula.common.http.HttpRequestBuilder
5 | import com.regula.facesamplekotlin.category.CategoryItem
6 | import com.regula.facesdk.FaceSDK
7 |
8 | class NetworkInterceptorItem : CategoryItem() {
9 |
10 | override fun onItemSelected(context: Context) {
11 | FaceSDK.Instance().setNetworkInterceptorListener { httpRequestBuilder: HttpRequestBuilder ->
12 | httpRequestBuilder.connection.setRequestProperty("fields", "value")
13 | }
14 | FaceSDK.Instance().serviceUrl = FaceSDK.Instance().serviceUrl
15 | FaceSDK.Instance().startLiveness(context) { }
16 | }
17 |
18 | override val title: String
19 | get() = "Network interceptor"
20 |
21 | override val description: String
22 | get() = "Adds custom http fields to the outgoing requests"
23 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/other/VideoCompletionItem.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.items.other
2 |
3 | import android.content.Context
4 | import android.util.Log
5 | import com.regula.facesamplekotlin.category.CategoryItem
6 | import com.regula.facesdk.FaceSDK
7 |
8 | class VideoCompletionItem: CategoryItem() {
9 |
10 | override fun onItemSelected(context: Context) {
11 | FaceSDK.Instance().setVideoEncoderCompletion { transactionId, success ->
12 | Log.d("VideoCompletionItem", "Transaction video: $transactionId success: $success")
13 | }
14 | FaceSDK.Instance().startLiveness(context) { }
15 | }
16 |
17 | override val title: String
18 | get() = "Video completion about uploading\nliveness video to service"
19 |
20 | override val description: String
21 | get() = "Video completion"
22 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/util/FaceCaptureResponseUtil.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.util
2 |
3 | import android.content.Context
4 | import android.widget.ImageView
5 | import android.widget.Toast
6 | import androidx.appcompat.app.AlertDialog
7 | import androidx.appcompat.app.AppCompatActivity
8 | import com.regula.facesdk.model.results.FaceCaptureResponse
9 |
10 | object FaceCaptureResponseUtil {
11 | fun response(context: Context?, faceCaptureResponse: FaceCaptureResponse) {
12 | if (faceCaptureResponse.exception != null)
13 | Toast.makeText(
14 | context,
15 | "Error: " + faceCaptureResponse.exception!!.message,
16 | Toast.LENGTH_SHORT
17 | ).show()
18 | else {
19 | if (context is AppCompatActivity) {
20 | faceCaptureResponse.image?.let {
21 | val image = ImageView(context)
22 | image.adjustViewBounds = true
23 | image.setImageBitmap(it.bitmap)
24 |
25 | AlertDialog.Builder(context)
26 | .setMessage("Face Capture")
27 | .setPositiveButton("OK", null)
28 | .setView(image).create().show()
29 | }
30 | }
31 | Toast.makeText(context, "Successfully got an image", Toast.LENGTH_SHORT).show()
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/util/LivenessResponseUtil.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.util
2 |
3 | import android.content.Context
4 | import android.widget.Toast
5 | import com.regula.facesdk.model.results.LivenessResponse
6 |
7 | object LivenessResponseUtil {
8 | fun response(context: Context?, livenessResponse: LivenessResponse) {
9 | if (livenessResponse.exception != null)
10 | Toast.makeText(context, "Error: " + livenessResponse.exception!!.message, Toast.LENGTH_SHORT).show()
11 | else
12 | Toast.makeText(context, "Liveness status: " + livenessResponse.liveness.name, Toast.LENGTH_SHORT).show()
13 | }
14 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/util/RandomColors.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.util
2 |
3 | import java.util.Collections
4 | import java.util.Stack
5 |
6 | class RandomColors {
7 | private val recycle: Stack = Stack()
8 | private val colors: Stack = Stack()
9 |
10 | init {
11 | recycle.addAll(
12 | mutableListOf(
13 | -0xe91e63, -0x9c27b0, -0x673ab7, -0x340000,
14 | -0x3f51b5, -0x2196f3, -0x3a9f4, -0xbcd4,
15 | -0x9688, -0x4caf50, -0x8bc34a, -0xcddc39,
16 | -0x795548, -0xe3dce, -0x3dcd0f, -0x9dcd0f,
17 | -0x3e0ece, -0x1e52f1, -0xa9f890, -0x1ee9a6,
18 | -0xff33ee, -0xffcf34, -0x33ff4f, -0x374af6
19 | )
20 | )
21 | }
22 |
23 | val color: Int
24 | get() {
25 | if (colors.size == 0) {
26 | while (!recycle.isEmpty()) colors.push(recycle.pop())
27 | Collections.shuffle(colors)
28 | }
29 | val c = colors.pop()
30 | recycle.push(c)
31 | return c
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/java/com/regula/facesamplekotlin/util/ResizeTransformation.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin.util
2 |
3 | import android.graphics.Bitmap
4 | import kotlin.math.max
5 |
6 | class ResizeTransformation(private val maxSize: Int) {
7 | fun transform(source: Bitmap?): Bitmap? {
8 | var result:Bitmap? = null
9 |
10 |
11 | if (source != null) {
12 | var width = source.width
13 | var height = source.height
14 |
15 | if(max(width, height) <= maxSize)
16 | return source
17 |
18 | val bitmapRatio = width.toFloat() / height.toFloat()
19 |
20 | if (bitmapRatio > 1) {
21 | width = maxSize;
22 | height = (width / bitmapRatio).toInt()
23 | } else {
24 | height = maxSize;
25 | width = (height * bitmapRatio).toInt()
26 | }
27 |
28 | result = Bitmap.createScaledBitmap(source, width, height, true)
29 | source.recycle()
30 | }
31 |
32 | return result
33 | }
34 | }
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable-nodpi/detect_face1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable-nodpi/detect_face1.jpeg
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable-nodpi/detect_face2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable-nodpi/detect_face2.jpeg
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable-nodpi/detect_face3.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable-nodpi/detect_face3.jpeg
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable-nodpi/detect_face4.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable-nodpi/detect_face4.jpeg
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable-nodpi/face_image_quality1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable-nodpi/face_image_quality1.jpeg
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable-nodpi/face_image_quality2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable-nodpi/face_image_quality2.jpeg
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable-nodpi/face_image_quality3.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable-nodpi/face_image_quality3.jpeg
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable-nodpi/face_image_quality4.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable-nodpi/face_image_quality4.jpeg
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable-v24/rounded_button_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/button_drawable.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/button_drawable_pressed.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/close_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/custom_button_drawable.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/done_button.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
14 |
19 |
20 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/flash_light_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable/flash_light_off.png
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/flash_light_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable/flash_light_on.png
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/hind_view_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/ic_emotions.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/ic_light.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/ic_looks_1.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/ic_looks_2.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/ic_looks_3.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/notification_background_white.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/notification_view_background_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/notification_view_background_white.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/drawable/rounded_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/font/roboto.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/font/roboto.ttf
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/font/roboto_italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/font/roboto_italic.ttf
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/layout/activity_face_quality.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/layout/fragment_face_quality_result.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
24 |
25 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/layout/fragment_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
16 |
17 |
24 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/layout/item_element.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
26 |
27 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/layout/item_header_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
17 |
18 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/layout/item_header_title.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
18 |
19 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/menu/menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/values-night/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #585858
4 | #ddddde
5 | #b7b7b7
6 | #828282
7 |
8 | #ffffff
9 | #ffffff
10 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 | #DDDDDE
11 | #2a2a2a
12 | #4d4d4d
13 | #4d4d4d
14 |
15 | #03DAC5
16 | #3700B3
17 |
18 | #469597
19 | #5BA199
20 | #E5E3E4
21 | #DDBEAA
22 | #BBC6C8
23 | #663399
24 | #E5E3E4
25 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | BasicSample
3 |
4 |
5 |
6 |
7 |
8 | - PRINTED
9 | - RFID
10 | - LIVE
11 | - DOCUMENT WITH LIVE
12 | - EXTERNAL
13 | - GHOST PORTRAIT
14 | - BARCODE
15 |
16 |
--------------------------------------------------------------------------------
/BasicSample/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/BasicSample/app/src/test/java/com/regula/facesamplekotlin/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
--------------------------------------------------------------------------------
/BasicSample/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.6.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:7.1.0'
9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10 | }
11 | }
12 |
13 | task clean(type: Delete) {
14 | delete rootProject.buildDir
15 | }
--------------------------------------------------------------------------------
/BasicSample/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
--------------------------------------------------------------------------------
/BasicSample/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/BasicSample/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Sep 26 18:06:35 MSK 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
8 |
--------------------------------------------------------------------------------
/BasicSample/settings.gradle:
--------------------------------------------------------------------------------
1 | import org.gradle.api.initialization.resolve.RepositoriesMode
2 |
3 | dependencyResolutionManagement {
4 | repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
5 | repositories {
6 | google()
7 | mavenCentral()
8 | jcenter() // Warning: this repository is going to shut down soon
9 | maven {
10 | url = uri("https://maven.regulaforensics.com/RegulaDocumentReader")
11 | }
12 | }
13 | }
14 | include ':app'
15 | rootProject.name = "BasicSample"
--------------------------------------------------------------------------------
/BasicSampleJava/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/BasicSampleJava/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | }
4 |
5 | android {
6 | compileSdk 32
7 |
8 | defaultConfig {
9 | applicationId "com.regula.facesample"
10 | minSdk 21
11 | targetSdk 32
12 | versionCode 1
13 | versionName "1.0"
14 |
15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | }
25 |
26 | dependencies {
27 | testImplementation 'junit:junit:4.+'
28 | androidTestImplementation 'androidx.test.ext:junit:1.1.2'
29 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
30 |
31 | implementation 'androidx.appcompat:appcompat:1.4.1'
32 | implementation 'com.google.android.material:material:1.5.0'
33 | implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
34 |
35 | implementation "androidx.recyclerview:recyclerview:1.2.1"
36 |
37 | implementation ('com.regula.face:api:6.3.+@aar'){
38 | transitive = true
39 | }
40 |
41 | implementation ('com.regula.face.core:basic:6.3.+@aar')
42 | }
43 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/androidTest/java/com/regula/facesample/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("com.regula.facesample", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
16 |
17 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 | import android.util.Log;
6 | import android.widget.Toast;
7 |
8 | import androidx.recyclerview.widget.LinearLayoutManager;
9 | import androidx.recyclerview.widget.RecyclerView;
10 |
11 | import com.regula.facesample.adapter.CategoryAdapter;
12 | import com.regula.facesample.data.CategoryDataProvider;
13 | import com.regula.facesdk.FaceSDK;
14 |
15 | public class MainActivity extends Activity {
16 |
17 | @Override
18 | public void onCreate(Bundle savedInstanceState) {
19 | super.onCreate(savedInstanceState);
20 | setContentView(R.layout.activity_main);
21 |
22 | CategoryDataProvider dataProvider = new CategoryDataProvider();
23 |
24 | RecyclerView recyclerView = findViewById(R.id.recyclerView);
25 | recyclerView.setHasFixedSize(true);
26 | final LinearLayoutManager mLayoutManager = new LinearLayoutManager(this);
27 | recyclerView.setLayoutManager(mLayoutManager);
28 |
29 | recyclerView.setAdapter(new CategoryAdapter(this, dataProvider));
30 |
31 | FaceSDK.Instance().initialize(this, (status, e) -> {
32 | if (!status) {
33 | Toast.makeText(MainActivity.this, "Init finished with error: " + (e != null ? e.getMessage() : ""), Toast.LENGTH_LONG).show();
34 | return;
35 | }
36 | Log.d("MainActivity", "FaceSDK init completed successfully");
37 | });
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/CategoryItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items;
2 |
3 | import android.content.Context;
4 |
5 | /**
6 | * Created by Sergey Yakimchik on 20.08.21.
7 | * Copyright (c) 2021 Regula. All rights reserved.
8 | */
9 |
10 | public abstract class CategoryItem implements ICategoryItem {
11 | public abstract void onItemSelected(Context context);
12 | public abstract String getDescription();
13 |
14 | @Override
15 | public boolean isHeader() {
16 | return false;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/ICategoryItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items;
2 |
3 | /**
4 | * Created by Sergey Yakimchik on 24.08.21.
5 | * Copyright (c) 2021 Regula. All rights reserved.
6 | */
7 |
8 | public interface ICategoryItem {
9 | String getTitle();
10 | boolean isHeader();
11 | }
12 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/basic/FaceCaptureDefaultItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.basic;
2 |
3 | import android.content.Context;
4 | import android.widget.Toast;
5 |
6 | import com.regula.facesample.items.CategoryItem;
7 | import com.regula.facesample.util.FaceCaptureResponseUtil;
8 | import com.regula.facesdk.FaceSDK;
9 |
10 | /**
11 | * Created by Sergey Yakimchik on 20.08.21.
12 | * Copyright (c) 2021 Regula. All rights reserved.
13 | */
14 |
15 | public class FaceCaptureDefaultItem extends CategoryItem {
16 |
17 | @Override
18 | public void onItemSelected(Context context) {
19 | FaceSDK.Instance().presentFaceCaptureActivity(context, faceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse));
20 | }
21 |
22 | @Override
23 | public String getTitle() {
24 | return "FaceCapture";
25 | }
26 |
27 | @Override
28 | public String getDescription() {
29 | return "Automaticlly captures face photo.";
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/basic/LivenessDefaultItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.basic;
2 |
3 | import android.content.Context;
4 | import android.widget.Toast;
5 |
6 | import com.regula.facesample.items.CategoryItem;
7 | import com.regula.facesample.util.LivenessResponseUtil;
8 | import com.regula.facesdk.FaceSDK;
9 |
10 | /**
11 | * Created by Sergey Yakimchik on 20.08.21.
12 | * Copyright (c) 2021 Regula. All rights reserved.
13 | */
14 |
15 | public class LivenessDefaultItem extends CategoryItem {
16 |
17 | @Override
18 | public void onItemSelected(Context context) {
19 | FaceSDK.Instance().startLiveness(context, livenessResponse -> LivenessResponseUtil.response(context, livenessResponse));
20 | }
21 |
22 | @Override
23 | public String getTitle() {
24 | return "Liveness";
25 | }
26 |
27 | @Override
28 | public String getDescription() {
29 | return "Detects if a person on camera is alive.";
30 | }
31 | }
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/basic/MatchFacesRequestItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.basic;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 |
6 | import com.regula.facesample.MatchFacesActivity;
7 | import com.regula.facesample.items.CategoryItem;
8 |
9 | /**
10 | * Created by Sergey Yakimchik on 20.08.21.
11 | * Copyright (c) 2021 Regula. All rights reserved.
12 | */
13 |
14 | public class MatchFacesRequestItem extends CategoryItem {
15 |
16 | @Override
17 | public void onItemSelected(Context context) {
18 | Intent intent = new Intent(context, MatchFacesActivity.class);
19 | context.startActivity(intent);
20 | }
21 |
22 | @Override
23 | public String getTitle() {
24 | return "MatchFacesRequest";
25 | }
26 |
27 | @Override
28 | public String getDescription() {
29 | return "Checks the likelihood that two faces belong to the same person.";
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/AdvancedCustomItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.items.customization.fragment.AdvancedCustomUiFragment;
7 | import com.regula.facesample.util.LivenessResponseUtil;
8 | import com.regula.facesdk.FaceSDK;
9 | import com.regula.facesdk.configuration.LivenessConfiguration;
10 |
11 | /**
12 | * Created by Sergey Yakimchik on 23.08.21.
13 | * Copyright (c) 2021 Regula. All rights reserved.
14 | */
15 |
16 | public class AdvancedCustomItem extends CategoryItem {
17 |
18 | @Override
19 | public void onItemSelected(Context context) {
20 | LivenessConfiguration configuration = new LivenessConfiguration.Builder()
21 | .registerUiFragmentClass(AdvancedCustomUiFragment.class)
22 | .build();
23 | FaceSDK.Instance().startLiveness(context, configuration, livenessResponse -> LivenessResponseUtil.response(context, livenessResponse));
24 | }
25 |
26 | @Override
27 | public String getTitle() {
28 | return "Liveness toolbar appearance";
29 | }
30 |
31 | @Override
32 | public String getDescription() {
33 | return "Usage example for toolbar.";
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/BasicCustomItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.items.customization.fragment.BasicCustomUiFragment;
7 | import com.regula.facesample.util.LivenessResponseUtil;
8 | import com.regula.facesdk.FaceSDK;
9 | import com.regula.facesdk.configuration.LivenessConfiguration;
10 |
11 | /**
12 | * Created by Sergey Yakimchik on 23.08.21.
13 | * Copyright (c) 2021 Regula. All rights reserved.
14 | */
15 |
16 | public class BasicCustomItem extends CategoryItem {
17 |
18 | @Override
19 | public void onItemSelected(Context context) {
20 | LivenessConfiguration configuration = new LivenessConfiguration.Builder()
21 | .registerUiFragmentClass(BasicCustomUiFragment.class)
22 | .build();
23 | FaceSDK.Instance().startLiveness(context, configuration, livenessResponse -> LivenessResponseUtil.response(context, livenessResponse));
24 | }
25 |
26 | @Override
27 | public String getTitle() {
28 | return "Basic custom UI fragment";
29 | }
30 |
31 | @Override
32 | public String getDescription() {
33 | return "Custom UI with basic functionality";
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/ButtonsColorItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.items.customization.fragment.ButtonsColorFragment;
7 | import com.regula.facesample.util.FaceCaptureResponseUtil;
8 | import com.regula.facesdk.FaceSDK;
9 | import com.regula.facesdk.configuration.FaceCaptureConfiguration;
10 | import com.regula.facesdk.configuration.LivenessConfiguration;
11 |
12 | /**
13 | * Created by Sergey Yakimchik on 6.09.21.
14 | * Copyright (c) 2021 Regula. All rights reserved.
15 | */
16 |
17 | public class ButtonsColorItem extends CategoryItem {
18 | @Override
19 | public void onItemSelected(Context context) {
20 | FaceCaptureConfiguration configuration = new FaceCaptureConfiguration.Builder()
21 | .setCameraSwitchEnabled(true)
22 | .registerUiFragmentClass(ButtonsColorFragment.class)
23 | .build();
24 | FaceSDK.Instance().presentFaceCaptureActivity(context, configuration, faceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse));
25 | }
26 |
27 | @Override
28 | public String getDescription() {
29 | return "Change buttons color using Default UI";
30 | }
31 |
32 | @Override
33 | public String getTitle() {
34 | return "Change buttons color";
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/FlashButtonItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.items.customization.fragment.FlashButtonFragment;
7 | import com.regula.facesample.util.FaceCaptureResponseUtil;
8 | import com.regula.facesdk.FaceSDK;
9 | import com.regula.facesdk.configuration.FaceCaptureConfiguration;
10 | import com.regula.facesdk.configuration.LivenessConfiguration;
11 |
12 | /**
13 | * Created by Sergey Yakimchik on 7.09.21.
14 | * Copyright (c) 2021 Regula. All rights reserved.
15 | */
16 |
17 | public class FlashButtonItem extends CategoryItem {
18 |
19 | @Override
20 | public void onItemSelected(Context context) {
21 | FaceCaptureConfiguration configuration = new FaceCaptureConfiguration.Builder()
22 | .registerUiFragmentClass(FlashButtonFragment.class)
23 | .setCameraSwitchEnabled(true)
24 | .build();
25 | FaceSDK.Instance().presentFaceCaptureActivity(context, configuration, faceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse));
26 | }
27 |
28 | @Override
29 | public String getDescription() {
30 | return "Change flash button using default UI";
31 | }
32 |
33 | @Override
34 | public String getTitle() {
35 | return "Custom flash button";
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/HideCloseButtonItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.util.FaceCaptureResponseUtil;
7 | import com.regula.facesdk.FaceSDK;
8 | import com.regula.facesdk.configuration.FaceCaptureConfiguration;
9 |
10 | /**
11 | * Created by Sergey Yakimchik on 6.09.21.
12 | * Copyright (c) 2021 Regula. All rights reserved.
13 | */
14 |
15 | public class HideCloseButtonItem extends CategoryItem {
16 |
17 | @Override
18 | public void onItemSelected(Context context) {
19 | FaceCaptureConfiguration configuration = new FaceCaptureConfiguration.Builder()
20 | .setCloseButtonEnabled(false)
21 | .build();
22 | FaceSDK.Instance().presentFaceCaptureActivity(context, configuration, faceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse));
23 | }
24 |
25 | @Override
26 | public String getDescription() {
27 | return "Hide close button using default UI";
28 | }
29 |
30 | @Override
31 | public String getTitle() {
32 | return "Hide close button";
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/HideFlashButtonItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.util.FaceCaptureResponseUtil;
7 | import com.regula.facesdk.FaceSDK;
8 | import com.regula.facesdk.configuration.FaceCaptureConfiguration;
9 |
10 | /**
11 | * Created by Sergey Yakimchik on 6.09.21.
12 | * Copyright (c) 2021 Regula. All rights reserved.
13 | */
14 |
15 | public class HideFlashButtonItem extends CategoryItem {
16 |
17 | @Override
18 | public void onItemSelected(Context context) {
19 | FaceCaptureConfiguration configuration = new FaceCaptureConfiguration.Builder()
20 | .setTorchButtonEnabled(false)
21 | .setCameraId(0)
22 | .build();
23 | FaceSDK.Instance().presentFaceCaptureActivity(context, configuration, faceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse));
24 | }
25 |
26 | @Override
27 | public String getDescription() {
28 | return "Hide flash button using default UI";
29 | }
30 |
31 | @Override
32 | public String getTitle() {
33 | return "Hide flash button";
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/HideNotificationViewItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.items.customization.fragment.HideNotificationViewFragment;
7 | import com.regula.facesample.util.FaceCaptureResponseUtil;
8 | import com.regula.facesdk.FaceSDK;
9 | import com.regula.facesdk.configuration.FaceCaptureConfiguration;
10 |
11 | /**
12 | * Created by Sergey Yakimchik on 6.09.21.
13 | * Copyright (c) 2021 Regula. All rights reserved.
14 | */
15 |
16 | public class HideNotificationViewItem extends CategoryItem {
17 | @Override
18 | public void onItemSelected(Context context) {
19 | FaceCaptureConfiguration configuration = new FaceCaptureConfiguration.Builder()
20 | .setCameraSwitchEnabled(true)
21 | .registerUiFragmentClass(HideNotificationViewFragment.class)
22 | .build();
23 | FaceSDK.Instance().presentFaceCaptureActivity(context, configuration, faceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse));
24 | }
25 |
26 | @Override
27 | public String getDescription() {
28 | return "Hide notification text view using default UI fragment";
29 | }
30 |
31 | @Override
32 | public String getTitle() {
33 | return "Hide notification text view";
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/LivenessProcessingCustomItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.items.customization.fragment.LivenessProcessingCustomFragment;
7 | import com.regula.facesample.util.LivenessResponseUtil;
8 | import com.regula.facesdk.FaceSDK;
9 | import com.regula.facesdk.configuration.LivenessConfiguration;
10 |
11 | /**
12 | * Created by Sergey Yakimchik on 29.04.22.
13 | * Copyright (c) 2022 Regula. All rights reserved.
14 | */
15 |
16 | public class LivenessProcessingCustomItem extends CategoryItem {
17 |
18 | @Override
19 | public void onItemSelected(Context context) {
20 | LivenessConfiguration configuration = new LivenessConfiguration.Builder()
21 | .registerProcessingFragment(LivenessProcessingCustomFragment.class)
22 | .build();
23 | FaceSDK.Instance().startLiveness(context, configuration, livenessResponse -> LivenessResponseUtil.response(context, livenessResponse));
24 | }
25 |
26 | @Override
27 | public String getDescription() {
28 | return "Customize liveness processing and retry screens";
29 | }
30 |
31 | @Override
32 | public String getTitle() {
33 | return "Custom liveness process";
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/NotificationViewItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.items.customization.fragment.NotificationViewFragment;
7 | import com.regula.facesample.util.FaceCaptureResponseUtil;
8 | import com.regula.facesdk.FaceSDK;
9 | import com.regula.facesdk.configuration.FaceCaptureConfiguration;
10 | import com.regula.facesdk.configuration.LivenessConfiguration;
11 |
12 | /**
13 | * Created by Sergey Yakimchik on 6.09.21.
14 | * Copyright (c) 2021 Regula. All rights reserved.
15 | */
16 |
17 | public class NotificationViewItem extends CategoryItem {
18 | @Override
19 | public void onItemSelected(Context context) {
20 | FaceCaptureConfiguration configuration = new FaceCaptureConfiguration.Builder()
21 | .registerUiFragmentClass(NotificationViewFragment.class)
22 | .setCameraSwitchEnabled(true)
23 | .build();
24 | FaceSDK.Instance().presentFaceCaptureActivity(context, configuration, faceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse));
25 | }
26 |
27 | @Override
28 | public String getDescription() {
29 | return "Custom notification background drawable based on Default UI";
30 | }
31 |
32 | @Override
33 | public String getTitle() {
34 | return "Custom notification background";
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/NotificationViewPositionItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.items.customization.fragment.NotificationViewPositionFragment;
7 | import com.regula.facesample.util.LivenessResponseUtil;
8 | import com.regula.facesdk.FaceSDK;
9 | import com.regula.facesdk.configuration.LivenessConfiguration;
10 |
11 | /**
12 | * Created by Sergey Yakimchik on 6.09.21.
13 | * Copyright (c) 2021 Regula. All rights reserved.
14 | */
15 |
16 | public class NotificationViewPositionItem extends CategoryItem {
17 | @Override
18 | public void onItemSelected(Context context) {
19 | LivenessConfiguration configuration = new LivenessConfiguration.Builder()
20 | .registerUiFragmentClass(NotificationViewPositionFragment.class)
21 | .build();
22 | FaceSDK.Instance().startLiveness(context, configuration, livenessResponse -> LivenessResponseUtil.response(context, livenessResponse));
23 | }
24 |
25 | @Override
26 | public String getDescription() {
27 | return "Change notification view position using default UI";
28 | }
29 |
30 | @Override
31 | public String getTitle() {
32 | return "Notification text view position";
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/OverlayCustomItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.util.FaceCaptureResponseUtil;
7 | import com.regula.facesdk.FaceSDK;
8 |
9 | /**
10 | * Created by Sergey Yakimchik on 24.08.21.
11 | * Copyright (c) 2021 Regula. All rights reserved.
12 | */
13 |
14 | public class OverlayCustomItem extends CategoryItem {
15 |
16 | @Override
17 | public void onItemSelected(Context context) {
18 | // uncomment in res/values/colors.xml:
19 | // all
20 | // facesdk_overlay_background_dark
21 | // facesdk_overlay_background_white
22 | // facesdk_overlay_border_default
23 | // facesdk_overlay_border_active
24 | FaceSDK.Instance().presentFaceCaptureActivity(context, faceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse));
25 | }
26 |
27 | @Override
28 | public String getTitle() {
29 | return "Custom Overlay";
30 | }
31 |
32 | @Override
33 | public String getDescription() {
34 | return "Change colors for overlay";
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/SwapButtonItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.items.customization.fragment.SwapButtonFragment;
7 | import com.regula.facesdk.FaceSDK;
8 | import com.regula.facesdk.configuration.FaceCaptureConfiguration;
9 | import com.regula.facesdk.configuration.LivenessConfiguration;
10 |
11 | /**
12 | * Created by Sergey Yakimchik on 7.09.21.
13 | * Copyright (c) 2021 Regula. All rights reserved.
14 | */
15 |
16 | public class SwapButtonItem extends CategoryItem {
17 | @Override
18 | public void onItemSelected(Context context) {
19 | FaceCaptureConfiguration configuration = new FaceCaptureConfiguration.Builder()
20 | .registerUiFragmentClass(SwapButtonFragment.class)
21 | .setCameraSwitchEnabled(true)
22 | .build();
23 | FaceSDK.Instance().presentFaceCaptureActivity(context, configuration, faceCaptureResponse -> {});
24 | }
25 |
26 | @Override
27 | public String getDescription() {
28 | return "Change swap button drawable using default UI";
29 | }
30 |
31 | @Override
32 | public String getTitle() {
33 | return "Change swap button";
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/fragment/BasicCustomUiFragment.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization.fragment;
2 |
3 | import android.view.View;
4 | import android.widget.TextView;
5 |
6 | import androidx.annotation.NonNull;
7 |
8 | import com.regula.facesample.R;
9 | import com.regula.facesdk.fragment.FaceUiFragment;
10 |
11 | /**
12 | * Created by Sergey Yakimchik on 19.08.21.
13 | * Copyright (c) 2021 Regula. All rights reserved.
14 | */
15 |
16 | public class BasicCustomUiFragment extends FaceUiFragment {
17 |
18 | @Override
19 | public View getSwapCameraButton(@NonNull View view) {
20 | return null;
21 | }
22 |
23 | @Override
24 | public View getFlashLightButton(@NonNull View view) {
25 | return null;
26 | }
27 |
28 | @Override
29 | public TextView getNotificationView(@NonNull View view) {
30 | return view.findViewById(R.id.notificationView);
31 | }
32 |
33 | @Override
34 | public int getResourceLayoutId() {
35 | return R.layout.custom_hint_view_appearance;
36 | }
37 |
38 | @Override
39 | public View getCloseButton(View view) {
40 | return view.findViewById(R.id.closeButton);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/fragment/ButtonsColorFragment.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization.fragment;
2 |
3 | import android.graphics.Color;
4 |
5 | import com.regula.facesdk.fragment.FaceDefaultUiFragment;
6 |
7 | /**
8 | * Created by Sergey Yakimchik on 6.09.21.
9 | * Copyright (c) 2021 Regula. All rights reserved.
10 | */
11 |
12 | public class ButtonsColorFragment extends FaceDefaultUiFragment {
13 |
14 | @Override
15 | public int getButtonsColor(boolean isLightOn) {
16 | return isLightOn ? Color.RED : Color.GREEN;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/fragment/FlashButtonFragment.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization.fragment;
2 |
3 | import android.view.View;
4 | import android.widget.ImageButton;
5 |
6 | import androidx.annotation.NonNull;
7 |
8 | import com.regula.facesample.R;
9 | import com.regula.facesdk.fragment.FaceDefaultUiFragment;
10 |
11 | /**
12 | * Created by Sergey Yakimchik on 7.09.21.
13 | * Copyright (c) 2021 Regula. All rights reserved.
14 | */
15 |
16 | public class FlashButtonFragment extends FaceDefaultUiFragment {
17 |
18 | View mFlashLightBtn;
19 |
20 | @Override
21 | public View getFlashLightButton(@NonNull View view) {
22 | mFlashLightBtn = super.getFlashLightButton(view);
23 | return mFlashLightBtn;
24 | }
25 |
26 | @Override
27 | public void updateFlashLightButton(boolean isLightOn) {
28 | if (mFlashLightBtn == null)
29 | return;
30 |
31 | if (mFlashLightBtn instanceof ImageButton)
32 | ((ImageButton) mFlashLightBtn).setImageDrawable(getResources().getDrawable(isLightOn ? R.drawable.flash_light_on : R.drawable.flash_light_off));
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/fragment/HideNotificationViewFragment.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization.fragment;
2 |
3 | import android.view.View;
4 | import android.widget.TextView;
5 |
6 | import androidx.annotation.NonNull;
7 |
8 | import com.regula.facesdk.fragment.FaceDefaultUiFragment;
9 |
10 | /**
11 | * Created by Sergey Yakimchik on 6.09.21.
12 | * Copyright (c) 2021 Regula. All rights reserved.
13 | */
14 |
15 | public class HideNotificationViewFragment extends FaceDefaultUiFragment {
16 |
17 | @Override
18 | public TextView getNotificationView(@NonNull View view) {
19 | TextView textView = super.getNotificationView(view);
20 | textView.setVisibility(View.INVISIBLE);
21 | return textView;
22 | }
23 |
24 | @Override
25 | public void setNotificationStatusText(String s) {
26 | // ignore any new status
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/fragment/NotificationViewFragment.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization.fragment;
2 |
3 | import android.content.Context;
4 | import android.graphics.drawable.Drawable;
5 |
6 | import androidx.core.content.ContextCompat;
7 |
8 | import com.regula.facesample.R;
9 | import com.regula.facesdk.fragment.FaceDefaultUiFragment;
10 |
11 | /**
12 | * Created by Sergey Yakimchik on 6.09.21.
13 | * Copyright (c) 2021 Regula. All rights reserved.
14 | */
15 |
16 | public class NotificationViewFragment extends FaceDefaultUiFragment {
17 |
18 | @Override
19 | public Drawable getNotificationBackgroundDrawable(Context context, boolean isLightOn) {
20 | return ContextCompat.getDrawable(context, isLightOn ? R.drawable.notification_view_background_dark : R.drawable.notification_view_background_white);
21 | }
22 |
23 | @Override
24 | public int getNotificationTextColor(boolean isLightOn) {
25 | return getResources().getColor(isLightOn ? R.color.notification_view_text_color_light_on : R.color.notification_view_text_color_light_off);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/fragment/NotificationViewPositionFragment.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization.fragment;
2 |
3 | import android.graphics.RectF;
4 | import android.view.View;
5 |
6 | import androidx.constraintlayout.widget.Guideline;
7 |
8 | import com.regula.facesample.R;
9 | import com.regula.facesdk.fragment.FaceDefaultUiFragment;
10 |
11 | /**
12 | * Created by Sergey Yakimchik on 6.09.21.
13 | * Copyright (c) 2021 Regula. All rights reserved.
14 | */
15 |
16 | public class NotificationViewPositionFragment extends FaceDefaultUiFragment {
17 |
18 | @Override
19 | public void onFaceAreaViewPositionUpdated(RectF rect) {
20 | View view = getView();
21 | if (view == null)
22 | return;
23 |
24 | int topMargin = (int) rect.top;
25 | topMargin += rect.height() * 0.4;
26 |
27 | Guideline notificationGuideline = view.findViewById(R.id.topNotificationGuideline);
28 | notificationGuideline.setGuidelinePercent(-1);
29 | notificationGuideline.setGuidelineBegin(topMargin);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/customization/fragment/SwapButtonFragment.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.customization.fragment;
2 |
3 | import android.view.View;
4 | import android.widget.ImageButton;
5 |
6 | import androidx.annotation.NonNull;
7 |
8 | import com.regula.facesample.R;
9 | import com.regula.facesdk.fragment.FaceDefaultUiFragment;
10 |
11 | /**
12 | * Created by Sergey Yakimchik on 7.09.21.
13 | * Copyright (c) 2021 Regula. All rights reserved.
14 | */
15 |
16 | public class SwapButtonFragment extends FaceDefaultUiFragment {
17 |
18 | @Override
19 | public View getSwapCameraButton(@NonNull View v) {
20 | View swapCameraBtn = super.getSwapCameraButton(v);
21 | if (swapCameraBtn instanceof ImageButton) {
22 | ((ImageButton) swapCameraBtn).setImageResource(R.drawable.swap_button);
23 | }
24 | return swapCameraBtn;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/features/FaceCaptureCameraPositionItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.features;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.util.FaceCaptureResponseUtil;
7 | import com.regula.facesdk.FaceSDK;
8 | import com.regula.facesdk.configuration.FaceCaptureConfiguration;
9 |
10 | /**
11 | * Created by Sergey Yakimchik on 23.08.21.
12 | * Copyright (c) 2021 Regula. All rights reserved.
13 | */
14 |
15 | public class FaceCaptureCameraPositionItem extends CategoryItem {
16 |
17 | @Override
18 | public void onItemSelected(Context context) {
19 | FaceCaptureConfiguration configuration = new FaceCaptureConfiguration.Builder()
20 | .setCameraSwitchEnabled(true)
21 | .setCameraId(0)
22 | .build();
23 | FaceSDK.Instance().presentFaceCaptureActivity(context, configuration, faceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse));
24 | }
25 |
26 | @Override
27 | public String getTitle() {
28 | return "Face Capture camera position";
29 | }
30 |
31 | @Override
32 | public String getDescription() {
33 | return "Changes default camera position to back.";
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/features/FaceSdkDeinitItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.features;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesdk.FaceSDK;
7 |
8 | public class FaceSdkDeinitItem extends CategoryItem {
9 |
10 | @Override
11 | public void onItemSelected(Context context) {
12 | FaceSDK.Instance().deinitialize();
13 | }
14 |
15 | @Override
16 | public String getDescription() {
17 | return "Deinitialization FaceSDK resources";
18 | }
19 |
20 | @Override
21 | public String getTitle() {
22 | return "Deinitialization SDK";
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/features/FaceSdkInitItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.features;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesdk.FaceSDK;
7 |
8 | public class FaceSdkInitItem extends CategoryItem {
9 |
10 | @Override
11 | public void onItemSelected(Context context) {
12 | FaceSDK.Instance().initialize(context, (status, exception) -> { });
13 | }
14 |
15 | @Override
16 | public String getDescription() {
17 | return "Initialization FaceSDK resources";
18 | }
19 |
20 | @Override
21 | public String getTitle() {
22 | return "Initialization SDK";
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/features/LivenessAttemptsCountItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.features;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.util.LivenessResponseUtil;
7 | import com.regula.facesdk.FaceSDK;
8 | import com.regula.facesdk.configuration.LivenessConfiguration;
9 |
10 | /**
11 | * Created by Sergey Yakimchik on 23.08.21.
12 | * Copyright (c) 2021 Regula. All rights reserved.
13 | */
14 |
15 | public class LivenessAttemptsCountItem extends CategoryItem {
16 | @Override
17 | public void onItemSelected(Context context) {
18 | LivenessConfiguration configuration = new LivenessConfiguration.Builder()
19 | .setAttemptsCount(2)
20 | .build();
21 | FaceSDK.Instance().startLiveness(context, configuration, livenessResponse -> LivenessResponseUtil.response(context, livenessResponse));
22 | }
23 |
24 | @Override
25 | public String getTitle() {
26 | return "Limit Liveness attempts count";
27 | }
28 |
29 | @Override
30 | public String getDescription() {
31 | return "Liveness is limited to the number of retries.";
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/features/LivenessDisableStepItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.features;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.util.LivenessResponseUtil;
7 | import com.regula.facesdk.FaceSDK;
8 | import com.regula.facesdk.configuration.LivenessConfiguration;
9 | import com.regula.facesdk.enums.LivenessSkipStep;
10 |
11 | public class LivenessDisableStepItem extends CategoryItem {
12 |
13 | @Override
14 | public void onItemSelected(Context context) {
15 | LivenessConfiguration configuration = new LivenessConfiguration.Builder()
16 | .setSkipStep(LivenessSkipStep.ONBOARDING_STEP, LivenessSkipStep.SUCCESS_STEP)
17 | .build();
18 | FaceSDK.Instance().startLiveness(context, configuration, livenessResponse -> LivenessResponseUtil.response(context, livenessResponse));
19 | }
20 |
21 | @Override
22 | public String getDescription() {
23 | return "Hide some steps in liveness process";
24 | }
25 |
26 | @Override
27 | public String getTitle() {
28 | return "Disable steps in liveness";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/features/LivenessSessionIdItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.features;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.util.LivenessResponseUtil;
7 | import com.regula.facesdk.FaceSDK;
8 | import com.regula.facesdk.configuration.LivenessConfiguration;
9 |
10 | import java.util.UUID;
11 |
12 | public class LivenessSessionIdItem extends CategoryItem {
13 |
14 | @Override
15 | public void onItemSelected(Context context) {
16 | LivenessConfiguration configuration = new LivenessConfiguration.Builder()
17 | .setTag(UUID.randomUUID().toString())
18 | .build();
19 | FaceSDK.Instance().startLiveness(context, configuration, livenessResponse -> LivenessResponseUtil.response(context, livenessResponse));
20 | }
21 |
22 | @Override
23 | public String getDescription() {
24 | return "Set up session Id for liveness";
25 | }
26 |
27 | @Override
28 | public String getTitle() {
29 | return "Liveness Session Id";
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/other/LocalizationItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.other;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.util.LivenessResponseUtil;
7 | import com.regula.facesdk.FaceSDK;
8 |
9 | /**
10 | * Created by Sergey Yakimchik on 24.08.21.
11 | * Copyright (c) 2021 Regula. All rights reserved.
12 | */
13 |
14 | public class LocalizationItem extends CategoryItem {
15 |
16 | @Override
17 | public void onItemSelected(Context context) {
18 | // uncomment in res/values/strings.xml:
19 | // hint.fit resource
20 |
21 |
22 | //This is another approach of customizing localization by overriding strings in callback
23 | FaceSDK.Instance().setLocalizationCallback(stringId -> {
24 | if(stringId.equals("livenessGuide.head"))
25 | return "this is custom selfie time string string";
26 | return null;
27 | });
28 |
29 | FaceSDK.Instance().startLiveness(context, livenessResponse -> LivenessResponseUtil.response(context, livenessResponse));
30 | }
31 |
32 | @Override
33 | public String getTitle() {
34 | return "Custom localization";
35 | }
36 |
37 | @Override
38 | public String getDescription() {
39 | return "Localization hook example.";
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/other/NetworkInterceptorItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.other;
2 |
3 | import android.content.Context;
4 |
5 | import com.regula.facesample.items.CategoryItem;
6 | import com.regula.facesample.util.LivenessResponseUtil;
7 | import com.regula.facesdk.FaceSDK;
8 |
9 | /**
10 | * Created by Sergey Yakimchik on 23.08.21.
11 | * Copyright (c) 2021 Regula. All rights reserved.
12 | */
13 |
14 | public class NetworkInterceptorItem extends CategoryItem {
15 |
16 | @Override
17 | public void onItemSelected(Context context) {
18 | FaceSDK.Instance().setNetworkInterceptorListener(httpURLConnection -> {
19 | httpURLConnection.getConnection().setRequestProperty("customFiels", "TestValue");
20 | });
21 | FaceSDK.Instance().setServiceUrl(FaceSDK.Instance().getServiceUrl());
22 | FaceSDK.Instance().startLiveness(context, livenessResponse -> LivenessResponseUtil.response(context, livenessResponse));
23 | }
24 |
25 | @Override
26 | public String getTitle() {
27 | return "Network interceptor";
28 | }
29 |
30 | @Override
31 | public String getDescription() {
32 | return "Adds custom http fields to the outgoing requests.";
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/items/other/VideoCompletionItem.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.items.other;
2 |
3 | import android.content.Context;
4 | import android.util.Log;
5 |
6 | import androidx.annotation.NonNull;
7 |
8 | import com.regula.facesample.items.CategoryItem;
9 | import com.regula.facesample.util.LivenessResponseUtil;
10 | import com.regula.facesdk.FaceSDK;
11 | import com.regula.facesdk.listener.IVideoEncoderCompletion;
12 |
13 | public class VideoCompletionItem extends CategoryItem {
14 |
15 | @Override
16 | public void onItemSelected(Context context) {
17 | FaceSDK.Instance().setVideoEncoderCompletion(new IVideoEncoderCompletion() {
18 | @Override
19 | public void onVideoRecorded(@NonNull String transactionId, boolean success) {
20 | Log.d("VideoCompletionItem", "Transaction video: " + transactionId + " success: " + success);
21 | }
22 | });
23 | FaceSDK.Instance().startLiveness(context, livenessResponse -> LivenessResponseUtil.response(context, livenessResponse));
24 | }
25 |
26 | @Override
27 | public String getDescription() {
28 | return "Video completion about uploading liveness video to service";
29 | }
30 |
31 | @Override
32 | public String getTitle() {
33 | return "Video completion";
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/util/FaceCaptureResponseUtil.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.util;
2 |
3 | import android.content.Context;
4 | import android.widget.Toast;
5 |
6 | import com.regula.facesdk.model.results.FaceCaptureResponse;
7 | import com.regula.facesdk.model.results.LivenessResponse;
8 |
9 | public class FaceCaptureResponseUtil {
10 |
11 | public static void response(Context context, FaceCaptureResponse faceCaptureResponse) {
12 | if (faceCaptureResponse.getException() != null)
13 | Toast.makeText(context, "Error: " + faceCaptureResponse.getException().getMessage(), Toast.LENGTH_SHORT).show();
14 | else
15 | Toast.makeText(context, "Successfully got an image", Toast.LENGTH_SHORT).show();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/java/com/regula/facesample/util/LivenessResponseUtil.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample.util;
2 |
3 | import android.content.Context;
4 | import android.widget.Toast;
5 |
6 | import com.regula.facesdk.model.results.LivenessResponse;
7 |
8 | public class LivenessResponseUtil {
9 |
10 | public static void response(Context context, LivenessResponse livenessResponse) {
11 | if (livenessResponse.getException() != null)
12 | Toast.makeText(context, "Error: " + livenessResponse.getException().getMessage(), Toast.LENGTH_SHORT).show();
13 | else
14 | Toast.makeText(context, "Liveness status: " + livenessResponse.getLiveness().name(), Toast.LENGTH_SHORT).show();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/drawable/close_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
14 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/drawable/done_button.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
14 |
19 |
20 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/drawable/flash_light_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSampleJava/app/src/main/res/drawable/flash_light_off.png
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/drawable/flash_light_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSampleJava/app/src/main/res/drawable/flash_light_on.png
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/drawable/hind_view_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/drawable/notification_view_background_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/drawable/notification_view_background_white.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/drawable/rounded_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/drawable/rounded_button_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/layout/custom_hint_view_appearance.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
27 |
28 |
38 |
39 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/layout/custom_liveness_processing.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
17 |
18 |
22 |
23 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/layout/item_element.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
25 |
26 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/layout/item_header_title.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
18 |
19 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/menu/menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSampleJava/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSampleJava/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSampleJava/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSampleJava/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSampleJava/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSampleJava/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSampleJava/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSampleJava/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSampleJava/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSampleJava/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/values-night/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #585858
4 | #ddddde
5 | #b7b7b7
6 | #828282
7 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 | #DDDDDE
11 | #2a2a2a
12 | #4d4d4d
13 | #4d4d4d
14 |
15 |
16 |
20 |
21 | #03DAC5
22 | #3700B3
23 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | BasicSampleJava
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/BasicSampleJava/app/src/test/java/com/regula/facesample/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.regula.facesample;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/BasicSampleJava/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:7.1.0'
8 | }
9 | }
10 |
11 | task clean(type: Delete) {
12 | delete rootProject.buildDir
13 | }
--------------------------------------------------------------------------------
/BasicSampleJava/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
--------------------------------------------------------------------------------
/BasicSampleJava/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSampleJava/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/BasicSampleJava/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Sep 26 18:06:35 MSK 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
8 |
--------------------------------------------------------------------------------
/BasicSampleJava/settings.gradle:
--------------------------------------------------------------------------------
1 | import org.gradle.api.initialization.resolve.RepositoriesMode
2 |
3 | dependencyResolutionManagement {
4 | repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
5 | repositories {
6 | google()
7 | mavenCentral()
8 | jcenter() // Warning: this repository is going to shut down soon
9 | maven {
10 | url = uri("https://maven.regulaforensics.com/RegulaDocumentReader")
11 | }
12 | }
13 | }
14 | include ':app'
15 | rootProject.name = "BasicSampleJava"
--------------------------------------------------------------------------------
/CertificatePinningSample/README.md:
--------------------------------------------------------------------------------
1 | # Regula Face SDK (Android version)
2 | Face SDK is a framework that is used for face matching, recognition, and liveness detection.
3 | In this sample we demonstrate how configure Certificate Pinning in the Android app
4 |
5 | ## Steps
6 |
7 | Here you can find how to generate key for the android app
8 | https://nikunj-joshi.medium.com/ssl-pinning-increase-server-identity-trust-656a2fc7e22b
9 |
10 | 1. In the mobile app you need to create xml file (main/res/xml/network_security_config)
11 | 2. In the AndroidManifest.xml you need to set up config above in the application area:
12 | android:networkSecurityConfig="@xml/network_security_config"
13 | 3. In the network-security-config you need to replace 'domain' to your and replace 'SHA-256'
--------------------------------------------------------------------------------
/CertificatePinningSample/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'kotlin-android'
4 | }
5 |
6 | android {
7 | compileSdk 32
8 |
9 | defaultConfig {
10 | applicationId "com.regula.facesamplekotlin"
11 | minSdk 24
12 | targetSdk 32
13 | versionCode 1
14 | versionName "1.0"
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 |
24 | buildFeatures {
25 | viewBinding true
26 | }
27 | }
28 |
29 | dependencies {
30 | implementation 'androidx.appcompat:appcompat:1.4.1'
31 | implementation 'com.google.android.material:material:1.5.0'
32 | implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
33 | implementation "androidx.recyclerview:recyclerview:1.2.1"
34 | implementation "androidx.core:core-ktx:1.7.0"
35 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
36 |
37 | implementation ('com.regula.face:api:6.3.+@aar'){
38 | transitive = true
39 | }
40 |
41 | implementation ('com.regula.face.core:basic:6.3.+@aar')
42 | }
43 |
--------------------------------------------------------------------------------
/CertificatePinningSample/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
15 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/drawable-v24/rounded_button_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
20 |
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/CertificatePinningSample/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/CertificatePinningSample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/CertificatePinningSample/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/CertificatePinningSample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/CertificatePinningSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/CertificatePinningSample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/CertificatePinningSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/CertificatePinningSample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/CertificatePinningSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/CertificatePinningSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/values-night/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #585858
4 | #ddddde
5 | #b7b7b7
6 | #828282
7 |
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 | #DDDDDE
11 | #2a2a2a
12 | #4d4d4d
13 | #4d4d4d
14 |
15 |
16 |
20 |
21 | #03DAC5
22 | #3700B3
23 |
24 | #469597
25 | #5BA199
26 | #E5E3E4
27 | #DDBEAA
28 | #BBC6C8
29 |
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | FaceSample
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/CertificatePinningSample/app/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | faceapi.regulaforensics.com
4 |
5 | /5RKFaPkCjAzvsEZHOlYqncYADaLIG5VfTmhsBbkaBk=
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CertificatePinningSample/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.6.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:7.1.0'
9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10 | }
11 | }
12 |
13 | task clean(type: Delete) {
14 | delete rootProject.buildDir
15 | }
--------------------------------------------------------------------------------
/CertificatePinningSample/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
--------------------------------------------------------------------------------
/CertificatePinningSample/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/CertificatePinningSample/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/CertificatePinningSample/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Sep 26 18:06:35 MSK 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
8 |
--------------------------------------------------------------------------------
/CertificatePinningSample/settings.gradle:
--------------------------------------------------------------------------------
1 | import org.gradle.api.initialization.resolve.RepositoriesMode
2 |
3 | dependencyResolutionManagement {
4 | repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
5 | repositories {
6 | google()
7 | mavenCentral()
8 | jcenter() // Warning: this repository is going to shut down soon
9 | maven {
10 | url = uri("https://maven.regulaforensics.com/RegulaDocumentReader")
11 | }
12 | }
13 | }
14 | include ':app'
15 | rootProject.name = "CertificatePinningSample"
--------------------------------------------------------------------------------
/FaceSearchSample/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/FaceSearchSample/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | }
4 |
5 | android {
6 | namespace 'com.regula.facepersonsearch'
7 | compileSdk 33
8 |
9 | defaultConfig {
10 | applicationId "com.regula.facepersonsearch"
11 | minSdk 21
12 | targetSdk 33
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 | }
18 |
19 | buildFeatures {
20 | viewBinding true
21 | }
22 |
23 | buildTypes {
24 | release {
25 | minifyEnabled false
26 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
27 | }
28 | }
29 | }
30 |
31 | dependencies {
32 |
33 | implementation 'com.google.android.material:material:1.8.0'
34 | implementation 'androidx.appcompat:appcompat:1.0.0'
35 | implementation 'androidx.constraintlayout:constraintlayout:2.0.0'
36 | implementation 'androidx.recyclerview:recyclerview:1.3.0'
37 |
38 | implementation ('com.regula.face:api:6.3.+@aar'){
39 | transitive = true
40 | }
41 | implementation ('com.regula.face.core:basic:6.3.+@aar')
42 |
43 | testImplementation 'junit:junit:4.13.2'
44 | androidTestImplementation 'androidx.test.ext:junit:1.1.5'
45 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
46 | }
--------------------------------------------------------------------------------
/FaceSearchSample/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
17 |
21 |
25 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/java/com/regula/facepersonsearch/ItemPositionAdapter.java:
--------------------------------------------------------------------------------
1 | package com.regula.facepersonsearch;
2 |
3 | import androidx.recyclerview.widget.RecyclerView;
4 |
5 | public abstract class ItemPositionAdapter
6 | extends RecyclerView.Adapter {
7 | private int position = -1;
8 |
9 | public int getPosition() {
10 | return this.position;
11 | }
12 |
13 | void setPosition(int position) {
14 | this.position = position;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/drawable/add_btn.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/drawable/search_btn.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/layout/activity_items_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
18 |
19 |
29 |
30 |
40 |
41 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/layout/fragment_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/layout/fragment_item_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/layout/group_create_update.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/layout/image_vh.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/menu/menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/menu/menu_reset.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/FaceSearchSample/app/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/FaceSearchSample/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/FaceSearchSample/app/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/FaceSearchSample/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/FaceSearchSample/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/FaceSearchSample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/FaceSearchSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/FaceSearchSample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/FaceSearchSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/FaceSearchSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | FacePersonSearch
3 |
--------------------------------------------------------------------------------
/FaceSearchSample/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
20 |
--------------------------------------------------------------------------------
/FaceSearchSample/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:7.1.0'
8 | }
9 | }
10 |
11 | task clean(type: Delete) {
12 | delete rootProject.buildDir
13 | }
--------------------------------------------------------------------------------
/FaceSearchSample/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Enables namespacing of each library's R class so that its R class includes only the
19 | # resources declared in the library itself and none from the library's dependencies,
20 | # thereby reducing the size of the R class for that library
21 | android.nonTransitiveRClass=true
--------------------------------------------------------------------------------
/FaceSearchSample/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/FaceSearchSample/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/FaceSearchSample/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Feb 17 09:49:02 EET 2023
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/FaceSearchSample/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | gradlePluginPortal()
6 | }
7 | }
8 | dependencyResolutionManagement {
9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
10 | repositories {
11 | google()
12 | mavenCentral()
13 |
14 | maven {
15 | url = uri("https://maven.regulaforensics.com/RegulaDocumentReader")
16 | }
17 | }
18 | }
19 | rootProject.name = "FacePersonSearch"
20 | include ':app'
21 |
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | app/build
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'kotlin-android'
4 | }
5 |
6 | android {
7 | compileSdk 34
8 |
9 | defaultConfig {
10 | applicationId "com.regula.documentreader"
11 | minSdk 21
12 | targetSdk 34
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 |
26 | buildFeatures {
27 | viewBinding true
28 | }
29 |
30 | //Required to add
31 | aaptOptions {
32 | noCompress "Regula/faceSdkResource.dat"
33 | }
34 | }
35 |
36 | dependencies {
37 | testImplementation 'junit:junit:4.+'
38 | androidTestImplementation 'androidx.test.ext:junit:1.1.2'
39 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
40 |
41 | implementation 'androidx.appcompat:appcompat:1.4.1'
42 | implementation 'com.google.android.material:material:1.5.0'
43 | implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
44 | implementation "androidx.recyclerview:recyclerview:1.2.1"
45 | implementation "androidx.core:core-ktx:1.7.0"
46 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
47 |
48 | implementation ('com.regula.face:api:6.3.+@aar'){
49 | transitive = true
50 | }
51 |
52 | implementation ('com.regula.face.core:match:6.3.+@aar')
53 | }
54 |
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/androidTest/java/com/regula/facesamplekotlin/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.regula.facesamplekotlin", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
16 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/java/com/regula/facesamplekotlin/FileUtil.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin
2 |
3 | import android.content.Context
4 | import java.io.IOException
5 |
6 |
7 | object FileUtil {
8 | fun getLicense(context: Context?): ByteArray? {
9 | if (context == null) return null
10 | val licInput = context.resources.openRawResource(R.raw.regula)
11 | val available: Int = try {
12 | licInput.available()
13 | } catch (e: IOException) {
14 | return null
15 | }
16 | val license = ByteArray(available)
17 | try {
18 | licInput.read(license)
19 | } catch (e: IOException) {
20 | return null
21 | }
22 | return license
23 | }
24 | }
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/java/com/regula/facesamplekotlin/ResizeTransformation.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin
2 |
3 | import android.graphics.Bitmap
4 | import kotlin.math.max
5 |
6 | class ResizeTransformation(private val maxSize: Int) {
7 | fun transform(source: Bitmap?): Bitmap? {
8 | var result:Bitmap? = null
9 |
10 |
11 | if (source != null) {
12 | var width = source.width
13 | var height = source.height
14 |
15 | if(max(width, height) <= maxSize)
16 | return source
17 |
18 | val bitmapRatio = width.toFloat() / height.toFloat()
19 |
20 | if (bitmapRatio > 1) {
21 | width = maxSize;
22 | height = (width / bitmapRatio).toInt()
23 | } else {
24 | height = maxSize;
25 | width = (height * bitmapRatio).toInt()
26 | }
27 |
28 | result = Bitmap.createScaledBitmap(source, width, height, true)
29 | source.recycle()
30 | }
31 |
32 | return result
33 | }
34 | }
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/drawable-v24/rounded_button_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/layout/fragment_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
23 |
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/menu/menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/OfflineMatchFaceSample/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/OfflineMatchFaceSample/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/OfflineMatchFaceSample/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/OfflineMatchFaceSample/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/OfflineMatchFaceSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/OfflineMatchFaceSample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/OfflineMatchFaceSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/OfflineMatchFaceSample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/OfflineMatchFaceSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/OfflineMatchFaceSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/values-night/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #585858
4 | #ddddde
5 | #b7b7b7
6 | #828282
7 | #ffffff
8 |
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 | #DDDDDE
11 | #2a2a2a
12 | #4d4d4d
13 | #4d4d4d
14 | #663399
15 |
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | OfflineMatchFaceSample
3 |
4 |
5 | - PRINTED
6 | - RFID
7 | - LIVE
8 | - DOCUMENT WITH LIVE
9 | - EXTERNAL
10 | - GHOST PORTRAIT
11 | - BARCODE
12 |
13 |
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/app/src/test/java/com/regula/facesamplekotlin/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.regula.facesamplekotlin
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.6.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:7.1.0'
9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10 | }
11 | }
12 |
13 | task clean(type: Delete) {
14 | delete rootProject.buildDir
15 | }
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/OfflineMatchFaceSample/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Sep 26 18:06:35 MSK 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
8 |
--------------------------------------------------------------------------------
/OfflineMatchFaceSample/settings.gradle:
--------------------------------------------------------------------------------
1 | import org.gradle.api.initialization.resolve.RepositoriesMode
2 |
3 | dependencyResolutionManagement {
4 | repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
5 | repositories {
6 | google()
7 | mavenCentral()
8 | jcenter() // Warning: this repository is going to shut down soon
9 | maven {
10 | url = uri("https://maven.regulaforensics.com/RegulaDocumentReader")
11 | }
12 | }
13 | }
14 | include ':app'
15 | rootProject.name = "OfflineMatchFaceSample"
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Regula Face SDK (Android version)
2 | Face SDK is a framework that is used for face matching, recognition, and liveness detection.
3 |
4 | # Contents
5 | * [How to build the demo application](#how-to-build-the-demo-application)
6 | * [Documentation](#documentation)
7 | * [Additional information](#additional-information)
8 |
9 | ## How to build the demo application
10 | 1. Download this repository using the command `git clone https://github.com/regulaforensics/FaceSDK-Android.git`.
11 | 2. Open the project and run it.
12 |
13 | ## Documentation
14 | You can find documentation on API [here](https://docs.regulaforensics.com/face-sdk).
15 |
16 | ## Additional information
17 | If you have any technical questions, feel free to [contact](mailto:support@regulaforensics.com) us or create issues [here](https://github.com/regulaforensics/FaceSDK-Android/issues).
18 |
--------------------------------------------------------------------------------