1 /* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.internal.pm.pkg.parsing; 18 19 import android.annotation.CallSuper; 20 import android.annotation.NonNull; 21 import android.annotation.Nullable; 22 import android.content.Intent; 23 import android.content.pm.ApplicationInfo; 24 import android.content.pm.ConfigurationInfo; 25 import android.content.pm.FeatureGroupInfo; 26 import android.content.pm.FeatureInfo; 27 import android.content.pm.PackageManager; 28 import android.content.pm.SigningDetails; 29 import android.os.Bundle; 30 import android.util.ArraySet; 31 import android.util.SparseArray; 32 import android.util.SparseIntArray; 33 34 import com.android.internal.R; 35 import com.android.internal.pm.parsing.pkg.ParsedPackage; 36 import com.android.internal.pm.pkg.component.ParsedActivity; 37 import com.android.internal.pm.pkg.component.ParsedApexSystemService; 38 import com.android.internal.pm.pkg.component.ParsedAttribution; 39 import com.android.internal.pm.pkg.component.ParsedInstrumentation; 40 import com.android.internal.pm.pkg.component.ParsedIntentInfo; 41 import com.android.internal.pm.pkg.component.ParsedPermission; 42 import com.android.internal.pm.pkg.component.ParsedPermissionGroup; 43 import com.android.internal.pm.pkg.component.ParsedProcess; 44 import com.android.internal.pm.pkg.component.ParsedProvider; 45 import com.android.internal.pm.pkg.component.ParsedService; 46 import com.android.internal.pm.pkg.component.ParsedUsesPermission; 47 48 import java.security.PublicKey; 49 import java.util.List; 50 import java.util.Map; 51 import java.util.Set; 52 53 /** 54 * Methods used for mutation during direct package parsing. 55 * 56 * @hide 57 */ 58 @SuppressWarnings("UnusedReturnValue") 59 public interface ParsingPackage { 60 addActivity(ParsedActivity parsedActivity)61 ParsingPackage addActivity(ParsedActivity parsedActivity); 62 addAdoptPermission(String adoptPermission)63 ParsingPackage addAdoptPermission(String adoptPermission); 64 addApexSystemService(ParsedApexSystemService parsedApexSystemService)65 ParsingPackage addApexSystemService(ParsedApexSystemService parsedApexSystemService); 66 addConfigPreference(ConfigurationInfo configPreference)67 ParsingPackage addConfigPreference(ConfigurationInfo configPreference); 68 addFeatureGroup(FeatureGroupInfo featureGroup)69 ParsingPackage addFeatureGroup(FeatureGroupInfo featureGroup); 70 addImplicitPermission(String permission)71 ParsingPackage addImplicitPermission(String permission); 72 addInstrumentation(ParsedInstrumentation instrumentation)73 ParsingPackage addInstrumentation(ParsedInstrumentation instrumentation); 74 addKeySet(String keySetName, PublicKey publicKey)75 ParsingPackage addKeySet(String keySetName, PublicKey publicKey); 76 addLibraryName(String libraryName)77 ParsingPackage addLibraryName(String libraryName); 78 addOriginalPackage(String originalPackage)79 ParsingPackage addOriginalPackage(String originalPackage); 80 addOverlayable(String overlayableName, String actorName)81 ParsingPackage addOverlayable(String overlayableName, String actorName); 82 addPermission(ParsedPermission permission)83 ParsingPackage addPermission(ParsedPermission permission); 84 addPermissionGroup(ParsedPermissionGroup permissionGroup)85 ParsingPackage addPermissionGroup(ParsedPermissionGroup permissionGroup); 86 addPreferredActivityFilter(String className, ParsedIntentInfo intentInfo)87 ParsingPackage addPreferredActivityFilter(String className, ParsedIntentInfo intentInfo); 88 89 /** Add a property to the application scope */ addProperty(PackageManager.Property property)90 ParsingPackage addProperty(PackageManager.Property property); 91 addProtectedBroadcast(String protectedBroadcast)92 ParsingPackage addProtectedBroadcast(String protectedBroadcast); 93 addProvider(ParsedProvider parsedProvider)94 ParsingPackage addProvider(ParsedProvider parsedProvider); 95 addAttribution(ParsedAttribution attribution)96 ParsingPackage addAttribution(ParsedAttribution attribution); 97 addReceiver(ParsedActivity parsedReceiver)98 ParsingPackage addReceiver(ParsedActivity parsedReceiver); 99 addReqFeature(FeatureInfo reqFeature)100 ParsingPackage addReqFeature(FeatureInfo reqFeature); 101 addUsesPermission(ParsedUsesPermission parsedUsesPermission)102 ParsingPackage addUsesPermission(ParsedUsesPermission parsedUsesPermission); 103 addService(ParsedService parsedService)104 ParsingPackage addService(ParsedService parsedService); 105 addUsesLibrary(String libraryName)106 ParsingPackage addUsesLibrary(String libraryName); 107 addUsesOptionalLibrary(String libraryName)108 ParsingPackage addUsesOptionalLibrary(String libraryName); 109 addUsesNativeLibrary(String libraryName)110 ParsingPackage addUsesNativeLibrary(String libraryName); 111 addUsesOptionalNativeLibrary(String libraryName)112 ParsingPackage addUsesOptionalNativeLibrary(String libraryName); 113 addUsesSdkLibrary(String libraryName, long versionMajor, String[] certSha256Digests, boolean usesSdkLibrariesOptional)114 ParsingPackage addUsesSdkLibrary(String libraryName, long versionMajor, 115 String[] certSha256Digests, boolean usesSdkLibrariesOptional); 116 addUsesStaticLibrary(String libraryName, long version, String[] certSha256Digests)117 ParsingPackage addUsesStaticLibrary(String libraryName, long version, 118 String[] certSha256Digests); 119 addQueriesIntent(Intent intent)120 ParsingPackage addQueriesIntent(Intent intent); 121 addQueriesPackage(String packageName)122 ParsingPackage addQueriesPackage(String packageName); 123 addQueriesProvider(String authority)124 ParsingPackage addQueriesProvider(String authority); 125 126 /** Sets a process name -> {@link ParsedProcess} map coming from the <processes> tag. */ setProcesses(@onNull Map<String, ParsedProcess> processes)127 ParsingPackage setProcesses(@NonNull Map<String, ParsedProcess> processes); 128 asSplit( String[] splitNames, String[] splitCodePaths, int[] splitRevisionCodes, @Nullable SparseArray<int[]> splitDependencies )129 ParsingPackage asSplit( 130 String[] splitNames, 131 String[] splitCodePaths, 132 int[] splitRevisionCodes, 133 @Nullable SparseArray<int[]> splitDependencies 134 ); 135 setMetaData(Bundle metaData)136 ParsingPackage setMetaData(Bundle metaData); 137 setForceQueryable(boolean forceQueryable)138 ParsingPackage setForceQueryable(boolean forceQueryable); 139 setMaxAspectRatio(float maxAspectRatio)140 ParsingPackage setMaxAspectRatio(float maxAspectRatio); 141 setMinAspectRatio(float minAspectRatio)142 ParsingPackage setMinAspectRatio(float minAspectRatio); 143 setPermission(String permission)144 ParsingPackage setPermission(String permission); 145 setProcessName(String processName)146 ParsingPackage setProcessName(String processName); 147 setSharedUserId(String sharedUserId)148 ParsingPackage setSharedUserId(String sharedUserId); 149 setStaticSharedLibraryName(String staticSharedLibName)150 ParsingPackage setStaticSharedLibraryName(String staticSharedLibName); 151 setTaskAffinity(String taskAffinity)152 ParsingPackage setTaskAffinity(String taskAffinity); 153 setTargetSdkVersion(int targetSdkVersion)154 ParsingPackage setTargetSdkVersion(int targetSdkVersion); 155 setUiOptions(int uiOptions)156 ParsingPackage setUiOptions(int uiOptions); 157 setHardwareAccelerated(boolean hardwareAccelerated)158 ParsingPackage setHardwareAccelerated(boolean hardwareAccelerated); 159 setResizeableActivity(Boolean resizeable)160 ParsingPackage setResizeableActivity(Boolean resizeable); 161 setResizeableActivityViaSdkVersion(boolean resizeableViaSdkVersion)162 ParsingPackage setResizeableActivityViaSdkVersion(boolean resizeableViaSdkVersion); 163 setAllowAudioPlaybackCapture(boolean allowAudioPlaybackCapture)164 ParsingPackage setAllowAudioPlaybackCapture(boolean allowAudioPlaybackCapture); 165 setBackupAllowed(boolean allowBackup)166 ParsingPackage setBackupAllowed(boolean allowBackup); 167 setClearUserDataAllowed(boolean allowClearUserData)168 ParsingPackage setClearUserDataAllowed(boolean allowClearUserData); 169 setClearUserDataOnFailedRestoreAllowed( boolean allowClearUserDataOnFailedRestore)170 ParsingPackage setClearUserDataOnFailedRestoreAllowed( 171 boolean allowClearUserDataOnFailedRestore); 172 setTaskReparentingAllowed(boolean allowTaskReparenting)173 ParsingPackage setTaskReparentingAllowed(boolean allowTaskReparenting); 174 setResourceOverlay(boolean isResourceOverlay)175 ParsingPackage setResourceOverlay(boolean isResourceOverlay); 176 setBackupInForeground(boolean backupInForeground)177 ParsingPackage setBackupInForeground(boolean backupInForeground); 178 setSaveStateDisallowed(boolean cantSaveState)179 ParsingPackage setSaveStateDisallowed(boolean cantSaveState); 180 setDebuggable(boolean debuggable)181 ParsingPackage setDebuggable(boolean debuggable); 182 setDefaultToDeviceProtectedStorage(boolean defaultToDeviceProtectedStorage)183 ParsingPackage setDefaultToDeviceProtectedStorage(boolean defaultToDeviceProtectedStorage); 184 setDirectBootAware(boolean directBootAware)185 ParsingPackage setDirectBootAware(boolean directBootAware); 186 setExternalStorage(boolean externalStorage)187 ParsingPackage setExternalStorage(boolean externalStorage); 188 setExtractNativeLibrariesRequested(boolean extractNativeLibs)189 ParsingPackage setExtractNativeLibrariesRequested(boolean extractNativeLibs); 190 setFullBackupOnly(boolean fullBackupOnly)191 ParsingPackage setFullBackupOnly(boolean fullBackupOnly); 192 setDeclaredHavingCode(boolean hasCode)193 ParsingPackage setDeclaredHavingCode(boolean hasCode); 194 setUserDataFragile(boolean hasFragileUserData)195 ParsingPackage setUserDataFragile(boolean hasFragileUserData); 196 setGame(boolean isGame)197 ParsingPackage setGame(boolean isGame); 198 setIsolatedSplitLoading(boolean isolatedSplitLoading)199 ParsingPackage setIsolatedSplitLoading(boolean isolatedSplitLoading); 200 setKillAfterRestoreAllowed(boolean killAfterRestore)201 ParsingPackage setKillAfterRestoreAllowed(boolean killAfterRestore); 202 setLargeHeap(boolean largeHeap)203 ParsingPackage setLargeHeap(boolean largeHeap); 204 setMultiArch(boolean multiArch)205 ParsingPackage setMultiArch(boolean multiArch); 206 setPartiallyDirectBootAware(boolean partiallyDirectBootAware)207 ParsingPackage setPartiallyDirectBootAware(boolean partiallyDirectBootAware); 208 setPersistent(boolean persistent)209 ParsingPackage setPersistent(boolean persistent); 210 setProfileableByShell(boolean profileableByShell)211 ParsingPackage setProfileableByShell(boolean profileableByShell); 212 setProfileable(boolean profileable)213 ParsingPackage setProfileable(boolean profileable); 214 setRequestLegacyExternalStorage(boolean requestLegacyExternalStorage)215 ParsingPackage setRequestLegacyExternalStorage(boolean requestLegacyExternalStorage); 216 setAllowNativeHeapPointerTagging(boolean allowNativeHeapPointerTagging)217 ParsingPackage setAllowNativeHeapPointerTagging(boolean allowNativeHeapPointerTagging); 218 setAutoRevokePermissions(int autoRevokePermissions)219 ParsingPackage setAutoRevokePermissions(int autoRevokePermissions); 220 setPreserveLegacyExternalStorage(boolean preserveLegacyExternalStorage)221 ParsingPackage setPreserveLegacyExternalStorage(boolean preserveLegacyExternalStorage); 222 setRestoreAnyVersion(boolean restoreAnyVersion)223 ParsingPackage setRestoreAnyVersion(boolean restoreAnyVersion); 224 setSdkLibraryName(String sdkLibName)225 ParsingPackage setSdkLibraryName(String sdkLibName); 226 setSdkLibVersionMajor(int sdkLibVersionMajor)227 ParsingPackage setSdkLibVersionMajor(int sdkLibVersionMajor); 228 setSdkLibrary(boolean sdkLibrary)229 ParsingPackage setSdkLibrary(boolean sdkLibrary); 230 setSplitHasCode(int splitIndex, boolean splitHasCode)231 ParsingPackage setSplitHasCode(int splitIndex, boolean splitHasCode); 232 setStaticSharedLibrary(boolean staticSharedLibrary)233 ParsingPackage setStaticSharedLibrary(boolean staticSharedLibrary); 234 setRtlSupported(boolean supportsRtl)235 ParsingPackage setRtlSupported(boolean supportsRtl); 236 setTestOnly(boolean testOnly)237 ParsingPackage setTestOnly(boolean testOnly); 238 setUseEmbeddedDex(boolean useEmbeddedDex)239 ParsingPackage setUseEmbeddedDex(boolean useEmbeddedDex); 240 setCleartextTrafficAllowed(boolean usesCleartextTraffic)241 ParsingPackage setCleartextTrafficAllowed(boolean usesCleartextTraffic); 242 setNonSdkApiRequested(boolean usesNonSdkApi)243 ParsingPackage setNonSdkApiRequested(boolean usesNonSdkApi); 244 setVisibleToInstantApps(boolean visibleToInstantApps)245 ParsingPackage setVisibleToInstantApps(boolean visibleToInstantApps); 246 setVmSafeMode(boolean vmSafeMode)247 ParsingPackage setVmSafeMode(boolean vmSafeMode); 248 removeUsesOptionalLibrary(String libraryName)249 ParsingPackage removeUsesOptionalLibrary(String libraryName); 250 removeUsesOptionalNativeLibrary(String libraryName)251 ParsingPackage removeUsesOptionalNativeLibrary(String libraryName); 252 setAnyDensity(int anyDensity)253 ParsingPackage setAnyDensity(int anyDensity); 254 setAppComponentFactory(String appComponentFactory)255 ParsingPackage setAppComponentFactory(String appComponentFactory); 256 setBackupAgentName(String backupAgentName)257 ParsingPackage setBackupAgentName(String backupAgentName); 258 setBannerResourceId(int banner)259 ParsingPackage setBannerResourceId(int banner); 260 setCategory(int category)261 ParsingPackage setCategory(int category); 262 setClassLoaderName(String classLoaderName)263 ParsingPackage setClassLoaderName(String classLoaderName); 264 setApplicationClassName(String className)265 ParsingPackage setApplicationClassName(String className); 266 setCompatibleWidthLimitDp(int compatibleWidthLimitDp)267 ParsingPackage setCompatibleWidthLimitDp(int compatibleWidthLimitDp); 268 setDescriptionResourceId(int descriptionRes)269 ParsingPackage setDescriptionResourceId(int descriptionRes); 270 setEnabled(boolean enabled)271 ParsingPackage setEnabled(boolean enabled); 272 setGwpAsanMode(@pplicationInfo.GwpAsanMode int gwpAsanMode)273 ParsingPackage setGwpAsanMode(@ApplicationInfo.GwpAsanMode int gwpAsanMode); 274 setMemtagMode(@pplicationInfo.MemtagMode int memtagMode)275 ParsingPackage setMemtagMode(@ApplicationInfo.MemtagMode int memtagMode); 276 setNativeHeapZeroInitialized( @pplicationInfo.NativeHeapZeroInitialized int nativeHeapZeroInitialized)277 ParsingPackage setNativeHeapZeroInitialized( 278 @ApplicationInfo.NativeHeapZeroInitialized int nativeHeapZeroInitialized); 279 setRequestRawExternalStorageAccess( @ullable Boolean requestRawExternalStorageAccess)280 ParsingPackage setRequestRawExternalStorageAccess( 281 @Nullable Boolean requestRawExternalStorageAccess); 282 setCrossProfile(boolean crossProfile)283 ParsingPackage setCrossProfile(boolean crossProfile); 284 setFullBackupContentResourceId(int fullBackupContentRes)285 ParsingPackage setFullBackupContentResourceId(int fullBackupContentRes); 286 setDataExtractionRulesResourceId(int dataExtractionRulesRes)287 ParsingPackage setDataExtractionRulesResourceId(int dataExtractionRulesRes); 288 setHasDomainUrls(boolean hasDomainUrls)289 ParsingPackage setHasDomainUrls(boolean hasDomainUrls); 290 setIconResourceId(int iconRes)291 ParsingPackage setIconResourceId(int iconRes); 292 setInstallLocation(int installLocation)293 ParsingPackage setInstallLocation(int installLocation); 294 295 /** @see R#styleable.AndroidManifest_sharedUserMaxSdkVersion */ setLeavingSharedUser(boolean leavingSharedUser)296 ParsingPackage setLeavingSharedUser(boolean leavingSharedUser); 297 setLabelResourceId(int labelRes)298 ParsingPackage setLabelResourceId(int labelRes); 299 setLargestWidthLimitDp(int largestWidthLimitDp)300 ParsingPackage setLargestWidthLimitDp(int largestWidthLimitDp); 301 setLogoResourceId(int logo)302 ParsingPackage setLogoResourceId(int logo); 303 setManageSpaceActivityName(String manageSpaceActivityName)304 ParsingPackage setManageSpaceActivityName(String manageSpaceActivityName); 305 setMinExtensionVersions(@ullable SparseIntArray minExtensionVersions)306 ParsingPackage setMinExtensionVersions(@Nullable SparseIntArray minExtensionVersions); 307 setMinSdkVersion(int minSdkVersion)308 ParsingPackage setMinSdkVersion(int minSdkVersion); 309 setMaxSdkVersion(int maxSdkVersion)310 ParsingPackage setMaxSdkVersion(int maxSdkVersion); 311 setNetworkSecurityConfigResourceId(int networkSecurityConfigRes)312 ParsingPackage setNetworkSecurityConfigResourceId(int networkSecurityConfigRes); 313 setNonLocalizedLabel(CharSequence nonLocalizedLabel)314 ParsingPackage setNonLocalizedLabel(CharSequence nonLocalizedLabel); 315 setOverlayCategory(String overlayCategory)316 ParsingPackage setOverlayCategory(String overlayCategory); 317 setOverlayIsStatic(boolean overlayIsStatic)318 ParsingPackage setOverlayIsStatic(boolean overlayIsStatic); 319 setOverlayPriority(int overlayPriority)320 ParsingPackage setOverlayPriority(int overlayPriority); 321 setOverlayTarget(String overlayTarget)322 ParsingPackage setOverlayTarget(String overlayTarget); 323 setOverlayTargetOverlayableName(String overlayTargetOverlayableName)324 ParsingPackage setOverlayTargetOverlayableName(String overlayTargetOverlayableName); 325 setRequiredAccountType(String requiredAccountType)326 ParsingPackage setRequiredAccountType(String requiredAccountType); 327 setRequiredForAllUsers(boolean requiredForAllUsers)328 ParsingPackage setRequiredForAllUsers(boolean requiredForAllUsers); 329 setRequiresSmallestWidthDp(int requiresSmallestWidthDp)330 ParsingPackage setRequiresSmallestWidthDp(int requiresSmallestWidthDp); 331 setResizeable(int resizeable)332 ParsingPackage setResizeable(int resizeable); 333 setRestrictUpdateHash(byte[] restrictUpdateHash)334 ParsingPackage setRestrictUpdateHash(byte[] restrictUpdateHash); 335 setRestrictedAccountType(String restrictedAccountType)336 ParsingPackage setRestrictedAccountType(String restrictedAccountType); 337 setRoundIconResourceId(int roundIconRes)338 ParsingPackage setRoundIconResourceId(int roundIconRes); 339 setSharedUserLabelResourceId(int sharedUserLabelRes)340 ParsingPackage setSharedUserLabelResourceId(int sharedUserLabelRes); 341 setSigningDetails(@onNull SigningDetails signingDetails)342 ParsingPackage setSigningDetails(@NonNull SigningDetails signingDetails); 343 setSplitClassLoaderName(int splitIndex, String classLoaderName)344 ParsingPackage setSplitClassLoaderName(int splitIndex, String classLoaderName); 345 setStaticSharedLibraryVersion(long staticSharedLibraryVersion)346 ParsingPackage setStaticSharedLibraryVersion(long staticSharedLibraryVersion); 347 setUpdatableSystem(boolean value)348 ParsingPackage setUpdatableSystem(boolean value); 349 350 /** 351 * Sets a system app that is allowed to update another system app 352 */ setEmergencyInstaller(String emergencyInstaller)353 ParsingPackage setEmergencyInstaller(String emergencyInstaller); 354 setLargeScreensSupported(int supportsLargeScreens)355 ParsingPackage setLargeScreensSupported(int supportsLargeScreens); 356 setNormalScreensSupported(int supportsNormalScreens)357 ParsingPackage setNormalScreensSupported(int supportsNormalScreens); 358 setSmallScreensSupported(int supportsSmallScreens)359 ParsingPackage setSmallScreensSupported(int supportsSmallScreens); 360 setExtraLargeScreensSupported(int supportsExtraLargeScreens)361 ParsingPackage setExtraLargeScreensSupported(int supportsExtraLargeScreens); 362 setTargetSandboxVersion(int targetSandboxVersion)363 ParsingPackage setTargetSandboxVersion(int targetSandboxVersion); 364 setThemeResourceId(int theme)365 ParsingPackage setThemeResourceId(int theme); 366 setRequestForegroundServiceExemption(boolean requestForegroundServiceExemption)367 ParsingPackage setRequestForegroundServiceExemption(boolean requestForegroundServiceExemption); 368 setUpgradeKeySets(@onNull Set<String> upgradeKeySets)369 ParsingPackage setUpgradeKeySets(@NonNull Set<String> upgradeKeySets); 370 set32BitAbiPreferred(boolean use32BitAbi)371 ParsingPackage set32BitAbiPreferred(boolean use32BitAbi); 372 setVolumeUuid(@ullable String volumeUuid)373 ParsingPackage setVolumeUuid(@Nullable String volumeUuid); 374 setZygotePreloadName(String zygotePreloadName)375 ParsingPackage setZygotePreloadName(String zygotePreloadName); 376 setAllowCrossUidActivitySwitchFromBelow( boolean allowCrossUidActivitySwitchFromBelow)377 ParsingPackage setAllowCrossUidActivitySwitchFromBelow( 378 boolean allowCrossUidActivitySwitchFromBelow); 379 sortActivities()380 ParsingPackage sortActivities(); 381 sortReceivers()382 ParsingPackage sortReceivers(); 383 sortServices()384 ParsingPackage sortServices(); 385 setBaseRevisionCode(int baseRevisionCode)386 ParsingPackage setBaseRevisionCode(int baseRevisionCode); 387 setVersionCode(int vesionCode)388 ParsingPackage setVersionCode(int vesionCode); 389 setVersionCodeMajor(int vesionCodeMajor)390 ParsingPackage setVersionCodeMajor(int vesionCodeMajor); 391 setVersionName(String versionName)392 ParsingPackage setVersionName(String versionName); 393 setCompileSdkVersion(int compileSdkVersion)394 ParsingPackage setCompileSdkVersion(int compileSdkVersion); 395 setCompileSdkVersionCodeName(String compileSdkVersionCodeName)396 ParsingPackage setCompileSdkVersionCodeName(String compileSdkVersionCodeName); 397 setAttributionsAreUserVisible(boolean attributionsAreUserVisible)398 ParsingPackage setAttributionsAreUserVisible(boolean attributionsAreUserVisible); 399 setResetEnabledSettingsOnAppDataCleared( boolean resetEnabledSettingsOnAppDataCleared)400 ParsingPackage setResetEnabledSettingsOnAppDataCleared( 401 boolean resetEnabledSettingsOnAppDataCleared); 402 setLocaleConfigResourceId(int localeConfigRes)403 ParsingPackage setLocaleConfigResourceId(int localeConfigRes); 404 405 /** 406 * Sets the trusted host certificates of apps that are allowed to embed activities of this 407 * application. 408 */ setKnownActivityEmbeddingCerts(Set<String> knownActivityEmbeddingCerts)409 ParsingPackage setKnownActivityEmbeddingCerts(Set<String> knownActivityEmbeddingCerts); 410 setOnBackInvokedCallbackEnabled(boolean enableOnBackInvokedCallback)411 ParsingPackage setOnBackInvokedCallbackEnabled(boolean enableOnBackInvokedCallback); 412 413 @CallSuper hideAsParsed()414 ParsedPackage hideAsParsed(); 415 416 // The remaining methods are copied out of [AndroidPackage] so that the parsing variant does 417 // not implement the final API interface and can't accidentally be used without finalizing 418 // the parsing process. 419 420 @NonNull getActivities()421 List<ParsedActivity> getActivities(); 422 423 @NonNull getAttributions()424 List<ParsedAttribution> getAttributions(); 425 426 @NonNull getBaseApkPath()427 String getBaseApkPath(); 428 429 @Nullable getClassLoaderName()430 String getClassLoaderName(); 431 432 @NonNull getConfigPreferences()433 List<ConfigurationInfo> getConfigPreferences(); 434 435 @NonNull getInstrumentations()436 List<ParsedInstrumentation> getInstrumentations(); 437 438 @NonNull getKeySetMapping()439 Map<String, ArraySet<PublicKey>> getKeySetMapping(); 440 441 @NonNull getLibraryNames()442 List<String> getLibraryNames(); 443 getMaxAspectRatio()444 float getMaxAspectRatio(); 445 getMaxSdkVersion()446 int getMaxSdkVersion(); 447 448 @Nullable getMetaData()449 Bundle getMetaData(); 450 getMinAspectRatio()451 float getMinAspectRatio(); 452 getMinSdkVersion()453 int getMinSdkVersion(); 454 getPackageName()455 String getPackageName(); 456 457 @Nullable getPermission()458 String getPermission(); 459 460 @NonNull getPermissions()461 List<ParsedPermission> getPermissions(); 462 463 @NonNull getProcessName()464 String getProcessName(); 465 466 @NonNull getProviders()467 List<ParsedProvider> getProviders(); 468 469 @NonNull getReceivers()470 List<ParsedActivity> getReceivers(); 471 472 @NonNull getRequestedPermissions()473 Set<String> getRequestedPermissions(); 474 475 @Nullable getResizeableActivity()476 Boolean getResizeableActivity(); 477 478 @Nullable getSdkLibraryName()479 String getSdkLibraryName(); 480 481 @NonNull getServices()482 List<ParsedService> getServices(); 483 484 @Nullable getSharedUserId()485 String getSharedUserId(); 486 487 @NonNull getSplitCodePaths()488 String[] getSplitCodePaths(); 489 490 @NonNull getSplitNames()491 String[] getSplitNames(); 492 493 @Nullable getStaticSharedLibraryName()494 String getStaticSharedLibraryName(); 495 getTargetSdkVersion()496 int getTargetSdkVersion(); 497 498 @Nullable getTaskAffinity()499 String getTaskAffinity(); 500 getUiOptions()501 int getUiOptions(); 502 503 @NonNull getUsesLibraries()504 List<String> getUsesLibraries(); 505 506 @NonNull getUsesNativeLibraries()507 List<String> getUsesNativeLibraries(); 508 509 @NonNull getUsesPermissions()510 List<ParsedUsesPermission> getUsesPermissions(); 511 512 @NonNull getUsesSdkLibraries()513 List<String> getUsesSdkLibraries(); 514 515 @Nullable getUsesSdkLibrariesVersionsMajor()516 long[] getUsesSdkLibrariesVersionsMajor(); 517 518 @NonNull getUsesStaticLibraries()519 List<String> getUsesStaticLibraries(); 520 521 @Nullable getZygotePreloadName()522 String getZygotePreloadName(); 523 isAllowCrossUidActivitySwitchFromBelow()524 boolean isAllowCrossUidActivitySwitchFromBelow(); 525 isBackupAllowed()526 boolean isBackupAllowed(); 527 isTaskReparentingAllowed()528 boolean isTaskReparentingAllowed(); 529 isAnyDensity()530 boolean isAnyDensity(); 531 isHardwareAccelerated()532 boolean isHardwareAccelerated(); 533 isSaveStateDisallowed()534 boolean isSaveStateDisallowed(); 535 isProfileable()536 boolean isProfileable(); 537 isProfileableByShell()538 boolean isProfileableByShell(); 539 isResizeable()540 boolean isResizeable(); 541 isResizeableActivityViaSdkVersion()542 boolean isResizeableActivityViaSdkVersion(); 543 isStaticSharedLibrary()544 boolean isStaticSharedLibrary(); 545 isExtraLargeScreensSupported()546 boolean isExtraLargeScreensSupported(); 547 isLargeScreensSupported()548 boolean isLargeScreensSupported(); 549 isNormalScreensSupported()550 boolean isNormalScreensSupported(); 551 isSmallScreensSupported()552 boolean isSmallScreensSupported(); 553 } 554