1 /* 2 * Copyright (c) 2021 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 package ohos; 17 18 import java.util.HashMap; 19 20 /** 21 * App AppInfo info. 22 * 23 */ 24 public class AppInfo { 25 /** 26 * Indicates the bundleName of app AppInfo. 27 */ 28 public String bundleName = ""; 29 30 /** 31 * Indicates the vendor of app AppInfo. 32 */ 33 public String vendor = ""; 34 35 /** 36 * Indicates the relatedBundleName of app AppInfo. 37 */ 38 public String relatedBundleName = ""; 39 40 /** 41 * Indicates the versionName of app AppInfo. 42 */ 43 public String versionName = ""; 44 45 /** 46 * Indicates the versionCode of app AppInfo. 47 */ 48 public String versionCode = ""; 49 50 /** 51 * Indicates the target Api Version of app AppInfo. 52 */ 53 public int targetApiVersion = 1; 54 55 /** 56 * Indicates the compatible Api Version of app AppInfo. 57 */ 58 public int compatibleApiVersion = 1; 59 60 /** 61 * Indicates the appName of app AppInfo. 62 */ 63 public String appName = ""; 64 65 /** 66 * Indicates the appNameEN of app AppInfo. 67 */ 68 public String appNameEN = ""; 69 70 /** 71 * Indicates the releaseType of app AppInfo. 72 */ 73 public String releaseType = ""; 74 75 private String shellVersionCode = ""; 76 private String shellVersionName = ""; 77 private boolean multiFrameworkBundle; 78 79 /** 80 * Indicates the debug of app AppJson. 81 */ 82 public boolean debug = false; 83 84 /** 85 * Indicates the icon of app AppJson. 86 */ 87 public String icon = ""; 88 89 /** 90 * Indicates the label of app AppJson. 91 */ 92 public String label = ""; 93 94 /** 95 * Indicates the description of app AppJson. 96 */ 97 public String description = ""; 98 99 /** 100 * Indicates the minCompatibleVersionCode of app AppJson. 101 */ 102 public int minCompatibleVersionCode = -1; 103 104 /** 105 * Indicates the distributedNotificationEnabled of app AppJson. 106 */ 107 public boolean distributedNotificationEnabled = false; 108 109 /** 110 * Indicates the type of bundle. 111 */ 112 private String bundleType = "app"; 113 114 /** 115 * Indicates the sdk version the app was compiled. 116 */ 117 private String compileSdkVersion = ""; 118 119 /** 120 * Indicates the sdk type the app was compiled. 121 */ 122 private String compileSdkType = ""; 123 124 /** 125 * Indicates the labels of app AppJson, for multilingual. 126 */ 127 private HashMap<String, String> labels = new HashMap<>(); 128 129 /** 130 * Indicates the descriptions of app AppJson, for multilingual. 131 */ 132 private HashMap<String, String> descriptions = new HashMap<>(); 133 134 /** 135 * Get shell version code. 136 * 137 * @return shell version code 138 */ getShellVersionCode()139 public String getShellVersionCode() { 140 return shellVersionCode; 141 } 142 143 /** 144 * Set shell version code. 145 * 146 * @param shellVersionCode Indicates the shell version name 147 */ setShellVersionCode(String shellVersionCode)148 public void setShellVersionCode(String shellVersionCode) { 149 this.shellVersionCode = shellVersionCode; 150 } 151 152 /** 153 * Get shell version name. 154 * 155 * @return shell version name 156 */ getShellVersionName()157 public String getShellVersionName() { 158 return shellVersionName; 159 } 160 161 /** 162 * Get bundle type. 163 * 164 * @return bundle type 165 */ getBundleType()166 public String getBundleType() { 167 return bundleType; 168 } 169 170 /** 171 * Set shell version name. 172 * 173 * @param shellVersionName Indicates the shell version name 174 */ setShellVersionName(String shellVersionName)175 public void setShellVersionName(String shellVersionName) { 176 this.shellVersionName = shellVersionName; 177 } 178 179 /** 180 * Whether the app is multi framework bundle. 181 * 182 * @return true if the app is a multi framework bundle. 183 */ isMultiFrameworkBundle()184 public boolean isMultiFrameworkBundle() { 185 return multiFrameworkBundle; 186 } 187 188 /** 189 * Set multi framework bundle. 190 * 191 * @param multiFrameworkBundle Indicates the app type 192 */ setMultiFrameworkBundle(boolean multiFrameworkBundle)193 public void setMultiFrameworkBundle(boolean multiFrameworkBundle) { 194 this.multiFrameworkBundle = multiFrameworkBundle; 195 } 196 197 /** 198 * Set default shell version 199 */ setDefaultShellVersion()200 public void setDefaultShellVersion() { 201 this.shellVersionCode = versionCode; 202 this.shellVersionName = versionName; 203 } 204 205 /** 206 * Set bundle type 207 * 208 * @param type bundle type 209 */ setBundleType(String type)210 public void setBundleType(String type) { 211 bundleType = type; 212 } 213 setDescriptions(HashMap<String, String> descriptions)214 public void setDescriptions(HashMap<String, String> descriptions) { 215 this.descriptions = descriptions; 216 } 217 setLabels(HashMap<String, String> labels)218 public void setLabels(HashMap<String, String> labels) { 219 this.labels = labels; 220 } 221 getLabels()222 public HashMap<String, String> getLabels() { 223 return labels; 224 } 225 getDescriptions()226 public HashMap<String, String> getDescriptions() { 227 return descriptions; 228 } 229 getCompileSdkVersion()230 public String getCompileSdkVersion() { 231 return compileSdkVersion; 232 } 233 setCompileSdkVersion(String compileSdkVersion)234 public void setCompileSdkVersion(String compileSdkVersion) { 235 this.compileSdkVersion = compileSdkVersion; 236 } 237 getCompileSdkType()238 public String getCompileSdkType() { 239 return compileSdkType; 240 } 241 setCompileSdkType(String compileSdkType)242 public void setCompileSdkType(String compileSdkType) { 243 this.compileSdkType = compileSdkType; 244 } 245 } 246