├── .gitignore ├── .npmignore ├── DemoApp ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── .yarnrc.yml ├── Gemfile ├── README.md ├── __tests__ │ ├── index.android.js │ └── index.ios.js ├── android │ ├── .gitignore │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ ├── .gitignore │ │ │ ├── classifier_on_device_ep_99_float16_quant.enc │ │ │ └── normalized_ensemble_passports_v2_float16_quant.enc │ │ │ ├── java │ │ │ └── com │ │ │ │ └── demoapp │ │ │ │ ├── MainActivity.kt │ │ │ │ └── MainApplication.kt │ │ │ ├── jni │ │ │ └── Android.mk │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ ├── strings-jumio-sdk.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── index.js ├── ios │ ├── .gitignore │ ├── .xcode.env │ ├── AppDelegate.swift │ ├── DemoApp-Bridging-Header.h │ ├── DemoApp.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── DemoApp.xcscheme │ ├── DemoApp.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── DemoApp │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── DemoApp.entitlements │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── PrivacyInfo.xcprivacy │ ├── File.swift │ ├── Podfile │ ├── classifier_on_device_ep_99_float16_quant.enc │ └── normalized_ensemble_passports_v2_float16_quant.enc ├── metro.config.js └── package.json ├── README.md ├── android ├── build.gradle ├── index.android.js └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── jumio │ │ └── react │ │ ├── JumioBaseModule.kt │ │ ├── JumioModule.kt │ │ └── JumioPackage.kt │ └── res │ └── values │ └── styles.xml ├── images ├── RN_localization.gif └── known_issues_xcode13.png ├── ios ├── Jumio-Bridging-Header.h ├── JumioCustomization.swift ├── JumioMobileReactSdk.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── JumioMobileSDK.m ├── JumioMobileSDK.swift ├── JumioReactMobileSdk-Bridging-Header.h ├── JumioReactMobileSdk.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── UIColorExtension.swift └── react-native-jumio-mobilesdk-Bridging-Header.h ├── package-lock.json ├── package.json └── react-native-jumio-mobilesdk.podspec /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # Intellij 36 | *.iml 37 | .idea/workspace.xml 38 | .idea/tasks.xml 39 | .idea/gradle.xml 40 | .idea/dictionaries 41 | .idea/libraries 42 | .idea/.gitignore 43 | .idea/modules.xml 44 | .idea/runConfigurations.xml 45 | .idea/vcs.xml 46 | android/.idea 47 | 48 | # Keystore files 49 | *.jks 50 | 51 | # External native build folder generated in Android Studio 2.2 and later 52 | .externalNativeBuild 53 | 54 | # Google Services (e.g. APIs or Firebase) 55 | google-services.json 56 | 57 | # Freeline 58 | freeline.py 59 | freeline/ 60 | freeline_project_description.json 61 | 62 | # XCode 63 | 64 | *.xcuserstate 65 | **/*.xcuserdatad/** 66 | 67 | # VSCode - Java plugin 68 | .project 69 | org.eclipse.buildship.core.prefs 70 | 71 | node_modules/ 72 | 73 | # Misc. OS files 74 | .DS_Store 75 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | DemoApp/ -------------------------------------------------------------------------------- /DemoApp/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /DemoApp/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | *.xcarchive 16 | !default.perspectivev3 17 | xcuserdata 18 | *.xccheckout 19 | *.moved-aside 20 | DerivedData 21 | *.hmap 22 | *.ipa 23 | *.xcuserstate 24 | **/.xcode.env.local 25 | 26 | # Android/IntelliJ 27 | # 28 | build/ 29 | .idea 30 | .gradle 31 | local.properties 32 | *.iml 33 | *.hprof 34 | .cxx/ 35 | *.keystore 36 | !debug.keystore 37 | .kotlin/ 38 | 39 | # node.js 40 | # 41 | node_modules/ 42 | npm-debug.log 43 | yarn-error.log 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://docs.fastlane.tools/best-practices/source-control/ 51 | 52 | **/fastlane/report.xml 53 | **/fastlane/Preview.html 54 | **/fastlane/screenshots 55 | **/fastlane/test_output 56 | 57 | # Bundle artifact 58 | *.jsbundle 59 | 60 | # Ruby / CocoaPods 61 | **/Pods/ 62 | /vendor/bundle/ 63 | 64 | # Temporary files created by Metro to check the health of the file watcher 65 | .metro-health-check* 66 | 67 | # testing 68 | /coverage 69 | 70 | # Yarn 71 | .yarn/* 72 | !.yarn/patches 73 | !.yarn/plugins 74 | !.yarn/releases 75 | !.yarn/sdks 76 | !.yarn/versions -------------------------------------------------------------------------------- /DemoApp/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /DemoApp/.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | 3 | yarnPath: .yarn/releases/yarn-3.6.4.cjs -------------------------------------------------------------------------------- /DemoApp/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby ">= 2.6.10" 5 | 6 | # Exclude problematic versions of cocoapods and activesupport that causes build failures. 7 | gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' 8 | gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' 9 | gem 'xcodeproj', '< 1.26.0' 10 | gem 'concurrent-ruby', '< 1.3.4' 11 | 12 | # Ruby 3.4.0 has removed some libraries from the standard library. 13 | gem 'bigdecimal' 14 | gem 'logger' 15 | gem 'benchmark' 16 | gem 'mutex_m' -------------------------------------------------------------------------------- /DemoApp/README.md: -------------------------------------------------------------------------------- 1 | # DemoApp for React Native 2 | 3 | ## Usage 4 | 5 | Adjust your credentials in **index.js** file, open a bash and run the following commands: 6 | 7 | ### Both 8 | Required to retrieve all dependencies that are required by this demo app: 9 | ``` 10 | npm install 11 | ``` 12 | 13 | ### iOS 14 | ``` 15 | cd ios 16 | pod install 17 | cd .. 18 | react-native run-ios or react-native run-ios --device 19 | ``` 20 | 21 | Jumio SDK dependencies added in version 3.8.0 make it necessary to add the following pre-install hook to the Podfile: 22 | ``` 23 | pre_install do |installer| 24 | installer.pod_targets.each do |pod| 25 | puts "Overriding the static_framework? method for #{pod.name}" 26 | def pod.static_framework?; 27 | true 28 | end 29 | def pod.build_type; 30 | Pod::BuildType.static_library 31 | end 32 | end 33 | end 34 | ``` 35 | This was added because iProov dependencies __SocketIO__ and __Starscream__ need to be build as dynamic frameworks while React Native are supported only as static libraries. This pre-install hook ensures that the pods added as `dynamic_frameworks` are built as dynamic frameworks, while the other pods are built as static libraries. 36 | 37 | One additional post-install hook needs to be added to the Podfile so that the dependencies are build for distribution: 38 | ``` 39 | post_install do |installer| 40 | installer.pods_project.targets.each do |target| 41 | target.build_configurations.each do |config| 42 | config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES' 43 | end 44 | end 45 | 46 | react_native_post_install( 47 | installer, 48 | config[:reactNativePath], 49 | :mac_catalyst_enabled => false 50 | ) 51 | __apply_Xcode_12_5_M1_post_install_workaround(installer) 52 | end 53 | ``` 54 | 55 | ### Android 56 | ``` 57 | npm run android-windows 58 | // or 59 | react-native run-android 60 | ``` 61 | 62 | If you get the error: `Unable to crunch file` on windows add the following line to your `build.gradle` (project): 63 | ```javascript 64 | allprojects { 65 | buildDir = "C:/tmp/${rootProject.name}/${project.name}" 66 | } 67 | ``` 68 | -------------------------------------------------------------------------------- /DemoApp/__tests__/index.android.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.android.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /DemoApp/__tests__/index.ios.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.ios.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /DemoApp/android/.gitignore: -------------------------------------------------------------------------------- 1 | # Non-project-specific build files: 2 | build.xml 3 | local.properties 4 | # Ant builds 5 | ant-build 6 | ant-gen 7 | # Eclipse builds 8 | gen 9 | out 10 | # Gradle builds 11 | /build 12 | *.iml 13 | .gradle 14 | /local.properties 15 | /.idea/workspace.xml 16 | /.idea/libraries 17 | .DS_Store 18 | build/ 19 | /captures 20 | .externalNativeBuild 21 | /.idea 22 | -------------------------------------------------------------------------------- /DemoApp/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] 15 | lib_deps.append(':' + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.demoapp", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.demoapp", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /DemoApp/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | apply plugin: "org.jetbrains.kotlin.android" 3 | apply plugin: "com.facebook.react" 4 | 5 | /** 6 | * This is the configuration block to customize your React Native Android app. 7 | * By default you don't need to apply any configuration, just uncomment the lines you need. 8 | */ 9 | react { 10 | /* Folders */ 11 | // The root of your project, i.e. where "package.json" lives. Default is '../..' 12 | // root = file("../../") 13 | // The folder where the react-native NPM package is. Default is ../../node_modules/react-native 14 | // reactNativeDir = file("../../node_modules/react-native") 15 | // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen 16 | // codegenDir = file("../../node_modules/@react-native/codegen") 17 | // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js 18 | // cliFile = file("../../node_modules/react-native/cli.js") 19 | 20 | /* Variants */ 21 | // The list of variants to that are debuggable. For those we're going to 22 | // skip the bundling of the JS bundle and the assets. By default is just 'debug'. 23 | // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. 24 | // debuggableVariants = ["liteDebug", "prodDebug"] 25 | 26 | /* Bundling */ 27 | // A list containing the node command and its flags. Default is just 'node'. 28 | // nodeExecutableAndArgs = ["node"] 29 | // 30 | // The command to run when bundling. By default is 'bundle' 31 | // bundleCommand = "ram-bundle" 32 | // 33 | // The path to the CLI configuration file. Default is empty. 34 | // bundleConfig = file(../rn-cli.config.js) 35 | // 36 | // The name of the generated asset file containing your JS bundle 37 | // bundleAssetName = "MyApplication.android.bundle" 38 | // 39 | // The entry file for bundle generation. Default is 'index.android.js' or 'index.js' 40 | // entryFile = file("../js/MyApplication.android.js") 41 | // 42 | // A list of extra flags to pass to the 'bundle' commands. 43 | // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle 44 | // extraPackagerArgs = [] 45 | 46 | /* Hermes Commands */ 47 | // The hermes compiler command to run. By default it is 'hermesc' 48 | // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" 49 | // 50 | // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" 51 | // hermesFlags = ["-O", "-output-source-map"] 52 | 53 | /* Autolinking */ 54 | autolinkLibrariesWithApp() 55 | } 56 | 57 | /** 58 | * Set this to true to Run Proguard on Release builds to minify the Java bytecode. 59 | */ 60 | def enableProguardInReleaseBuilds = false 61 | 62 | /** 63 | * The preferred build flavor of JavaScriptCore (JSC) 64 | * 65 | * For example, to use the international variant, you can use: 66 | * `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+` 67 | * 68 | * The international variant includes ICU i18n library and necessary data 69 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 70 | * give correct results when using with locales other than en-US. Note that 71 | * this variant is about 6MiB larger per architecture than default. 72 | */ 73 | def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+' 74 | 75 | android { 76 | compileSdk 35 77 | 78 | namespace "com.demoapp" 79 | defaultConfig { 80 | applicationId "com.demoapp" 81 | minSdkVersion 24 82 | targetSdkVersion 35 83 | versionCode 1 84 | versionName "1.0" 85 | } 86 | buildTypes { 87 | release { 88 | minifyEnabled enableProguardInReleaseBuilds 89 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 90 | } 91 | } 92 | 93 | packagingOptions { 94 | resources.excludes.add("META-INF/versions/9/OSGI-INF/MANIFEST.MF") 95 | resources.excludes.add("META-INF/kotlin-project-structure-metadata.json") 96 | resources.excludes.add("META-INF/kotlinx_coroutines_core.version") 97 | resources.excludes.add("META-INF/LICENSE.md") 98 | resources.excludes.add("META-INF/LICENSE-notice.md") 99 | resources.excludes.add("commonMain/default/manifest") 100 | resources.excludes.add("commonMain/default/linkdata/module") 101 | resources.excludes.add("commonMain/default/linkdata/**/*.knm") 102 | resources.excludes.add("nativeMain/default/manifest") 103 | resources.excludes.add("nativeMain/default/linkdata/module") 104 | resources.excludes.add("nativeMain/default/linkdata/**/*.knm") 105 | resources.excludes.add("nonJvmMain/default/manifest") 106 | resources.excludes.add("nonJvmMain/default/linkdata/module") 107 | resources.excludes.add("nonJvmMain/default/linkdata/**/*.knm") 108 | } 109 | } 110 | 111 | repositories { 112 | google() 113 | mavenCentral() 114 | gradlePluginPortal() 115 | exclusiveContent { 116 | forRepository { 117 | maven { 118 | url 'https://repo.mobile.jumio.ai' 119 | } 120 | } 121 | filter { 122 | includeGroup "com.jumio.android" 123 | includeGroup "com.iproov.sdk" 124 | } 125 | } 126 | } 127 | 128 | dependencies { 129 | implementation project(':react-native-jumio-mobilesdk') 130 | implementation fileTree(include: ['*.jar'], dir: 'libs') 131 | // The version of react-native is set by the React Native Gradle Plugin 132 | implementation("com.facebook.react:react-android") 133 | 134 | if (hermesEnabled.toBoolean()) { 135 | implementation("com.facebook.react:hermes-android") 136 | } else { 137 | implementation jscFlavor 138 | } 139 | } -------------------------------------------------------------------------------- /DemoApp/android/app/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jumio/mobile-react/2cba53e402f56e0adf260d0f2fc093b1700c76e8/DemoApp/android/app/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /DemoApp/android/app/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /DemoApp/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | -keep class com.facebook.soloader.** { *; } 51 | -keepclassmembers class com.facebook.soloader.SoLoader { 52 | static ; 53 | } 54 | 55 | 56 | -dontwarn com.facebook.react.** 57 | 58 | # TextLayoutBuilder uses a non-public Android constructor within StaticLayout. 59 | # See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. 60 | -dontwarn android.text.StaticLayout 61 | 62 | # okhttp 63 | 64 | -keepattributes Signature 65 | -keepattributes *Annotation* 66 | -keep class okhttp3.** { *; } 67 | -keep interface okhttp3.** { *; } 68 | -dontwarn okhttp3.** 69 | 70 | # okio 71 | 72 | -keep class sun.misc.Unsafe { *; } 73 | -dontwarn java.nio.file.* 74 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 75 | -dontwarn okio.** 76 | 77 | # Jumio 78 | -keep class com.jumio.** { *; } 79 | -keep class jumio.** { *; } 80 | # keep constraintlayout.motion classes and members for face help animation 81 | #-keep class androidx.constraintlayout.motion.widget.** { *; } 82 | 83 | #Microblink 84 | -keep class com.microblink.** { *; } 85 | -keep class com.microblink.**$* { *; } 86 | 87 | #IProov 88 | -keep public class com.iproov.sdk.IProov {public *; } 89 | 90 | #JRMT 91 | -keep class org.jmrtd.** { *; } 92 | -keep class net.sf.scuba.** { *; } 93 | -keep class org.bouncycastle.** { *; } 94 | -keep class org.ejbca.** { *; } 95 | 96 | -dontwarn java.nio.** 97 | -dontwarn org.codehaus.** 98 | -dontwarn org.ejbca.** 99 | -dontwarn org.bouncycastle.** 100 | -dontwarn module-info 101 | -dontwarn com.microblink.** 102 | -dontwarn javax.annotation.Nullable -------------------------------------------------------------------------------- /DemoApp/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 17 | 20 | 21 | 25 | 26 | 27 | 33 | 34 | 35 | 36 | 37 | 38 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /DemoApp/android/app/src/main/assets/.gitignore: -------------------------------------------------------------------------------- 1 | *.bundle 2 | *.bundle.meta 3 | -------------------------------------------------------------------------------- /DemoApp/android/app/src/main/assets/classifier_on_device_ep_99_float16_quant.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jumio/mobile-react/2cba53e402f56e0adf260d0f2fc093b1700c76e8/DemoApp/android/app/src/main/assets/classifier_on_device_ep_99_float16_quant.enc -------------------------------------------------------------------------------- /DemoApp/android/app/src/main/assets/normalized_ensemble_passports_v2_float16_quant.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jumio/mobile-react/2cba53e402f56e0adf260d0f2fc093b1700c76e8/DemoApp/android/app/src/main/assets/normalized_ensemble_passports_v2_float16_quant.enc -------------------------------------------------------------------------------- /DemoApp/android/app/src/main/java/com/demoapp/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.demoapp 2 | 3 | import com.facebook.react.ReactActivity 4 | import com.facebook.react.ReactActivityDelegate 5 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled 6 | import com.facebook.react.defaults.DefaultReactActivityDelegate 7 | 8 | class MainActivity : ReactActivity() { 9 | /** 10 | * Returns the name of the main component registered from JavaScript. This is used to schedule 11 | * rendering of the component. 12 | */ 13 | @Override 14 | override fun getMainComponentName() = "DemoApp"; 15 | 16 | /** 17 | * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] 18 | * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] 19 | */ 20 | override fun createReactActivityDelegate() = DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) 21 | } -------------------------------------------------------------------------------- /DemoApp/android/app/src/main/java/com/demoapp/MainApplication.kt: -------------------------------------------------------------------------------- 1 | package com.demoapp 2 | 3 | import android.app.Application 4 | import com.facebook.react.PackageList 5 | import com.facebook.react.ReactApplication 6 | import com.facebook.react.ReactHost 7 | import com.facebook.react.ReactNativeHost 8 | import com.facebook.react.ReactPackage 9 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load 10 | import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost 11 | import com.facebook.react.defaults.DefaultReactNativeHost 12 | import com.facebook.react.soloader.OpenSourceMergedSoMapping 13 | import com.facebook.soloader.SoLoader 14 | import com.jumio.react.JumioPackage 15 | 16 | class MainApplication : Application(), ReactApplication { 17 | override val reactNativeHost: ReactNativeHost = 18 | object : DefaultReactNativeHost(this) { 19 | override fun getPackages(): List = 20 | PackageList(this).packages.apply { 21 | // Packages that cannot be autolinked yet can be added manually here, for example: 22 | add(JumioPackage()) 23 | } 24 | 25 | override fun getJSMainModuleName(): String = "index" 26 | override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG 27 | override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED 28 | override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED 29 | } 30 | override val reactHost: ReactHost 31 | get() = getDefaultReactHost(applicationContext, reactNativeHost) 32 | 33 | override fun onCreate() { 34 | super.onCreate() 35 | SoLoader.init(this, OpenSourceMergedSoMapping) 36 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { 37 | // If you opted-in for the New Architecture, we load the native entry point for this app. 38 | load() 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /DemoApp/android/app/src/main/jni/Android.mk: -------------------------------------------------------------------------------- 1 | THIS_DIR := $(call my-dir) 2 | 3 | include $(REACT_ANDROID_DIR)/Android-prebuilt.mk 4 | 5 | # If you wish to add a custom TurboModule or Fabric component in your app you 6 | # will have to include the following autogenerated makefile. 7 | # include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk 8 | include $(CLEAR_VARS) 9 | 10 | LOCAL_PATH := $(THIS_DIR) 11 | 12 | # You can customize the name of your application .so file here. 13 | LOCAL_MODULE := demoapp_appmodules 14 | 15 | LOCAL_C_INCLUDES := $(LOCAL_PATH) 16 | LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) 17 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 18 | 19 | # If you wish to add a custom TurboModule or Fabric component in your app you 20 | # will have to uncomment those lines to include the generated source 21 | # files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni) 22 | # 23 | # LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni 24 | # LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp) 25 | # LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni 26 | 27 | # Here you should add any native library you wish to depend on. 28 | LOCAL_SHARED_LIBRARIES := \ 29 | libfabricjni \ 30 | libfbjni \ 31 | libfolly_futures \ 32 | libfolly_json \ 33 | libglog \ 34 | libjsi \ 35 | libreact_codegen_rncore \ 36 | libreact_debug \ 37 | libreact_nativemodule_core \ 38 | libreact_render_componentregistry \ 39 | libreact_render_core \ 40 | libreact_render_debug \ 41 | libreact_render_graphics \ 42 | librrc_view \ 43 | libruntimeexecutor \ 44 | libturbomodulejsijni \ 45 | libyoga 46 | 47 | LOCAL_CFLAGS := -DLOG_TAG=\"ReactNative\" -fexceptions -frtti -std=c++17 -Wall 48 | 49 | include $(BUILD_SHARED_LIBRARY) -------------------------------------------------------------------------------- /DemoApp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jumio/mobile-react/2cba53e402f56e0adf260d0f2fc093b1700c76e8/DemoApp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /DemoApp/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jumio/mobile-react/2cba53e402f56e0adf260d0f2fc093b1700c76e8/DemoApp/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /DemoApp/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jumio/mobile-react/2cba53e402f56e0adf260d0f2fc093b1700c76e8/DemoApp/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /DemoApp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jumio/mobile-react/2cba53e402f56e0adf260d0f2fc093b1700c76e8/DemoApp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /DemoApp/android/app/src/main/res/values/strings-jumio-sdk.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 113 | 114 | 115 | 143 | 144 | 145 | 194 | 195 | -------------------------------------------------------------------------------- /DemoApp/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | DemoApp 3 | 4 | -------------------------------------------------------------------------------- /DemoApp/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | 15 | --> 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /DemoApp/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | ext { 4 | buildToolsVersion = "35.0.0" 5 | minSdkVersion = 24 6 | compileSdkVersion = 35 7 | } 8 | repositories { 9 | google() 10 | mavenCentral() 11 | gradlePluginPortal() 12 | exclusiveContent { 13 | forRepository { 14 | maven { 15 | url 'https://repo.mobile.jumio.ai' 16 | } 17 | } 18 | filter { 19 | includeGroup "com.jumio.android" 20 | includeGroup "com.iproov.sdk" 21 | } 22 | } 23 | } 24 | dependencies { 25 | classpath("com.android.tools.build:gradle") 26 | // classpath("com.google.gms:google-services:4.2.0") 27 | classpath("com.google.android.gms:play-services-vision:20.1.3") 28 | classpath("com.facebook.react:react-native-gradle-plugin") 29 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") 30 | } 31 | } 32 | 33 | apply plugin: "com.facebook.react.rootproject" -------------------------------------------------------------------------------- /DemoApp/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m 13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useAndroidX=true 21 | android.useDeprecatedNdk=true 22 | 23 | # Use this property to specify which architecture you want to build. 24 | # You can also override it from the CLI using 25 | # ./gradlew -PreactNativeArchitectures=x86_64 26 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 27 | 28 | # Use this property to enable support to the new architecture. 29 | # This will allow you to use TurboModules and the Fabric render in 30 | # your application. You should enable this flag either if you want 31 | # to write custom TurboModules/Fabric components OR use libraries that 32 | # are providing them. 33 | newArchEnabled=false 34 | 35 | # Use this property to enable or disable the Hermes JS engine. 36 | # If set to false, you will be using JSC instead. 37 | hermesEnabled=true -------------------------------------------------------------------------------- /DemoApp/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jumio/mobile-react/2cba53e402f56e0adf260d0f2fc093b1700c76e8/DemoApp/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /DemoApp/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 19 12:48:49 EEST 2023 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /DemoApp/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # SPDX-License-Identifier: Apache-2.0 19 | # 20 | 21 | ############################################################################## 22 | # 23 | # Gradle start up script for POSIX generated by Gradle. 24 | # 25 | # Important for running: 26 | # 27 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 28 | # noncompliant, but you have some other compliant shell such as ksh or 29 | # bash, then to run this script, type that shell name before the whole 30 | # command line, like: 31 | # 32 | # ksh Gradle 33 | # 34 | # Busybox and similar reduced shells will NOT work, because this script 35 | # requires all of these POSIX shell features: 36 | # * functions; 37 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 38 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 39 | # * compound commands having a testable exit status, especially «case»; 40 | # * various built-in commands including «command», «set», and «ulimit». 41 | # 42 | # Important for patching: 43 | # 44 | # (2) This script targets any POSIX shell, so it avoids extensions provided 45 | # by Bash, Ksh, etc; in particular arrays are avoided. 46 | # 47 | # The "traditional" practice of packing multiple parameters into a 48 | # space-separated string is a well documented source of bugs and security 49 | # problems, so this is (mostly) avoided, by progressively accumulating 50 | # options in "$@", and eventually passing that to Java. 51 | # 52 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 53 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 54 | # see the in-line comments for details. 55 | # 56 | # There are tweaks for specific operating systems such as AIX, CygWin, 57 | # Darwin, MinGW, and NonStop. 58 | # 59 | # (3) This script is generated from the Groovy template 60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 61 | # within the Gradle project. 62 | # 63 | # You can find Gradle at https://github.com/gradle/gradle/. 64 | # 65 | ############################################################################## 66 | 67 | # Attempt to set APP_HOME 68 | 69 | # Resolve links: $0 may be a link 70 | app_path=$0 71 | 72 | # Need this for daisy-chained symlinks. 73 | while 74 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 75 | [ -h "$app_path" ] 76 | do 77 | ls=$( ls -ld "$app_path" ) 78 | link=${ls#*' -> '} 79 | case $link in #( 80 | /*) app_path=$link ;; #( 81 | *) app_path=$APP_HOME$link ;; 82 | esac 83 | done 84 | 85 | # This is normally unused 86 | # shellcheck disable=SC2034 87 | APP_BASE_NAME=${0##*/} 88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | if ! command -v java >/dev/null 2>&1 137 | then 138 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 139 | 140 | Please set the JAVA_HOME variable in your environment to match the 141 | location of your Java installation." 142 | fi 143 | fi 144 | 145 | # Increase the maximum file descriptors if we can. 146 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 147 | case $MAX_FD in #( 148 | max*) 149 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 150 | # shellcheck disable=SC2039,SC3045 151 | MAX_FD=$( ulimit -H -n ) || 152 | warn "Could not query maximum file descriptor limit" 153 | esac 154 | case $MAX_FD in #( 155 | '' | soft) :;; #( 156 | *) 157 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 158 | # shellcheck disable=SC3045 159 | ulimit -n "$MAX_FD" || 160 | warn "Could not set maximum file descriptor limit to $MAX_FD" 161 | esac 162 | fi 163 | 164 | # Collect all arguments for the java command, stacking in reverse order: 165 | # * args from the command line 166 | # * the main class name 167 | # * -classpath 168 | # * -D...appname settings 169 | # * --module-path (only if needed) 170 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 171 | 172 | # For Cygwin or MSYS, switch paths to Windows format before running java 173 | if "$cygwin" || "$msys" ; then 174 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 175 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 176 | 177 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 178 | 179 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 180 | for arg do 181 | if 182 | case $arg in #( 183 | -*) false ;; # don't mess with options #( 184 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 185 | [ -e "$t" ] ;; #( 186 | *) false ;; 187 | esac 188 | then 189 | arg=$( cygpath --path --ignore --mixed "$arg" ) 190 | fi 191 | # Roll the args list around exactly as many times as the number of 192 | # args, so each arg winds up back in the position where it started, but 193 | # possibly modified. 194 | # 195 | # NB: a `for` loop captures its iteration list before it begins, so 196 | # changing the positional parameters here affects neither the number of 197 | # iterations, nor the values presented in `arg`. 198 | shift # remove old arg 199 | set -- "$@" "$arg" # push replacement arg 200 | done 201 | fi 202 | 203 | 204 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 205 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 206 | 207 | # Collect all arguments for the java command: 208 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 209 | # and any embedded shellness will be escaped. 210 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 211 | # treated as '${Hostname}' itself on the command line. 212 | 213 | set -- \ 214 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 215 | -classpath "$CLASSPATH" \ 216 | org.gradle.wrapper.GradleWrapperMain \ 217 | "$@" 218 | 219 | # Stop when "xargs" is not available. 220 | if ! command -v xargs >/dev/null 2>&1 221 | then 222 | die "xargs is not available" 223 | fi 224 | 225 | # Use "xargs" to parse quoted args. 226 | # 227 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 228 | # 229 | # In Bash we could simply go: 230 | # 231 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 232 | # set -- "${ARGS[@]}" "$@" 233 | # 234 | # but POSIX shell has neither arrays nor command substitution, so instead we 235 | # post-process each arg (as a line of input to sed) to backslash-escape any 236 | # character that might be a shell metacharacter, then use eval to reverse 237 | # that process (while maintaining the separation between arguments), and wrap 238 | # the whole thing up as a single "set" statement. 239 | # 240 | # This will of course break if any of these variables contains a newline or 241 | # an unmatched quote. 242 | # 243 | 244 | eval "set -- $( 245 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 246 | xargs -n1 | 247 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 248 | tr '\n' ' ' 249 | )" '"$@"' 250 | 251 | exec "$JAVACMD" "$@" -------------------------------------------------------------------------------- /DemoApp/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | @rem SPDX-License-Identifier: Apache-2.0 17 | @rem 18 | 19 | @if "%DEBUG%"=="" @echo off 20 | @rem ########################################################################## 21 | @rem 22 | @rem Gradle startup script for Windows 23 | @rem 24 | @rem ########################################################################## 25 | 26 | @rem Set local scope for the variables with windows NT shell 27 | if "%OS%"=="Windows_NT" setlocal 28 | 29 | set DIRNAME=%~dp0 30 | if "%DIRNAME%"=="" set DIRNAME=. 31 | @rem This is normally unused 32 | set APP_BASE_NAME=%~n0 33 | set APP_HOME=%DIRNAME% 34 | 35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 37 | 38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 40 | 41 | @rem Find java.exe 42 | if defined JAVA_HOME goto findJavaFromJavaHome 43 | 44 | set JAVA_EXE=java.exe 45 | %JAVA_EXE% -version >NUL 2>&1 46 | if %ERRORLEVEL% equ 0 goto execute 47 | 48 | echo. 1>&2 49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 50 | echo. 1>&2 51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 52 | echo location of your Java installation. 1>&2 53 | 54 | goto fail 55 | 56 | :findJavaFromJavaHome 57 | set JAVA_HOME=%JAVA_HOME:"=% 58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 59 | 60 | if exist "%JAVA_EXE%" goto execute 61 | 62 | echo. 1>&2 63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 64 | echo. 1>&2 65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 66 | echo location of your Java installation. 1>&2 67 | 68 | goto fail 69 | 70 | :execute 71 | @rem Setup the command line 72 | 73 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 74 | 75 | 76 | @rem Execute Gradle 77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 78 | 79 | :end 80 | @rem End local scope for the variables with windows NT shell 81 | if %ERRORLEVEL% equ 0 goto mainEnd 82 | 83 | :fail 84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 85 | rem the _cmd.exe /c_ return code! 86 | set EXIT_CODE=%ERRORLEVEL% 87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 89 | exit /b %EXIT_CODE% 90 | 91 | :mainEnd 92 | if "%OS%"=="Windows_NT" endlocal 93 | 94 | :omega -------------------------------------------------------------------------------- /DemoApp/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") } 2 | plugins { id("com.facebook.react.settings") } 3 | extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } 4 | 5 | rootProject.name = 'DemoApp' 6 | include ':react-native-jumio-mobilesdk' 7 | project(':react-native-jumio-mobilesdk').projectDir = new File(rootProject.projectDir, '../../android') 8 | include ':react-native-jumio-mobilesdk' 9 | project(':react-native-jumio-mobilesdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-jumio-mobilesdk/android') 10 | 11 | include ':app' 12 | includeBuild('../node_modules/@react-native/gradle-plugin') -------------------------------------------------------------------------------- /DemoApp/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DemoApp", 3 | "displayName": "DemoApp" 4 | } -------------------------------------------------------------------------------- /DemoApp/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:@react-native/babel-preset'], 3 | }; -------------------------------------------------------------------------------- /DemoApp/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, {Component, useState} from 'react'; 8 | import { 9 | AppRegistry, 10 | Button, 11 | Platform, 12 | StyleSheet, 13 | View, 14 | NativeModules, 15 | NativeEventEmitter, 16 | TextInput, 17 | Text 18 | } from 'react-native'; 19 | import { LogBox } from 'react-native'; 20 | 21 | LogBox.ignoreLogs(['new NativeEventEmitter']); 22 | 23 | const { JumioMobileSDK } = NativeModules; 24 | 25 | var DATACENTER = 'DATACENTER' 26 | 27 | // Jumio SDK 28 | const startJumio = (authorizationToken) => { 29 | JumioMobileSDK.initialize(authorizationToken, DATACENTER); 30 | 31 | // Setup iOS customizations 32 | // JumioMobileSDK.setupCustomizations( 33 | // { 34 | // background: "#AC3D9A", 35 | // primaryColor: "#FF5722", 36 | // loadingCircleIcon: "#F2F233", 37 | // loadingCirclePlain: "#57ffc7", 38 | // loadingCircleGradientStart: "#EC407A", 39 | // loadingCircleGradientEnd: "#bc2e41", 40 | // loadingErrorCircleGradientStart: "#AC3D9A", 41 | // loadingErrorCircleGradientEnd: "#C31322", 42 | // primaryButtonBackground: {"light": "#D900ff00", "dark": "#9Edd9E"} 43 | // } 44 | // ); 45 | 46 | JumioMobileSDK.start(); 47 | }; 48 | 49 | const isDeviceRooted = async () => { 50 | const isRooted = await JumioMobileSDK.isRooted(); 51 | console.warn("Device is rooted: " + isRooted) 52 | } 53 | 54 | // Callbacks - (Data is displayed as a warning for demo purposes) 55 | const emitterJumio = new NativeEventEmitter(JumioMobileSDK); 56 | emitterJumio.addListener( 57 | 'EventResult', 58 | (EventResult) => console.warn("EventResult: " + JSON.stringify(EventResult)) 59 | ); 60 | emitterJumio.addListener( 61 | 'EventError', 62 | (EventError) => console.warn("EventError: " + JSON.stringify(EventError)) 63 | ); 64 | 65 | const initModelPreloading = () => { 66 | JumioMobileSDK.setPreloaderFinishedBlock(() => { 67 | console.log('All models are preloaded. You may start the SDK now!'); 68 | }); 69 | JumioMobileSDK.preloadIfNeeded() 70 | }; 71 | 72 | initModelPreloading(); 73 | 74 | export default class DemoApp extends Component { 75 | render() { 76 | return ( 77 | 78 | 79 | 80 | ); 81 | } 82 | } 83 | 84 | const AuthTokenInput = () => { 85 | const [authorizationToken, setAuthorizationToken] = useState(""); 86 | 87 | const [buttonText, setButtonText] = useState('Click'); 88 | 89 | function handleClick() { 90 | setButtonText({DATACENTER}); 91 | } 92 | 93 | return ( 94 | 95 | setAuthorizationToken(text)} 101 | value={authorizationToken} 102 | /> 103 |