• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 #ifndef DEVELOPTOOLS_PACKING_TOOL_APT_FRAMEWORKS_INCLUDE_HAP_VERIFY_INFO_H
17 #define DEVELOPTOOLS_PACKING_TOOL_APT_FRAMEWORKS_INCLUDE_HAP_VERIFY_INFO_H
18 
19 #include <list>
20 #include <map>
21 #include <string>
22 
23 #include "dependency_item.h"
24 #include "distro_filter.h"
25 #include "module_api_version.h"
26 #include "multi_app_mode.h"
27 #include "preload_item.h"
28 #include "version.h"
29 
30 namespace OHOS {
31 namespace AppPackingTool {
32 class HapVerifyInfo {
33 public:
HapVerifyInfo()34     HapVerifyInfo() {};
~HapVerifyInfo()35     virtual ~HapVerifyInfo() {};
36 
37     const std::string& GetBundleName() const;
38     void SetBundleName(const std::string& bundleName);
39     const std::string& GetVendor() const;
40     void SetVendor(const std::string& vendor);
41     const Version& GetVersion() const;
42     void SetVersion(const Version& version);
43     const ModuleApiVersion& GetApiVersion() const;
44     void SetApiVersion(const ModuleApiVersion& apiVersion);
45     const std::string& GetModuleName() const;
46     void SetModuleName(const std::string& moduleName);
47     const std::string& GetPackageName() const;
48     void SetPackageName(const std::string& packageName);
49     const std::list<std::string>& GetAbilityNames() const;
50     void SetAbilityNames(const std::list<std::string>& abilityNames);
51     void AddAbilityNames(const std::list<std::string>& nameList);
52     const DistroFilter& GetDistroFilter() const;
53     void SetDistroFilter(const DistroFilter& distroFilter);
54     const std::list<std::string>& GetDeviceTypes() const;
55     void SetDeviceTypes(const std::list<std::string>& deviceTypes);
56     const bool& IsStageModule() const;
57     void SetStageModule(const bool& isStageModule);
58     const std::string& GetModuleType() const;
59     void SetModuleType(const std::string& moduleType);
60     const bool& IsInstallationFree() const;
61     void SetInstallationFree(const bool& isInstallationFree);
62     const std::list<std::string>& GetDependencies() const;
63     void SetDependencies(const std::list<std::string>& dependencies);
64     const std::list<DependencyItem>& GetDependencyItemList() const;
65     void SetDependencyItemList(const std::list<DependencyItem>& dependencyItemList);
66     const std::string& GetProfileStr() const;
67     void SetProfileStr(const std::string& profileStr);
68     const std::map<std::string, std::string>& GetResourceMap() const;
69     void SetResourceMap(const std::map<std::string, std::string>& resourceMap);
70     const std::string& GetBundleType() const;
71     void SetBundleType(const std::string& bundleType);
72     const std::string& GetAtomicServiceType() const;
73     void SetAtomicServiceType(const std::string& atomicServiceType);
74     const std::list<PreloadItem>& GetPreloadItems() const;
75     void SetPreloadItems(const std::list<PreloadItem>& preloadItems);
76     const std::string& GetTargetBundleName() const;
77     void SetTargetBundleName(const std::string& targetBundleName);
78     const int32_t& GetTargetPriority() const;
79     void SetTargetPriority(const int32_t& priority);
80     const std::string& GetTargetModuleName() const;
81     void SetTargetModuleName(const std::string& targetModuleName);
82     const int32_t& GetTargetModulePriority() const;
83     void SetTargetModulePriority(const int32_t& priority);
84     const int64_t& GetFileLength() const;
85     void SetFileLength(const int64_t& fileLength);
86     const int32_t& GetEntrySizeLimit() const;
87     void SetEntrySizeLimit(const int32_t& limit);
88     const int32_t& GetNotEntrySizeLimit() const;
89     void SetNotEntrySizeLimit(const int32_t& notEntrySizeLimit);
90     const int32_t& GetSumSizeLimit() const;
91     void SetSumSizeLimit(const int32_t& sumSizeLimit);
92     const bool& IsDebug() const;
93     void SetDebug(const bool& debug);
94     const std::string& GetCompileSdkVersion() const;
95     void SetCompileSdkVersion(const std::string& compileSdkVersion);
96     const std::string& GetCompileSdkType() const;
97     void SetCompileSdkType(const std::string& compileSdkType);
98     const std::list<std::string>& GetProxyDataUris() const;
99     void SetProxyDataUris(const std::list<std::string>& proxyDataUris);
100     const std::map<std::string, std::list<std::string>>& GetContinueTypeMap() const;
101     void SetContinueTypeMap(const std::map<std::string, std::list<std::string>>& continueTypeMap);
102     const MultiAppMode& GetMultiAppMode() const;
103     void SetMultiAppMode(const MultiAppMode& multiAppMode);
104     const std::string& GetFileType() const;
105     void SetFileType(const std::string& fileType);
106     const std::list<std::string>& GetAssetAccessGroups() const;
107     void SetAssetAccessGroups(const std::list<std::string>& assetAccessGroups);
108 
109 private:
110     void ConvertToDependency();
111 
112 private:
113     std::string bundleName_ = "";
114     std::string vendor_ = "";
115     Version version_;
116     ModuleApiVersion apiVersion_;
117     std::string moduleName_ = "";
118     std::string packageName_ = "";
119     std::list<std::string> abilityNames_;
120     DistroFilter distroFilter_;
121     std::list<std::string> deviceTypes_;
122     bool isStageModule_ = true;
123     std::string moduleType_ = "";
124     std::string atomicServiceType_ = "";
125     bool isInstallationFree_ = false;
126     std::list<std::string> dependencies_;
127     std::list<DependencyItem> dependencyItemList_;
128     // json file content string
129     std::string profileStr_ = "";
130     std::map<std::string, std::string> resourceMap_;
131     std::string bundleType_ = "app";
132     std::string targetBundleName_ = "";
133     int32_t targetPriority_ = 0;
134     std::string targetModuleName_ = "";
135     int32_t targetModulePriority_ = 0;
136     std::list<PreloadItem> preloadItems_;
137     // json file size
138     int64_t fileLength_ = 0L;
139     int32_t entrySizeLimit_ = 2;
140     int32_t notEntrySizeLimit_ = 2;
141     int32_t sumSizeLimit_ = 10;
142     bool debug_ = false;
143     std::string compileSdkVersion_ = "";
144     std::string compileSdkType_ = "";
145     std::list<std::string> proxyDataUris_;
146     std::list<std::string> assetAccessGroups_;
147     std::map<std::string, std::list<std::string>> continueTypeMap_;
148     MultiAppMode multiAppMode_;
149     std::string fileType_ = "";
150 };
151 }  // namespace AppPackingTool
152 }  // namespace OHOS
153 #endif  // DEVELOPTOOLS_PACKING_TOOL_APT_FRAMEWORKS_INCLUDE_HAP_VERIFY_INFO_H
154