diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ded3a89 --- /dev/null +++ b/.github/workflows/main.yml @@ -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() diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..dea0598 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..51de567 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +**/.gradle/** +**/build/ +**/.idea/ diff --git a/README.md b/README.md index 869eb18..52761df 100644 --- a/README.md +++ b/README.md @@ -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 { @@ -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') } ``` @@ -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. @@ -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 { - @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); ``` @@ -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` @@ -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. diff --git a/android-studio-sample-app/app/build.gradle b/android-studio-sample-app/app/build.gradle index 38a91a7..49dbc3c 100644 --- a/android-studio-sample-app/app/build.gradle +++ b/android-studio-sample-app/app/build.gradle @@ -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 { @@ -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') } diff --git a/android-studio-sample-app/app/libs/fraudforce-lib-release-4.3.0.aar b/android-studio-sample-app/app/libs/fraudforce-lib-release-4.3.0.aar deleted file mode 100644 index 9e0e670..0000000 Binary files a/android-studio-sample-app/app/libs/fraudforce-lib-release-4.3.0.aar and /dev/null differ diff --git a/android-studio-sample-app/app/libs/fraudforce-lib-release-4.3.1.aar b/android-studio-sample-app/app/libs/fraudforce-lib-release-4.3.1.aar new file mode 100644 index 0000000..a9ea931 Binary files /dev/null and b/android-studio-sample-app/app/libs/fraudforce-lib-release-4.3.1.aar differ diff --git a/android-studio-sample-app/app/src/androidTest/java/com/iovation/mobile/android/sample/androidstudiosampleapp/ApplicationTest.java b/android-studio-sample-app/app/src/androidTest/java/com/iovation/mobile/android/sample/androidstudiosampleapp/ApplicationTest.java deleted file mode 100644 index 7dc10c6..0000000 --- a/android-studio-sample-app/app/src/androidTest/java/com/iovation/mobile/android/sample/androidstudiosampleapp/ApplicationTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.iovation.mobile.android.sample.androidstudiosampleapp; - -import android.app.Application; -import android.test.ApplicationTestCase; - -/** - * Testing Fundamentals - */ -public class ApplicationTest extends ApplicationTestCase { - public ApplicationTest() { - super(Application.class); - } -} \ No newline at end of file diff --git a/android-studio-sample-app/app/src/main/AndroidManifest.xml b/android-studio-sample-app/app/src/main/AndroidManifest.xml index 8be3427..f1b909e 100644 --- a/android-studio-sample-app/app/src/main/AndroidManifest.xml +++ b/android-studio-sample-app/app/src/main/AndroidManifest.xml @@ -1,15 +1,19 @@ + package="com.iovation.mobile.android.sample.sampleapp"> - - - - + + + + + + - + @@ -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"> + android:exported="true" + android:label="@string/app_name"> @@ -30,7 +35,8 @@ + android:exported="false" + android:label="@string/wv_name"> diff --git a/android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/androidstudiosampleapp/MainApplication.java b/android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/sampleapp/MainApplication.java similarity index 90% rename from android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/androidstudiosampleapp/MainApplication.java rename to android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/sampleapp/MainApplication.java index 8a2297a..1b21f14 100644 --- a/android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/androidstudiosampleapp/MainApplication.java +++ b/android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/sampleapp/MainApplication.java @@ -1,4 +1,4 @@ -package com.iovation.mobile.android.sample.androidstudiosampleapp; +package com.iovation.mobile.android.sample.sampleapp; import android.app.Application; diff --git a/android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/androidstudiosampleapp/NativeActivity.java b/android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/sampleapp/NativeActivity.java similarity index 93% rename from android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/androidstudiosampleapp/NativeActivity.java rename to android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/sampleapp/NativeActivity.java index c7b876c..a9ce5d7 100644 --- a/android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/androidstudiosampleapp/NativeActivity.java +++ b/android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/sampleapp/NativeActivity.java @@ -1,4 +1,4 @@ -package com.iovation.mobile.android.sample.androidstudiosampleapp; +package com.iovation.mobile.android.sample.sampleapp; import android.app.Activity; import android.os.AsyncTask; @@ -6,7 +6,6 @@ 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 { diff --git a/android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/androidstudiosampleapp/WebViewActivity.java b/android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/sampleapp/WebViewActivity.java similarity index 87% rename from android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/androidstudiosampleapp/WebViewActivity.java rename to android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/sampleapp/WebViewActivity.java index 9ff8d4a..da3616b 100644 --- a/android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/androidstudiosampleapp/WebViewActivity.java +++ b/android-studio-sample-app/app/src/main/java/com/iovation/mobile/android/sample/sampleapp/WebViewActivity.java @@ -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; /** diff --git a/android-studio-sample-app/build.gradle b/android-studio-sample-app/build.gradle index 4886e3d..37f8076 100644 --- a/android-studio-sample-app/build.gradle +++ b/android-studio-sample-app/build.gradle @@ -3,7 +3,6 @@ buildscript { repositories { mavenLocal() - jcenter() mavenCentral() google() } @@ -17,7 +16,7 @@ buildscript { allprojects { repositories { - jcenter() google() + mavenCentral() } } diff --git a/fraudforce-lib-release-4.3.0.aar b/fraudforce-lib-release-4.3.0.aar deleted file mode 100644 index 9e0e670..0000000 Binary files a/fraudforce-lib-release-4.3.0.aar and /dev/null differ diff --git a/fraudforce-lib-release-4.3.1.aar b/fraudforce-lib-release-4.3.1.aar new file mode 100644 index 0000000..a9ea931 Binary files /dev/null and b/fraudforce-lib-release-4.3.1.aar differ diff --git a/release-notes.md b/release-notes.md new file mode 100644 index 0000000..5ab69ed --- /dev/null +++ b/release-notes.md @@ -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. \ No newline at end of file