Skip to content

Commit

Permalink
Final commit for 3.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
JumioMobileTeam committed Sep 13, 2019
1 parent 1dbbae1 commit b01f78c
Show file tree
Hide file tree
Showing 1,125 changed files with 16,397 additions and 96,688 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ demo/platforms/ios/Pods
demo/platforms/ios/Podfile.lock
demo/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata
demo/package-lock.json
demo/node_modules

# Log Files
*.log
Expand All @@ -17,11 +18,12 @@ demo/package-lock.json
# Android Studio captures folder
captures/

# Intellij
# Intellij & etc
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/dictionaries
.idea/libraries
*.iml
.vscode/
40 changes: 24 additions & 16 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Official Jumio Mobile SDK plugin for Apache Cordova

This plugin is compatible with version 3.1.0 of the Jumio SDK. This is the final update to the Cordova plugin — future SDK compatibility can not be guaranteed. If you have questions, please reach out to your Account Manager or contact Jumio Support at [email protected] or https://support.jumio.com
This plugin is compatible with version 3.3.1 of the Jumio SDK. If you have questions, please reach out to your Account Manager or contact Jumio Support at [email protected] or https://support.jumio.com

## Compatibility
With this release, we only ensure compatibility with the latest Cordova versions and plugins.
Expand All @@ -19,14 +19,14 @@ cordova create MyProject com.my.project "MyProject"
cd MyProject
cordova platform add ios
cordova platform add android
cordova plugin add https://github.com/Jumio/mobile-cordova.git#v3.1.0
cordova plugin add https://github.com/Jumio/mobile-cordova.git#v3.3.1
```

## Integration

### iOS

Manual integration or dependency management via cocoapods possible, please see [the official documentation of the Jumio Mobile SDK for iOS](https://github.com/Jumio/mobile-sdk-ios/tree/v3.1.0#basic-setup)
Manual integration or dependency management via cocoapods possible, please see [the official documentation of the Jumio Mobile SDK for iOS](https://github.com/Jumio/mobile-sdk-ios/tree/v3.3.1#basic-setup)

### Android

Expand All @@ -43,17 +43,17 @@ Add a parameter for your SDK_VERSION into the ext-section:

```
ext {
SDK_VERSION = "3.1.0"
SDK_VERSION = "3.3.1"
}
```

Add required permissions for the products as described in chapter [Permissions](https://github.com/Jumio/mobile-sdk-android/blob/v3.1.0/README.md#permissions)
Add required permissions for the products as described in chapter [Permissions](https://github.com/Jumio/mobile-sdk-android/blob/v3.3.1/README.md#permissions)

Open the android project of your cordova project located in */platforms/android* and insert the dependencies from the products you require to your **build.gradle** file. (Module: android)

* [Netverify & Fastfill](https://github.com/Jumio/mobile-sdk-android/blob/v3.1.0/docs/integration_netverify-fastfill.md#dependencies)
* [Document Verification](https://github.com/Jumio/mobile-sdk-android/blob/v3.1.0/docs/integration_document-verification.md#dependencies)
* [BAM Checkout](https://github.com/Jumio/mobile-sdk-android/blob/v3.1.0/docs/integration_bam-checkout.md#dependencies)
* [Netverify & Fastfill](https://github.com/Jumio/mobile-sdk-android/blob/v3.3.1/docs/integration_netverify-fastfill.md#dependencies)
* [Document Verification](https://github.com/Jumio/mobile-sdk-android/blob/v3.3.1/docs/integration_document-verification.md#dependencies)
* [BAM Checkout](https://github.com/Jumio/mobile-sdk-android/blob/v3.3.1/docs/integration_bam-checkout.md#dependencies)

Due to the outdated Cordova platform that is not yet updated for Android API version 28 and AndroidX, it's necessary to adapt your project to support the proper build environment for the native Jumio Android component. Take a look at the [Demo App build.gradle](https://github.com/Jumio/mobile-cordova/blob/master/demo/platforms/android/build.gradle) how to upgrade to API level 28. The [FAQ section](#faq) at the bottom covers common build issues and how to fix them.
Open your Cordova Android project in Android Studio to get IDE auto-suggestions and support for all the required changes.
Expand Down Expand Up @@ -88,6 +88,8 @@ Configure the SDK with the *configuration*-Object.
| cameraPosition | String | Which camera is used by default. Can be **FRONT** or **BACK**. |
| preselectedDocumentVariant | String | Which types of document variants are available. Can be **PAPER** or **PLASTIC** |
| documentTypes | String-Array | An array of accepted document types: Available document types: **PASSPORT**, **DRIVER_LICENSE**, **IDENTITY_CARD**, **VISA** |
| enableWatchlistScreening | String | Enables [Jumio Screening](https://www.jumio.com/screening/). Can be **ENABLED**, **DISABLED** or **DEFAULT** (when not specified reverts to **DEFAULT**) |
| watchlistSearchProfile | String | Specifies specific profile of watchlist |


Initialization example with configuration.
Expand All @@ -98,7 +100,9 @@ Jumio.initNetverify("API_TOKEN", "API_SECRET", "US", {
userReference: "USERREFERENCE",
preselectedCountry: "USA",
cameraPosition: "BACK",
documentTypes: ["DRIVER_LICENSE", "PASSPORT", "IDENTITY_CARD", "VISA"]
documentTypes: ["DRIVER_LICENSE", "PASSPORT", "IDENTITY_CARD", "VISA"],
enableWatchlistScreening: "ENABLED",
watchlistSearchProfile: "YOURPROFILENAME"
});
```

Expand All @@ -110,7 +114,7 @@ If you are using eMRTD scanning, following lines are needed in your Manifest fil
-keep class net.sf.scuba.smartcards.IsoDepCardService {*;}
-keep class org.jmrtd.** { *; }
-keep class net.sf.scuba.** {*;}
-keep class org.spongycastle.** {*;}
-keep class org.bouncycastle.** {*;}
-keep class org.ejbca.** {*;}

-dontwarn java.nio.**
Expand Down Expand Up @@ -161,10 +165,13 @@ Datacenter can either be **US** or **EU**.

Configure the SDK with the *configuration*-Object. **(configuration marked with * are mandatory)**

In order to connect the Authentication transaction to a specific Netverify user identity the parameter `enrollmentTransactionReference` must be set. In case an Authentication transaction has been created via the facemap server to server API `authenticationTransactionReference` should be used. Therefore `enrollmentTransactionReference` should not be set.

| Configuration | Datatype | Description |
| ------ | -------- | ----------- |
| **enrollmentTransactionReference*** | String | The reference of the enrollment scan to authenticate for |
| userReference | String | Set a customer identifier (max. 100 characters) |
| **authenticationTransactionReference*** | String | The reference of the authentication scan to authenticate for |
| **userReference*** | String | Set a customer identifier (max. 100 characters) |
| callbackUrl | String | Specify an URL for callback |

