1 /* 2 * Copyright (C) 2021-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 #ifndef PROVISION_INFO_H 16 #define PROVISION_INFO_H 17 18 #include <string> 19 #include <vector> 20 21 namespace OHOS { 22 namespace Security { 23 namespace Verify { 24 enum ProvisionType { 25 DEBUG = 0, 26 RELEASE = 1, 27 }; 28 29 enum AppDistType { 30 NONE_TYPE = 0, 31 APP_GALLERY = 1, 32 ENTERPRISE = 2, 33 OS_INTEGRATION = 3, 34 CROWDTESTING = 4, 35 }; 36 37 struct BundleInfo { 38 std::string developerId; 39 std::string developmentCertificate; 40 std::string distributionCertificate; 41 std::string bundleName; 42 std::string apl; 43 std::string appFeature; 44 }; 45 46 struct Acls { 47 std::vector<std::string> allowedAcls; 48 }; 49 50 struct Permissions { 51 std::vector<std::string> restrictedPermissions; 52 std::vector<std::string> restrictedCapabilities; 53 }; 54 55 struct DebugInfo { 56 std::string deviceIdType; 57 std::vector<std::string> deviceIds; 58 }; 59 60 struct Metadata { 61 std::string name; 62 std::string value; 63 std::string resource; 64 }; 65 66 struct ProvisionInfo { 67 int32_t versionCode = 0; 68 std::string versionName; 69 std::string uuid; 70 ProvisionType type = DEBUG; 71 AppDistType distributionType = NONE_TYPE; 72 BundleInfo bundleInfo; 73 Acls acls; 74 Permissions permissions; 75 DebugInfo debugInfo; 76 std::string issuer; 77 std::string appId; 78 std::string fingerprint; 79 std::vector<std::string> appPrivilegeCapabilities; 80 std::vector<Metadata> metadatas; 81 }; 82 } // namespace Verify 83 } // namespace Security 84 } // namespace OHOS 85 #endif // PROVISION_INFO_H 86