28 lines
872 B
C#
28 lines
872 B
C#
#if UNITY_IOS
|
||
using UnityEditor;
|
||
using UnityEditor.Callbacks;
|
||
using UnityEditor.iOS.Xcode;
|
||
using System.IO;
|
||
|
||
public class iOSPermissionPostProcessor
|
||
{
|
||
[PostProcessBuild]
|
||
public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
|
||
{
|
||
if (target != BuildTarget.iOS) return;
|
||
|
||
string plistPath = Path.Combine(pathToBuiltProject, "Info.plist");
|
||
PlistDocument plist = new PlistDocument();
|
||
plist.ReadFromString(File.ReadAllText(plistPath));
|
||
|
||
PlistElementDict rootDict = plist.root;
|
||
|
||
// 声明 App 仅使用豁免加密(标准 HTTPS/TLS),避免每次提交时手动回答加密文稿问卷
|
||
// 值设为 false:未使用非豁免加密
|
||
rootDict.SetBoolean("ITSAppUsesNonExemptEncryption", false);
|
||
|
||
File.WriteAllText(plistPath, plist.WriteToString());
|
||
}
|
||
}
|
||
#endif
|