3

Recently Apple has made it mandatory to add declare encryption/cryptography with every build uploaded to Itunesconnect. But since it is not applicable to me since my app doesn't involve in any of those functions said by apple page (Correct me If I am wrong).I would like to apply for exemption from it.

For that I have to add

<key>ITSAppUsesNonExemptEncryption</key><false/>

to info.plist as specified by Ituneconnect manual.

Since my app is built with Phonegap Build I can only add with config file(Would like to know if there are any other way.).

So I try to add it with Config File Element.Like this.

  <config-file platform="ios" parent="ITSAppUsesNonExemptEncryption" mode="add">
       <false />
   </config-file>

But it did no difference.info.plist did not include above property when I try to extract .ipa from phonegap build and check it out. What am I doing wrong. Is there any other way to get around Compliance Laws with phonegap build.

This is the config.xml file:

<widget id="com.example.examples" version="0.0.30.4" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
    <name>example</name>
    <description>
    example example
    </description>
    <author email="example.com" href="example.com">
        Nikhil Shetye
    </author>
    <content src="index.html" />
    <preference name="permissions" value="none" />
    <preference name="orientation" value="portrait" />
    <preference name="target-device" value="universal" />
    <preference name="fullscreen" value="true" />
    <preference name="webviewbounce" value="true" />
    <preference name="prerendered-icon" value="true" />
    <preference name="stay-in-webview" value="false" />
    <preference name="ios-statusbarstyle" value="black-opaque" />
    <preference name="detect-data-types" value="true" />
    <preference name="exit-on-suspend" value="false" />
    <preference name="show-splash-screen-spinner" value="true" />
    <preference name="auto-hide-splash-screen" value="true" />
    <preference name="disable-cursor" value="false" />
    <preference name="android-minSdkVersion" value="7" />
    <preference name="android-installLocation" value="auto" />

    <gap:plugin name="org.apache.cordova.battery-status" />
    <gap:plugin name="org.apache.cordova.camera" />
    <gap:plugin name="org.apache.cordova.media-capture" />
    <gap:plugin name="org.apache.cordova.console" />
    <gap:plugin name="org.apache.cordova.contacts" />
    <gap:plugin name="org.apache.cordova.device" />
    <gap:plugin name="org.apache.cordova.device-motion" />
    <gap:plugin name="org.apache.cordova.device-orientation" />
    <gap:plugin name="org.apache.cordova.dialogs" />
    <gap:plugin name="org.apache.cordova.file" />
    <gap:plugin name="org.apache.cordova.file-transfer" />
    <gap:plugin name="org.apache.cordova.geolocation" />
    <gap:plugin name="org.apache.cordova.globalization" />
    <gap:plugin name="org.apache.cordova.inappbrowser" />
    <gap:plugin name="org.apache.cordova.media" />
    <gap:plugin name="org.apache.cordova.network-information" />
    <gap:plugin name="org.apache.cordova.splashscreen" />
    <gap:plugin name="org.apache.cordova.vibration" />
    <gap:plugin name="cordova-custom-config" source="npm" spec="1.2.6" />

    <access origin="*" />
    <plugin name="cordova-plugin-whitelist" version="1" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <config-file platform="ios" target="*-Info.plist" parent="ITSAppUsesNonExemptEncryption">
            <false />
        </config-file>
    </platform>
    <engine name="ios" spec="~4.0.1" />
</widget>

And info.plist generated for it:

<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>BuildMachineOSBuild</key>
        <string>5665646</string>
        <key>CFBundleDevelopmentRegion</key>
        <string>English</string>
        <key>CFBundleDisplayName</key>
        <string>Example</string>
        <key>CFBundleExecutable</key>
        <string>Example</string>
        <key>CFBundleIconFiles</key>
        <array>
            <string>icon.png</string>
            <string>icon@2x.png</string>
            <string>icon-72.png</string>
            <string>icon-72@2x.png</string>
            <string>icon-50.png</string>
            <string>icon-50@2x.png</string>
            <string>icon-60.png</string>
            <string>icon-60@2x.png</string>
            <string>icon-76.png</string>
            <string>icon-76@2x.png</string>
            <string>icon-40.png</string>
            <string>icon-40@2x.png</string>
            <string>icon-small.png</string>
            <string>icon-small@2x.png</string>
        </array>
        <key>CFBundleIdentifier</key>
        <string>com.examples.example</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
        <string>Example</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
        <string>0.0.30.4</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleSupportedPlatforms</key>
        <array>
            <string>iPhoneOS</string>
        </array>
        <key>CFBundleURLTypes</key>
        <array/>
        <key>CFBundleVersion</key>
        <string>0.0.30.4</string>
        <key>DTCompiler</key>
        <string>com.apple.compilers.llvm.clang.1_0</string>
        <key>DTPlatformBuild</key>
        <string>13B137</string>
        <key>DTPlatformName</key>
        <string>iphoneos</string>
        <key>DTPlatformVersion</key>
        <string>9.1</string>
        <key>DTSDKBuild</key>
        <string>13B137</string>
        <key>DTSDKName</key>
        <string>iphoneos9.1</string>
        <key>DTXcode</key>
        <string>0710</string>
        <key>DTXcodeBuild</key>
        <string>7B91b</string>
        <key>LSRequiresIPhoneOS</key>
        <true/>
        <key>MinimumOSVersion</key>
        <string>6.0</string>
        <key>NSAppTransportSecurity</key>
        <dict>
            <key>NSAllowsArbitraryLoads</key>
            <true/>
        </dict>
        <key>NSLocationWhenInUseUsageDescription</key>
        <string></string>
        <key>UIDeviceFamily</key>
        <array>
            <integer>1</integer>
            <integer>2</integer>
        </array>
        <key>UILaunchImages</key>
        <array>
            <dict>
                <key>UILaunchImageMinimumOSVersion</key>
                <string>8.0</string>
                <key>UILaunchImageName</key>
                <string>Default</string>
                <key>UILaunchImageOrientation</key>
                <string>Portrait</string>
                <key>UILaunchImageSize</key>
                <string>{320, 480}</string>
            </dict>
            <dict>
                <key>UILaunchImageMinimumOSVersion</key>
                <string>8.0</string>
                <key>UILaunchImageName</key>
                <string>Default</string>
                <key>UILaunchImageOrientation</key>
                <string>Landscape</string>
                <key>UILaunchImageSize</key>
                <string>{320, 480}</string>
            </dict>
            <dict>
                <key>UILaunchImageMinimumOSVersion</key>
                <string>8.0</string>
                <key>UILaunchImageName</key>
                <string>Default-568h</string>
                <key>UILaunchImageOrientation</key>
                <string>Portrait</string>
                <key>UILaunchImageSize</key>
                <string>{320, 568}</string>
            </dict>
            <dict>
                <key>UILaunchImageMinimumOSVersion</key>
                <string>8.0</string>
                <key>UILaunchImageName</key>
                <string>Default-568h</string>
                <key>UILaunchImageOrientation</key>
                <string>Landscape</string>
                <key>UILaunchImageSize</key>
                <string>{320, 568}</string>
            </dict>
            <dict>
                <key>UILaunchImageMinimumOSVersion</key>
                <string>8.0</string>
                <key>UILaunchImageName</key>
                <string>Default-667h</string>
                <key>UILaunchImageOrientation</key>
                <string>Portrait</string>
                <key>UILaunchImageSize</key>
                <string>{375, 667}</string>
            </dict>
            <dict>
                <key>UILaunchImageMinimumOSVersion</key>
                <string>8.0</string>
                <key>UILaunchImageName</key>
                <string>Default-667h</string>
                <key>UILaunchImageOrientation</key>
                <string>Landscape</string>
                <key>UILaunchImageSize</key>
                <string>{375, 667}</string>
            </dict>
            <dict>
                <key>UILaunchImageMinimumOSVersion</key>
                <string>8.0</string>
                <key>UILaunchImageName</key>
                <string>Default-736h</string>
                <key>UILaunchImageOrientation</key>
                <string>Portrait</string>
                <key>UILaunchImageSize</key>
                <string>{414, 736}</string>
            </dict>
            <dict>
                <key>UILaunchImageMinimumOSVersion</key>
                <string>8.0</string>
                <key>UILaunchImageName</key>
                <string>Default-Landscape-736h</string>
                <key>UILaunchImageOrientation</key>
                <string>Landscape</string>
                <key>UILaunchImageSize</key>
                <string>{414, 736}</string>
            </dict>
            <dict>
                <key>UILaunchImageMinimumOSVersion</key>
                <string>8.0</string>
                <key>UILaunchImageName</key>
                <string>Default-Portrait</string>
                <key>UILaunchImageOrientation</key>
                <string>Portrait</string>
                <key>UILaunchImageSize</key>
                <string>{768, 1024}</string>
            </dict>
            <dict>
                <key>UILaunchImageMinimumOSVersion</key>
                <string>8.0</string>
                <key>UILaunchImageName</key>
                <string>Default-Landscape</string>
                <key>UILaunchImageOrientation</key>
                <string>Landscape</string>
                <key>UILaunchImageSize</key>
                <string>{768, 1024}</string>
            </dict>
        </array>
        <key>UIPrerenderedIcon</key>
        <true/>
        <key>UIRequiresFullScreen</key>
        <true/>
        <key>UIStatusBarHidden</key>
        <true/>
        <key>UIStatusBarStyle</key>
        <string>UIStatusBarStyleBlackOpaque</string>
        <key>UISupportedInterfaceOrientations</key>
        <array>
            <string>UIInterfaceOrientationPortrait</string>
            <string>UIInterfaceOrientationPortraitUpsideDown</string>
        </array>
        <key>UISupportedInterfaceOrientations~ipad</key>
        <array>
            <string>UIInterfaceOrientationPortrait</string>
            <string>UIInterfaceOrientationPortraitUpsideDown</string>
        </array>
    </dict>
    </plist>

