Skip to content

Commit f1b68fe

Browse files
authored
Merge pull request #141 from adjust/v4170
Version 4.17.0
2 parents a16ce54 + 17856a5 commit f1b68fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+808
-246
lines changed

Assets/Adjust/Adjust.cs

+16
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,22 @@ public static string getIdfa()
385385
#endif
386386
}
387387

388+
public static string getSdkVersion()
389+
{
390+
if (IsEditor()) { return string.Empty; }
391+
392+
#if UNITY_IOS
393+
return AdjustiOS.GetSdkVersion();
394+
#elif UNITY_ANDROID
395+
return AdjustAndroid.GetSdkVersion();
396+
#elif (UNITY_WSA || UNITY_WP8)
397+
return AdjustWindows.GetSdkVersion();
398+
#else
399+
Debug.Log(errorMsgPlatform);
400+
return string.Empty;
401+
#endif
402+
}
403+
388404
[Obsolete("This method is intended for testing purposes only. Do not use it.")]
389405
public static void setReferrer(string referrer)
390406
{

Assets/Adjust/Android/AdjustAndroid.cs

+7-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.15.0";
11+
private const string sdkPrefix = "unity4.17.0";
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");
@@ -377,6 +377,12 @@ public static string GetAmazonAdId()
377377
return ajcAdjust.CallStatic<string>("getAmazonAdId", ajoCurrentActivity);
378378
}
379379

