Created
August 30, 2017 14:30
-
-
Save mattiaswargren-zz/7b68ec5b5701b8278e5295f594c533ec to your computer and use it in GitHub Desktop.
Unity ITSAppUsesNonExemptEncryption export compliance Post Process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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