-
-
Save Kibsgaard/2ab8b8917be88123c5541a33fc6ea224 to your computer and use it in GitHub Desktop.
Marks ITSAppUsesNonExemptEncryption in Unity generated Info.plist file to false. Doing this no longer requires manually marking the app as not using non-exempt encryption in iTunes Connect for Testflight beta testing.
This file contains hidden or 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
using UnityEngine; | |
using UnityEditor.Build; | |
using UnityEditor.Build.Reporting; | |
using UnityEditor; | |
using UnityEditor.iOS.Xcode; | |
using System.IO; | |
public class ExcemptFromEncryption : IPostprocessBuildWithReport // Will execute after XCode project is built | |
{ | |
public int callbackOrder { get { return 0; } } | |
public void OnPostprocessBuild(BuildReport report) | |
{ | |
if (report.summary.platform == BuildTarget.iOS) // Check if the build is for iOS | |
{ | |
string plistPath = report.summary.outputPath + "/Info.plist"; | |
PlistDocument plist = new PlistDocument(); // Read Info.plist file into memory | |
plist.ReadFromString(File.ReadAllText(plistPath)); | |
PlistElementDict rootDict = plist.root; | |
rootDict.SetBoolean("ITSAppUsesNonExemptEncryption", false); | |
File.WriteAllText(plistPath, plist.WriteToString()); // Override Info.plist | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment