| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.content.pm.parsing; |
| 18 |
|
| 19 |
import android.annotation.NonNull; |
| 20 |
import android.annotation.Nullable; |
| 21 |
import android.content.pm.PackageInfo; |
| 22 |
import android.content.pm.VerifierInfo; |
| 23 |
|
| 24 |
import com.android.internal.util.ArrayUtils; |
| 25 |
import com.android.internal.util.CollectionUtils; |
| 26 |
import com.android.internal.util.DataClass; |
| 27 |
|
| 28 |
import java.util.ArrayList; |
| 29 |
import java.util.Collections; |
| 30 |
import java.util.List; |
| 31 |
import java.util.Set; |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
@DataClass(genConstructor = false, genConstDefs = false) |
| 39 |
public class PackageLite { |
| 40 |
|
| 41 |
private final @NonNull String mPackageName; |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
private final @NonNull String mPath; |
| 48 |
|
| 49 |
private final @NonNull String mBaseApkPath; |
| 50 |
|
| 51 |
private final @Nullable String[] mSplitApkPaths; |
| 52 |
|
| 53 |
private final @Nullable String[] mSplitNames; |
| 54 |
|
| 55 |
private final @Nullable String[] mUsesSplitNames; |
| 56 |
private final @Nullable String[] mConfigForSplit; |
| 57 |
|
| 58 |
private final @Nullable Set<String> mBaseRequiredSplitTypes; |
| 59 |
|
| 60 |
private final @Nullable Set<String>[] mRequiredSplitTypes; |
| 61 |
|
| 62 |
private final @Nullable Set<String>[] mSplitTypes; |
| 63 |
|
| 64 |
private final int mVersionCodeMajor; |
| 65 |
private final int mVersionCode; |
| 66 |
private final int mTargetSdk; |
| 67 |
|
| 68 |
private final int mBaseRevisionCode; |
| 69 |
|
| 70 |
private final @Nullable int[] mSplitRevisionCodes; |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
private final int mInstallLocation; |
| 79 |
|
| 80 |
private final @NonNull VerifierInfo[] mVerifiers; |
| 81 |
|
| 82 |
|
| 83 |
private final @Nullable boolean[] mIsFeatureSplits; |
| 84 |
|
| 85 |
private final boolean mIsolatedSplits; |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
private final boolean mSplitRequired; |
| 91 |
|
| 92 |
private final boolean mCoreApp; |
| 93 |
|
| 94 |
private final boolean mDebuggable; |
| 95 |
|
| 96 |
private final boolean mMultiArch; |
| 97 |
|
| 98 |
private final boolean mUse32bitAbi; |
| 99 |
|
| 100 |
private final boolean mExtractNativeLibs; |
| 101 |
|
| 102 |
private final boolean mProfileableByShell; |
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
private final boolean mUseEmbeddedDex; |
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
private final boolean mIsSdkLibrary; |
| 112 |
|
| 113 |
public PackageLite(String path, String baseApkPath, ApkLite baseApk, |
| 114 |
String[] splitNames, boolean[] isFeatureSplits, String[] usesSplitNames, |
| 115 |
String[] configForSplit, String[] splitApkPaths, int[] splitRevisionCodes, |
| 116 |
int targetSdk, Set<String>[] requiredSplitTypes, Set<String>[] splitTypes) { |
| 117 |
|
| 118 |
|
| 119 |
mPath = path; |
| 120 |
mBaseApkPath = baseApkPath; |
| 121 |
mPackageName = baseApk.getPackageName(); |
| 122 |
mVersionCode = baseApk.getVersionCode(); |
| 123 |
mVersionCodeMajor = baseApk.getVersionCodeMajor(); |
| 124 |
mInstallLocation = baseApk.getInstallLocation(); |
| 125 |
mVerifiers = baseApk.getVerifiers(); |
| 126 |
mBaseRevisionCode = baseApk.getRevisionCode(); |
| 127 |
mCoreApp = baseApk.isCoreApp(); |
| 128 |
mDebuggable = baseApk.isDebuggable(); |
| 129 |
mMultiArch = baseApk.isMultiArch(); |
| 130 |
mUse32bitAbi = baseApk.isUse32bitAbi(); |
| 131 |
mExtractNativeLibs = baseApk.isExtractNativeLibs(); |
| 132 |
mIsolatedSplits = baseApk.isIsolatedSplits(); |
| 133 |
mUseEmbeddedDex = baseApk.isUseEmbeddedDex(); |
| 134 |
mBaseRequiredSplitTypes = baseApk.getRequiredSplitTypes(); |
| 135 |
mRequiredSplitTypes = requiredSplitTypes; |
| 136 |
mSplitRequired = (baseApk.isSplitRequired() || hasAnyRequiredSplitTypes()); |
| 137 |
mProfileableByShell = baseApk.isProfileableByShell(); |
| 138 |
mIsSdkLibrary = baseApk.isIsSdkLibrary(); |
| 139 |
mSplitNames = splitNames; |
| 140 |
mSplitTypes = splitTypes; |
| 141 |
mIsFeatureSplits = isFeatureSplits; |
| 142 |
mUsesSplitNames = usesSplitNames; |
| 143 |
mConfigForSplit = configForSplit; |
| 144 |
mSplitApkPaths = splitApkPaths; |
| 145 |
mSplitRevisionCodes = splitRevisionCodes; |
| 146 |
mTargetSdk = targetSdk; |
| 147 |
} |
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
public List<String> getAllApkPaths() { |
| 153 |
final ArrayList<String> paths = new ArrayList<>(); |
| 154 |
paths.add(mBaseApkPath); |
| 155 |
if (!ArrayUtils.isEmpty(mSplitApkPaths)) { |
| 156 |
Collections.addAll(paths, mSplitApkPaths); |
| 157 |
} |
| 158 |
return paths; |
| 159 |
} |
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
public long getLongVersionCode() { |
| 166 |
return PackageInfo.composeLongVersionCode(mVersionCodeMajor, mVersionCode); |
| 167 |
} |
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
private boolean hasAnyRequiredSplitTypes() { |
| 173 |
if (!CollectionUtils.isEmpty(mBaseRequiredSplitTypes)) { |
| 174 |
return true; |
| 175 |
} |
| 176 |
return ArrayUtils.find(mRequiredSplitTypes, r -> !CollectionUtils.isEmpty(r)) != null; |
| 177 |
} |
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
@DataClass.Generated.Member |
| 198 |
public @NonNull String getPackageName() { |
| 199 |
return mPackageName; |
| 200 |
} |
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
@DataClass.Generated.Member |
| 208 |
public @NonNull String getPath() { |
| 209 |
return mPath; |
| 210 |
} |
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
@DataClass.Generated.Member |
| 216 |
public @NonNull String getBaseApkPath() { |
| 217 |
return mBaseApkPath; |
| 218 |
} |
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
@DataClass.Generated.Member |
| 224 |
public @Nullable String[] getSplitApkPaths() { |
| 225 |
return mSplitApkPaths; |
| 226 |
} |
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
@DataClass.Generated.Member |
| 232 |
public @Nullable String[] getSplitNames() { |
| 233 |
return mSplitNames; |
| 234 |
} |
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
@DataClass.Generated.Member |
| 240 |
public @Nullable String[] getUsesSplitNames() { |
| 241 |
return mUsesSplitNames; |
| 242 |
} |
| 243 |
|
| 244 |
@DataClass.Generated.Member |
| 245 |
public @Nullable String[] getConfigForSplit() { |
| 246 |
return mConfigForSplit; |
| 247 |
} |
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
@DataClass.Generated.Member |
| 253 |
public @Nullable Set<String> getBaseRequiredSplitTypes() { |
| 254 |
return mBaseRequiredSplitTypes; |
| 255 |
} |
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
@DataClass.Generated.Member |
| 261 |
public @Nullable Set<String>[] getRequiredSplitTypes() { |
| 262 |
return mRequiredSplitTypes; |
| 263 |
} |
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
@DataClass.Generated.Member |
| 269 |
public @Nullable Set<String>[] getSplitTypes() { |
| 270 |
return mSplitTypes; |
| 271 |
} |
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
@DataClass.Generated.Member |
| 277 |
public int getVersionCodeMajor() { |
| 278 |
return mVersionCodeMajor; |
| 279 |
} |
| 280 |
|
| 281 |
@DataClass.Generated.Member |
| 282 |
public int getVersionCode() { |
| 283 |
return mVersionCode; |
| 284 |
} |
| 285 |
|
| 286 |
@DataClass.Generated.Member |
| 287 |
public int getTargetSdk() { |
| 288 |
return mTargetSdk; |
| 289 |
} |
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
@DataClass.Generated.Member |
| 295 |
public int getBaseRevisionCode() { |
| 296 |
return mBaseRevisionCode; |
| 297 |
} |
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
@DataClass.Generated.Member |
| 303 |
public @Nullable int[] getSplitRevisionCodes() { |
| 304 |
return mSplitRevisionCodes; |
| 305 |
} |
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
@DataClass.Generated.Member |
| 315 |
public int getInstallLocation() { |
| 316 |
return mInstallLocation; |
| 317 |
} |
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
|
| 322 |
@DataClass.Generated.Member |
| 323 |
public @NonNull VerifierInfo[] getVerifiers() { |
| 324 |
return mVerifiers; |
| 325 |
} |
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
@DataClass.Generated.Member |
| 331 |
public @Nullable boolean[] getIsFeatureSplits() { |
| 332 |
return mIsFeatureSplits; |
| 333 |
} |
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
@DataClass.Generated.Member |
| 339 |
public boolean isIsolatedSplits() { |
| 340 |
return mIsolatedSplits; |
| 341 |
} |
| 342 |
|
| 343 |
|
| 344 |
|
| 345 |
|
| 346 |
|
| 347 |
@DataClass.Generated.Member |
| 348 |
public boolean isSplitRequired() { |
| 349 |
return mSplitRequired; |
| 350 |
} |
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
@DataClass.Generated.Member |
| 356 |
public boolean isCoreApp() { |
| 357 |
return mCoreApp; |
| 358 |
} |
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
@DataClass.Generated.Member |
| 364 |
public boolean isDebuggable() { |
| 365 |
return mDebuggable; |
| 366 |
} |
| 367 |
|
| 368 |
|
| 369 |
|
| 370 |
|
| 371 |
@DataClass.Generated.Member |
| 372 |
public boolean isMultiArch() { |
| 373 |
return mMultiArch; |
| 374 |
} |
| 375 |
|
| 376 |
|
| 377 |
|
| 378 |
|
| 379 |
@DataClass.Generated.Member |
| 380 |
public boolean isUse32bitAbi() { |
| 381 |
return mUse32bitAbi; |
| 382 |
} |
| 383 |
|
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
@DataClass.Generated.Member |
| 388 |
public boolean isExtractNativeLibs() { |
| 389 |
return mExtractNativeLibs; |
| 390 |
} |
| 391 |
|
| 392 |
|
| 393 |
|
| 394 |
|
| 395 |
@DataClass.Generated.Member |
| 396 |
public boolean isProfileableByShell() { |
| 397 |
return mProfileableByShell; |
| 398 |
} |
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
|
| 403 |
|
| 404 |
@DataClass.Generated.Member |
| 405 |
public boolean isUseEmbeddedDex() { |
| 406 |
return mUseEmbeddedDex; |
| 407 |
} |
| 408 |
|
| 409 |
|
| 410 |
|
| 411 |
|
| 412 |
@DataClass.Generated.Member |
| 413 |
public boolean isIsSdkLibrary() { |
| 414 |
return mIsSdkLibrary; |
| 415 |
} |
| 416 |
|
| 417 |
@DataClass.Generated( |
| 418 |
time = 1643132127068L, |
| 419 |
codegenVersion = "1.0.23", |
| 420 |
sourceFile = "frameworks/base/core/java/android/content/pm/parsing/PackageLite.java", |
| 421 |
inputSignatures = |
| 422 |
"private final @android.annotation.NonNull java.lang.String mPackageName\nprivate final @android.annotation.NonNull java.lang.String mPath\nprivate final @android.annotation.NonNull java.lang.String mBaseApkPath\nprivate final @android.annotation.Nullable java.lang.String[] mSplitApkPaths\nprivate final @android.annotation.Nullable java.lang.String[] mSplitNames\nprivate final @android.annotation.Nullable java.lang.String[] mUsesSplitNames\nprivate final @android.annotation.Nullable java.lang.String[] mConfigForSplit\nprivate final @android.annotation.Nullable java.util.Set<java.lang.String> mBaseRequiredSplitTypes\nprivate final @android.annotation.Nullable java.util.Set<java.lang.String>[] mRequiredSplitTypes\nprivate final @android.annotation.Nullable java.util.Set<java.lang.String>[] mSplitTypes\nprivate final int mVersionCodeMajor\nprivate final int mVersionCode\nprivate final int mTargetSdk\nprivate final int mBaseRevisionCode\nprivate final @android.annotation.Nullable int[] mSplitRevisionCodes\nprivate final int mInstallLocation\nprivate final @android.annotation.NonNull android.content.pm.VerifierInfo[] mVerifiers\nprivate final @android.annotation.Nullable boolean[] mIsFeatureSplits\nprivate final boolean mIsolatedSplits\nprivate final boolean mSplitRequired\nprivate final boolean mCoreApp\nprivate final boolean mDebuggable\nprivate final boolean mMultiArch\nprivate final boolean mUse32bitAbi\nprivate final boolean mExtractNativeLibs\nprivate final boolean mProfileableByShell\nprivate final boolean mUseEmbeddedDex\nprivate final boolean mIsSdkLibrary\npublic java.util.List<java.lang.String> getAllApkPaths()\npublic long getLongVersionCode()\nprivate boolean hasAnyRequiredSplitTypes()\nclass PackageLite extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genConstructor=false, genConstDefs=false)") |
| 423 |
@Deprecated |
| 424 |
private void __metadata() {} |
| 425 |
|
| 426 |
|
| 427 |
|
| 428 |
|
| 429 |
|
| 430 |
} |