添加自定义参数 - Phonegap Build [英] Adding Custom Parameter - Phonegap Build

查看:25
本文介绍了添加自定义参数 - Phonegap Build的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,Apple 强制要求在上传到 Itunesconnect 的每个构建中添加声明加密/加密.但是由于我的应用程序不涉及apple page所说的任何功能(如果我错了,请纠正我),因此不适用于我.我想申请豁免.

为此我必须添加

ITSAppUsesNonExemptEncryption

到 Ituneconnect 手册指定的 info.plist.

由于我的应用程序是使用 Phonegap Build 构建的,所以我只能添加配置文件(想知道是否有其他方法.)

所以我尝试用 配置文件元素添加它.喜欢这个.

 <假/></config-file>

但它没有区别.当我尝试从 phonegap 构建中提取 .ipa 并检查它时,info.plist 没有包含上述属性.我究竟做错了什么.有没有其他方法可以通过 phonegap build 绕过合规性法律.

这是 config.xml 文件:

<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"><名称>示例</名称><说明>示例示例</描述><author email="example.com" href="example.com">尼基尔·谢蒂<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="*"/><插件名称="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:*"/><平台名称=ios"><allow-intent href="itms:*"/><allow-intent href="itms-apps:*"/><config-file platform="ios" target="*-Info.plist" parent="ITSAppUsesNonExemptEncryption"><假/></config-file></平台><engine name="ios" spec="~4.0.1"/></小部件>

为它生成的 info.plist:

<plist version="1.0"><字典><key>BuildMachineOSBuild</key><string>5665646</string><key>CFBundleDevelopmentRegion</key><string>英文</string><key>CFBundleDisplayName</key><string>示例</string><key>CFBundleExecutable</key><string>示例</string><key>CFBundleIconFiles</key><阵列><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></阵列><key>CFBundleIdentifier</key><string>com.examples.example</string><key>CFBundleInfoDictionaryVersion</key><string>6.0</string><key>CFBundleName</key><string>示例</string><key>CFBundlePackageType</key><string>APPL</string><key>CFBundleShortVersionString</key><string>0.0.30.4</string><key>CFBundleSignature</key><string>????</string><key>CFBundleSupportedPlatforms</key><阵列><string>iPhoneOS</string></阵列><key>CFBundleURLTypes</key><数组/><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><真/><key>MinimumOSVersion</key><string>6.0</string><key>NSAppTransportSecurity</key><字典><key>NSAllowsArbitraryLoads</key><真/></dict><key>NSLocationWhenInUseUsageDescription</key><字符串></字符串><key>UIDeviceFamily</key><阵列><整数>1</整数><整数>2</整数></阵列><key>UILaunchImages</key><阵列><字典><key>UILaunchImageMinimumOSVersion</key><string>8.0</string><key>UILaunchImageName</key><string>默认</string><key>UILaunchImageOrientation</key><string>肖像</string><key>UILaunchImageSize</key><string>{320, 480}</string></dict><字典><key>UILaunchImageMinimumOSVersion</key><string>8.0</string><key>UILaunchImageName</key><string>默认</string><key>UILaunchImageOrientation</key><string>风景</string><key>UILaunchImageSize</key><string>{320, 480}</string></dict><字典><key>UILaunchImageMinimumOSVersion</key><string>8.0</string><key>UILaunchImageName</key><string>默认值-568h</string><key>UILaunchImageOrientation</key><string>肖像</string><key>UILaunchImageSize</key><string>{320, 568}</string></dict><字典><key>UILaunchImageMinimumOSVersion</key><string>8.0</string><key>UILaunchImageName</key><string>默认值-568h</string><key>UILaunchImageOrientation</key><string>风景</string><key>UILaunchImageSize</key><string>{320, 568}</string></dict><字典><key>UILaunchImageMinimumOSVersion</key><string>8.0</string><key>UILaunchImageName</key><string>默认值-667h</string><key>UILaunchImageOrientation</key><string>肖像</string><key>UILaunchImageSize</key><string>{375, 667}</string></dict><字典><key>UILaunchImageMinimumOSVersion</key><string>8.0</string><key>UILaunchImageName</key><string>默认值-667h</string><key>UILaunchImageOrientation</key><string>风景</string><key>UILaunchImageSize</key><string>{375, 667}</string></dict><字典><key>UILaunchImageMinimumOSVersion</key><string>8.0</string><key>UILaunchImageName</key><string>Default-736h</string><key>UILaunchImageOrientation</key><string>肖像</string><key>UILaunchImageSize</key><string>{414, 736}</string></dict><字典><key>UILaunchImageMinimumOSVersion</key><string>8.0</string><key>UILaunchImageName</key><string>Default-Landscape-736h</string><key>UILaunchImageOrientation</key><string>风景</string><key>UILaunchImageSize</key><string>{414, 736}</string></dict><字典><key>UILaunchImageMinimumOSVersion</key><string>8.0</string><key>UILaunchImageName</key><string>默认肖像</string><key>UILaunchImageOrientation</key><string>肖像</string><key>UILaunchImageSize</key><string>{768, 1024}</string></dict><字典><key>UILaunchImageMinimumOSVersion</key><string>8.0</string><key>UILaunchImageName</key><string>默认风景</string><key>UILaunchImageOrientation</key><string>风景</string><key>UILaunchImageSize</key><string>{768, 1024}</string></dict></阵列><key>UIPrerenderedIcon</key><真/><key>UIRequiresFullScreen</key><真/><key>UIStatusBarHidden</key><真/><key>UIStatusBarStyle</key><string>UIStatusBarStyleBlackOpaque</string><key>UISupportedInterfaceOrientations</key><阵列><string>UIInterfaceOrientationPortrait</string><string>UIInterfaceOrientationPortraitUpsideDown</string></阵列><key>UISupportedInterfaceOrientations~ipad</key><阵列><string>UIInterfaceOrientationPortrait</string><string>UIInterfaceOrientationPortraitUpsideDown</string></阵列></dict></plist>

它只是没有添加所需的属性ITSAppUsesNonExemptEncryption".

请帮忙

解决方案

这里的要点与文档完全相反 http://docs.build.phonegap.com/en_US/configuring_config_file_element.md.html

必须使用 gap: 命名空间,以便 config-file 标记起作用.请参阅https://github.com/phonegap/build/issues/512.>

我可以确认,twistedm3 发布的解决方案导致标签按预期包含在 Info.plist 中.

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

解决方案

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.

这篇关于添加自定义参数 - Phonegap Build的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