Guest User

Untitled

a guest
May 27th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEditor.Build;
  3. using UnityEditor.Build.Reporting;
  4. using UnityEditor;
  5. using UnityEditor.iOS.Xcode;
  6. using System.IO;
  7.  
  8. public class ExcemptFromEncryption : IPostprocessBuildWithReport // Will execute after XCode project is built
  9. {
  10. public int callbackOrder { get { return 0; } }
  11.  
  12. public void OnPostprocessBuild(BuildReport report)
  13. {
  14. if (report.summary.platform == BuildTarget.iOS) // Check if the build is for iOS
  15. {
  16. string plistPath = report.summary.outputPath + "/Info.plist";
  17.  
  18. PlistDocument plist = new PlistDocument(); // Read Info.plist file into memory
  19. plist.ReadFromString(File.ReadAllText(plistPath));
  20.  
  21. PlistElementDict rootDict = plist.root;
  22. rootDict.SetBoolean("ITSAppUsesNonExemptEncryption", false);
  23.  
  24. File.WriteAllText(plistPath, plist.WriteToString()); // Override Info.plist
  25. }
  26. }
  27. }
Add Comment
Please, Sign In to add comment