Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build & Archive App

on:
push:
branches:
- main
- 'release/**'
pull_request:
branches: [ main ]

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./android-studio-sample-app

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Clean
run: ./gradlew clean --refresh-dependencies --stacktrace

- name: Build APK
run: ./gradlew --stacktrace assembleRelease

- name: Build AAB
run: ./gradlew --stacktrace bundleRelease

- name: Archive Artifacts
uses: actions/upload-artifact@v2
with:
name: APK & AAB artifacts
path: |
**/app/build/outputs/apk/
**/app/build/outputs/bundle/
!**/*.json

- name: Send Slack Message
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: always()
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Draft Release

on:
push:
tags:
- 'v*'

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ncipollo/release-action@v1
with:
artifacts: "fraudforce-lib*.aar"
draft: true
bodyFile: "release-notes.md"
token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/.gradle/**
**/build/
**/.idea/
65 changes: 32 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,38 @@ The Device Risk SDK integrates with native and hybrid apps. Hybrid apps mix nati

| | |
|---------------------------------|-------------------------------------------------------------------------------------------------------------------|
| **SDK Filename** | fraudforce-lib-release-4.3.0.aar |
| **Version** | 4.3.0 |
| **SDK Filename** | fraudforce-lib-release-4.3.1.aar |
| **Version** | 4.3.1 |
| **Package** | com.iovation.mobile.android.FraudForce |
| **Android SDK Dependencies** | Android SDK 5.0 or higher (SDK level 21) |
| **Library Dependencies** | None |
| **Required Permissions** | None |
| **Optional Permissions** | BLUETOOTH, CAMERA, ACCESS\_WIFI\_STATE, READ\_PHONE\_STATE, ACCESS\_FINE\_LOCATION, ACCESS\_BACKGROUND\_LOCATION, |
| **Optional Permissions** | BLUETOOTH (up to Android 11), BLUETOOTH_CONNECT (starting on Android 12), CAMERA, ACCESS\_WIFI\_STATE, |
| | READ\_PHONE\_STATE, ACCESS\_FINE\_LOCATION, ACCESS\_BACKGROUND\_LOCATION, |
| | GET\_ACCOUNTS, ACCESS\_NETWORK\_STATE |
| **Supported NDK Architectures** | x86, x86_64, arm64-v8a, armeabi-v7a |

> __NOTE__ Android 12 introduced the BLUETOOTH_CONNECT permission, protected at the dangerous level. Refer to the [official Android documentation](https://developer.android.com/about/versions/12/features/bluetooth-permissions) on how to include it.

> __NOTE__ Regarding Android 11 background location changes: The Device Risk SDK neither requires nor requests location when the application is in a background state.

> __NOTE__ If the permissions listed are not required by the application, the values collected using those permissions will be ignored. The permissions are not required to obtain a usable blackbox, but they do help obtain some unique device information.

> __NOTE__ Android 10 introduced the ACCESS_BACKGROUND_LOCATION permission, protected at the dangerous level as is the case for ACCESS_FINE_LOCATION. Refer to the official Android documentation for when to incorporate this permission.

Version 4.3.0 of the TruValidate Device Risk SDK for Android supports Android 5.0 or higher.
Version 4.3.1 of the TruValidate Device Risk SDK for Android supports Android 5.0 or higher.

## Installing the Device Risk SDK for Android

1. Download iovation-android-sdk-4.3.0.zip from here: [iovation Mobile SDK for Android](https://github.com/iovation/deviceprint-SDK-Android). 
1. Download iovation-android-sdk-4.3.1.zip from here: [iovation Mobile SDK for Android](https://github.com/iovation/deviceprint-SDK-Android). 

2. Unzip iovation-android-sdk-4.3.0.zip.
2. Unzip iovation-android-sdk-4.3.1.zip.

3. Depending on your IDE, do one of the following:

- In __Eclipse and Maven__, deploy the AAR file to your local Maven repository, using maven-deploy. For more information, see [Guide to installing 3rd party JARs](http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html).
- In __Maven__, deploy the AAR file to your local Maven repository, using maven-deploy. For more information, see [Guide to installing 3rd party JARs](http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html).

- If you are using __Android Studio with Gradle__, add the *fraudforce-lib-release-4.3.0.aar* file to your application module's libs directory. Then, edit the *build.gradle* file in order to add the libs directory as a flat-file repository to the `buildscript` and `repository` sections. This makes the fraudforce-lib-release-4.3.0.aar file accessible to Gradle.
- If you are using __Gradle__, add the *fraudforce-lib-release-4.3.1.aar* file to your application module's libs directory. Then, edit the *build.gradle* file in order to add the libs directory as a flat-file repository to the `buildscript` and `repository` sections. This makes the fraudforce-lib-release-4.3.1.aar file accessible to Gradle.

```
buildscript {
Expand All @@ -65,12 +68,21 @@ Version 4.3.0 of the TruValidate Device Risk SDK for Android supports Android 5.
}
}
```
Also in the application module's `build.gradle` file, make sure that fraudforce-lib-release-4.3.0 is a compile-time dependency:
Also in the application module's `build.gradle` file, make sure that fraudforce-lib-release-4.3.1 is included as a dependency:

```
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile(name:'fraudforce-lib-release-4.3.0', ext:'aar')
...
implementation(name:'fraudforce-lib-release-4.3.1', ext:'aar')
}
```

Alternatively, you can include the dependency without exposing your libs folder as a repository by declaring it in the module's `build.gradle` file as follows:

```
dependencies {
...
implementation('libs/fraudforce-lib-release-4.3.1.aar')
}
```

Expand Down Expand Up @@ -115,7 +127,7 @@ To integrate into native apps:
fraudForceManager.initialize(configuration, context);
```

4. Call the `refresh()` method in the same Activity or Fragment where `getBlackbox()` will be called. The integrating application only needs to call this method on the Fragments where the `getBlackbox()` method will be called.
4. Call the `refresh()` method in the same Activity/Fragment/ViewModel where `getBlackbox()` will be called. The integrating application only needs to call this method on the Fragments where the `getBlackbox()` method will be called.

> __NOTE__: This method calls updates the geolocation and network information, if enabled.

Expand All @@ -125,27 +137,8 @@ To integrate into native apps:
FraudForceManager.getInstance().refresh(context);
```

4. Do one of the following to generate the blackbox:
* To build a blackbox **asynchronously**, create an AsyncTask object to generate the blackbox off the main thread.
```
private class FraudForceThread extends AsyncTask<Void, Void, String> {
@Override
protected String doInBackground(Void... voids) {
return FraudForceManager.getInstance().getBlackbox(context);
}
4. To generate the blackbox, call the getBlackbox(Context context) function on an instance of FraudForceManager. This method is a **blocking** call so it is **recommended** to call it on a background thread/coroutine.

@Override
protected void onPostExecute(String blackbox) {
// Integrator's code to store the blackbox
}
}
```
* Then execute the FraudForceThread object to get the blackbox.
```
new FraudForceThread().execute();
```

* To build a blackbox **synchronously**, call the `getBlackbox(Context context)` function on a FraudForceManager object.
```
String blackbox = FraudForceManager.getInstance().getBlackbox(context);
```
Expand Down Expand Up @@ -246,7 +239,7 @@ The SDK includes the ability to make a network call to TransUnion TruValidate's

1 In Android Studio, select File | Open or click **Open Existing Android Studio Project** from the quick-start screen.

2. From the directory where you unzipped fraudforce-lib-release-4.3.0.zip, open the **android-studio-sample-app** directory.
2. From the directory where you unzipped fraudforce-lib-release-4.3.1.zip or cloned the repo, open the **android-studio-sample-app** directory.

3. In the project navigation view, open `src/main/java/com/iovation/mobile/android/sample/MainActivity.java`

Expand All @@ -262,6 +255,12 @@ The SDK includes the ability to make a network call to TransUnion TruValidate's

## Changelog

### 4.3.1
- Update target and compilation SDK versions to 31.
- Adjusted collection details.
- Compatible with the new bluetooth changes/permissions in Android 12.
- Fixed crashes on devices running below SDK version 24.

### 4.3.0

- Minimum supported Android version updated, from 16 to 21.
Expand Down
34 changes: 7 additions & 27 deletions android-studio-sample-app/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 30
compileSdkVersion 31

defaultConfig {
applicationId "com.iovation.mobile.android.sample.androidstudiosampleapp"
applicationId "com.iovation.mobile.android.sample.sampleapp"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "4.3.0"
targetSdkVersion 31
versionCode 2
versionName "4.3.1"
}
buildTypes {
release {
Expand All @@ -21,27 +21,7 @@ android {
}
}

buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
flatDir {
dirs 'libs'
}
}
}

repositories {
mavenLocal()
jcenter()
mavenCentral()
flatDir {
dirs 'libs'
}
}

dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
api(name:'fraudforce-lib-release-4.3.0', ext:'aar')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation files('libs/fraudforce-lib-release-4.3.1.aar')
}
Binary file not shown.
Binary file not shown.

This file was deleted.

24 changes: 15 additions & 9 deletions android-studio-sample-app/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.iovation.mobile.android.sample.androidstudiosampleapp" >
package="com.iovation.mobile.android.sample.sampleapp">

<!-- 1.0 Permissions -->
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission
android:name="android.permission.BLUETOOTH"
android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- 1.1 Permissions -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<!-- Required for NewRelic -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Expand All @@ -18,10 +22,11 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:theme="@style/AppTheme">
<activity
android:name=".NativeActivity"
android:label="@string/app_name" >
android:exported="true"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -30,7 +35,8 @@
</activity>
<activity
android:name=".WebViewActivity"
android:label="@string/wv_name" >
android:exported="false"
android:label="@string/wv_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.iovation.mobile.android.sample.androidstudiosampleapp;
package com.iovation.mobile.android.sample.sampleapp;

import android.app.Application;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package com.iovation.mobile.android.sample.androidstudiosampleapp;
package com.iovation.mobile.android.sample.sampleapp;

import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.iovation.mobile.android.FraudForceConfiguration;
import com.iovation.mobile.android.FraudForceManager;

public class NativeActivity extends Activity {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
package com.iovation.mobile.android.sample.androidstudiosampleapp;
package com.iovation.mobile.android.sample.sampleapp;

import android.app.Activity;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.TextView;

import com.iovation.mobile.android.FraudForceConfiguration;
import com.iovation.mobile.android.FraudForceManager;

/**
Expand Down
3 changes: 1 addition & 2 deletions android-studio-sample-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
google()
}
Expand All @@ -17,7 +16,7 @@ buildscript {

allprojects {
repositories {
jcenter()
google()
mavenCentral()
}
}
Binary file removed fraudforce-lib-release-4.3.0.aar
Binary file not shown.
Binary file added fraudforce-lib-release-4.3.1.aar
Binary file not shown.
5 changes: 5 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### What's new
- Update target and compilation SDK versions to 31.
- Adjusted collection details.
- Compatible with the new bluetooth changes/permissions in Android 12.
- Fixed crashes on devices running below SDK version 24.