问题
Acknowledging a similar question in the link below does anyone know how to add the information to the config.xml file in Cordova?
ITSAppUsesNonExemptEncryption export compliance while internal testing?
I need to have a true value in the plist:
ITSAppUsesNonExemptEncryption ITSEncryptionExportComplianceCode [ Key Value ]
Does anyone know the correct syntax to add this information?
回答1:
I had to modify Andrej's answer a bit, this worked for me:
<platform name="ios">
...
<config-file target="*-Info.plist" parent="ITSAppUsesNonExemptEncryption" mode="add">
<false/>
</config-file>
...
</platform>
回答2:
I have create a simple empty plugin to set this ITSAppUsesNonExemptEncryption
to false.
Simply add the following to your config.xml
<plugin name="cordova-ios-plugin-no-export-compliance" spec="0.0.5" />
or run
cordova plugin add cordova-ios-plugin-no-export-compliance
If you need to set it to true you can fork the plugin and change the plugin.xml
file accordingly then add the plugin from the forked repository.
See the plugin on NPM for more info.
回答3:
As of 2/7/2019, the correct way to do this is to add this snippet to your <platform name="ios">
section:
<edit-config file="*-Info.plist" mode="add" target="ITSAppUsesNonExemptEncryption">
<false/>
</edit-config>
回答4:
Note that the plugin mentioned will not work in phonegap build. The solution to make this work in phonegap build is outlined in this stackoverflow question and in this github issue: Use
<gap:config-file platform="ios" parent="ITSAppUsesNonExemptEncryption" mode="add">
<false/>
</gap:config-file>
in your config.xml.
Note that you MUST explicitly set platform="ios" as an attribute, even if you already have a platform block. Note that you MUST use the gap: namespace.
The following WILL NOT work as per 2016-04-08:
<platform name="ios">
<gap:config-file parent="ITSAppUsesNonExemptEncryption" mode="add">
<false/>
</gap:config-file>
</platform>
Neither will this one work:
<config-file platform="ios" parent="ITSAppUsesNonExemptEncryption" mode="add">
<false/>
</config-file>
回答5:
The correct answer is actually:
<config-file platform="ios" target="*-Info.plist" parent="ITSAppUsesNonExemptEncryption">
<false/>
</config-file>
Taken from Add hint that this won't work in phonegap build
回答6:
This works for me (Actually I needed to put false, instead of true).
<platform name="ios">
...
<config-file target="*-Info.plist" parent="CFBundleURLTypes" mode="add">
<array>
<dict>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
</dict>
</array>
</config-file>
...
</platform>
I am using cordova 6.3.0
engineios@~4.2.0
.
I hope I helped :)
回答7:
I can across this issue using ionic.
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 0.0.48
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: macOS Sierra
Node Version: v7.1.0
Xcode version: Xcode 8.2.1 Build version 8C1002
After more research than expected I learned that plugins have the ability to update the config. To that end I just added the plugin "cordova-plugin-ios-non-exempt-encryption" to my package.json, rebuilt and it works!
回答8:
November 2019, next is working for me:
<platform name="ios">
...
<config-file parent="ITSAppUsesNonExemptEncryption" target="*-Info.plist">
<false />
</config-file>
NOTE: DON'T FORGET TO REMOVE platforms/ios folder and build again with ionic cordova prepare ios
. Without that plist file may stay unchanged.
来源:https://stackoverflow.com/questions/35798375/itsappusesnonexemptencryption-cordova-build