How to remove the permissions automatically added by cloud packaging?

Application manifest file AndroidManifest.xml

In HBuilderX, right-click the project root directory menu "New" -> "Custom File"
insert image description here
insert image description here

Enter the file name AndroidManifest.xml (note that it is case-sensitive), and click the "Create" button to create a new file

Notice:

The manifest file must comply with the standard xml format. The manifest
file must conform to the Android system specification. For details, refer to Google's official AndroidManifest.xml document. The root node must be the manifest root node. The XML namespace xmlns:android and xmlns:tools in the example must be added. The root node must be configured package attribute, and the attribute value cannot be empty. The attribute value is recommended to use the Android package name AndroidManifest.xml configured during cloud packaging , and the content of manifest.json should avoid conflicts, that is, do not configure the content that has been configured in the manifest. The application manifest files will be merged during cloud packaging. If there is a conflict error, please check according to the packaging log. The manifest file configuration needs to be submitted to the cloud packaging to take effect. When running on a real machine, please use a custom debugging base




Remove Android permissions.
If the application uses a third-party SDK (uts plugin or uni native plugin), some Android permissions are included by default, but they may not be used in practice. You can configure permissions in the application manifest file and add tools:node=" remove",
the following example is an example of removing permissions:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
	package="com.hd.debug">
	<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />
	<uses-permission android:name="android.permission.INSTALL_PACKAGES" tools:node="remove" />
	<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" tools:node="remove" />
	<application>
		<!--meta-data-->
	</application>
</manifest>

These will do.

Note: After this configuration, first open the custom base and then open the official package, and directly open the official package does not seem to take effect!

Detailed explanation of uniapp Android native application manifest file and resource configuration

Guess you like

Origin blog.csdn.net/weixin_45361998/article/details/131602034