Repository navigation
Conversation
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.
Related: #2602, #3874
On Huawei devices, signature spoofing only works because the system binds microG's
com.huawei.signature.diffservice and asks it for signatures. Self-Check doesn't show whether this happens. When "System spoofs signature" is unchecked, it can mean that the system never asked microG, or that it asked and the spoofing still failed. These have different causes, and today the only way to tell them apart is logcat.This comes up in two cases:
This adds one row to "Signature spoofing support", "Huawei system asks microG for its signature":
fake-signaturestores the currentSettings.Global.BOOT_COUNTon the firstquerySignature()call in the:signatureprocess.It only shows whether the system asks at all. It doesn't check whether a given app is in
signature_want_fake(#3874).Huawei devices (official 0.3.18-hw, Mate X6 EMUI 15.0.0.221, MatePad Mini HarmonyOS 4.3.0.118, MatePad Pro HarmonyOS 4.3.0.208, all Android 12)
I used a small test app that requests package signatures, and counted wake-ups of the binder threads in microG's
:signatureprocesses before and after each step (a proxy for incoming calls). Same pattern on all three, with some background noise on the Mate X6, which is my daily phone:system_server(uid 1000) binds the service after unlock.getPackageInfo(..., GET_SIGNATURES)forcom.google.android.gmsorcom.android.vendingin a process causes onequerySignature()call. Repeated requests in the same process cause none, so the system caches the result.UnsupportedOperationException: Illegal).With a debug build of this branch (before the row was renamed) on the MatePad Mini, the service is never bound and the row is unchecked.
selfcheck-huawei-probe.txt
Emulators (AOSP userdebug, API 31, 33, 34, 35, 36, debug builds of this branch)
querySignature()from the shell user (uid 2000), which passes the samegetCallingUid() > 10000check assystem_server, records the currentBOOT_COUNT.Before I added the manufacturer check, the same test showed the row checked after the shell call and unchecked again after a reboot (part 2 of the log).
selfcheck-emulators.txt
Not tested
Notes
querySignature()). Both lines can stay. If feat(installer): persist fake signature policies after successful installs #3884 is merged first, I'll update this PR../gradlew buildpasses.