It just doesn't add the desired property "ITSAppUsesNonExemptEncryption".

Please Help

Nikhil Shetye
  • 71
  • 1
  • 7
  • You can use the plugin mentioned on this question http://stackoverflow.com/questions/35798375/itsappusesnonexemptencryption-cordova-build – jcesarmobile Mar 15 '16 at 09:47
  • Since it is a year old thread so wanted to know if your issue resolved and how please ? I am also looking to add the same in info.plist though phonegap build service – adang Apr 23 '17 at 10:54

3 Answers3

1

As a PhoneGap Build user in the config.xml try:

<gap:config-file platform="ios" parent="ITSAppUsesNonExemptEncryption" mode="add">
<false/>
</gap:config-file>
twistedm3
  • 19
  • 1
  • This does nothing for me. Info.plist is not modified. – Simon Woodside Jun 15 '16 at 23:36
  • Update: Looking at https://github.com/phonegap/build/issues/503 I see that this will only work if you are using the Phonegap Build service. I tried to Undo my down vote on your answer and I get an error that I'm not allowed to vote again. – Simon Woodside Jun 15 '16 at 23:43
1

The point here is that quite in contrary to the documentation http://docs.build.phonegap.com/en_US/configuring_config_file_element.md.html

You must use the gap: namespace such that the config-file tags have an effect. See https://github.com/phonegap/build/issues/512.

I can confirm that the solution twistedm3 posted leads to the tags to be included in the Info.plist like expected.

istr
  • 171
  • 1
  • 2
0

UPDATE

You can't use the cordova-custom-config plugin to define custom config in your config.xml because Phonegap Build doesn't execute plugin hooks :-(

But I believe (not being a Phonegap Build user) that you can use their Config File Elements to do something like:

<config-file platform="ios" parent="CFBundleURLTypes" mode="add">
    <array>
        <dict>
            <key>ITSAppUsesNonExemptEncryption</key>
            <false/>
        </dict>
    </array>
</config-file>

There's a skeleton plugin that applies this to the iOS .plist, but since it's only in a Git repo and not published to NPM, I don't think you can use it with Phonegap Build.

DaveAlden
  • 30,083
  • 11
  • 93
  • 155
  • But will it work with Phonegap build??? I had used similar thing as said above.Which has little bit different structure then yours though. – Nikhil Shetye Mar 13 '16 at 11:58
  • Yes, it will work with Phonegap Build. I created it using hooks that attach to the Cordova build process. Phonegap Build still uses this. But the proof is in the pudding - try it. – DaveAlden Mar 13 '16 at 13:26
  • cordova-custom-config Plugin doesn't get included into app , when I check extracted .ipa. Any idea why?? – Nikhil Shetye Mar 13 '16 at 14:44
  • The plugin is a collection of Javascript hooks that modifies the build process. Nothing is installed into the ipa. – DaveAlden Mar 13 '16 at 14:51
  • @DaveAlden, unless they recently changed something on phonegap build and I'm not aware of, phonegap build doesn't execute plugin hooks due to security reasons. – jcesarmobile Mar 15 '16 at 09:45
  • @jcesarmobile again, you are right :-) [PGB doesn't support use of JS hooks](https://github.com/phonegap/build/issues/425). Well, that sucks - I'm glad I don't use it. Another reason to build locally. But looking at PGB docs, they have their own mechanism for custom config injection. – DaveAlden Mar 15 '16 at 09:55
  • Yes, they have a mechanism, he is already using it, but he is using it with the wrong values. Yours seem better. BTW, you can now use github plugins on phonegap build. – jcesarmobile Mar 15 '16 at 10:52
  • `BTW, you can now use github plugins on phonegap build` - out of the Cretaceous and into the Jurassic :-) – DaveAlden Mar 15 '16 at 12:02
  • Well,frustrated by phonegap build's other shortcomings I moved to Intel Xdk...but thank you nontheles – Nikhil Shetye Mar 16 '16 at 14:07
  • how do you use github plugins? please explain – Brent Mar 30 '16 at 15:56