diff --git a/en/device-dev/subsystems/Readme-EN.md b/en/device-dev/subsystems/Readme-EN.md index d56854b895f3138843dba4ef56bd2858f82316d2..2c1f70ba1f2e1cc64af4978fb9d620e9233335c1 100644 --- a/en/device-dev/subsystems/Readme-EN.md +++ b/en/device-dev/subsystems/Readme-EN.md @@ -65,8 +65,8 @@ - [Development on IPC Authentication](subsys-security-communicationverify.md) - [Development on Device Security Level Management](subsys-security-devicesecuritylevel.md) - [Development on HUKS](subsys-security-huks-guide.md) - - [Application Privilege Configuration Guide](subsys-app-privilege-config-guide.md) - - [Preset Application Configuration Guide](subsys-preinstall-app-config-guide.md) + - [Application Privilege Configuration](subsys-app-privilege-config-guide.md) + - [Configuration of Pre-installed Applications](subsys-preinstall-app-config-guide.md) - Startup - [Startup](subsys-boot-overview.md) - init Module diff --git a/en/device-dev/subsystems/subsys-app-privilege-config-guide.md b/en/device-dev/subsystems/subsys-app-privilege-config-guide.md index e5a8f8a2e6af975dd852904fcf40b5d4b036163c..c2aaa29d6cf2ed8d29ecda1e6adb089b3ba81045 100644 --- a/en/device-dev/subsystems/subsys-app-privilege-config-guide.md +++ b/en/device-dev/subsystems/subsys-app-privilege-config-guide.md @@ -1,4 +1,4 @@ -# Application Privilege Configuration Guide +# Application Privilege Configuration Application privileges are high-level capabilities of an application, for example, restricting an application from being uninstalled or restricting application data from being deleted. diff --git a/en/device-dev/subsystems/subsys-preinstall-app-config-guide.md b/en/device-dev/subsystems/subsys-preinstall-app-config-guide.md index e7f7ad33c0da91c8f41fd4f334c4f4baf0b8f122..b2a84e4d9e1847e1111eb1e58bcd357d72c1516b 100644 --- a/en/device-dev/subsystems/subsys-preinstall-app-config-guide.md +++ b/en/device-dev/subsystems/subsys-preinstall-app-config-guide.md @@ -1,35 +1,73 @@ -# Preset Application Configuration Guide +# Configuration and Installation of Pre-installed Applications -OpenHarmony supports differentiated configuration of preset applications on different devices. +Pre-installed applications are applications that are natively installed on a device from factory setup. OpenHarmony supports differentiated configuration of pr-installed applications on different devices. -In addition, OpenHarmony provides **GetCfgDirList** for your application to obtain the preset directories, such as **system**, **chipset**, **sys_prod**, and **chip_prod**, in ascending order of priority. For example, the priority of **chip_prod** is higher than that of **system**. +## Configuring Pre-installed Applications -## Configuring the Preset Applications to Be Installed +1. Before the configuration, run the following command to query the directories for pre-installed applications supported by the system: + + ``` + hdc shell param get const.cust.config_dir_layer + ``` + + The query result includes **system**, **chipset**, **sys_prod**, **chip_prod**, and more. The directories are listed in ascending order of priority. For example, **chip_prod** has higher priority than **system**. This document uses **/system/etc/app/** as an example. -### Procedure +2. Configure the HAP path on the device in the **install_list.json** file. -1. Add the application name in the preset directory as the application directory. -2. Preset the application in the application directory, for example, **/system/app/Hiworld/entry.hap**. -3. Add the application directory to [install_list.json](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/install_list.json) and configure **removable** as required. +``` +hdc shell mount -o rw,remount / +hdc file recv /system/etc/app/install_list.json . +``` -### Example +3. Configure **install_list**. ``` { "install_list" : [ { - "app_dir" : "/system/app/Hiworld", - "removable": false // The application cannot be uninstalled. + "app_dir":"system/app/xxxx/yyyy", // HAP path on the device. If the directory does not exist, create it and push HAP to this directory. + "removable":true // Whether the application can be uninstalled. The value true means the application can be uninstalled; the value false means the opposite. } ] } ``` -## Configuring the Preset Applications Not to Be Installed +4. Transfer the **install_list.json** file to the device, and restart the device for the modification to take effect. + +``` + hdc shell mount -o rw,remount / + hdc file send install_list.json /system/etc/app/install_list.json + hdc shell reboot +``` + +## Updating Pre-installed Applications + +After the pre-installed applications are updated, use either of the following methods to reinstall them: + +- Method 1: Clear **/data** and restart the device. The applications will be automatically installed. + +``` + hdc shell mount -o rw,remount / + hdc shell rm /data/* -rf + hdc shell sync + hdc shell /system/bin/udevadm trigger + hdc shell reboot +``` +- Method 2: Run the following command to restart the device. The applications will be installed. + + If an application has been installed, the application version No. ([versionCode](../../application-dev/quick-start/app-configuration-file.md) configured in **app.json5** for the stage model or [code](../../application-dev/quick-start/app-structure.md#internal-structure-of-the-version-atttribute) in the configuration file for the FA model) sent to the **/system/app/** directory must be later than the version number of the application installed. + +``` + hdc shell mount -o rw,remount / + hdc shell param set persist.bms.test-upgrade true + hdc shell reboot +``` + +# Configuring Applications Not Installed -The configuration priority of [**uninstall_list.json**](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/uninstall_list.json) is higher than that of **install_list.json**. The applications added to **uninstall_list.json** will not be installed. +The [**uninstall_list.json**](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/uninstall_list.json) has higher configuration priority than **install_list.json**. The applications added to **uninstall_list.json** will not be installed. -### Example 1: +## Example 1 ``` /system/etc/app/uninstall_list.json @@ -39,7 +77,7 @@ The configuration priority of [**uninstall_list.json**](https://gitee.com/openha } ``` -### Example 2: +## Example 2 ``` /system/etc/app/uninstall_list.json