• Home
Name Date Size #Lines LOC

..--

figures/12-May-2024-

frameworks/bundle_lite/12-May-2024-4,3193,542

interfaces/12-May-2024-2,380947

services/bundlemgr_lite/12-May-2024-14,06811,620

utils/bundle_lite/12-May-2024-869605

LICENSED12-May-202410.1 KiB177150

README.mdD12-May-20243.4 KiB5840

README_zh.mdD12-May-20242.8 KiB5840

bundle.jsonD12-May-20242.5 KiB7272

README.md

1# Bundle Management Framework<a name="EN-US_TOPIC_0000001061838370"></a>
2
3-   [Introduction](#section11660541593)
4-   [Directory Structure](#section1464106163817)
5-   [Repositories Involved](#section93061357133720)
6
7## Introduction<a name="section11660541593"></a>
8
9The bundle management framework is provided by OpenHarmony for you to manage application bundles \(installation packages\). The following figure shows the architecture of the bundle management framework.
10
11**Figure  1**  Bundle management framework architecture<a name="fig1047932418305"></a>
12![](figures/bundle-management-framework-architecture.png "bundle-management-framework-architecture")
13
14-   **BundleKit**  includes external APIs provided by the Bundle Manager Service, including the APIs for application installation and uninstallation, bundle information query, and bundle state change listeners.
15-   The  **bundle scanning sub-module**  parses pre-installed or installed bundles on the local device and extracts information from them for the bundle management sub-module to manage and make the information persistent for storage.
16
17-   The  **bundle installation sub-module**  installs, uninstalls, and updates a bundle.
18-   The  **bundle installation service**  is an independent process used to create or delete installation directories and has high permissions.
19
20-   The  **bundle management sub-module**  manages information related to application bundles and stores persistent bundle information.
21
22-   The  **bundle security management sub-module**  verifies signatures, and grants and manages permissions.
23
24## Directory Structure<a name="section1464106163817"></a>
25
26```
27/foundation/appexecfwk/appexecfwk_lite
28     ├── frameworks
29     │      └── bundle_lite                # Client code used for communication between the BundleKit and Bundle Manager Service
30     ├── interfaces
31     │      ├── kits
32     │      │     └── bundle_lite         # BundleKit APIs exposed externally
33     │      └── innerkits
34     │             └── bundlemgr_lite      # Core implementation code of BundleKit and internal APIs provided by the Bundle Manager Service for other subsystems
35     ├── services
36     │      └── bundlemgr_lite             # Implementation code of the Bundle Manager Service
37     └── utils
38             └── bundle_lite                # Utility code used during the implementation of the Bundle Manager Service
39```
40
41-   The Bundle Manager Service is running in the foundation process.
42-   The Bundle Manager Service is registered with  **sa\_manager**.  **sa\_manager**  runs in the foundation process and sets up a thread runtime environment for the service. For details about how to create and use the Bundle Manager Service, see  [SA Framework](en-us_topic_0000001051589563.md).
43-   The Bundle Manager Service starts upon OS startup.
44-   You can use the bm tool to install the specified HAP. \(Taking  **hispark\_taurus**  as an example, you can obtain the bm tool from the  **out/hispark\_taurus/ipcamera\_hispark\_taurus/dev\_tools/bin directory**  after the version building.\)
45
46```
47./bin/bm install -p /nfs/xxxx.hap
48```
49
50## Repositories Involved<a name="section93061357133720"></a>
51
52[Application framework](https://gitee.com/openharmony/docs/blob/master/en/readme/application-framework.md)
53
54[aafwk\_aafwk\_lite](https://gitee.com/openharmony/aafwk_aafwk_lite/blob/master/README.md)
55
56**appexecfwk\_appexecfwk\_lite**
57
58

README_zh.md

1# 包管理组件<a name="ZH-CN_TOPIC_0000001061838370"></a>
2
3-   [简介](#section11660541593)
4-   [目录](#section1464106163817)
5-   [相关仓](#section93061357133720)
6
7## 简介<a name="section11660541593"></a>
8
9**包管理组件**,是OpenHarmony为开发者提供的安装包管理框架。包管理组件的由如下模块组成:
10
11**图 1**  包管理组件框架图<a name="fig1047932418305"></a>
12![](figures/包管理组件框架图.png "包管理组件框架图")
13
14-   **BundleKit**:是包管理服务对外提供的接口,有安装/卸载接口、包信息查询接口、包状态变化监听接口。
15-   **包扫描子模块**:用来解析本地预制或者安装的安装包,提取里面的各种信息,供管理子模块进行管理,持久化。
16
17-   **包安装子模块**:负责安装,卸载,升级一个包。
18-   **包安装服务**:一个单独进程的用于创建删除安装目录,具有较高的权限。
19
20-   **包管理子模块**:管理安装包相关的信息,存储持久化包信息。
21
22-   **包安全管理子模块**:签名检查、权限授予、权限管理。
23
24## 目录<a name="section1464106163817"></a>
25
26```
27/foundation/appexecfwk/appexecfwk_lite
28     ├── frameworks
29     │      └── bundle_lite                # 管理BundleKit与包管理服务通信的客户端代码
30     ├── interfaces
31     │      ├── kits
32     │      │     └── bundle_lite         # BundleKit为开发者提供的接口
33     │      └── innerkits
34     │             └── bundlemgr_lite      # BundleKit实现的核心代码,及包管理服务为其它子系统提供的接口
35     ├── services
36     │      └── bundlemgr_lite             # 包管理服务的实现代码
37     └── utils
38             └── bundle_lite                # 包管理服务实现中用到的工具性的代码
39```
40
41-   包管理服务为BundleMs,服务运行于foudation进程中;
42-   BundleMs注册到sa\_manager中,sa\_manager运行于foundation进程中,sa\_manager为BundleMs创建线程运行环境。具体创建BundleMs服务的方式以及使用该服务的方式,可参考系统服务框架子系统;
43-   系统启动后,BundleMs会随系统启动而启动;
44-   使用bm工具可以安装指定的hap包(以hispark\_taurus为例,bm工具在系统构建后放置在out/hispark\_taurus/ipcamera\_hispark\_taurus/dev\_tools/bin下):
45
46```
47./bin/bm install -p /nfs/xxxx.hap
48```
49
50## 相关仓<a name="section93061357133720"></a>
51
52[用户程序框架子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/%E7%94%A8%E6%88%B7%E7%A8%8B%E5%BA%8F%E6%A1%86%E6%9E%B6%E5%AD%90%E7%B3%BB%E7%BB%9F.md)
53
54[aafwk\_aafwk\_lite](https://gitee.com/openharmony/aafwk_aafwk_lite/blob/master/README_zh.md)
55
56**appexecfwk\_appexecfwk\_lite**
57
58