Skip to content

Commit b5733fb

Browse files
author
Srđan Tubin
authored
Merge pull request #146 from adjust/v4172
Version 4.17.2
2 parents 36a2bed + 9963a48 commit b5733fb

File tree

8 files changed

+74
-42
lines changed

8 files changed

+74
-42
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.1";
11+
private const string sdkPrefix = "unity4.17.2";
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");

Assets/Adjust/Unity/AdjustUtils.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -240,43 +240,43 @@ public static AndroidJavaObject TestOptionsMap2AndroidJavaObject(Dictionary<stri
240240
}
241241
if (testOptionsMap.ContainsKey(KeyTestOptionsUseTestConnectionOptions))
242242
{
243-
bool useTestConnectionOptions = testOptionsMap [KeyTestOptionsUseTestConnectionOptions].ToLower () == "true";
243+
bool useTestConnectionOptions = testOptionsMap[KeyTestOptionsUseTestConnectionOptions].ToLower() == "true";
244244
AndroidJavaObject ajoUseTestConnectionOptions = new AndroidJavaObject("java.lang.Boolean", useTestConnectionOptions);
245245
ajoTestOptions.Set<AndroidJavaObject>("useTestConnectionOptions", ajoUseTestConnectionOptions);
246246
}
247247
if (testOptionsMap.ContainsKey(KeyTestOptionsTimerIntervalInMilliseconds))
248248
{
249-
var timerIntervalInMilliseconds = long.Parse (testOptionsMap [KeyTestOptionsTimerIntervalInMilliseconds]);
249+
var timerIntervalInMilliseconds = long.Parse(testOptionsMap[KeyTestOptionsTimerIntervalInMilliseconds]);
250250
AndroidJavaObject ajoTimerIntervalInMilliseconds = new AndroidJavaObject("java.lang.Long", timerIntervalInMilliseconds);
251251
ajoTestOptions.Set<AndroidJavaObject>("timerIntervalInMilliseconds", ajoTimerIntervalInMilliseconds);
252252
}
253253
if (testOptionsMap.ContainsKey(KeyTestOptionsTimerStartInMilliseconds))
254254
{
255-
var timerStartInMilliseconds = long.Parse (testOptionsMap [KeyTestOptionsTimerStartInMilliseconds]);
255+
var timerStartInMilliseconds = long.Parse(testOptionsMap[KeyTestOptionsTimerStartInMilliseconds]);
256256
AndroidJavaObject ajoTimerStartInMilliseconds = new AndroidJavaObject("java.lang.Long", timerStartInMilliseconds);
257257
ajoTestOptions.Set<AndroidJavaObject>("timerStartInMilliseconds", ajoTimerStartInMilliseconds);
258258
}
259259
if (testOptionsMap.ContainsKey(KeyTestOptionsSessionIntervalInMilliseconds))
260260
{
261-
var sessionIntervalInMilliseconds = long.Parse (testOptionsMap [KeyTestOptionsSessionIntervalInMilliseconds]);
261+
var sessionIntervalInMilliseconds = long.Parse(testOptionsMap[KeyTestOptionsSessionIntervalInMilliseconds]);
262262
AndroidJavaObject ajoSessionIntervalInMilliseconds = new AndroidJavaObject("java.lang.Long", sessionIntervalInMilliseconds);
263263
ajoTestOptions.Set<AndroidJavaObject>("sessionIntervalInMilliseconds", ajoSessionIntervalInMilliseconds);
264264
}
265265
if (testOptionsMap.ContainsKey(KeyTestOptionsSubsessionIntervalInMilliseconds))
266266
{
267-
var subsessionIntervalInMilliseconds = long.Parse (testOptionsMap [KeyTestOptionsSubsessionIntervalInMilliseconds]);
267+
var subsessionIntervalInMilliseconds = long.Parse(testOptionsMap[KeyTestOptionsSubsessionIntervalInMilliseconds]);
268268
AndroidJavaObject ajoSubsessionIntervalInMilliseconds = new AndroidJavaObject("java.lang.Long", subsessionIntervalInMilliseconds);
269269
ajoTestOptions.Set<AndroidJavaObject>("subsessionIntervalInMilliseconds", ajoSubsessionIntervalInMilliseconds);
270270
}
271271
if (testOptionsMap.ContainsKey(KeyTestOptionsTeardown))
272272
{
273-
bool teardown = testOptionsMap [KeyTestOptionsTeardown].ToLower () == "true";
273+
bool teardown = testOptionsMap[KeyTestOptionsTeardown].ToLower() == "true";
274274
AndroidJavaObject ajoTeardown = new AndroidJavaObject("java.lang.Boolean", teardown);
275275
ajoTestOptions.Set<AndroidJavaObject>("teardown", ajoTeardown);
276276
}
277277
if (testOptionsMap.ContainsKey(KeyTestOptionsNoBackoffWait))
278278
{
279-
bool noBackoffWait = testOptionsMap [KeyTestOptionsNoBackoffWait].ToLower () == "true";
279+
bool noBackoffWait = testOptionsMap[KeyTestOptionsNoBackoffWait].ToLower() == "true";
280280
AndroidJavaObject ajoNoBackoffWait = new AndroidJavaObject("java.lang.Boolean", noBackoffWait);
281281
ajoTestOptions.Set<AndroidJavaObject>("noBackoffWait", ajoNoBackoffWait);
282282
}

