Skip to content

Commit

Permalink
Merge pull request #263 from adjust/v4330
Browse files Browse the repository at this point in the history
Version 4.33.0
  • Loading branch information
uerceg authored Dec 8, 2022
2 parents fb74fa0 + 591fcfd commit fe1de07
Show file tree
Hide file tree
Showing 36 changed files with 719 additions and 68 deletions.
7 changes: 6 additions & 1 deletion Assets/Adjust/Android/AdjustAndroid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace com.adjust.sdk
#if UNITY_ANDROID
public class AdjustAndroid
{
private const string sdkPrefix = "unity4.32.2";
private const string sdkPrefix = "unity4.33.0";
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<AndroidJavaObject>("currentActivity");
Expand Down Expand Up @@ -153,6 +153,11 @@ public static void Start(AdjustConfig adjustConfig)
AndroidJavaObject ajoUrlStrategyIndia = new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic<AndroidJavaObject>("URL_STRATEGY_INDIA");
ajoAdjustConfig.Call("setUrlStrategy", ajoUrlStrategyIndia);
}
else if (adjustConfig.urlStrategy == AdjustConfig.AdjustUrlStrategyCn)
{
AndroidJavaObject ajoUrlStrategyCn = new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic<AndroidJavaObject>("URL_STRATEGY_CN");
ajoAdjustConfig.Call("setUrlStrategy", ajoUrlStrategyCn);
}
else if (adjustConfig.urlStrategy == AdjustConfig.AdjustDataResidencyEU)
{
AndroidJavaObject ajoDataResidencyEU = new AndroidJavaClass("com.adjust.sdk.AdjustConfig").GetStatic<AndroidJavaObject>("DATA_RESIDENCY_EU");
Expand Down
Binary file modified Assets/Adjust/Android/adjust-android.jar
Binary file not shown.
19 changes: 12 additions & 7 deletions Assets/Adjust/Editor/AdjustEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,20 +179,13 @@ private static void RunPostBuildScript(BuildTarget target, string projectPath =
Debug.Log("[Adjust]: Skipping AppTrackingTransparency.framework linking.");
}

// The Adjust SDK needs to have Obj-C exceptions enabled.
// GCC_ENABLE_OBJC_EXCEPTIONS=YES
Debug.Log("[Adjust]: Enabling Obj-C exceptions by setting GCC_ENABLE_OBJC_EXCEPTIONS value to YES.");
xcodeProject.AddBuildProperty(xcodeTarget, "GCC_ENABLE_OBJC_EXCEPTIONS", "YES");
Debug.Log("[Adjust]: Obj-C exceptions enabled successfully.");

// The Adjust SDK needs to have -ObjC flag set in other linker flags section because of it's categories.
// OTHER_LDFLAGS -ObjC
//
// Seems that in newer Unity IDE versions adding -ObjC flag to Unity-iPhone target doesn't do the trick.
// Adding -ObjC to UnityFramework target however does make things work nicely again.
// This happens because Unity is linking SDK's static library into UnityFramework target.
// Check for presence of UnityFramework target and if there, include -ObjC flag inside of it.

Debug.Log("[Adjust]: Adding -ObjC flag to other linker flags (OTHER_LDFLAGS) of Unity-iPhone target.");
xcodeProject.AddBuildProperty(xcodeTarget, "OTHER_LDFLAGS", "-ObjC");
Debug.Log("[Adjust]: -ObjC successfully added to other linker flags.");
Expand All @@ -204,6 +197,18 @@ private static void RunPostBuildScript(BuildTarget target, string projectPath =
Debug.Log("[Adjust]: -ObjC successfully added to other linker flags.");
}

// The Adjust SDK needs to have Obj-C exceptions enabled.
// GCC_ENABLE_OBJC_EXCEPTIONS=YES
Debug.Log("[Adjust]: Enabling Obj-C exceptions by setting GCC_ENABLE_OBJC_EXCEPTIONS value to YES.");
xcodeProject.AddBuildProperty(xcodeTarget, "GCC_ENABLE_OBJC_EXCEPTIONS", "YES");
Debug.Log("[Adjust]: Obj-C exceptions enabled successfully.");
if (!string.IsNullOrEmpty(xcodeTargetUnityFramework))
{
Debug.Log("[Adjust]: Enabling Obj-C exceptions by setting GCC_ENABLE_OBJC_EXCEPTIONS value to YES.");
xcodeProject.AddBuildProperty(xcodeTargetUnityFramework, "GCC_ENABLE_OBJC_EXCEPTIONS", "YES");
Debug.Log("[Adjust]: Obj-C exceptions enabled successfully.");
}

if (xcodeProject.ContainsFileByProjectPath("Libraries/Adjust/iOS/AdjustSigSdk.a"))
{
if (!string.IsNullOrEmpty(xcodeTargetUnityFramework))
Expand Down
Loading

0 comments on commit fe1de07

Please sign in to comment.