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 targetBundleName of app AppJson. 126 */ 127 private String targetBundleName = ""; 128 129 /** 130 * Indicates the targetPriority of app AppJson. 131 */ 132 private int targetPriority = 0; 133 134 /** 135 * Indicates the labels of app AppJson, for multilingual. 136 */ 137 private HashMap<String, String> labels = new HashMap<>(); 138 139 /** 140 * Indicates the descriptions of app AppJson, for multilingual. 141 */ 142 private HashMap<String, String> descriptions = new HashMap<>(); 143 144 /** 145 * Indicates the iconId of app AppJson. 146 */ 147 private int iconId = 0; 148 149 /** 150 * Indicates the labelId of app AppJson. 151 */ 152 private int labelId = 0; 153 154 /** 155 * Get shell version code. 156 * 157 * @return shell version code 158 */ getShellVersionCode()159 public String getShellVersionCode() { 160 return shellVersionCode; 161 } 162 163 /** 164 * Set shell version code. 165 * 166 * @param shellVersionCode Indicates the shell version name 167 */ setShellVersionCode(String shellVersionCode)168 public void setShellVersionCode(String shellVersionCode) { 169 this.shellVersionCode = shellVersionCode; 170 } 171 172 /** 173 * Get shell version name. 174 * 175 * @return shell version name 176 */ getShellVersionName()177 public String getShellVersionName() { 178 return shellVersionName; 179 } 180 181 /** 182 * Get bundle type. 183 * 184 * @return bundle type 185 */ getBundleType()186 public String getBundleType() { 187 return bundleType; 188 } 189 190 /** 191 * Set shell version name. 192 * 193 * @param shellVersionName Indicates the shell version name 194 */ setShellVersionName(String shellVersionName)195 public void setShellVersionName(String shellVersionName) { 196 this.shellVersionName = shellVersionName; 197 } 198 199 /** 200 * Whether the app is multi framework bundle. 201 * 202 * @return true if the app is a multi framework bundle. 203 */ isMultiFrameworkBundle()204 public boolean isMultiFrameworkBundle() { 205 return multiFrameworkBundle; 206 } 207 208 /** 209 * Set multi framework bundle. 210 * 211 * @param multiFrameworkBundle Indicates the app type 212 */ setMultiFrameworkBundle(boolean multiFrameworkBundle)213 public void setMultiFrameworkBundle(boolean multiFrameworkBundle) { 214 this.multiFrameworkBundle = multiFrameworkBundle; 215 } 216 217 /** 218 * Set default shell version 219 */ setDefaultShellVersion()220 public void setDefaultShellVersion() { 221 this.shellVersionCode = versionCode; 222 this.shellVersionName = versionName; 223 } 224 225 /** 226 * Set bundle type 227 * 228 * @param type bundle type 229 */ setBundleType(String type)230 public void setBundleType(String type) { 231 bundleType = type; 232 } 233 setDescriptions(HashMap<String, String> descriptions)234 public void setDescriptions(HashMap<String, String> descriptions) { 235 this.descriptions = descriptions; 236 } 237 setLabels(HashMap<String, String> labels)238 public void setLabels(HashMap<String, String> labels) { 239 this.labels = labels; 240 } 241 getLabels()242 public HashMap<String, String> getLabels() { 243 return labels; 244 } 245 getDescriptions()246 public HashMap<String, String> getDescriptions() { 247 return descriptions; 248 } 249 getCompileSdkVersion()250 public String getCompileSdkVersion() { 251 return compileSdkVersion; 252 } 253 setCompileSdkVersion(String compileSdkVersion)254 public void setCompileSdkVersion(String compileSdkVersion) { 255 this.compileSdkVersion = compileSdkVersion; 256 } 257 getCompileSdkType()258 public String getCompileSdkType() { 259 return compileSdkType; 260 } 261 setCompileSdkType(String compileSdkType)262 public void setCompileSdkType(String compileSdkType) { 263 this.compileSdkType = compileSdkType; 264 } 265 getTargetBundleName()266 public String getTargetBundleName() { 267 return targetBundleName; 268 } 269 setTargetBundleName(String targetBundleName)270 public void setTargetBundleName(String targetBundleName) { 271 this.targetBundleName = targetBundleName; 272 } 273 getTargetPriority()274 public int getTargetPriority() { 275 return targetPriority; 276 } 277 setTargetPriority(int targetPriority)278 public void setTargetPriority(int targetPriority) { 279 this.targetPriority = targetPriority; 280 } 281 getIconId()282 public int getIconId() { 283 return iconId; 284 } 285 setIconId(int iconId)286 public void setIconId(int iconId) { 287 this.iconId = iconId; 288 } 289 getLabelId()290 public int getLabelId() { 291 return labelId; 292 } 293 setLabelId(int labelId)294 public void setLabelId(int labelId) { 295 this.labelId = labelId; 296 } 297 } 298