Assets/Adjust/Windows/AdjustWindows.cs

+50-30
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System;
33
using System.Collections;
44
using System.Collections.Generic;
5+
using System.Reflection;
56
using UnityEngine;
67

78
#if UNITY_WSA_10_0
@@ -16,7 +17,7 @@ namespace com.adjust.sdk
1617
{
1718
public class AdjustWindows
1819
{
19-
private const string sdkPrefix = "unity4.17.1";
20+
private const string sdkPrefix = "unity4.17.2";
2021
private static bool appLaunched = false;
2122

2223
public static void Start(AdjustConfig adjustConfig)
@@ -270,50 +271,69 @@ public static void SetTestOptions(Dictionary<string, string> testOptions)
270271
bool deleteState = false;
271272
bool noBackoffWait = false;
272273

273-
if (testOptions.ContainsKey (AdjustUtils.KeyTestOptionsTimerIntervalInMilliseconds))
274+
if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsTimerIntervalInMilliseconds))
274275
{
275-
timerIntervalMls = long.Parse (testOptions [AdjustUtils.KeyTestOptionsTimerIntervalInMilliseconds]);
276+
timerIntervalMls = long.Parse(testOptions[AdjustUtils.KeyTestOptionsTimerIntervalInMilliseconds]);
276277
}
277-
if (testOptions.ContainsKey (AdjustUtils.KeyTestOptionsTimerStartInMilliseconds))
278+
if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsTimerStartInMilliseconds))
278279
{
279-
timerStartMls = long.Parse (testOptions [AdjustUtils.KeyTestOptionsTimerStartInMilliseconds]);
280+
timerStartMls = long.Parse(testOptions[AdjustUtils.KeyTestOptionsTimerStartInMilliseconds]);
280281
}
281-
if (testOptions.ContainsKey (AdjustUtils.KeyTestOptionsSessionIntervalInMilliseconds))
282+
if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsSessionIntervalInMilliseconds))
282283
{
283-
sessionIntMls = long.Parse (testOptions [AdjustUtils.KeyTestOptionsSessionIntervalInMilliseconds]);
284+
sessionIntMls = long.Parse(testOptions[AdjustUtils.KeyTestOptionsSessionIntervalInMilliseconds]);
284285
}
285-
if (testOptions.ContainsKey (AdjustUtils.KeyTestOptionsSubsessionIntervalInMilliseconds))
286+
if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsSubsessionIntervalInMilliseconds))
286287
{
287-
subsessionIntMls = long.Parse (testOptions [AdjustUtils.KeyTestOptionsSubsessionIntervalInMilliseconds]);
288+
subsessionIntMls = long.Parse(testOptions[AdjustUtils.KeyTestOptionsSubsessionIntervalInMilliseconds]);
288289
}
289-
if (testOptions.ContainsKey (AdjustUtils.KeyTestOptionsTeardown))
290+
if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsTeardown))
290291
{
291-
teardown = testOptions [AdjustUtils.KeyTestOptionsTeardown].ToLower() == "true";
292+
teardown = testOptions[AdjustUtils.KeyTestOptionsTeardown].ToLower() == "true";
292293
}
293-
if (testOptions.ContainsKey (AdjustUtils.KeyTestOptionsDeleteState))
294+
if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsDeleteState))
294295
{
295-
deleteState = testOptions [AdjustUtils.KeyTestOptionsDeleteState].ToLower() == "true";
296+
deleteState = testOptions[AdjustUtils.KeyTestOptionsDeleteState].ToLower() == "true";
296297
}
297-
if (testOptions.ContainsKey (AdjustUtils.KeyTestOptionsNoBackoffWait))
298+
if (testOptions.ContainsKey(AdjustUtils.KeyTestOptionsNoBackoffWait))
298299
{
299-
noBackoffWait = testOptions [AdjustUtils.KeyTestOptionsNoBackoffWait].ToLower() == "true";
300+
noBackoffWait = testOptions[AdjustUtils.KeyTestOptionsNoBackoffWait].ToLower() == "true";
300301
}
301302

302-
TestLibraryInterface.TestLibraryInterface.SetTestOptions(
303-
new TestLibraryInterface.AdjustTestOptionsDto
304-
{
305-
BaseUrl = testOptions[AdjustUtils.KeyTestOptionsBaseUrl],
306-
GdprUrl = testOptions[AdjustUtils.KeyTestOptionsGdprUrl],
307-
BasePath = basePath,
308-
GdprPath = gdprPath,
309-
SessionIntervalInMilliseconds = sessionIntMls,
310-
SubsessionIntervalInMilliseconds = subsessionIntMls,
311-
TimerIntervalInMilliseconds = timerIntervalMls,
312-
TimerStartInMilliseconds = timerStartMls,
313-
DeleteState = deleteState,
314-
Teardown = teardown,
315-
NoBackoffWait = noBackoffWait
316-
});
303+
Type testLibInterfaceType = Type.GetType("TestLibraryInterface.TestLibraryInterface, TestLibraryInterface");
304+
Type adjustTestOptionsDtoType = Type.GetType("TestLibraryInterface.AdjustTestOptionsDto, TestLibraryInterface");
305+
if (testLibInterfaceType == null || adjustTestOptionsDtoType == null)
306+
{
307+
return;
308+
}
309+
310+
PropertyInfo baseUrlInfo = adjustTestOptionsDtoType.GetProperty("BaseUrl");
311+
PropertyInfo gdprUrlInfo = adjustTestOptionsDtoType.GetProperty("GdprUrl");
312+
PropertyInfo basePathInfo = adjustTestOptionsDtoType.GetProperty("BasePath");
313+
PropertyInfo gdprPathInfo = adjustTestOptionsDtoType.GetProperty("GdprPath");
314+
PropertyInfo sessionIntervalInMillisecondsInfo = adjustTestOptionsDtoType.GetProperty("SessionIntervalInMilliseconds");
315+
PropertyInfo subsessionIntervalInMillisecondsInfo = adjustTestOptionsDtoType.GetProperty("SubsessionIntervalInMilliseconds");
316+
PropertyInfo timerIntervalInMillisecondsInfo = adjustTestOptionsDtoType.GetProperty("TimerIntervalInMilliseconds");
317+
PropertyInfo timerStartInMillisecondsInfo = adjustTestOptionsDtoType.GetProperty("TimerStartInMilliseconds");
318+
PropertyInfo deleteStateInfo = adjustTestOptionsDtoType.GetProperty("DeleteState");
319+
PropertyInfo teardownInfo = adjustTestOptionsDtoType.GetProperty("Teardown");
320+
PropertyInfo noBackoffWaitInfo = adjustTestOptionsDtoType.GetProperty("NoBackoffWait");
321+
322+
object adjustTestOptionsDtoInstance = Activator.CreateInstance(adjustTestOptionsDtoType);
323+
baseUrlInfo.SetValue(adjustTestOptionsDtoInstance, testOptions[AdjustUtils.KeyTestOptionsBaseUrl], null);
324+
gdprUrlInfo.SetValue(adjustTestOptionsDtoInstance, testOptions[AdjustUtils.KeyTestOptionsGdprUrl], null);
325+
basePathInfo.SetValue(adjustTestOptionsDtoInstance, basePath, null);
326+
gdprPathInfo.SetValue(adjustTestOptionsDtoInstance, gdprPath, null);
327+
sessionIntervalInMillisecondsInfo.SetValue(adjustTestOptionsDtoInstance, sessionIntMls, null);
328+
subsessionIntervalInMillisecondsInfo.SetValue(adjustTestOptionsDtoInstance, subsessionIntMls, null);
329+
timerIntervalInMillisecondsInfo.SetValue(adjustTestOptionsDtoInstance, timerIntervalMls, null);
330+
timerStartInMillisecondsInfo.SetValue(adjustTestOptionsDtoInstance, timerStartMls, null);
331+
deleteStateInfo.SetValue(adjustTestOptionsDtoInstance, deleteState, null);
332+
teardownInfo.SetValue(adjustTestOptionsDtoInstance, teardown, null);
333+
noBackoffWaitInfo.SetValue(adjustTestOptionsDtoInstance, noBackoffWait, null);
334+
335+
MethodInfo setTestOptionsMethodInfo = testLibInterfaceType.GetMethod("SetTestOptions");
336+
setTestOptionsMethodInfo.Invoke(null, new object[] { adjustTestOptionsDtoInstance });
317337
}
318338
}
319339
}

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.1";
11+
private const string sdkPrefix = "unity4.17.2";
1212

1313
[DllImport("__Internal")]
1414
private static extern void _AdjustLaunchApp(

Assets/Editor/AdjustEditor.cs

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ static void ExportAdjustUnityPackage()
9090
assetsToExport.Add(assetsPath + "/Windows/WS/WinWsInterface.dll");
9191
assetsToExport.Add(assetsPath + "/Windows/WU10/AdjustUAP10.dll");
9292
assetsToExport.Add(assetsPath + "/Windows/WU10/Win10Interface.dll");
93+
assetsToExport.Add(assetsPath + "/Windows/Newtonsoft.Json.dll");
9394

9495
AssetDatabase.ExportPackage(
9596
assetsToExport.ToArray(),

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
### Version 4.17.2 (29th March 2019)
2+
#### Fixed
3+
- Fixed bug in `AdjustWindows.cs` which prevented the project to be built for Universal Windows Platform.
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.1 (21st March 2019)
213
#### Fixed
314
- 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).

VERSION

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

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.1 from 3.4.4
1+
## Migrate your Adjust SDK for Unity3d to 4.17.2 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.1 of our SDK requires the following steps:
12+
Migration to version 4.17.2 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.

0 commit comments

Comments
 (0)