update: 更新 Adujust Signature V3 原生库的部署路基,可选部署对应的文件
--story=1020267 --user=yufei.hu 【中台】【变现】添加 Adjust SDK 签名 https://www.tapd.cn/33527076/s/1148070 Signed-off-by: huyufei <yufei.hu@castbox.fm>hotfix/v1.0.12.2
							parent
							
								
									6df7530aa8
								
							
						
					
					
						commit
						225197c867
					
				|  | @ -0,0 +1,6 @@ | ||||||
|  | { | ||||||
|  |   "name": "GuruAdjust.Editor", | ||||||
|  |   "includePlatforms": [ | ||||||
|  |     "Editor" | ||||||
|  |   ] | ||||||
|  | } | ||||||
|  | @ -0,0 +1,3 @@ | ||||||
|  | fileFormatVersion: 2 | ||||||
|  | guid: 82f90ccbb33b42e9ad29f5f5a861dc4a | ||||||
|  | timeCreated: 1717137351 | ||||||
|  | @ -0,0 +1,3 @@ | ||||||
|  | fileFormatVersion: 2 | ||||||
|  | guid: 522c3aca8edd4e5bb3c57f54460df356 | ||||||
|  | timeCreated: 1717137307 | ||||||
|  | @ -0,0 +1,81 @@ | ||||||
|  | using System.IO; | ||||||
|  | using UnityEditor; | ||||||
|  | using UnityEngine; | ||||||
|  | 
 | ||||||
|  | namespace Guru | ||||||
|  | { | ||||||
|  |     public class AdjustSignatureHelper | ||||||
|  |     { | ||||||
|  |          | ||||||
|  |         private static readonly string AndroidLib = "adjust-android-signature-3.13.1.aar"; | ||||||
|  |         private static readonly string iOSLib = "AdjustSigSdk.a"; | ||||||
|  | 
 | ||||||
|  |         public static void DeployFiles() | ||||||
|  |         { | ||||||
|  |             var dir = GetParentDir(); | ||||||
|  |             var files = $"{dir}/Files"; | ||||||
|  |             if (Directory.Exists(files)) | ||||||
|  |             { | ||||||
|  |                 string from, to; | ||||||
|  |                 bool res; | ||||||
|  |                 from = $"{files}/{AndroidLib}.f"; | ||||||
|  |                 to = $"{Application.dataPath}/Plugins/Android/{AndroidLib}"; | ||||||
|  |                 res = CopyFile(from, to); | ||||||
|  |                 if (res) Debug.Log($"Copy <color=#88ff00>{AndroidLib} to {to}</color> success..."); | ||||||
|  |                 from = $"{files}/{AndroidLib}.f.meta"; | ||||||
|  |                 to = $"{Application.dataPath}/Plugins/Android/{AndroidLib}.meta"; | ||||||
|  |                 CopyFile(from, to); | ||||||
|  |                  | ||||||
|  |                 from = $"{files}/{iOSLib}.f"; | ||||||
|  |                 to = $"{Application.dataPath}/Plugins/iOS/{iOSLib}"; | ||||||
|  |                 res = CopyFile(from, to);  | ||||||
|  |                 if (res) Debug.Log($"Copy <color=#88ff00>{iOSLib} to {to}</color> success..."); | ||||||
|  |                 from = $"{files}/{iOSLib}.f.meta"; | ||||||
|  |                 to = $"{Application.dataPath}/Plugins/iOS/{iOSLib}.meta"; | ||||||
|  |                 CopyFile(from, to); | ||||||
|  |                  | ||||||
|  |                 AssetDatabase.Refresh(); | ||||||
|  |             } | ||||||
|  |             else | ||||||
|  |             { | ||||||
|  |                 Debug.Log($"<color=red>Files not found: {files}</color>"); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |         private static string GetParentDir() | ||||||
|  |         { | ||||||
|  |             var guids = AssetDatabase.FindAssets(nameof(AdjustSignatureHelper)); | ||||||
|  |             if (guids != null && guids.Length > 0) | ||||||
|  |             { | ||||||
|  |                 var path = AssetDatabase.GUIDToAssetPath(guids[0]); | ||||||
|  |                 var dir = Directory.GetParent(Path.GetFullPath(path)); | ||||||
|  |                 return dir.FullName; | ||||||
|  |             } | ||||||
|  |             return Path.GetFullPath($"{Application.dataPath}/../Packages/com.guru.unity.sdk.core/Runtime/GuruAdjust/Editor/Signature"); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         private static bool CopyFile(string source, string dest) | ||||||
|  |         { | ||||||
|  |             if (File.Exists(source)) | ||||||
|  |             { | ||||||
|  |                 if (!File.Exists(dest)) | ||||||
|  |                 { | ||||||
|  |                     File.Delete(dest); | ||||||
|  |                 } | ||||||
|  |                 else | ||||||
|  |                 { | ||||||
|  |                     var destDir = Directory.GetParent(dest); | ||||||
|  |                     if(!destDir.Exists) destDir.Create(); | ||||||
|  |                 } | ||||||
|  |                  | ||||||
|  |                 File.Copy(source, dest, true); | ||||||
|  |                 return true; | ||||||
|  |             } | ||||||
|  |             | ||||||
|  |             Debug.Log($"<colo=red>File not found: {source}...</color>"); | ||||||
|  |             return false; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | @ -0,0 +1,3 @@ | ||||||
|  | fileFormatVersion: 2 | ||||||
|  | guid: fcbb67d0a48d4b88bc8fd1430c4bbda4 | ||||||
|  | timeCreated: 1717137470 | ||||||
|  | @ -0,0 +1,14 @@ | ||||||
|  | namespace Guru | ||||||
|  | { | ||||||
|  |     using UnityEditor; | ||||||
|  |      | ||||||
|  |     public class AdjustSignatureMenuItem | ||||||
|  |     { | ||||||
|  |         [MenuItem("Guru/Adjust/SignatureV3/Deploy Libs")] | ||||||
|  |         private static void CopyLibsToPlugins() | ||||||
|  |         { | ||||||
|  |             AdjustSignatureHelper.DeployFiles(); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | @ -0,0 +1,3 @@ | ||||||
|  | fileFormatVersion: 2 | ||||||
|  | guid: 5f624e98bef44a399cf808a6aa7f5499 | ||||||
|  | timeCreated: 1717137523 | ||||||
|  | @ -1,3 +0,0 @@ | ||||||
| fileFormatVersion: 2 |  | ||||||
| guid: 8597d2c1bebc4dc39ffc6f7700b61dfe |  | ||||||
| timeCreated: 1717034055 |  | ||||||
		Loading…
	
		Reference in New Issue