Skip to content

Commit 36a2bed

Browse files
authored
Merge pull request #145 from adjust/v4171
Version 4.17.1
2 parents 4dddbd2 + 565596e commit 36a2bed

File tree

13 files changed

+60
-54
lines changed

13 files changed

+60
-54
lines changed

Assets/Adjust/Android/AdjustAndroid.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace com.adjust.sdk
88
#if UNITY_ANDROID
99
public class AdjustAndroid
1010
{
11-
private const string sdkPrefix = "unity4.17.0";
11+
private const string sdkPrefix = "unity4.17.1";
1212
private static bool launchDeferredDeeplink = true;
1313
private static AndroidJavaClass ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust");
1414
private static AndroidJavaObject ajoCurrentActivity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity");
0 Bytes
Binary file not shown.

Assets/Adjust/Windows/AdjustWindows.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace com.adjust.sdk
1616
{
1717
public class AdjustWindows
1818
{
19-
private const string sdkPrefix = "unity4.17.0";
19+
private const string sdkPrefix = "unity4.17.1";
2020
private static bool appLaunched = false;
2121

2222
public static void Start(AdjustConfig adjustConfig)

Assets/Adjust/iOS/Adjust.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Adjust.h
33
// Adjust
44
//
5-
// V4.17.1
5+
// V4.17.2
66
// Created by Christian Wellenbrock (wellle) on 23rd July 2013.
77
// Copyright © 2012-2017 Adjust GmbH. All rights reserved.
88
//

Assets/Adjust/iOS/AdjustSdk.a

694 KB
Binary file not shown.

Assets/Adjust/iOS/AdjustiOS.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace com.adjust.sdk
88
#if UNITY_IOS
99
public class AdjustiOS
1010
{
11-
private const string sdkPrefix = "unity4.17.0";
11+
private const string sdkPrefix = "unity4.17.1";
1212

1313
[DllImport("__Internal")]
1414
private static extern void _AdjustLaunchApp(
-80 Bytes
Binary file not shown.

Assets/Editor/AdjustEditor.cs

+39-45
Original file line numberDiff line numberDiff line change
@@ -384,60 +384,23 @@ private static void AddBroadcastReceiver(XmlDocument manifest)
384384
// Let's now check if user has already defined a receiver which is listening to INSTALL_REFERRER intent.
385385
// If that is already defined, don't force the Adjust broadcast receiver to the manifest file.
386386
// If not, add the Adjust broadcast receiver to the manifest file.
387-
bool isThereAnyCustomBroadcastReiver = false;
388-
bool isUsedBroadcastReceiverOurs = false;
389387

390-
foreach (XmlNode node in applicationNode.ChildNodes)
388+
List<XmlNode> customBroadcastReceiversNodes = getCustomRecieverNodes(applicationNode);
389+
if (customBroadcastReceiversNodes.Count > 0)
391390
{
392-
if (node.Name == "receiver")
391+
bool foundAdjustBroadcastReceiver = false;
392+
for (int i = 0; i < customBroadcastReceiversNodes.Count; i += 1)
393393
{
394-
foreach (XmlNode subnode in node.ChildNodes)
395-
{
396-
if (subnode.Name == "intent-filter")
397-
{
398-
foreach (XmlNode subsubnode in subnode.ChildNodes)
399-
{
400-
if (subsubnode.Name == "action")
401-
{
402-
foreach (XmlAttribute attribute in subsubnode.Attributes)
403-
{
404-
if (attribute.Value.Contains("com.android.vending.INSTALL_REFERRER"))
405-
{
406-
isThereAnyCustomBroadcastReiver = true;
407-
}
408-
}
409-
}
410-
}
411-
}
412-
}
413-
414-
// At this point we figured out if there is a broadcast receiver for INSTALL_REFERRER intent.
415-
// In case there is one, let's check if that receiver is actually our broadcast receiver.
416-
// If it is, no need to warn about usage of custom broadcast receiver.
417-
418-
if (!isThereAnyCustomBroadcastReiver)
419-
{
420-
// If there's no custom broadcast receiver, that's it, that's all.
421-
break;
422-
}
423-
else
394+
foreach (XmlAttribute attribute in customBroadcastReceiversNodes[i].Attributes)
424395
{
425-
// If there's custom broadcast receiver, let's iterate on "receiver" attributes a bit more to see if it's ours.
426-
foreach (XmlAttribute attribute in node.Attributes)
396+
if (attribute.Value.Contains("com.adjust.sdk.AdjustReferrerReceiver"))
427397
{
428-
if (attribute.Value.Contains("com.adjust.sdk.AdjustReferrerReceiver"))
429-
{
430-
isUsedBroadcastReceiverOurs = true;
431-
}
398+
foundAdjustBroadcastReceiver = true;
432399
}
433400
}
434401
}
435-
}
436402

437-
// Let's see what we have found so far.
438-
if (isThereAnyCustomBroadcastReiver)
439-
{
440-
if (!isUsedBroadcastReceiverOurs)
403+
if (!foundAdjustBroadcastReceiver)
441404
{
442405
UnityEngine.Debug.Log("[Adjust]: It seems like you are using your own broadcast receiver.");
443406
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)
484447
manifestWriter.Write(manifestContent);
485448
manifestWriter.Close();
486449
}
450+
451+
private static List<XmlNode> getCustomRecieverNodes(XmlNode applicationNode)
452+
{
453+
List<XmlNode> nodes = new List<XmlNode>();
454+
foreach (XmlNode node in applicationNode.ChildNodes)
455+
{
456+
if (node.Name == "receiver")
457+
{
458+
foreach (XmlNode subnode in node.ChildNodes)
459+
{
460+
if (subnode.Name == "intent-filter")
461+
{
462+
foreach (XmlNode subsubnode in subnode.ChildNodes)
463+
{
464+
if (subsubnode.Name == "action")
465+
{
466+
foreach (XmlAttribute attribute in subsubnode.Attributes)
467+
{
468+
if (attribute.Value.Contains("com.android.vending.INSTALL_REFERRER"))
469+
{
470+
nodes.Add(node);
471+
}
472+
}
473+
}
474+
}
475+
}
476+
}
477+
}
478+
}
479+
return nodes;
480+
}
487481
}

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
### Version 4.17.1 (21st March 2019)
2+
#### Fixed
3+
- 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).
4+
5+
#### Native SDKs
6+
- [[email protected]][ios_sdk_v4.17.2]
7+
- [[email protected]][android_sdk_v4.17.0]
8+
- [[email protected]][windows_sdk_v4.17.0]
9+
10+
---
11+
112
### Version 4.17.0 (13th December 2018)
213
#### Added
314
- Added `getSdkVersion()` method to `Adjust` interface to obtain current SDK version string.
@@ -542,6 +553,7 @@
542553
[ios_sdk_v4.14.1]: https://github.com/adjust/ios_sdk/tree/v4.14.1
543554
[ios_sdk_v4.15.0]: https://github.com/adjust/ios_sdk/tree/v4.15.0
544555
[ios_sdk_v4.17.1]: https://github.com/adjust/ios_sdk/tree/v4.17.1
556+
[ios_sdk_v4.17.2]: https://github.com/adjust/ios_sdk/tree/v4.17.2
545557

546558
[android_sdk_v3.5.0]: https://github.com/adjust/android_sdk/tree/v3.5.0
547559
[android_sdk_v4.1.0]: https://github.com/adjust/android_sdk/tree/v4.1.0

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.17.0
1+
4.17.1

doc/english/migration/migrate.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Migrate your Adjust SDK for Unity3d to 4.17.0 from 3.4.4
1+
## Migrate your Adjust SDK for Unity3d to 4.17.1 from 3.4.4
22

33
### Migration procedure
44

@@ -9,7 +9,7 @@ keeping in `Assets/Plugins` folder.
99

1010
For migration purposes, we have prepared the Adjust SDK uninstall script written in Python (`adjust_uninstall.py`).
1111

12-
Migration to version 4.17.0 of our SDK requires the following steps:
12+
Migration to version 4.17.1 of our SDK requires the following steps:
1313

1414
1. Copy the `adjust_uninstall.py` script to your root Unity project directory and run it. This script should
1515
delete all adjust source files from the previous SDK version you had.

ext/android/sdk

Submodule sdk updated 34 files

0 commit comments

Comments
 (0)