diff --git a/Adjust/adjust/build.gradle b/Adjust/adjust/build.gradle index 1125e9bfd..a3dd926d9 100644 --- a/Adjust/adjust/build.gradle +++ b/Adjust/adjust/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.library' def getVersionName() { - return "4.12.3" + return "4.12.4" } android { diff --git a/Adjust/adjust/src/main/java/com/adjust/sdk/Constants.java b/Adjust/adjust/src/main/java/com/adjust/sdk/Constants.java index 6e7556284..6e544f7ec 100644 --- a/Adjust/adjust/src/main/java/com/adjust/sdk/Constants.java +++ b/Adjust/adjust/src/main/java/com/adjust/sdk/Constants.java @@ -29,7 +29,7 @@ public interface Constants { String BASE_URL = "https://app.adjust.com"; String SCHEME = "https"; String AUTHORITY = "app.adjust.com"; - String CLIENT_SDK = "android4.12.3"; + String CLIENT_SDK = "android4.12.4"; String LOGTAG = "Adjust"; String REFTAG = "reftag"; String INSTALL_REFERRER = "install_referrer"; diff --git a/Adjust/adjust/src/main/java/com/adjust/sdk/EventResponseData.java b/Adjust/adjust/src/main/java/com/adjust/sdk/EventResponseData.java index d757bfb6d..4add664ae 100644 --- a/Adjust/adjust/src/main/java/com/adjust/sdk/EventResponseData.java +++ b/Adjust/adjust/src/main/java/com/adjust/sdk/EventResponseData.java @@ -1,5 +1,7 @@ package com.adjust.sdk; +import org.json.JSONObject; + /** * Created by pfms on 09/02/16. */ @@ -19,7 +21,11 @@ public AdjustEventSuccess getSuccessResponseData() { successResponseData.message = message; successResponseData.timestamp = timestamp; successResponseData.adid = adid; - successResponseData.jsonResponse = jsonResponse; + if (jsonResponse != null) { + successResponseData.jsonResponse = jsonResponse; + } else { + successResponseData.jsonResponse = new JSONObject(); + } successResponseData.eventToken = eventToken; return successResponseData; @@ -35,7 +41,11 @@ public AdjustEventFailure getFailureResponseData() { failureResponseData.timestamp = timestamp; failureResponseData.adid = adid; failureResponseData.willRetry = willRetry; - failureResponseData.jsonResponse = jsonResponse; + if (jsonResponse != null) { + failureResponseData.jsonResponse = jsonResponse; + } else { + failureResponseData.jsonResponse = new JSONObject(); + } failureResponseData.eventToken = eventToken; return failureResponseData; diff --git a/Adjust/adjust/src/main/java/com/adjust/sdk/InstallReferrer.java b/Adjust/adjust/src/main/java/com/adjust/sdk/InstallReferrer.java index 5351b9c4e..c426d75f3 100644 --- a/Adjust/adjust/src/main/java/com/adjust/sdk/InstallReferrer.java +++ b/Adjust/adjust/src/main/java/com/adjust/sdk/InstallReferrer.java @@ -245,17 +245,47 @@ private void startConnection(final Class listenerClass, final Object listenerPro * {@inheritDoc} */ @Override - public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { + public Object invoke(final Object proxy, final Method method, Object[] args) + throws Throwable { + if (method == null) { + logger.error("InstallReferrer invoke method null"); + return null; + } String methodName = method.getName(); + if (methodName == null) { + logger.error("InstallReferrer invoke method name null"); + return null; + } // Prints the method being invoked logger.debug("InstallReferrer invoke method name: %s", methodName); + if (args == null) { + logger.warn("InstallReferrer invoke args null"); + args = new Object[0]; + } for (Object arg : args) { logger.debug("InstallReferrer invoke arg: %s", arg); } // if the method name equals some method's name then call your method if (methodName.equals("onInstallReferrerSetupFinished")) { - onInstallReferrerSetupFinishedInt((Integer) args[0]); + if (args.length != 1) { + logger.error("InstallReferrer invoke onInstallReferrerSetupFinished args lenght not 1: %d", args.length); + return null; + } + + Object arg = args[0]; + if (!(arg instanceof Integer)) { + logger.error("InstallReferrer invoke onInstallReferrerSetupFinished arg not int"); + return null; + } + + Integer responseCode = (Integer) arg; + if (responseCode == null) { + logger.error("InstallReferrer invoke onInstallReferrerSetupFinished responseCode arg is null"); + return null; + } + + onInstallReferrerSetupFinishedInt(responseCode); } else if (methodName.equals("onInstallReferrerServiceDisconnected")) { logger.debug("InstallReferrer onInstallReferrerServiceDisconnected"); } diff --git a/Adjust/adjust/src/main/java/com/adjust/sdk/SessionResponseData.java b/Adjust/adjust/src/main/java/com/adjust/sdk/SessionResponseData.java index 835cdb6bf..293cae7d4 100644 --- a/Adjust/adjust/src/main/java/com/adjust/sdk/SessionResponseData.java +++ b/Adjust/adjust/src/main/java/com/adjust/sdk/SessionResponseData.java @@ -1,5 +1,7 @@ package com.adjust.sdk; +import org.json.JSONObject; + /** * Created by pfms on 09/02/16. */ @@ -13,7 +15,11 @@ public AdjustSessionSuccess getSuccessResponseData() { successResponseData.message = message; successResponseData.timestamp = timestamp; successResponseData.adid = adid; - successResponseData.jsonResponse = jsonResponse; + if (jsonResponse != null) { + successResponseData.jsonResponse = jsonResponse; + } else { + successResponseData.jsonResponse = new JSONObject(); + } return successResponseData; } @@ -28,7 +34,11 @@ public AdjustSessionFailure getFailureResponseData() { failureResponseData.timestamp = timestamp; failureResponseData.adid = adid; failureResponseData.willRetry = willRetry; - failureResponseData.jsonResponse = jsonResponse; + if (jsonResponse != null) { + failureResponseData.jsonResponse = jsonResponse; + } else { + failureResponseData.jsonResponse = new JSONObject(); + } return failureResponseData; } diff --git a/Adjust/example/build.gradle b/Adjust/example/build.gradle index 8a398eee5..d4b4bbff9 100644 --- a/Adjust/example/build.gradle +++ b/Adjust/example/build.gradle @@ -27,7 +27,7 @@ dependencies { // running mvn package //compile fileTree(dir: '../target', include: ['*.jar']) // using maven repository - //compile 'com.adjust.sdk:adjust-android:4.12.3' + //compile 'com.adjust.sdk:adjust-android:4.12.4' debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.4' releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4' diff --git a/Adjust/pom.xml b/Adjust/pom.xml index 359d22706..c36c6a63b 100644 --- a/Adjust/pom.xml +++ b/Adjust/pom.xml @@ -5,7 +5,7 @@ 4.0.0 adjust-android com.adjust.sdk - 4.12.3 + 4.12.4 jar Adjust Android SDK https://github.com/adjust/android_sdk diff --git a/Adjust/pom_criteo.xml b/Adjust/pom_criteo.xml index b269eda2a..0fae914c9 100644 --- a/Adjust/pom_criteo.xml +++ b/Adjust/pom_criteo.xml @@ -5,7 +5,7 @@ 4.0.0 adjust-android-criteo com.adjust.sdk - 4.12.3 + 4.12.4 jar Adjust Android SDK https://github.com/adjust/android_sdk diff --git a/Adjust/pom_sociomantic.xml b/Adjust/pom_sociomantic.xml index 41e0c2ec9..f335de2aa 100644 --- a/Adjust/pom_sociomantic.xml +++ b/Adjust/pom_sociomantic.xml @@ -5,7 +5,7 @@ 4.0.0 adjust-android-sociomantic com.adjust.sdk - 4.12.3 + 4.12.4 jar Adjust Android SDK https://github.com/adjust/android_sdk diff --git a/Adjust/pom_trademob.xml b/Adjust/pom_trademob.xml index e6d799f0b..4c37e72e2 100644 --- a/Adjust/pom_trademob.xml +++ b/Adjust/pom_trademob.xml @@ -5,7 +5,7 @@ 4.0.0 adjust-android-trademob com.adjust.sdk - 4.12.3 + 4.12.4 jar Adjust Android SDK https://github.com/adjust/android_sdk diff --git a/Adjust/test/src/androidTest/java/com/adjust/sdk/TestActivityPackage.java b/Adjust/test/src/androidTest/java/com/adjust/sdk/TestActivityPackage.java index e22972873..40dc04b16 100644 --- a/Adjust/test/src/androidTest/java/com/adjust/sdk/TestActivityPackage.java +++ b/Adjust/test/src/androidTest/java/com/adjust/sdk/TestActivityPackage.java @@ -53,7 +53,7 @@ public TestActivityPackage(ActivityPackage activityPackage) { // default values appToken = "123456789012"; environment = "sandbox"; - clientSdk = "android4.12.3"; + clientSdk = "android4.12.4"; suffix = ""; attribution = new AdjustAttribution(); playServices = true; diff --git a/Adjust/testapp/src/main/java/com/adjust/testapp/MainActivity.java b/Adjust/testapp/src/main/java/com/adjust/testapp/MainActivity.java index ca4970b1c..849a0f4dd 100644 --- a/Adjust/testapp/src/main/java/com/adjust/testapp/MainActivity.java +++ b/Adjust/testapp/src/main/java/com/adjust/testapp/MainActivity.java @@ -34,6 +34,6 @@ private void startTestSession() { //testLibrary.addTestDirectory("current/sdkInfo"); //testLibrary.addTest("current/appSecret/Test_AppSecret_no_secret"); - testLibrary.startTestSession("android4.12.3"); + testLibrary.startTestSession("android4.12.4"); } } diff --git a/CHANGELOG.md b/CHANGELOG.md index cdd09d14d..092d70b84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### Version 4.12.4 (9th March 2018) +#### Changed +- Added additional null checks into `InstallReferrer` `invoke` method. + +--- + ### Version 4.12.3 (7th March 2018) #### Fixed - Fixed random `OutOfMemoryError` occurrences when reading/writing referrers array. diff --git a/README.md b/README.md index 8512d0ecd..3c52e4bbc 100644 --- a/README.md +++ b/README.md @@ -72,14 +72,14 @@ These are the minimal steps required to integrate the Adjust SDK into your Andro If you are using Maven, add the following to your `build.gradle` file: ``` -compile 'com.adjust.sdk:adjust-android:4.12.3' +compile 'com.adjust.sdk:adjust-android:4.12.4' compile 'com.android.installreferrer:installreferrer:1.0' ``` **Note**: If you are using `Gradle 3.0.0 or above`, make sure to use the `implementation` keyword instead of `compile` as follows: ``` -implementation 'com.adjust.sdk:adjust-android:4.12.3' +implementation 'com.adjust.sdk:adjust-android:4.12.4' implementation 'com.android.installreferrer:installreferrer:1.0' ``` diff --git a/VERSION b/VERSION index d140ced1c..23297c30e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.12.3 +4.12.4 diff --git a/doc/english/criteo_plugin.md b/doc/english/criteo_plugin.md index fcac3842c..d34d7e05f 100644 --- a/doc/english/criteo_plugin.md +++ b/doc/english/criteo_plugin.md @@ -3,7 +3,7 @@ Add the dependency of the adjust sdk with the Criteo plugin: ``` -compile 'com.adjust.sdk:adjust-android-criteo:4.12.3' +compile 'com.adjust.sdk:adjust-android-criteo:4.12.4' ``` Or integrate adjust with Criteo events by following these steps: diff --git a/doc/english/migrate.md b/doc/english/migrate.md index f1c97cf5f..0320874ec 100644 --- a/doc/english/migrate.md +++ b/doc/english/migrate.md @@ -1,4 +1,4 @@ -## Migrate your adjust SDK for Android to 4.12.3 from 3.6.2 +## Migrate your adjust SDK for Android to 4.12.4 from 3.6.2 ### The Application class diff --git a/doc/english/sociomantic_plugin.md b/doc/english/sociomantic_plugin.md index 64eec721b..c3532fdea 100644 --- a/doc/english/sociomantic_plugin.md +++ b/doc/english/sociomantic_plugin.md @@ -3,7 +3,7 @@ Add the dependency of the adjust sdk with the Sociomantic plugin: ``` -compile 'com.adjust.sdk:adjust-android-sociomantic:4.12.3' +compile 'com.adjust.sdk:adjust-android-sociomantic:4.12.4' ``` Or integrate adjust with Sociomantic events by following these steps: diff --git a/doc/english/trademob_plugin.md b/doc/english/trademob_plugin.md index e3847c980..61c101e45 100644 --- a/doc/english/trademob_plugin.md +++ b/doc/english/trademob_plugin.md @@ -3,7 +3,7 @@ Add the dependency of the adjust sdk with the Trademob plugin: ``` -compile 'com.adjust.sdk:adjust-android-trademob:4.12.3' +compile 'com.adjust.sdk:adjust-android-trademob:4.12.4' ``` Or integrate adjust with Trademob events by following these steps: