Repository navigation
fix(runtime): include GET_SIGNATURES on all API 28+ archive reads - #851
Open
New-President wants to merge 1 commit into
Open
New-President wants to merge 1 commit into
New-President wants to merge 1 commit into
Conversation
- Always combine `PackageManager.GET_SIGNING_CERTIFICATES` with `PackageManager.GET_SIGNATURES` in `PM.getPackageInfo(File, includeSigning = true)` rather than restricting `GET_SIGNATURES` to `SDK_INT < R`. - Several Android 11-13 OEM frameworks (such as Unisoc/Alldocube Android 13 `T1030_V1.0`) still gate `PackageParser.collectCertificates(pkg, false)` in `PackageManager.getPackageArchiveInfo()` purely on `(flags & PackageManager.GET_SIGNATURES) != 0` before checking `GET_SIGNING_CERTIFICATES`. - Update `archive-signing-test.py` to verify that `GET_SIGNATURES` is always passed alongside `GET_SIGNING_CERTIFICATES`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PackageManager.GET_SIGNATURESalongsidePackageManager.GET_SIGNING_CERTIFICATESinPM.getPackageInfo(File, includeSigning = true)on API 28+, instead of only onBuild.VERSION.SDK_INT < Build.VERSION_CODES.R.app/src/test/scripts/archive-signing-test.pyto assert thatGET_SIGNATURESis always included whenincludeSigning = true.Root Cause
Commit
c7b9fe12(#839) addedPackageManager.GET_SIGNATURESforSDK_INT < R(Android 9 and 10). However, several Android 11–13 OEM framework builds (verified by disassembling/system/framework/framework.jaron an Alldocube iPlay 50 running Android 13 / API 33, buildT1030_V1.0_20240516) retain the legacygetPackageArchiveInfocondition:When
SDK_INT >= 30passesGET_SIGNING_CERTIFICATES(0x08000000) withoutGET_SIGNATURES(0x00000040),(flags & 0x40) == 0skipsPackageParser.collectCertificates(pkg, false), leavingpkg.mSigningDetailsuninitialized and returningPackageInfowith bothsigningInfo == nullandsignatures == null. That causesPatcherRuntimePluginRepository.archiveSigners()to throw:SecurityException: Failed to read signer for app.universal.patch.manager.support.runtimePassing
GET_SIGNING_CERTIFICATES or GET_SIGNATURESon all API 28+ devices is completely harmless on standard AOSP Android 11+ and ensurescollectCertificatesruns on OEM builds that gate certificate collection onGET_SIGNATURES, while still populatingPackageInfo.signingInfofor current signers and certificate rotation history.