Initialization example with configuration:
Expand All @@ -173,7 +180,8 @@ Initialization example with configuration:
// Authentication
Jumio.initAuthentication(<API_TOKEN>, <API_SECRET>, <DATACENTER>, {
enrollmentTransactionReference: "EnrollmentTransactionReference",
userReference: "UserReference",
//authenticationTransactionReference: "AuthenticationTransactionReference",
userReference: "UserReference"
callbackUrl: "URL"
});
}
Expand Down Expand Up @@ -332,13 +340,13 @@ Jumio.startBAM(function(cardInformation) {
### Android

#### Netverify
The Netverify SDK can be customized to the respective needs by following this [customization chapter](https://github.com/Jumio/mobile-sdk-android/blob/v3.1.0/docs/integration_netverify-fastfill.md#customization).
The Netverify SDK can be customized to the respective needs by following this [customization chapter](https://github.com/Jumio/mobile-sdk-android/blob/v3.3.1/docs/integration_netverify-fastfill.md#customization).

#### BAM Checkout
The Netverify SDK can be customized to the respective needs by following this [customization chapter](https://github.com/Jumio/mobile-sdk-android/blob/v3.1.0/docs/integration_bam-checkout.md#customization).
The Netverify SDK can be customized to the respective needs by following this [customization chapter](https://github.com/Jumio/mobile-sdk-android/blob/v3.3.1/docs/integration_bam-checkout.md#customization).

#### Document Verification
The Netverify SDK can be customized to the respective needs by following this [customization chapter](https://github.com/Jumio/mobile-sdk-android/blob/v3.1.0/docs/integration_document-verification.md#customization).
The Netverify SDK can be customized to the respective needs by following this [customization chapter](https://github.com/Jumio/mobile-sdk-android/blob/v3.3.1/docs/integration_document-verification.md#customization).

### iOS
The SDK can be customized to the respective needs. You can pass the following customization options to the initializer:
Expand Down Expand Up @@ -376,7 +384,7 @@ The SDK can be customized to the respective needs. You can pass the following cu
All colors are provided with a HEX string with the following format: #ff00ff.

**Customization example**
```javascript
```
Jumio.initNetverify("API_TOKEN", "API_SECRET", "US", {
requireVerification: false,
...
Expand Down
Empty file modified demo/README.md
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions demo/config.xml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.jumio.cordova.demo" version="3.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="com.jumio.cordova.demo" version="3.3.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>DemoApp</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
Expand All @@ -23,7 +23,7 @@
<allow-intent href="itms-apps:*" />
</platform>
<plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
<plugin name="cordova-plugin-jumio-mobilesdk" spec="git+https://github.com/Jumio/mobile-cordova.git#v3.1.0">
<plugin name="cordova-plugin-jumio-mobilesdk" spec="git+https://github.com/Jumio/mobile-cordova.git#v3.3.1">
<variable name="CAMERA_USAGE_DESCRIPTION" value="This will allow ${PRODUCT_NAME} to take photos of your credentials." />
</plugin>
<engine name="android" spec="8.0.0" />
Expand Down
Empty file modified demo/gradle/wrapper/gradle-wrapper.jar
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion demo/gradle/wrapper/gradle-wrapper.properties
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-all.zip
Empty file modified demo/hooks/README.md
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions demo/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
8 changes: 3 additions & 5 deletions demo/package.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.jumio.cordova.demo",
"displayName": "DemoApp",
"version": "3.1.0",
"version": "3.3.1",
"description": "A sample Apache Cordova application that responds to the deviceready event.",
"main": "index.js",
"scripts": {
Expand All @@ -10,20 +10,18 @@
"author": "Apache Cordova Team",
"license": "Apache-2.0",
"dependencies": {
"cordova-android": "8.0.0",
"cordova-android": "^8.0.0",
"cordova-ios": "^5.0.1",
"cordova-plugin-jumio-mobilesdk": "git+https://github.com/Jumio/mobile-cordova.git#v3.1.0",
"cordova-plugin-jumio-mobilesdk": "git+https://github.com/Jumio/mobile-cordova.git#v3.3.1",
"cordova-plugin-whitelist": "^1.3.3"
},
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-jumio-mobilesdk": {
"CAMERA_USAGE_DESCRIPTION": "This will allow ${PRODUCT_NAME} to take photos of your credentials."
}
},
"platforms": [
"android",
"ios"
]
}
Expand Down
Empty file modified demo/platforms/.gitignore
100644 → 100755
Empty file.
10 changes: 8 additions & 2 deletions demo/platforms/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ ant-gen
# Eclipse builds
gen
out
# Gradle builds
# Gradle build artifacts
.gradle
.gradletasknamecache
/build
/.idea
/CordovaLib/build
/app/build
gradle-app.setting
# Android Studio
.idea
3 changes: 1 addition & 2 deletions demo/platforms/android/CordovaLib/AndroidManifest.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@
under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.apache.cordova" android:versionName="1.0" android:versionCode="1">
</manifest>
package="org.apache.cordova" android:versionName="1.0" android:versionCode="1"></manifest>
41 changes: 16 additions & 25 deletions demo/platforms/android/CordovaLib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@ ext {

buildscript {
repositories {
google()
google()
jcenter()
maven {
url "https://maven.google.com"
}
}
}

dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
// The gradle plugin and the maven plugin have to be updated after each version of Android
// studio comes out
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
}

Expand All @@ -46,19 +45,8 @@ group = 'org.apache.cordova'
version = '8.0.0'

android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
publishNonDefault true

lintOptions {
abortOnError false
}

defaultConfig {
// Enabling multidex support.
minSdkVersion 19
multiDexEnabled true
}
compileSdkVersion cdvCompileSdkVersion
buildToolsVersion cdvBuildToolsVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -83,6 +71,9 @@ android {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
}
defaultConfig {
minSdkVersion 19
}
}

install {
Expand All @@ -105,9 +96,9 @@ install {
}
}
scm {
connection 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git'
developerConnection 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git'
url 'https://git-wip-us.apache.org/repos/asf?p=cordova-android'
connection 'scm:git:https://github.com/apache/cordova-android.git'
developerConnection 'scm:git:[email protected]:apache/cordova-android.git'
url 'https://github.com/apache/cordova-android'

}
}
Expand All @@ -133,9 +124,9 @@ bintray {
name = 'cordova-android'
userOrg = 'cordova'
licenses = ['Apache-2.0']
vcsUrl = 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git'
vcsUrl = 'https://github.com/apache/cordova-android'
websiteUrl = 'https://cordova.apache.org'
issueTrackerUrl = 'https://issues.apache.org/jira/browse/CB'
issueTrackerUrl = 'https://github.com/apache/cordova-android/issues'
publicDownloadNumbers = true
licenses = ['Apache-2.0']
labels = ['android', 'cordova', 'phonegap']
Expand Down
8 changes: 6 additions & 2 deletions demo/platforms/android/CordovaLib/cordova.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ String doEnsureValueExists(filePath, props, key) {

String doGetProjectTarget() {
def props = new Properties()
file('project.properties').withReader { reader ->
def propertiesFile = 'project.properties';
if(!(file(propertiesFile).exists())) {
propertiesFile = '../project.properties';
}
file(propertiesFile).withReader { reader ->
props.load(reader)
}
return doEnsureValueExists('project.properties', props, 'target')
Expand Down Expand Up @@ -161,7 +165,7 @@ def doPromptForPassword(msg) {
}

def doGetConfigXml() {
def xml = file("res/xml/config.xml").getText()
def xml = file("src/main/res/xml/config.xml").getText()
// Disable namespace awareness since Cordova doesn't use them properly
return new XmlParser(false, false).parseText(xml)
}
Expand Down
13 changes: 4 additions & 9 deletions demo/platforms/android/CordovaLib/project.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.
# This file was originally created by the Android Tools, but is now
# used by cordova-android to manage the project configuration.

# Indicates whether an apk should be generated for each density.
split.density=false

# Project target.
target=android-26
target=android-28
apk-configurations=
renderscript.opt.level=O0
android.library=true
3 changes: 2 additions & 1 deletion demo/platforms/android/CordovaLib/src/org/apache/cordova/CordovaActivity.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void onCreate(Bundle savedInstanceState) {
if (preferences.getBoolean("Fullscreen", false)) {
// NOTE: use the FullscreenNotImmersive configuration key to set the activity in a REAL full screen
// (as was the case in previous cordova versions)
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) && !preferences.getBoolean("FullscreenNotImmersive", false)) {
if (!preferences.getBoolean("FullscreenNotImmersive", false)) {
immersiveMode = true;
} else {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
Expand Down Expand Up @@ -319,6 +319,7 @@ public void onDestroy() {
/**
* Called when view focus is changed
*/
@SuppressLint("InlinedApi")
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Licensed to the Apache Software Foundation (ASF) under one
*/
package org.apache.cordova;

import android.annotation.SuppressLint;

import java.security.SecureRandom;

import org.json.JSONArray;
Expand Down Expand Up @@ -110,6 +112,9 @@ public boolean isSecretEstablished() {
}

/** Called by cordova.js to initialize the bridge. */
//On old Androids SecureRandom isn't really secure, this is the least of your problems if
//you're running Android 4.3 and below in 2017
@SuppressLint("TrulyRandom")
int generateBridgeSecret() {
SecureRandom randGen = new SecureRandom();
expectedBridgeSecret = randGen.nextInt(Integer.MAX_VALUE);
Expand Down
Loading

0 comments on commit b01f78c

Please sign in to comment.