Build Script: No Encryption Used

If you do not use any encryption technology in your iOS App, you can stop iTunes Connect asking for information about used encryption technology using this little Build Script.

Just place a Build Script between the Build and Sign steps, with the following Script:

[code]Dim App As String = CurrentBuildLocation + “/” + CurrentBuildAppName

Dim mycommand As String = "/usr/bin/defaults write " + App + “/Info.plist ITSAppUsesNonExemptEncryption false”

Call DoShellCommand (mycommand)[/code]

Handy!

careful as changes to the defaults command may render this not functional
It may NOT write into the plist in the bundle but to the plist in your user preferences

This not in the man page for defaults is relevant
[i]
filepath Domains may also be specified as a path to an arbitrary plist file, with or without the ‘.plist’ extension. For example:

 WARNING: The defaults command will be changed in an upcoming major release to only operate on preferences domains. General plist manipulation utilities will be folded into a different command-line program.

[/i]
We’ve run into this & ended up having to use PlistBuddy which is also installed

Thank you @Norman Palardy for this important information.

[code]Dim App As String = CurrentBuildLocation + “/” + CurrentBuildAppName + “/Info.plist”

Dim mycommand As String = "/usr/libexec/plistbuddy -c " + Chr(34) + “Add :ITSAppUsesNonExemptEncryption bool false” + Chr(34) + " " + App

Call DoShellCommand (mycommand)[/code]

I forget the syntax for plistbuddy

you CAN just create a plist & drop it in the IDE & it will add it to the generated plist

Same result using PlistBuddy Command:

[code]Dim App As String = CurrentBuildLocation + “/” + CurrentBuildAppName + “/Info.plist”

Dim mycommand As String = "/usr/libexec/plistbuddy -c " + Chr(34) + “Add :ITSAppUsesNonExemptEncryption bool false” + Chr(34) + " " + App

Call DoShellCommand (mycommand)[/code]

Or, as @Norman Palardy wrote:

I changed the Script because @Norman Palardy wrote:

Apple wrote that warning - not me :stuck_out_tongue:
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/defaults.1.html

[quote=261393:@Norman Palardy]Apple wrote that warning - not me :stuck_out_tongue:
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/defaults.1.html[/quote]

:smiley:

BTW: You say i can just write my own Info.plist File and place it beside my Project and then Drag & Drop it into my Project? A file with the following text would be fine?

[code]<?xml version="1.0" encoding="UTF-8"?>

ITSAppUsesNonExemptEncryption [/code]

That should work

Thank you @Norman Palardy !
Because i think it’s safer to use Xojo’s own solutions where available, i want to change my initial hint. Instead of using commands like “defaults” or “PlistBuddy”, better use a Plist File and drag it into the IDE.

To do this you just create a File like f.e. “AdditionalPlistSettings.plist” with the following content:

[code]<?xml version="1.0" encoding="UTF-8"?>

ITSAppUsesNonExemptEncryption [/code]

More info can be found in the Xojo Dev Center here.