科尔多瓦从CLI建设时增加了不必要的权限的Andr​​oidManifest.xml [英] Cordova adds unwanted permission to AndroidManifest.xml when building from CLI

查看:163
本文介绍了科尔多瓦从CLI建设时增加了不必要的权限的Andr​​oidManifest.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用CLI建立我的科尔多瓦应用程序,我已经添加了多媒体插件。

I use CLI to build my Cordova app, and I have added the Media plugin.

科尔多瓦构建自动添加android.permission.RECORD_AUDIO我AndroidManifest.xml中,即使我不使用这个权限。

'cordova build' automatically adds the android.permission.RECORD_AUDIO to my AndroidManifest.xml even though I don't use that permission.

那么,如何去除呢?每一个我建立释放时,允许被添加到APK。

So how do I remove it? Each time I build to release, the permission is added to the apk.

推荐答案

在您的项目中,编辑文件的插件/ org.apache.cordova.media / plugin.xml的
你会看到Android的具体配置

In your project, edit the file plugins/org.apache.cordova.media/plugin.xml You'll see the android specific configuration

   <platform name="android">
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="Media" >
                <param name="android-package" value="org.apache.cordova.media.AudioHandler"/>
            </feature>
        </config-file>

        <config-file target="AndroidManifest.xml" parent="/*">
            <uses-permission android:name="android.permission.RECORD_AUDIO" />
            <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
            <uses-permission android:name="android.permission.READ_PHONE_STATE" />
        </config-file>
...

删除行&LT;使用许可权的android:NAME =android.permission.RECORD_AUDIO/&GT; 这样的许可,不会每次你建立时添加

remove the line <uses-permission android:name="android.permission.RECORD_AUDIO" />like this the permission will not be added each time you build.

由于权限已被添加到AndroidManifest.xml中,你必须手动删除它,那么它应该在下一次建立时间不回来了。

As the permission has already been added to AndroidManifest.xml, you'll have to remove it manually and then it should not come back next time you build.

这篇关于科尔多瓦从CLI建设时增加了不必要的权限的Andr​​oidManifest.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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