Skip to content

Commit ff24707

Browse files
authored
Merge pull request #195 from adjust/v4231
Version 4.23.1
2 parents 181c7ec + bca5ef1 commit ff24707

File tree

16 files changed

+150
-29
lines changed

16 files changed

+150
-29
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.23.0";
11+
private const string sdkPrefix = "unity4.23.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.
157 Bytes
Binary file not shown.

Assets/Adjust/Editor/AdjustEditor.cs

+24-21
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,32 @@
1414

1515
public class AdjustEditor : AssetPostprocessor
1616
{
17-
private static bool isPostProcessingEnabled = true;
18-
private static String ios14EditorPrefsKey = "adjustiOS14Support";
19-
20-
[MenuItem("Assets/Adjust/Is iOS 14 Support Enabled?")]
21-
public static void IsiOS14SupportEnabled()
17+
[MenuItem("Assets/Adjust/Check iOS 14 Support Status")]
18+
public static void CheckIOS14SupportStatus()
2219
{
23-
bool isEnabled = EditorPrefs.GetBool(ios14EditorPrefsKey, false);
24-
EditorUtility.DisplayDialog("Adjust SDK", "iOS 14 support is " + (isEnabled ? "enabled." : "disabled."), "OK");
20+
EditorUtility.DisplayDialog("Adjust SDK", "iOS 14 support is " + (AdjustSettings.IsiOS14ProcessingEnabled ? "enabled." : "disabled."), "OK");
2521
}
2622

27-
[MenuItem("Assets/Adjust/Toggle iOS 14 Support")]
28-
public static void ToggleiOS14Support()
23+
[MenuItem("Assets/Adjust/Toggle iOS 14 Support Status")]
24+
public static void ToggleiOS14SupportStatus()
2925
{
30-
bool isEnabled = !EditorPrefs.GetBool(ios14EditorPrefsKey, false);
31-
EditorPrefs.SetBool(ios14EditorPrefsKey, isEnabled);
32-
EditorUtility.DisplayDialog("Adjust SDK", "iOS 14 support is now " + (isEnabled ? "enabled." : "disabled."), "OK");
26+
AdjustSettings.IsiOS14ProcessingEnabled = !AdjustSettings.IsiOS14ProcessingEnabled;
27+
EditorUtility.SetDirty(AdjustSettings.Instance);
28+
EditorUtility.DisplayDialog("Adjust SDK", "iOS 14 support is now " + (AdjustSettings.IsiOS14ProcessingEnabled ? "enabled." : "disabled."), "OK");
3329
}
3430

35-
[MenuItem("Assets/Adjust/Is Post Processing Enabled?")]
36-
public static void IsPostProcessingEnabled()
31+
[MenuItem("Assets/Adjust/Check Post Processing Status")]
32+
public static void CheckPostProcessingStatus()
3733
{
38-
EditorUtility.DisplayDialog("Adjust SDK", "The post processing for Adjust SDK is " + (isPostProcessingEnabled ? "enabled." : "disabled."), "OK");
34+
EditorUtility.DisplayDialog("Adjust SDK", "The post processing for Adjust SDK is " + (AdjustSettings.IsPostProcessingEnabled ? "enabled." : "disabled."), "OK");
3935
}
4036

41-
[MenuItem("Assets/Adjust/Toggle Post Processing Permission")]
42-
public static void TogglePostProcessingPermission()
37+
[MenuItem("Assets/Adjust/Toggle Post Processing Status")]
38+
public static void TogglePostProcessingStatus()
4339
{
44-
isPostProcessingEnabled = !isPostProcessingEnabled;
45-
EditorUtility.DisplayDialog("Adjust SDK", "The post processing for Adjust SDK is now " + (isPostProcessingEnabled ? "enabled." : "disabled."), "OK");
40+
AdjustSettings.IsPostProcessingEnabled = !AdjustSettings.IsPostProcessingEnabled;
41+
EditorUtility.SetDirty(AdjustSettings.Instance);
42+
EditorUtility.DisplayDialog("Adjust SDK", "The post processing for Adjust SDK is now " + (AdjustSettings.IsPostProcessingEnabled ? "enabled." : "disabled."), "OK");
4643
}
4744

4845
[MenuItem("Assets/Adjust/Export Unity Package")]
@@ -60,6 +57,7 @@ public static void ExportAdjustUnityPackage()
6057
assetsToExport.Add(assetsPath + "/Android/AdjustAndroidManifest.xml");
6158

6259
assetsToExport.Add(assetsPath + "/Editor/AdjustEditor.cs");
60+
assetsToExport.Add(assetsPath + "/Editor/AdjustSettings.cs");
6361

6462
assetsToExport.Add(assetsPath + "/ExampleGUI/ExampleGUI.cs");
6563
assetsToExport.Add(assetsPath + "/ExampleGUI/ExampleGUI.prefab");
@@ -123,7 +121,7 @@ public static void OnPostprocessBuild(BuildTarget target, string projectPath)
123121
{
124122
// Check what is user setting about allowing Adjust SDK to perform post build tasks.
125123
// If user disabled it, oh well, we won't do a thing.
126-
if (!isPostProcessingEnabled)
124+
if (!AdjustSettings.IsPostProcessingEnabled)
127125
{
128126
UnityEngine.Debug.Log("[Adjust]: You have forbidden the Adjust SDK to perform post processing tasks.");
129127
UnityEngine.Debug.Log("[Adjust]: Skipping post processing tasks.");
@@ -177,7 +175,7 @@ private static void RunPostBuildScript(BuildTarget target, bool preBuild, string
177175
xcodeProject.AddFrameworkToProject(xcodeTarget, "CoreTelephony.framework", true);
178176
UnityEngine.Debug.Log("[Adjust]: CoreTelephony.framework added successfully.");
179177

180-
if (EditorPrefs.GetBool(ios14EditorPrefsKey, false))
178+
if (AdjustSettings.IsiOS14ProcessingEnabled)
181179
{
182180
UnityEngine.Debug.Log("[Adjust]: Xcode project being built with iOS 14 support.");
183181

@@ -206,6 +204,11 @@ private static void RunPostBuildScript(BuildTarget target, bool preBuild, string
206204

207205
UnityEngine.Debug.Log("[Adjust]: -ObjC successfully added to other linker flags.");
208206

207+
if (xcodeProject.ContainsFileByProjectPath("Libraries/Adjust/iOS/AdjustSigSdk.a"))
208+
{
209+
xcodeProject.AddBuildProperty(xcodeTarget, "OTHER_LDFLAGS", "-force_load $(PROJECT_DIR)/Libraries/Adjust/iOS/AdjustSigSdk.a");
210+
}
211+
209212
// Save the changes to Xcode project file.
210213
xcodeProject.WriteToFile(xcodeProjectPath);
211214
#endif
+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
// Inspired by: https://github.com/facebook/facebook-sdk-for-unity/blob/master/Facebook.Unity.Settings/FacebookSettings.cs
2+
3+
using System;
4+
using System.IO;
5+
using UnityEditor;
6+
using UnityEngine;
7+
8+
public class AdjustSettings : ScriptableObject
9+
{
10+
private static AdjustSettings instance;
11+
12+
[SerializeField]
13+
private bool isPostProcessingEnabled = true;
14+
[SerializeField]
15+
private bool isiOS14ProcessingEnabled = false;
16+
17+
public static AdjustSettings Instance
18+
{
19+
get
20+
{
21+
instance = NullableInstance;
22+
23+
if (instance == null)
24+
{
25+
instance = ScriptableObject.CreateInstance<AdjustSettings>();
26+
AssetDatabase.CreateAsset(instance, "Assets/Adjust/Editor/AdjustSettings.asset");
27+
28+
// Before switching to AssetsDatabase, EditorPrefs were used to write 'adjustiOS14Support' key.
29+
// Check if this key still exists in EditorPrefs.
30+
// If yes, migrate the value to AdjustSettings.asset and remove the key from EditorPrefs.
31+
if (EditorPrefs.HasKey("adjustiOS14Support"))
32+
{
33+
UnityEngine.Debug.Log("[Adjust]: Found 'adjustiOS14Support' key in EditorPrefs.");
34+
UnityEngine.Debug.Log("[Adjust]: Migrating that value to AdjustSettings.asset.");
35+
IsiOS14ProcessingEnabled = EditorPrefs.GetBool("adjustiOS14Support", false);
36+
EditorPrefs.DeleteKey("adjustiOS14Support");
37+
UnityEngine.Debug.Log("[Adjust]: Key 'adjustiOS14Support' removed from EditorPrefs.");
38+
}
39+
}
40+
41+
return instance;
42+
}
43+
}
44+
45+
public static AdjustSettings NullableInstance
46+
{
47+
get
48+
{
49+
if (instance == null)
50+
{
51+
instance = (AdjustSettings)AssetDatabase.LoadAssetAtPath("Assets/Adjust/Editor/AdjustSettings.asset", typeof(AdjustSettings));
52+
}
53+
54+
return instance;
55+
}
56+
}
57+
58+
public static bool IsPostProcessingEnabled
59+
{
60+
get
61+
{
62+
return Instance.isPostProcessingEnabled;
63+
}
64+
65+
set
66+
{
67+
if (Instance.isPostProcessingEnabled != value)
68+
{
69+
Instance.isPostProcessingEnabled = value;
70+
}
71+
}
72+
}
73+
74+
public static bool IsiOS14ProcessingEnabled
75+
{
76+
get
77+
{
78+
return Instance.isiOS14ProcessingEnabled;
79+
}
80+
81+
set
82+
{
83+
if (Instance.isiOS14ProcessingEnabled != value)
84+
{
85+
Instance.isiOS14ProcessingEnabled = value;
86+
}
87+
}
88+
}
89+
}

Assets/Adjust/Editor/AdjustSettings.cs.meta

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

Assets/Adjust/Windows/AdjustWindows.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace com.adjust.sdk
1717
{
1818
public class AdjustWindows
1919
{
20-
private const string sdkPrefix = "unity4.23.0";
20+
private const string sdkPrefix = "unity4.23.1";
2121
private static bool appLaunched = false;
2222

2323
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.23.0
5+
// V4.23.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

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

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

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
### Version 4.23.1 (29th August 2020)
2+
#### Fixed
3+
- Fixed duplicate `ADJUrlStrategy` symbol error.
4+
5+
#### Changed
6+
- Switched to usage of `AssetDatabase` instead of `EditorPrefs` to store relevant information from `AdjustEditor`.
7+
8+
#### Native SDKs
9+
- [[email protected]][ios_sdk_v4.23.2]
10+
- [[email protected]][android_sdk_v4.24.1]
11+
- [[email protected]][windows_sdk_v4.17.0]
12+
13+
---
14+
115
### Version 4.23.0 (21st August 2020)
216
#### Added
317
- Added communication with SKAdNetwork framework by default on iOS 14.
@@ -765,6 +779,7 @@
765779
[ios_sdk_v4.22.0]: https://github.com/adjust/ios_sdk/tree/v4.22.0
766780
[ios_sdk_v4.22.1]: https://github.com/adjust/ios_sdk/tree/v4.22.1
767781
[ios_sdk_v4.23.0]: https://github.com/adjust/ios_sdk/tree/v4.23.0
782+
[ios_sdk_v4.23.2]: https://github.com/adjust/ios_sdk/tree/v4.23.2
768783

769784
[android_sdk_v3.5.0]: https://github.com/adjust/android_sdk/tree/v3.5.0
770785
[android_sdk_v4.1.0]: https://github.com/adjust/android_sdk/tree/v4.1.0
@@ -793,6 +808,7 @@
793808
[android_sdk_v4.21.1]: https://github.com/adjust/android_sdk/tree/v4.21.1
794809
[android_sdk_v4.22.0]: https://github.com/adjust/android_sdk/tree/v4.22.0
795810
[android_sdk_v4.24.0]: https://github.com/adjust/android_sdk/tree/v4.24.0
811+
[android_sdk_v4.24.1]: https://github.com/adjust/android_sdk/tree/v4.24.1
796812

797813
[windows_sdk_v4.12.0]: https://github.com/adjust/windows_sdk/tree/v4.12.0
798814
[windows_sdk_v4.13.0]: https://github.com/adjust/windows_sdk/tree/v4.13.0

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.23.0
1+
4.23.1

doc/english/migration/migrate.md

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

33
### Migration procedure
44

0 commit comments

Comments
 (0)