380+
public static string GetSdkVersion()
381+
{
382+
string nativeSdkVersion = ajcAdjust.CallStatic<string>("getSdkVersion");
383+
return sdkPrefix + "@" + nativeSdkVersion;
384+
}
385+
380386
// Used for testing only.
381387
public static void SetTestOptions(Dictionary<string, string> testOptions)
382388
{
21.5 KB
Binary file not shown.

Assets/Adjust/Android/Test/adjust-test.jar.meta

+29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-21.9 KB
Binary file not shown.

Assets/Adjust/Android/Test/adjust-testing.jar.meta

-33
This file was deleted.
4 KB
Binary file not shown.

Assets/Adjust/Test/CommandListenerAndroid.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class CommandListenerAndroid : AndroidJavaProxy
1111
private static CommandExecutor _commandExecutor;
1212
#endif
1313

14-
public CommandListenerAndroid(CommandExecutor commandExecutor) : base("com.adjust.testlibrary.ICommandRawJsonListener")
14+
public CommandListenerAndroid(CommandExecutor commandExecutor) : base("com.adjust.test.ICommandRawJsonListener")
1515
{
1616
#if UNITY_ANDROID
1717
_commandExecutor = commandExecutor;

Assets/Adjust/Test/TestApp.cs

+15-22
Original file line numberDiff line numberDiff line change
@@ -10,61 +10,54 @@ public class TestApp : MonoBehaviour
1010
public static readonly string TAG = "[TestApp]";
1111

1212
#if (UNITY_WSA || UNITY_WP8)
13-
public const string CLIENT_SDK = "[email protected]";
1413
private const string PORT = ":8080";
1514
private const string PROTOCOL = "http://";
16-
private const string BASE_URL = PROTOCOL + "localhost" + PORT; // Windows simulator
15+
private const string BASE_URL = PROTOCOL + "localhost" + PORT;
16+
private const string GDPR_URL = PROTOCOL + "localhost" + PORT;
1717
#elif UNITY_ANDROID
18-
public const string CLIENT_SDK = "[email protected]";
1918
private const string PORT = ":8443";
2019
private const string PROTOCOL = "https://";
21-
private const string BASE_URL = PROTOCOL + "10.0.2.2" + PORT; // Android simulator
20+
private const string BASE_URL = PROTOCOL + "192.168.8.197" + PORT;
21+
private const string GDPR_URL = PROTOCOL + "192.168.8.197" + PORT;
2222
#elif UNITY_IOS
23-
public const string CLIENT_SDK = "[email protected]";
2423
private const string PORT = ":8080";
2524
private const string PROTOCOL = "http://";
26-
private const string BASE_URL = PROTOCOL + "127.0.0.1" + PORT; // iOS simulator
27-
// private const string BASE_URL = PROTOCOL + "192.168.8.141" + PORT; // Over WiFi
28-
25+
private const string BASE_URL = PROTOCOL + "192.168.8.197" + PORT;
26+
private const string GDPR_URL = PROTOCOL + "192.168.8.197" + PORT;
2927
private TestLibraryiOS _testLibraryiOS;
30-
#else
31-
public const string CLIENT_SDK = null;
3228
#endif
3329

3430
void OnGUI()
3531
{
3632
if (GUI.Button(new Rect(0, Screen.height * 0 / 2, Screen.width, Screen.height / 2), "Start test"))
3733
{
38-
StartTestSession ();
34+
StartTestSession();
3935
}
4036
}
4137

4238
private void StartTestSession()
4339
{
44-
ITestLibrary testLibrary = GetPlatformSpecificTestLibrary ();
45-
40+
ITestLibrary testLibrary = GetPlatformSpecificTestLibrary();
4641
#if UNITY_IOS
4742
_testLibraryiOS = testLibrary as TestLibraryiOS;
4843
#endif
4944
// Set specific tests to run.
50-
//testLibrary.AddTest("current/eventBuffering/Test_EventBuffering_sensitive_packets");
51-
//testLibrary.AddTest("current/gdpr/Test_GdprForgetMe_after_install");
52-
//testLibrary.AddTestDirectory ("current/deeplink-deferred");
45+
// testLibrary.AddTest("current/eventBuffering/Test_EventBuffering_sensitive_packets");
46+
// testLibrary.AddTest("current/gdpr/Test_GdprForgetMe_after_install");
47+
// testLibrary.AddTestDirectory ("current/deeplink-deferred");
5348

54-
Log("Starting test session...");
49+
Log("Starting test session.");
5550
testLibrary.StartTestSession();
5651
}
5752

5853
private ITestLibrary GetPlatformSpecificTestLibrary()
5954
{
60-
// gdpr url on sdk_test_server is the same as base url
61-
string gdprUrl = BASE_URL;
6255
#if UNITY_IOS
63-
return new TestLibraryiOS(BASE_URL, gdprUrl);
56+
return new TestLibraryiOS(BASE_URL, GDPR_URL);
6457
#elif UNITY_ANDROID
65-
return new TestLibraryAndroid(BASE_URL, gdprUrl);
58+
return new TestLibraryAndroid(BASE_URL, GDPR_URL);
6659
#elif (UNITY_WSA || UNITY_WP8)
67-
return new TestLibraryWindows(BASE_URL, gdprUrl);
60+
return new TestLibraryWindows(BASE_URL, GDPR_URL);
6861
#else
6962
Debug.Log("Cannot run integration tests (Error in TestApp.GetPlatformSpecificTestLibrary(...)). None of the supported platforms selected.");
7063
return null;

Assets/Adjust/Test/TestLibraryAndroid.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ public TestLibraryAndroid(string baseUrl, string gdprUrl)
1212
CommandExecutor commandExecutor = new CommandExecutor(this, baseUrl, gdprUrl);
1313
onCommandReceivedListener = new CommandListenerAndroid(commandExecutor);
1414
ajoTestLibrary = new AndroidJavaObject(
15-
"com.adjust.testlibrary.TestLibrary",
15+
"com.adjust.test.TestLibrary",
1616
baseUrl,
1717
onCommandReceivedListener);
1818
}
1919

2020
public void StartTestSession()
2121
{
22-
ajoTestLibrary.Call("startTestSession", TestApp.CLIENT_SDK);
22+
ajoTestLibrary.Call("startTestSession", Adjust.getSdkVersion());
2323
}
2424

2525
public void AddInfoToSend(string key, string paramValue)

Assets/Adjust/Test/TestLibraryWindows.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public TestLibraryWindows(string baseUrl, string gdprUrl)
2020
public void StartTestSession()
2121
{
2222
TestApp.Log("TestLibrary -> StartTestSession()");
23-
_testLibraryInterface.StartTestSession(TestApp.CLIENT_SDK);
23+
_testLibraryInterface.StartTestSession(Adjust.getSdkVersion());
2424
}
2525

2626
public void AddInfoToSend(string key, string paramValue)

Assets/Adjust/Test/TestLibraryiOS.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public TestLibraryiOS(string baseUrl, string gdprUrl)
1717
public void StartTestSession()
1818
{
1919
TestApp.Log("TestLibrary -> StartTestSession()");
20-
TestLibraryBridgeiOS.StartTestSession(TestApp.CLIENT_SDK);
20+
TestLibraryBridgeiOS.StartTestSession(Adjust.getSdkVersion());
2121
}
2222

2323
public void AddInfoToSend(string key, string paramValue)

Assets/Adjust/Windows/AdjustWindows.cs

+6-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.15.0";
19+
private const string sdkPrefix = "unity4.17.0";
2020
private static bool appLaunched = false;
2121

2222
public static void Start(AdjustConfig adjustConfig)
@@ -230,6 +230,11 @@ public static string GetAdid()
230230
return AdjustWinInterface.GetAdid();
231231
}
232232

233+
public static string GetSdkVersion()
234+
{
235+
return sdkPrefix + "@" + AdjustWinInterface.GetSdkVersion();
236+
}
237+
233238
public static AdjustAttribution GetAttribution()
234239
{
235240
var attributionMap = AdjustWinInterface.GetAttribution();
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

Assets/Adjust/Windows/WS/AdjustWS.dll

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

Assets/Adjust/iOS/ADJConfig.h

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* @brief Optional delegate that will get informed about tracking results.
2020
*/
2121
@protocol AdjustDelegate
22+
2223
@optional
2324

2425
/**

Assets/Adjust/iOS/Adjust.h

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Adjust.h
33
// Adjust
44
//
5-
// V4.15.0
5+
// V4.17.1
66
// Created by Christian Wellenbrock (wellle) on 23rd July 2013.
77
// Copyright © 2012-2017 Adjust GmbH. All rights reserved.
88
//
@@ -152,6 +152,13 @@ extern NSString * __nonnull const ADJEnvironmentProduction;
152152
*/
153153
+ (nullable ADJAttribution *)attribution;
154154

155+
/**
156+
* @brief Get current Adjust SDK version string.
157+
*
158+
* @return Adjust SDK version string (iosX.Y.Z).
159+
*/
160+
+ (nullable NSString *)sdkVersion;
161+
155162
/**
156163
* @brief Convert a universal link style URL to a deeplink style URL with the corresponding scheme.
157164
*
@@ -271,6 +278,8 @@ extern NSString * __nonnull const ADJEnvironmentProduction;
271278

272279
- (nullable NSString *)idfa;
273280

281+
- (nullable NSString *)sdkVersion;
282+
274283
- (nullable ADJAttribution *)attribution;
275284

276285
- (nullable NSURL *)convertUniversalLink:(nonnull NSURL *)url scheme:(nonnull NSString *)scheme;

Assets/Adjust/iOS/AdjustSdk.a

-501 KB
Binary file not shown.

Assets/Adjust/iOS/AdjustUnity.mm

+15
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,21 @@ void _AdjustAppWillOpenUrl(const char* url) {
330330
return adidCStringCopy;
331331
}
332332

333+
char* _AdjustGetSdkVersion() {
334+
NSString *sdkVersion = [Adjust sdkVersion];
335+
if (nil == sdkVersion) {
336+
return NULL;
337+
}
338+
339+
const char* sdkVersionCString = [sdkVersion UTF8String];
340+
if (NULL == sdkVersionCString) {
341+
return NULL;
342+
}
343+
344+
char* sdkVersionCStringCopy = strdup(sdkVersionCString);
345+
return sdkVersionCStringCopy;
346+
}
347+
333348
char* _AdjustGetAttribution() {
334349
ADJAttribution *attribution = [Adjust attribution];
335350
if (nil == attribution) {

Assets/Adjust/iOS/AdjustiOS.cs

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

1313
[DllImport("__Internal")]
1414
private static extern void _AdjustLaunchApp(
@@ -70,6 +70,9 @@ private static extern void _AdjustTrackEvent(
7070
[DllImport("__Internal")]
7171
private static extern string _AdjustGetAdid();
7272

73+
[DllImport("__Internal")]
74+
private static extern string _AdjustGetSdkVersion();
75+
7376
[DllImport("__Internal")]
7477
private static extern void _AdjustGdprForgetMe();
7578

@@ -259,6 +262,11 @@ public static string GetAdid()
259262
return _AdjustGetAdid();
260263
}
261264

265+
public static string GetSdkVersion()
266+
{
267+
return sdkPrefix + "@" + _AdjustGetSdkVersion();
268+
}
269+
262270
public static void GdprForgetMe()
263271
{
264272
_AdjustGdprForgetMe();
53.4 KB
Binary file not shown.

Assets/AdjustImei.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/AdjustImei/Android.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System;
2+
using System.Runtime.InteropServices;
3+
using UnityEngine;
4+
5+
namespace com.adjust.sdk.imei
6+
{
7+
#if UNITY_ANDROID
8+
public class AdjustImeiAndroid
9+
{
10+
private static AndroidJavaClass ajcAdjustImei = new AndroidJavaClass("com.adjust.sdk.imei.AdjustImei");
11+
12+
public static void ReadImei()
13+
{
14+
if (ajcAdjustImei == null)
15+
{
16+
ajcAdjustImei = new AndroidJavaClass("com.adjust.sdk.Adjust");
17+
}
18+
ajcAdjustImei.CallStatic("readImei");
19+
}
20+
21+
public static void DoNotReadImei()
22+
{
23+
if (ajcAdjustImei == null)
24+
{
25+
ajcAdjustImei = new AndroidJavaClass("com.adjust.sdk.Adjust");
26+
}
27+
ajcAdjustImei.CallStatic("doNotReadImei");
28+
}
29+
}
30+
#endif
31+
}

0 commit comments

Comments
 (0)