feat:opt plist change

xiaoyi 2021-10-15 14:54:44 +08:00
parent a02b3dc996
commit 9d17d1caf2
1 changed files with 11 additions and 2 deletions

View File

@ -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");