Skip to content

Instantly share code, notes, and snippets.

@mattiaswargren-zz
Created August 30, 2017 14:30
Show Gist options
  • Save mattiaswargren-zz/7b68ec5b5701b8278e5295f594c533ec to your computer and use it in GitHub Desktop.
Save mattiaswargren-zz/7b68ec5b5701b8278e5295f594c533ec to your computer and use it in GitHub Desktop.
Unity ITSAppUsesNonExemptEncryption export compliance Post Process
#if UNITY_IOS
using UnityEditor.Callbacks;
using UnityEditor;
using UnityEditor.iOS.Xcode;
using System.IO;
public class PostProcessXCodeComplianceFix
{
[PostProcessBuild]
public static void ChangeXcodePlist(BuildTarget buildTarget, string pathToBuiltProject)
{
if (buildTarget == BuildTarget.iOS)
{
// Get plist
string plistPath = pathToBuiltProject + "/Info.plist";
var plist = new PlistDocument();
plist.ReadFromString(File.ReadAllText(plistPath));
// Get root
var rootDict = plist.root;
var buildKey2 = "ITSAppUsesNonExemptEncryption";
rootDict.SetString(buildKey2, "false");
// Write to file
File.WriteAllText(plistPath, plist.WriteToString());
}
}
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment