Skip to content

Commit

Permalink
demoapp/bump_applovin_plugin_6.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
AppLovin-Mobile-Engineering committed Aug 10, 2024
1 parent 318f2bc commit 233500b
Show file tree
Hide file tree
Showing 35 changed files with 131 additions and 92 deletions.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions DemoApp/Assets/ExternalDependencyManager/Editor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Version 1.2.182 - Aug 2, 2024
* General - Check for gradle version instead of Unity version when determining
the template files to modify.

# Version 1.2.181 - Jun 26, 2024
* General - Disable `EditorMeasurement` reporting that relied on the
Measurement Protocol for Universal Analytics.

# Version 1.2.180 - Jun 4, 2024
* General - Fix project settings resetting on domain reload.
Fixes #524

# Version 1.2.179 - Feb 12, 2024
* Android Resolver - Added logic to automatically turn on `mainTemplate.gradle`
for new projects, and prompt users to enable it on projects that have previously
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions DemoApp/Assets/ExternalDependencyManager/Editor/LICENSE.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Assets/ExternalDependencyManager/Editor/1.2.182/Google.IOSResolver.dll
Assets/ExternalDependencyManager/Editor/1.2.182/Google.IOSResolver.pdb
Assets/ExternalDependencyManager/Editor/1.2.182/Google.JarResolver.dll
Assets/ExternalDependencyManager/Editor/1.2.182/Google.JarResolver.pdb
Assets/ExternalDependencyManager/Editor/1.2.182/Google.PackageManagerResolver.dll
Assets/ExternalDependencyManager/Editor/1.2.182/Google.PackageManagerResolver.pdb
Assets/ExternalDependencyManager/Editor/1.2.182/Google.VersionHandlerImpl.dll
Assets/ExternalDependencyManager/Editor/1.2.182/Google.VersionHandlerImpl.pdb
Assets/ExternalDependencyManager/Editor/CHANGELOG.md
Assets/ExternalDependencyManager/Editor/Google.VersionHandler.dll
Assets/ExternalDependencyManager/Editor/Google.VersionHandler.pdb
Assets/ExternalDependencyManager/Editor/LICENSE
Assets/ExternalDependencyManager/Editor/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/AppLovin.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/AppLovin/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/AppLovin/Plugins.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/AppLovin/Plugins/Android.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/AppLovin/Plugins/iOS.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 12 additions & 20 deletions DemoApp/Assets/MaxSdk/AppLovin/Plugins/iOS/MAUnityPlugin.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "MAUnityAdManager.h"

#define VERSION @"6.6.1"
#define VERSION @"6.6.2"
#define NSSTRING(_X) ( (_X != NULL) ? [NSString stringWithCString: _X encoding: NSStringEncodingConversionAllowLossy].al_stringByTrimmingWhitespace : nil)

@interface NSString (ALUtils)
Expand All @@ -28,7 +28,6 @@ - (void)setSdkKey:(NSString *)sdkKey;
static NSString *const KeySdkKey = @"SdkKey";

UIView* UnityGetGLView();
NSString *getSdkKeyFromAppLovinSettingsPlist();

static ALSdkInitializationConfigurationBuilder *_initConfigurationBuilder;
static ALSdk *_sdk;
Expand All @@ -42,16 +41,6 @@ - (void)setSdkKey:(NSString *)sdkKey;
// Helper method to log errors
void logUninitializedAccessError(const char *callingMethod);

ALSdkInitializationConfigurationBuilder *getInitConfigurationBuilder()
{
if ( !_initConfigurationBuilder )
{
_initConfigurationBuilder = [ALSdkInitializationConfiguration builderWithSdkKey: getSdkKeyFromAppLovinSettingsPlist()];
}

return _initConfigurationBuilder;
}

ALSdk *getSdk()
{
if ( !_sdk )
Expand All @@ -72,6 +61,17 @@ - (void)setSdkKey:(NSString *)sdkKey;
return _adManager;
}

ALSdkInitializationConfigurationBuilder *getInitConfigurationBuilder()
{
if ( !_initConfigurationBuilder )
{
NSString *sdkKey = [getSdk().settings.extraParameters al_stringForKey: KeySdkKey];
_initConfigurationBuilder = [ALSdkInitializationConfiguration builderWithSdkKey: sdkKey];
}

return _initConfigurationBuilder;
}

int getConsentStatusValue(NSNumber *consentStatus)
{
if ( consentStatus )
Expand Down Expand Up @@ -117,14 +117,6 @@ id getLocalExtraParameterValue(const char *json)
return array;
}

NSString *getSdkKeyFromAppLovinSettingsPlist()
{
NSString *settingsPlistResourceURL = [NSBundle.mainBundle pathForResource: @"AppLovin-Settings" ofType: @"plist"];
NSDictionary<NSString *, id> *sdkSettingsFromPlist = settingsPlistResourceURL ? [[NSDictionary alloc] initWithContentsOfFile: settingsPlistResourceURL] : @{};

return [sdkSettingsFromPlist al_stringForKey: KeySdkKey];
}

MASegmentCollection *getSegmentCollection(const char *collectionJson)
{
MASegmentCollectionBuilder *segmentCollectionBuilder = [MASegmentCollection builder];
Expand Down
2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/Prefabs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/Resources.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/Resources/Images.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion DemoApp/Assets/MaxSdk/Scripts.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public class AppLovinPostProcessAndroid : IPostGenerateGradleAndroidProject
private const string KeyConsentFlowPrivacyPolicy = "consent_flow_privacy_policy";
private const string KeyConsentFlowDebugUserGeography = "consent_flow_debug_user_geography";

private const string KeyRenderOutsideSafeArea = "render_outside_safe_area";

#if UNITY_2022_3_OR_NEWER
// To match "'com.android.library' version '7.3.1'" line in build.gradle
private static readonly Regex TokenGradleVersionLibrary = new Regex(".*id ['\"]com\\.android\\.library['\"] version");
Expand Down Expand Up @@ -354,6 +356,7 @@ private static void AddSdkSettings(string path)

// Add the SDK key to the SDK settings.
appLovinSdkSettings[KeySdkKey] = AppLovinSettings.Instance.SdkKey;
appLovinSdkSettings[KeyRenderOutsideSafeArea] = PlayerSettings.Android.renderOutsideSafeArea;

// Add the Consent/Terms flow settings if needed.
if (AppLovinInternalSettings.Instance.ConsentFlowEnabled)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

using System.IO;
using UnityEditor.Android;
using UnityEngine;

namespace AppLovinMax.Scripts.IntegrationManager.Editor
{
Expand All @@ -27,15 +26,21 @@ public void OnPostGenerateGradleAndroidProject(string path)
// On Unity 2019.3+, the path returned is the path to the unityLibrary's module.
// The AppLovin Quality Service buildscript closure related lines need to be added to the root build.gradle file.
var rootGradleBuildFilePath = Path.Combine(path, "../build.gradle");
#if UNITY_2022_2_OR_NEWER
if (!AddPluginToRootGradleBuildFile(rootGradleBuildFilePath)) return;

var rootSettingsGradleFilePath = Path.Combine(path, "../settings.gradle");
if (!AddAppLovinRepository(rootSettingsGradleFilePath)) return;
#else

// For 2022.2 and newer and 2021.3.41+
var qualityServiceAdded = AddPluginToRootGradleBuildFile(rootGradleBuildFilePath);
var appLovinRepositoryAdded = AddAppLovinRepository(rootSettingsGradleFilePath);

// For 2021.3.40 and older and 2022.0 - 2022.1.x
var buildScriptChangesAdded = AddQualityServiceBuildScriptLines(rootGradleBuildFilePath);
if (!buildScriptChangesAdded) return;
#endif

var failedToAddPlugin = !buildScriptChangesAdded && !(qualityServiceAdded && appLovinRepositoryAdded);
if (failedToAddPlugin)
{
MaxSdkLogger.UserWarning("Failed to add AppLovin Quality Service plugin to the gradle project.");
return;
}

// The plugin needs to be added to the application module (named launcher)
var applicationGradleBuildFilePath = Path.Combine(path, "../launcher/build.gradle");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public class AppLovinPostProcessiOS
#if !UNITY_2019_3_OR_NEWER
private const string UnityMainTargetName = "Unity-iPhone";
#endif
// Use a priority of 90 to have AppLovin embed frameworks after Pods are installed (EDM finishes installing Pods at priority 60) and before Firebase Crashlytics runs their scripts (at priority 100).
private const int AppLovinEmbedFrameworksPriority = 90;

private const string TargetUnityIphonePodfileLine = "target 'Unity-iPhone' do";
private const string UseFrameworksPodfileLine = "use_frameworks!";
Expand Down Expand Up @@ -146,7 +148,7 @@ public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath)
}
}

[PostProcessBuild(int.MaxValue)]
[PostProcessBuild(AppLovinEmbedFrameworksPriority)]
public static void MaxPostProcessPbxProject(BuildTarget buildTarget, string buildPath)
{
var projectPath = PBXProject.GetPBXProjectPath(buildPath);
Expand Down
Loading

0 comments on commit 233500b

Please sign in to comment.