From f7d0451cd47ddd21fd982ebffa16d737319957e1 Mon Sep 17 00:00:00 2001 From: huyufei Date: Mon, 17 Jun 2024 10:28:06 +0800 Subject: [PATCH] =?UTF-8?q?update=EF=BC=9AMoloco=20=E9=9B=86=E6=88=90?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=AE=98=E8=81=9A=EF=BC=8C=20=20=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=20Max=20=E5=86=85=E9=83=A8=E7=9A=84=20Moloco=20=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=EF=BC=8C=20=E5=90=8C=E6=97=B6=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E5=A4=96=E9=83=A8=E7=9A=84=20Moloco=20=E7=9A=84?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --story=1020566 --user=yufei.hu 【Unity】-【变现】MAX聚合双端接入支持Moloco Bidding的Adapter 版本 https://www.tapd.cn/33527076/s/1150752 --- ...nuItems.cs.backup => AppLovinMenuItems.cs} | 0 ....backup.meta => AppLovinMenuItems.cs.meta} | 0 Moloco/Editor.meta => Mediation/Moloco.meta | 5 +- .../Scripts => Mediation/Moloco}/Editor.meta | 5 +- Mediation/Moloco/Editor/Dependencies.xml | 9 ++ .../Moloco/Editor/Dependencies.xml.meta | 2 +- Moloco/Editor/ALMolocoAdapterDependencies.xml | 10 --- Moloco/Moloco.asmdef | 3 - Moloco/Moloco.asmdef.meta | 3 - Moloco/Scripts.meta | 8 -- Moloco/Scripts/Editor/Moloco.Editor.asmdef | 6 -- .../Scripts/Editor/Moloco.Editor.asmdef.meta | 3 - .../Editor/MolocoPostProcessBuildiOS.cs | 90 ------------------- .../Editor/MolocoPostProcessBuildiOS.cs.meta | 11 --- Moloco/Scripts/Editor/PodfileEditor.cs | 63 ------------- Moloco/Scripts/Editor/PodfileEditor.cs.meta | 11 --- 16 files changed, 18 insertions(+), 211 deletions(-) rename MaxSdk/Scripts/IntegrationManager/Editor/{AppLovinMenuItems.cs.backup => AppLovinMenuItems.cs} (100%) rename MaxSdk/Scripts/IntegrationManager/Editor/{AppLovinMenuItems.cs.backup.meta => AppLovinMenuItems.cs.meta} (100%) rename Moloco/Editor.meta => Mediation/Moloco.meta (56%) rename {Moloco/Scripts => Mediation/Moloco}/Editor.meta (55%) create mode 100644 Mediation/Moloco/Editor/Dependencies.xml rename Moloco/Editor/ALMolocoAdapterDependencies.xml.meta => Mediation/Moloco/Editor/Dependencies.xml.meta (84%) delete mode 100644 Moloco/Editor/ALMolocoAdapterDependencies.xml delete mode 100644 Moloco/Moloco.asmdef delete mode 100644 Moloco/Moloco.asmdef.meta delete mode 100644 Moloco/Scripts.meta delete mode 100644 Moloco/Scripts/Editor/Moloco.Editor.asmdef delete mode 100644 Moloco/Scripts/Editor/Moloco.Editor.asmdef.meta delete mode 100644 Moloco/Scripts/Editor/MolocoPostProcessBuildiOS.cs delete mode 100644 Moloco/Scripts/Editor/MolocoPostProcessBuildiOS.cs.meta delete mode 100644 Moloco/Scripts/Editor/PodfileEditor.cs delete mode 100644 Moloco/Scripts/Editor/PodfileEditor.cs.meta diff --git a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs.backup b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs similarity index 100% rename from MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs.backup rename to MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs diff --git a/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs.backup.meta b/MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs.meta similarity index 100% rename from MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs.backup.meta rename to MaxSdk/Scripts/IntegrationManager/Editor/AppLovinMenuItems.cs.meta diff --git a/Moloco/Editor.meta b/Mediation/Moloco.meta similarity index 56% rename from Moloco/Editor.meta rename to Mediation/Moloco.meta index 3106fe6..2e95b5c 100644 --- a/Moloco/Editor.meta +++ b/Mediation/Moloco.meta @@ -1,5 +1,8 @@ fileFormatVersion: 2 -guid: 610d1cb8415d649f8ae9c669633471f6 +guid: 09d05d27690c64a7e83fbbabceaaa10a +labels: +- al_max +- al_max_export_path-MaxSdk/Mediation/Moloco folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Moloco/Scripts/Editor.meta b/Mediation/Moloco/Editor.meta similarity index 55% rename from Moloco/Scripts/Editor.meta rename to Mediation/Moloco/Editor.meta index f011e99..9299be4 100644 --- a/Moloco/Scripts/Editor.meta +++ b/Mediation/Moloco/Editor.meta @@ -1,5 +1,8 @@ fileFormatVersion: 2 -guid: 63ffaa4af1ddc4c28b3939f81c9ebf26 +guid: a86a3a94db2fc4759a126a577b762257 +labels: +- al_max +- al_max_export_path-MaxSdk/Mediation/Moloco/Editor folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Mediation/Moloco/Editor/Dependencies.xml b/Mediation/Moloco/Editor/Dependencies.xml new file mode 100644 index 0000000..6fef892 --- /dev/null +++ b/Mediation/Moloco/Editor/Dependencies.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Moloco/Editor/ALMolocoAdapterDependencies.xml.meta b/Mediation/Moloco/Editor/Dependencies.xml.meta similarity index 84% rename from Moloco/Editor/ALMolocoAdapterDependencies.xml.meta rename to Mediation/Moloco/Editor/Dependencies.xml.meta index 3603b28..452bd95 100644 --- a/Moloco/Editor/ALMolocoAdapterDependencies.xml.meta +++ b/Mediation/Moloco/Editor/Dependencies.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4285403e3608e4fc68d6ada86a902e2c +guid: df52eab134aaf4687be700447620003c labels: - al_max - al_max_export_path-MaxSdk/Mediation/Moloco/Editor/Dependencies.xml diff --git a/Moloco/Editor/ALMolocoAdapterDependencies.xml b/Moloco/Editor/ALMolocoAdapterDependencies.xml deleted file mode 100644 index 3f14858..0000000 --- a/Moloco/Editor/ALMolocoAdapterDependencies.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/Moloco/Moloco.asmdef b/Moloco/Moloco.asmdef deleted file mode 100644 index eedfdb1..0000000 --- a/Moloco/Moloco.asmdef +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "Moloco" -} diff --git a/Moloco/Moloco.asmdef.meta b/Moloco/Moloco.asmdef.meta deleted file mode 100644 index 814b033..0000000 --- a/Moloco/Moloco.asmdef.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: d5456fec572384e828c8ac8565043709 -timeCreated: 1700133547 \ No newline at end of file diff --git a/Moloco/Scripts.meta b/Moloco/Scripts.meta deleted file mode 100644 index f615a18..0000000 --- a/Moloco/Scripts.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f5455d04fd4f045d1a9312ce39a5902a -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Moloco/Scripts/Editor/Moloco.Editor.asmdef b/Moloco/Scripts/Editor/Moloco.Editor.asmdef deleted file mode 100644 index fe350b8..0000000 --- a/Moloco/Scripts/Editor/Moloco.Editor.asmdef +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Moloco.Editor", - "includePlatforms": [ - "Editor" - ] -} \ No newline at end of file diff --git a/Moloco/Scripts/Editor/Moloco.Editor.asmdef.meta b/Moloco/Scripts/Editor/Moloco.Editor.asmdef.meta deleted file mode 100644 index 0577ca1..0000000 --- a/Moloco/Scripts/Editor/Moloco.Editor.asmdef.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 8e16e974e6af41fab383d3dcd2d5866e -timeCreated: 1701005033 \ No newline at end of file diff --git a/Moloco/Scripts/Editor/MolocoPostProcessBuildiOS.cs b/Moloco/Scripts/Editor/MolocoPostProcessBuildiOS.cs deleted file mode 100644 index d2c0610..0000000 --- a/Moloco/Scripts/Editor/MolocoPostProcessBuildiOS.cs +++ /dev/null @@ -1,90 +0,0 @@ -#if UNITY_IOS || UNITY_IPHONE - -using System.Collections.Generic; -using System.IO; -using UnityEditor; -using UnityEditor.Callbacks; -using UnityEditor.iOS.Xcode; -using UnityEditor.iOS.Xcode.Extensions; - -namespace Moloco.IOS.Scripts.Editor -{ - public class MolocoPostProcessBuildiOS - { -#if !UNITY_2019_3_OR_NEWER - private const string UnityMainTargetName = "Unity-iPhone"; -#endif - - private static readonly List DynamicLibrariesToEmbed = new List - { - "MolocoSDK.xcframework", - "MolocoCustomAdapter.xcframework" - }; - - private static void EmbedDynamicLibrariesIfNeeded(string buildPath, PBXProject project, string targetGuid) - { - // Check that the Pods directory exists (it might not if a publisher is building with Generate Podfile setting disabled in EDM). - var podsDirectory = Path.Combine(buildPath, "Pods"); - if (!Directory.Exists(podsDirectory)) return; - - var dynamicLibraryPathsPresentInProject = new List(); - foreach (var dynamicLibraryToSearch in DynamicLibrariesToEmbed) - { - // both .framework and .xcframework are directories, not files - var directories = - Directory.GetDirectories(podsDirectory, dynamicLibraryToSearch, SearchOption.AllDirectories); - if (directories.Length <= 0) continue; - - var dynamicLibraryAbsolutePath = directories[0]; - var index = dynamicLibraryAbsolutePath.LastIndexOf("Pods"); - var relativePath = dynamicLibraryAbsolutePath.Substring(index); - dynamicLibraryPathsPresentInProject.Add(relativePath); - } - - if (dynamicLibraryPathsPresentInProject.Count <= 0) return; - -#if UNITY_2019_3_OR_NEWER - foreach (var dynamicLibraryPath in dynamicLibraryPathsPresentInProject) - { - var fileGuid = project.AddFile(dynamicLibraryPath, dynamicLibraryPath); - project.AddFileToEmbedFrameworks(targetGuid, fileGuid); - } -#else - string runpathSearchPaths; -#if UNITY_2018_2_OR_NEWER - runpathSearchPaths = project.GetBuildPropertyForAnyConfig(targetGuid, "LD_RUNPATH_SEARCH_PATHS"); -#else - runpathSearchPaths = "$(inherited)"; -#endif - runpathSearchPaths += string.IsNullOrEmpty(runpathSearchPaths) ? "" : " "; - - // Check if runtime search paths already contains the required search paths for dynamic libraries. - if (runpathSearchPaths.Contains("@executable_path/Frameworks")) - return; - - runpathSearchPaths += "@executable_path/Frameworks"; - project.SetBuildProperty(targetGuid, "LD_RUNPATH_SEARCH_PATHS", runpathSearchPaths); -#endif - } - - [PostProcessBuildAttribute(int.MaxValue)] - public static void MolocoPostProcessPbxProject(BuildTarget buildTarget, string buildPath) - { - var projectPath = PBXProject.GetPBXProjectPath(buildPath); - var project = new PBXProject(); - project.ReadFromFile(projectPath); - -#if UNITY_2019_3_OR_NEWER - var unityMainTargetGuid = project.GetUnityMainTargetGuid(); - var unityFrameworkTargetGuid = project.GetUnityFrameworkTargetGuid(); -#else - var unityMainTargetGuid = project.TargetGuidByName(UnityMainTargetName); - var unityFrameworkTargetGuid = project.TargetGuidByName(UnityMainTargetName); -#endif - EmbedDynamicLibrariesIfNeeded(buildPath, project, unityMainTargetGuid); - project.WriteToFile(projectPath); - } - } -} - -#endif \ No newline at end of file diff --git a/Moloco/Scripts/Editor/MolocoPostProcessBuildiOS.cs.meta b/Moloco/Scripts/Editor/MolocoPostProcessBuildiOS.cs.meta deleted file mode 100644 index d03fe4c..0000000 --- a/Moloco/Scripts/Editor/MolocoPostProcessBuildiOS.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c652888c174cc466f992f1fc1a713fb7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Moloco/Scripts/Editor/PodfileEditor.cs b/Moloco/Scripts/Editor/PodfileEditor.cs deleted file mode 100644 index f58585a..0000000 --- a/Moloco/Scripts/Editor/PodfileEditor.cs +++ /dev/null @@ -1,63 +0,0 @@ -#if UNITY_IOS || UNITY_IPHONE - -using System.IO; -using System.Linq; -using UnityEditor; -using UnityEditor.Callbacks; -using UnityEngine; - -namespace Moloco.Scripts.Editor -{ - public class PodfileEditor - { - // [PostProcessBuild(45)] // Add to the Podfile after it's generated (40) but before "pod install" (50) - public static void OnPostProcessBuild(BuildTarget buildTarget, string pathToBuiltProject) - { - if (buildTarget != BuildTarget.iOS) - { - return; - } - - string podfilePath = Path.Combine(pathToBuiltProject, "Podfile"); - - if (File.Exists(podfilePath)) - { - var codeSigningStyle = PlayerSettings.iOS.appleEnableAutomaticSigning ? "Automatic" : "Manual"; - var teamId = PlayerSettings.iOS.appleDeveloperTeamID; - var provisioningProfileId = PlayerSettings.iOS.iOSManualProvisioningProfileID; - var provisioningProfileType = PlayerSettings.iOS.iOSManualProvisioningProfileType; - - string[] molocoTargets = - { - "MolocoSDKiOS-MolocoSDK", - "MolocoCustomAdapter-MolocoCustomAdapter", - "MolocoCustomAdapterAppLovin-MolocoCustomAdapterAppLovin", - "MolocoCustomAdapterIronSource-MolocoCustomAdapterIronSource" - }; - var molocoTargetsString = string.Join(", ", molocoTargets.Select(element => $"'{element}'")); - - using var sw = File.AppendText(podfilePath); - sw.WriteLine("\n\n\npost_install do |installer|"); - sw.WriteLine(" installer.pods_project.targets.each do |target|"); - sw.WriteLine(" target.build_configurations.each do |config|"); - sw.WriteLine(" if [" + molocoTargetsString + "].include? target.name"); - sw.WriteLine(" config.build_settings['CODE_SIGN_STYLE'] = '" + codeSigningStyle + "'"); - sw.WriteLine(" config.build_settings['DEVELOPMENT_TEAM'] = '" + teamId + "'"); - if (!PlayerSettings.iOS.appleEnableAutomaticSigning) - { - sw.WriteLine(" config.build_settings['PROVISIONING_PROFILE_APP'] = '" + provisioningProfileId + "\'"); - } - sw.WriteLine(" end"); - sw.WriteLine(" end"); - sw.WriteLine(" end"); - sw.WriteLine("end"); - } - else - { - Debug.LogWarning("Podfile not found in the Xcode project."); - } - } - } -} - -#endif \ No newline at end of file diff --git a/Moloco/Scripts/Editor/PodfileEditor.cs.meta b/Moloco/Scripts/Editor/PodfileEditor.cs.meta deleted file mode 100644 index cc339f4..0000000 --- a/Moloco/Scripts/Editor/PodfileEditor.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 930ff57270fca425885f84404dbfaafc -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: