科尔多瓦4.0 config.xml的Android权限 [英] Android permissions in Cordova 4.0 config.xml
问题描述
我用科尔多瓦4.0创建了PhoneGap的应用程序(即通过了关于IOS CLI工作的罚款),但我也想用build.phonegap.com特别为Android。
I used Cordova 4.0 to create a phonegap app (that has worked fine via cli on iOS), but I also want to use build.phonegap.com particularly for Android.
目前的主要问题是,在Android上安装APK,安全警告列出了所有功能,当我实际上并不需要任何。
The main issue is that upon installing the APK on Android, the security warning lists all features, when I do not actually need any.
我有阅读您可以删除所有权限与< preference NAME =权限价值=无/方式>
,然后选择添加自己想要的
I have read that you can remove all permissions with <preference name="permissions" value="none" />
and then selectively add back the ones you want.
然而,这是不工作;我仍然可以在安装时所需的所有权限。我必须失去了一些东西,或者有些事情已经改变。 (我做出用科尔多瓦,而不是PhoneGap的错吗?这是相当容易纠正。)
However, this is not working; I still get all the permissions requested upon install. I must be missing something, or something has changed. (Did I make a mistake using Cordova instead of Phonegap? That's reasonably easy to correct..)
我的config.xml的是如下:
My config.xml is below:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.test" version="1.0.0"
xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv="http://cordova.apache.org/ns/1.0"
xmlns:gap="phonegap.com/ns/1.0"
xmlns:android = "http://schemas.android.com/apk/res/android">
<name>Test</name>
<description>
Test.
</description>
<author email="test@test.com" href="http://test.com">
Test
</author>
<content src="index.html" />
<access origin="*" />
<gap:plugin name="org.apache.cordova.statusbar" />
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#ffffff" />
<preference name="StatusBarStyle" value="default" />
<preference name="DisallowOverscroll" value="true" />
<preference name="permissions" value="none" />
</widget>
编辑:要删除含糊,我想删除了Android的安全警告说,这个程序需要完全访问联系人,摄像头,网络接入等我不需要任何这些
To remove ambiguity, I want to remove the Android security warnings saying this app needs full access to contacts, camera, internet access, etc. I do not need any of these.
推荐答案
config.xml中,仅仅是一堆信息。它不是顺序执行。所以,如果你提到您需要 DisallowOverscroll
许可,然后提起你不要求任何权限,这意味着,
config.xml , is just a bunch of information. It is not executed sequentially. so if you mention you require DisallowOverscroll
permission and then mention you dont require any permission, it means ,
<preference name="permissions" value="none" />
将不会覆盖
<preference name="DisallowOverscroll" value="true" />
例如:
<preference name="DisallowOverscroll" value="true" />
<preference name="permissions" value="none" />
和
<preference name="DisallowOverscroll" value="true" />
<preference name="permissions" value="none" />
都是一样的。
这篇关于科尔多瓦4.0 config.xml的Android权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!