• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**
17  * @addtogroup Native_Bundle
18  * @{
19  *
20  * @brief Describes the Native Bundle.
21  *
22  * @since 9
23  * @version 1.0
24  */
25 
26 /**
27  * @file native_interface_bundle.h
28  *
29  * @brief Declares the <b>Bundle</b>-specific function, including function for obtaining application info.
30  *
31  * @library libbundle.z.so
32  * @syscap SystemCapability.BundleManager.BundleFramework.Core
33  * @since 9
34  * @version 1.0
35  */
36 #ifndef FOUNDATION_APPEXECFWK_STANDARD_KITS_APPKIT_NATIVE_BUNDLE_INCLUDE_NATIVE_INTERFACE_BUNDLE_H
37 #define FOUNDATION_APPEXECFWK_STANDARD_KITS_APPKIT_NATIVE_BUNDLE_INCLUDE_NATIVE_INTERFACE_BUNDLE_H
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 /**
43  * @brief Indicates information of application
44  *
45  * @syscap SystemCapability.BundleManager.BundleFramework.Core
46  * @since 9
47  */
48 struct OH_NativeBundle_ApplicationInfo {
49     /**
50      * Indicates the name of application
51      * @syscap SystemCapability.BundleManager.BundleFramework.Core
52      * @since 9
53      */
54     char* bundleName;
55 
56     /**
57      * Indicates the fingerprint of application
58      * @syscap SystemCapability.BundleManager.BundleFramework.Core
59      * @since 9
60      */
61     char* fingerprint;
62 };
63 
64 /**
65  * @brief Indicates information of application
66  *
67  * @since 11
68  * @version 1.0
69  */
70 typedef struct OH_NativeBundle_ApplicationInfo OH_NativeBundle_ApplicationInfo;
71 
72 /**
73  * @brief Obtains the application info based on the The current bundle.
74  *
75  * @return Returns the application info.
76  * @since 9
77  * @version 1.0
78  */
79 OH_NativeBundle_ApplicationInfo OH_NativeBundle_GetCurrentApplicationInfo();
80 
81 /**
82  * @brief Obtains the appId of application. AppId indicates the ID of the application to which this bundle belongs
83  * The application ID uniquely identifies an application. It is determined by the bundle name and signature.
84  * After utilizing this interface, to prevent memory leaks,
85  * it is necessary to manually release the pointer returned by the interface.
86  *
87  * @return Returns the appId info.
88  * @since 11
89  * @version 1.0
90  */
91 char* OH_NativeBundle_GetAppId();
92 
93 /**
94  * @brief Obtains the appIdentifier of application. AppIdentifier does not change along the application lifecycle,
95  * including version updates, certificate changes, public and private key changes, and application transfer.
96  * After utilizing this interface, to prevent memory leaks,
97  * it is necessary to manually release the pointer returned by the interface.
98  *
99  * @return Returns the appIdentifier info.
100  * @since 11
101  * @version 1.0
102  */
103 char* OH_NativeBundle_GetAppIdentifier();
104 #ifdef __cplusplus
105 };
106 #endif
107 /** @} */
108 #endif // FOUNDATION_APPEXECFWK_STANDARD_KITS_APPKIT_NATIVE_BUNDLE_INCLUDE_NATIVE_INTERFACE_BUNDLE_H
109