From 9d17d1caf2ab05ec9e571e444df8a23147c4c130 Mon Sep 17 00:00:00 2001 From: xiaoyi Date: Fri, 15 Oct 2021 14:54:44 +0800 Subject: [PATCH] feat:opt plist change --- Editor/TapCommonCompile.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Editor/TapCommonCompile.cs b/Editor/TapCommonCompile.cs index 95e32fd..081b4ad 100644 --- a/Editor/TapCommonCompile.cs +++ b/Editor/TapCommonCompile.cs @@ -126,7 +126,12 @@ namespace TapTap.Common.Editor "tapsdk", "tapiosdk", }; - var plistElementList = rootDic.CreateArray("LSApplicationQueriesSchemes"); + + if (!(rootDic["LSApplicationQueriesSchemes"] is PlistElementArray plistElementList)) + { + plistElementList = rootDic.CreateArray("LSApplicationQueriesSchemes"); + } + foreach (var t in items) { plistElementList.AddString(t); @@ -154,7 +159,11 @@ namespace TapTap.Common.Editor //添加url var dict = plist.root.AsDict(); - var array = dict.CreateArray("CFBundleURLTypes"); + if (!(dict["CFBundleURLTypes"] is PlistElementArray array)) + { + array = dict.CreateArray("CFBundleURLTypes"); + } + var dict2 = array.AddDict(); dict2.SetString("CFBundleURLName", "TapTap"); var array2 = dict2.CreateArray("CFBundleURLSchemes");