diff --git a/Assets/Adjust/Android/AdjustAndroid.cs b/Assets/Adjust/Android/AdjustAndroid.cs index c73f5941..71c1956b 100644 --- a/Assets/Adjust/Android/AdjustAndroid.cs +++ b/Assets/Adjust/Android/AdjustAndroid.cs @@ -8,7 +8,7 @@ namespace com.adjust.sdk #if UNITY_ANDROID public class AdjustAndroid { - private const string sdkPrefix = "unity4.17.0"; + private const string sdkPrefix = "unity4.17.1"; private static bool launchDeferredDeeplink = true; private static AndroidJavaClass ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); private static AndroidJavaObject ajoCurrentActivity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic("currentActivity"); diff --git a/Assets/Adjust/Android/adjust-android.jar b/Assets/Adjust/Android/adjust-android.jar index 26f625f5..f6319ed8 100644 Binary files a/Assets/Adjust/Android/adjust-android.jar and b/Assets/Adjust/Android/adjust-android.jar differ diff --git a/Assets/Adjust/Windows/AdjustWindows.cs b/Assets/Adjust/Windows/AdjustWindows.cs index 4453fd60..126ea3b9 100644 --- a/Assets/Adjust/Windows/AdjustWindows.cs +++ b/Assets/Adjust/Windows/AdjustWindows.cs @@ -16,7 +16,7 @@ namespace com.adjust.sdk { public class AdjustWindows { - private const string sdkPrefix = "unity4.17.0"; + private const string sdkPrefix = "unity4.17.1"; private static bool appLaunched = false; public static void Start(AdjustConfig adjustConfig) diff --git a/Assets/Adjust/iOS/Adjust.h b/Assets/Adjust/iOS/Adjust.h index 0454255a..dbc4fcee 100644 --- a/Assets/Adjust/iOS/Adjust.h +++ b/Assets/Adjust/iOS/Adjust.h @@ -2,7 +2,7 @@ // Adjust.h // Adjust // -// V4.17.1 +// V4.17.2 // Created by Christian Wellenbrock (wellle) on 23rd July 2013. // Copyright © 2012-2017 Adjust GmbH. All rights reserved. // diff --git a/Assets/Adjust/iOS/AdjustSdk.a b/Assets/Adjust/iOS/AdjustSdk.a index 5b132a7e..7ad5f63e 100644 Binary files a/Assets/Adjust/iOS/AdjustSdk.a and b/Assets/Adjust/iOS/AdjustSdk.a differ diff --git a/Assets/Adjust/iOS/AdjustiOS.cs b/Assets/Adjust/iOS/AdjustiOS.cs index 78e8b6e6..a2ca6745 100644 --- a/Assets/Adjust/iOS/AdjustiOS.cs +++ b/Assets/Adjust/iOS/AdjustiOS.cs @@ -8,7 +8,7 @@ namespace com.adjust.sdk #if UNITY_IOS public class AdjustiOS { - private const string sdkPrefix = "unity4.17.0"; + private const string sdkPrefix = "unity4.17.1"; [DllImport("__Internal")] private static extern void _AdjustLaunchApp( diff --git a/Assets/Adjust/iOS/Test/AdjustTestLibrary.a b/Assets/Adjust/iOS/Test/AdjustTestLibrary.a index 8617ff4e..6f30a343 100644 Binary files a/Assets/Adjust/iOS/Test/AdjustTestLibrary.a and b/Assets/Adjust/iOS/Test/AdjustTestLibrary.a differ diff --git a/Assets/Editor/AdjustEditor.cs b/Assets/Editor/AdjustEditor.cs index 2f72c369..ec682a0d 100644 --- a/Assets/Editor/AdjustEditor.cs +++ b/Assets/Editor/AdjustEditor.cs @@ -384,60 +384,23 @@ private static void AddBroadcastReceiver(XmlDocument manifest) // Let's now check if user has already defined a receiver which is listening to INSTALL_REFERRER intent. // If that is already defined, don't force the Adjust broadcast receiver to the manifest file. // If not, add the Adjust broadcast receiver to the manifest file. - bool isThereAnyCustomBroadcastReiver = false; - bool isUsedBroadcastReceiverOurs = false; - foreach (XmlNode node in applicationNode.ChildNodes) + List customBroadcastReceiversNodes = getCustomRecieverNodes(applicationNode); + if (customBroadcastReceiversNodes.Count > 0) { - if (node.Name == "receiver") + bool foundAdjustBroadcastReceiver = false; + for (int i = 0; i < customBroadcastReceiversNodes.Count; i += 1) { - foreach (XmlNode subnode in node.ChildNodes) - { - if (subnode.Name == "intent-filter") - { - foreach (XmlNode subsubnode in subnode.ChildNodes) - { - if (subsubnode.Name == "action") - { - foreach (XmlAttribute attribute in subsubnode.Attributes) - { - if (attribute.Value.Contains("com.android.vending.INSTALL_REFERRER")) - { - isThereAnyCustomBroadcastReiver = true; - } - } - } - } - } - } - - // At this point we figured out if there is a broadcast receiver for INSTALL_REFERRER intent. - // In case there is one, let's check if that receiver is actually our broadcast receiver. - // If it is, no need to warn about usage of custom broadcast receiver. - - if (!isThereAnyCustomBroadcastReiver) - { - // If there's no custom broadcast receiver, that's it, that's all. - break; - } - else + foreach (XmlAttribute attribute in customBroadcastReceiversNodes[i].Attributes) { - // If there's custom broadcast receiver, let's iterate on "receiver" attributes a bit more to see if it's ours. - foreach (XmlAttribute attribute in node.Attributes) + if (attribute.Value.Contains("com.adjust.sdk.AdjustReferrerReceiver")) { - if (attribute.Value.Contains("com.adjust.sdk.AdjustReferrerReceiver")) - { - isUsedBroadcastReceiverOurs = true; - } + foundAdjustBroadcastReceiver = true; } } } - } - // Let's see what we have found so far. - if (isThereAnyCustomBroadcastReiver) - { - if (!isUsedBroadcastReceiverOurs) + if (!foundAdjustBroadcastReceiver) { UnityEngine.Debug.Log("[Adjust]: It seems like you are using your own broadcast receiver."); UnityEngine.Debug.Log("[Adjust]: Please, add the calls to the Adjust broadcast receiver like described in here: https://github.com/adjust/android_sdk/blob/master/doc/english/referrer.md"); @@ -484,4 +447,35 @@ private static void CleanManifestFile(String manifestPath) manifestWriter.Write(manifestContent); manifestWriter.Close(); } + + private static List getCustomRecieverNodes(XmlNode applicationNode) + { + List nodes = new List(); + foreach (XmlNode node in applicationNode.ChildNodes) + { + if (node.Name == "receiver") + { + foreach (XmlNode subnode in node.ChildNodes) + { + if (subnode.Name == "intent-filter") + { + foreach (XmlNode subsubnode in subnode.ChildNodes) + { + if (subsubnode.Name == "action") + { + foreach (XmlAttribute attribute in subsubnode.Attributes) + { + if (attribute.Value.Contains("com.android.vending.INSTALL_REFERRER")) + { + nodes.Add(node); + } + } + } + } + } + } + } + } + return nodes; + } } diff --git a/CHANGELOG.md b/CHANGELOG.md index e2591d9a..286cd515 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +### Version 4.17.1 (21st March 2019) +#### Fixed +- Fixed bug in `AdjustEditor.cs` which would add multiple instance of Adjust broadcast receiver to `AndroidManifest.xml` (https://github.com/adjust/unity_sdk/issues/144). + +#### Native SDKs +- [iOS@v4.17.2][ios_sdk_v4.17.2] +- [Android@v4.17.0][android_sdk_v4.17.0] +- [Windows@v4.17.0][windows_sdk_v4.17.0] + +--- + ### Version 4.17.0 (13th December 2018) #### Added - Added `getSdkVersion()` method to `Adjust` interface to obtain current SDK version string. @@ -542,6 +553,7 @@ [ios_sdk_v4.14.1]: https://github.com/adjust/ios_sdk/tree/v4.14.1 [ios_sdk_v4.15.0]: https://github.com/adjust/ios_sdk/tree/v4.15.0 [ios_sdk_v4.17.1]: https://github.com/adjust/ios_sdk/tree/v4.17.1 +[ios_sdk_v4.17.2]: https://github.com/adjust/ios_sdk/tree/v4.17.2 [android_sdk_v3.5.0]: https://github.com/adjust/android_sdk/tree/v3.5.0 [android_sdk_v4.1.0]: https://github.com/adjust/android_sdk/tree/v4.1.0 diff --git a/VERSION b/VERSION index 43b58271..1b0a87fd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.17.0 +4.17.1 diff --git a/doc/english/migration/migrate.md b/doc/english/migration/migrate.md index 8149057d..dd433661 100644 --- a/doc/english/migration/migrate.md +++ b/doc/english/migration/migrate.md @@ -1,4 +1,4 @@ -## Migrate your Adjust SDK for Unity3d to 4.17.0 from 3.4.4 +## Migrate your Adjust SDK for Unity3d to 4.17.1 from 3.4.4 ### Migration procedure @@ -9,7 +9,7 @@ keeping in `Assets/Plugins` folder. For migration purposes, we have prepared the Adjust SDK uninstall script written in Python (`adjust_uninstall.py`). -Migration to version 4.17.0 of our SDK requires the following steps: +Migration to version 4.17.1 of our SDK requires the following steps: 1. Copy the `adjust_uninstall.py` script to your root Unity project directory and run it. This script should delete all adjust source files from the previous SDK version you had. diff --git a/ext/android/sdk b/ext/android/sdk index 09b13b9a..fcfb0f90 160000 --- a/ext/android/sdk +++ b/ext/android/sdk @@ -1 +1 @@ -Subproject commit 09b13b9af945ba13cdcc295842a484aef6951860 +Subproject commit fcfb0f90c0273faf490d606aaa2742f1174c5813 diff --git a/ext/ios/sdk b/ext/ios/sdk index 035cb9ea..019a8bb5 160000 --- a/ext/ios/sdk +++ b/ext/ios/sdk @@ -1 +1 @@ -Subproject commit 035cb9ea3162bf49cafec60db96eba87c3419043 +Subproject commit 019a8bb5e337f91fd8b54ea45ceef8480ccf3778