Software Archive
Read-only legacy content
17061 Discussions

Add Encryption String to iOS plist

Kevin_L_3
Beginner
1,933 Views

Hi Intel gurus (or other XDK gurus)

Apple have changed the way they deal with encryption certification and now if you have your encryption approved you don't have to upload the BIS certificate everytime. However this means you have to add the compliance code to the plist. I don't know where to do this? Is this in the additions.xml file? And what format does it take? What should the parent be? This doesn't work below when added to the intel.config.additions.xml file:

<config-file target="*-Info.plist" parent="CFBundleURLTypes">
<array>
<key>ITSAppUsesNonExemptEncryption</key><true/>
<key>ITSEncryptionExportComplianceCode</key><string>[STRING KEY FROM APPLE]</string>
</array>
</config-file-->

I get a build error and I suspect its because I've used the wrong parent string. Please advise!!!

Thank you

 

0 Kudos
11 Replies
Amrita_C_Intel
Employee
1,933 Views

Hello,

What is your goal?

I would recommend going through this article.

https://software.intel.com/en-us/xdk/article/my-private-notes-sample

0 Kudos
Kevin_L_3
Beginner
1,933 Views

Hi Amrita

Thanks for your reply but we've already implemented encryption and security within the code so the focus is how to modify the plist successfully in the iOS build to add the encryption certifcatation key from Apple. This is the string that says we're compliance with US Export laws on encryption. I'd prefer not to have to do a build on a Mac where I can easily modify the plist hence the question about what we do within the IntelXDK framework.

There must be guidance on the correct syntax to modify the plist from the additions file somewhere?

Thanks

 

0 Kudos
Kevin_L_3
Beginner
1,933 Views

I tried the following, the build worked but the submission still said Encryption Approval missing.

<preference name="ITSAppUsesNonExemptEncryption" value="true"/>
<preference name="ITSEncryptionExportComplianceCode" value="[EXEMPTION STRING"/>

Still seeking ideas.

 

0 Kudos
PaulF_IntelCorp
Employee
1,933 Views

Kevin, can you provide a pointer to some docs or info pages regarding what Apple is asking you to do? I'm not quite clear on what it is you have to provide. With a better understanding of that we can search for standard Cordova solutions to this problem and then translate that into how you do this with the XDK.

0 Kudos
Kevin_L_3
Beginner
1,933 Views

From iTunes connect: Go to your apps, Features, Encryption. This notice appears:

Encryption

If your app contains encryption, you must provide export compliance documentation. Learn more about compliance with export laws.

 

Use the key string value in your Info.plist file so you don't have to provide export compliance information with your next build.

<key>ITSAppUsesNonExemptEncryption</key><true/>
<key>ITSEncryptionExportComplianceCode</key><string> [ Key Value ] </string>

 

How do I add the above into a Cordova build?

0 Kudos
PaulF_IntelCorp
Employee
1,933 Views

Kevin -- I believe you can do it with a "dummy plugin" like the following (obviously, you'll have to update the [ Key Value ] part of the plugn):

<?xml version="1.0" encoding="UTF-8"?>
<plugin 
    xmlns="http://apache.org/cordova/ns/plugins/1.0" 
    id="my-custom-bis-plugin" 
    version="0.0.2"
>

    <name>My Custom BIS Plugin</name>
    <description>Add BIS info to iOS plist file.</description>
    <license>BSD-3</license>

    <preference name="BIS_KEY" />

    <engines>
        <engine name="cordova" version=">=3.0.0" />
    </engines>

    <!-- ios -->
    <platform name="ios">
        <config-file target="*-Info.plist" parent="CFBundleURLTypes">
            <array>
                <dict>
                    <key>ITSAppUsesNonExemptEncryption</key><true/>
                    <key>ITSEncryptionExportComplianceCode</key><string>$BIS_KEY</string>
                </dict>
            </array>
        </config-file>
    </platform>

</plugin>

What you will have is a plugin that consists of a single file named plugin.xml (the contents of plugin.xml are shown above).

Normally, I would tell you to put your plugin.xml file inside a folder named "my-custom-bis-plugin" (see the id in plugin.xml above). And then "import" that plugin using the plugin management tool on the Projects tab as a "local plugin." However, there is something wrong with the local import tool, so I have created a version of the plugin in my github account and you can try and add it from there.

I have no way to test this (because I don't have an app that requires a BIS key), so you'll have to give it a try. See this image for how to add it as a git repo plugin. The XDK will prompt you for a BIS_KEY, which should then get automatically added when the plugin is built.

Additional info regarding this can be found here > https://software.intel.com/en-us/xdk/faqs/general#android-manifest

Screen Shot 2016-03-04 at 6.03.10 PM.png

0 Kudos
Kevin_L_3
Beginner
1,933 Views

Hi Paul, thank you very much for pulling this together. I've run through the steps as above and entered the appropriate key, and I can see the data in the intel.config.ios.xml file. The custom plugin is visible in my build. I've done 2 builds with this but unfortunately the App Store still says I'm missing encryption exemption and keeps prompting me to include the key/string in the plist in my next build. I'll do a screenshot next time I do an update (probably tomorrow) so you can see the exact message.

0 Kudos
Kevin_L_3
Beginner
1,933 Views

Hi Paul - another update - Apple have streamlined things a little now - so even though the plugin data isn't being recognized (maybe the preference name should change? - I haven't been able to find what it should be though) - you still have to go through a 5 step wizard to select your exemption document but better than having to wait one to two days for them to process it though.

I've looked through the plist in Xcode and can't find what the suitable title name is as well. So maybe when there's an update Apple will make it a little easier for us.

0 Kudos
PaulF_IntelCorp
Employee
1,933 Views

Kevin -- thanks for the update. Yes, please do update this thread if you find out what that magic sauce for the plist file is and we can try again creating a dummy plugin to make that work. Paul

0 Kudos
Thepjday_A_
Beginner
1,933 Views

I tried adding the data to the plist file by adding content to an existing plugin. The data shows as present in the plist binary but apple does not recognize it.

0 Kudos
mattias_c_
Beginner
1,933 Views

I'm here with the exact same problem, did you ever solve it?

0 Kudos
Reply