update:Moloco 集成改为官聚, 升级 Max 内部的 Moloco 版本, 同时移除外部的 Moloco 的插件文件
--story=1020566 --user=yufei.hu 【Unity】-【变现】MAX聚合双端接入支持Moloco Bidding的Adapter 版本 https://www.tapd.cn/33527076/s/1150752dev
							parent
							
								
									974d8927f6
								
							
						
					
					
						commit
						f7d0451cd4
					
				|  | @ -1,5 +1,8 @@ | ||||||
| fileFormatVersion: 2 | fileFormatVersion: 2 | ||||||
| guid: 610d1cb8415d649f8ae9c669633471f6 | guid: 09d05d27690c64a7e83fbbabceaaa10a | ||||||
|  | labels: | ||||||
|  | - al_max | ||||||
|  | - al_max_export_path-MaxSdk/Mediation/Moloco | ||||||
| folderAsset: yes | folderAsset: yes | ||||||
| DefaultImporter: | DefaultImporter: | ||||||
|   externalObjects: {} |   externalObjects: {} | ||||||
|  | @ -1,5 +1,8 @@ | ||||||
| fileFormatVersion: 2 | fileFormatVersion: 2 | ||||||
| guid: 63ffaa4af1ddc4c28b3939f81c9ebf26 | guid: a86a3a94db2fc4759a126a577b762257 | ||||||
|  | labels: | ||||||
|  | - al_max | ||||||
|  | - al_max_export_path-MaxSdk/Mediation/Moloco/Editor | ||||||
| folderAsset: yes | folderAsset: yes | ||||||
| DefaultImporter: | DefaultImporter: | ||||||
|   externalObjects: {} |   externalObjects: {} | ||||||
|  | @ -0,0 +1,9 @@ | ||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <dependencies> | ||||||
|  |     <androidPackages> | ||||||
|  |         <androidPackage spec="com.applovin.mediation:moloco-adapter:3.0.0.0" /> | ||||||
|  |     </androidPackages> | ||||||
|  |     <iosPods> | ||||||
|  |         <iosPod name="AppLovinMediationMolocoAdapter" version="2.2.1.0" /> | ||||||
|  |     </iosPods> | ||||||
|  | </dependencies> | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| fileFormatVersion: 2 | fileFormatVersion: 2 | ||||||
| guid: 4285403e3608e4fc68d6ada86a902e2c | guid: df52eab134aaf4687be700447620003c | ||||||
| labels: | labels: | ||||||
| - al_max | - al_max | ||||||
| - al_max_export_path-MaxSdk/Mediation/Moloco/Editor/Dependencies.xml | - al_max_export_path-MaxSdk/Mediation/Moloco/Editor/Dependencies.xml | ||||||
|  | @ -1,10 +0,0 @@ | ||||||
| <?xml version="1.0" encoding="utf-8"?> |  | ||||||
| <dependencies> |  | ||||||
|     <androidPackages> |  | ||||||
|        <androidPackage spec="com.moloco.sdk.adapters:applovin:1.7.0.0"> |  | ||||||
|         </androidPackage> |  | ||||||
|     </androidPackages> |  | ||||||
|     <iosPods> |  | ||||||
|         <iosPod name="MolocoCustomAdapterAppLovin" version="2.1.0.0" /> |  | ||||||
|     </iosPods> |  | ||||||
| </dependencies> |  | ||||||
|  | @ -1,3 +0,0 @@ | ||||||
| { |  | ||||||
| 	"name": "Moloco" |  | ||||||
| } |  | ||||||
|  | @ -1,3 +0,0 @@ | ||||||
| fileFormatVersion: 2 |  | ||||||
| guid: d5456fec572384e828c8ac8565043709 |  | ||||||
| timeCreated: 1700133547 |  | ||||||
|  | @ -1,8 +0,0 @@ | ||||||
| fileFormatVersion: 2 |  | ||||||
| guid: f5455d04fd4f045d1a9312ce39a5902a |  | ||||||
| folderAsset: yes |  | ||||||
| DefaultImporter: |  | ||||||
|   externalObjects: {} |  | ||||||
|   userData:  |  | ||||||
|   assetBundleName:  |  | ||||||
|   assetBundleVariant:  |  | ||||||
|  | @ -1,6 +0,0 @@ | ||||||
| { |  | ||||||
|   "name": "Moloco.Editor", |  | ||||||
|   "includePlatforms": [ |  | ||||||
|     "Editor" |  | ||||||
|   ] |  | ||||||
| } |  | ||||||
|  | @ -1,3 +0,0 @@ | ||||||
| fileFormatVersion: 2 |  | ||||||
| guid: 8e16e974e6af41fab383d3dcd2d5866e |  | ||||||
| timeCreated: 1701005033 |  | ||||||
|  | @ -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<string> DynamicLibrariesToEmbed = new List<string> |  | ||||||
|         { |  | ||||||
|             "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<string>(); |  | ||||||
|             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 |  | ||||||
|  | @ -1,11 +0,0 @@ | ||||||
| fileFormatVersion: 2 |  | ||||||
| guid: c652888c174cc466f992f1fc1a713fb7 |  | ||||||
| MonoImporter: |  | ||||||
|   externalObjects: {} |  | ||||||
|   serializedVersion: 2 |  | ||||||
|   defaultReferences: [] |  | ||||||
|   executionOrder: 0 |  | ||||||
|   icon: {instanceID: 0} |  | ||||||
|   userData:  |  | ||||||
|   assetBundleName:  |  | ||||||
|   assetBundleVariant:  |  | ||||||
|  | @ -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 |  | ||||||
|  | @ -1,11 +0,0 @@ | ||||||
| fileFormatVersion: 2 |  | ||||||
| guid: 930ff57270fca425885f84404dbfaafc |  | ||||||
| MonoImporter: |  | ||||||
|   externalObjects: {} |  | ||||||
|   serializedVersion: 2 |  | ||||||
|   defaultReferences: [] |  | ||||||
|   executionOrder: 0 |  | ||||||
|   icon: {instanceID: 0} |  | ||||||
|   userData:  |  | ||||||
|   assetBundleName:  |  | ||||||
|   assetBundleVariant:  |  | ||||||
		Loading…
	
		Reference in New Issue