离子6电容器:在构建中添加权限到AndroidManifest.xml
使用离子Cordova,可以在构建过程中使用项目中的config.xml文件在androidmanifest.xml文件中添加特定权限。这样,当删除Android平台文件夹时,每次重建应用程序时,每次都会将权限添加到清单文件中。
现在,我正在迁移到电容器并寻找类似的解决方案。但是,电容器文档非常模糊,并提到了AndroidManifest.xml的直接编辑。现在,我已经跑了两次,必须删除Android文件夹,因此许可编辑也丢失了。
有谁知道如何和何处配置离子电容器的权限,因此编译应用程序还将将权限设置回清单文件?
With Ionic Cordova, it was possible to use the config.xml file in the project to add specific permissions to the AndroidManifest.xml file during build. That way, when the Android platform folder was removed, the permissions were added to the manifest file each time when rebuilding the app.
Now I am migrating to Capacitor and looking for a similar solution. The Capacitor documentation is however very vague, and mentions direct editing of the AndroidManifest.xml. Now I already ran twice into a situation where I had to remove the Android folder, so the permission edits were lost as well.
Does anyone know how and where to configure the permissions for Ionic Capacitor, so compiling the app will also set the permissions back to the manifest file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
https://github.com/ionic-team/trapeze :
您可以尝试此插件 使自动化本机移动iOS和Android项目的配置变得容易,并支持传统的本机,离子,电容器,React Native,Flutter和.Net Maui。
飞人通过自动修改PBXPROJ,PLIST,XML,Gradle,JSON,Resource,Properties,属性以及其他文件和Android App Project中的其他文件。它具有配置驱动的工具,该工具将使用iOS和Android项目修改进行YAML文件,并从命令行进行交互作用。项目API也可用于编写自定义JavaScript/Typescript项目修改脚本以进行全面控制。配置工具在引擎盖下使用此API。
you can try this plugin https://github.com/ionic-team/trapeze :
Trapeze makes it easy to automate the configuration of native mobile iOS and Android projects, and supports traditional native, Ionic, Capacitor, React Native, Flutter, and .NET MAUI.
Trapeze works by automating the modification of pbxproj, plist, XML, Gradle, JSON, resource, properties, and other files in iOS and Android app projects. It features a configuration-driven tool that takes a YAML file with iOS and Android project modifications and performs those modifications from the command line interactively. A Project API is also available for writing custom JavaScript/TypeScript project modification scripts for full control. The configuration tool uses this API under the hood.