Repository navigation
android: Omit user when uid has no passwd entry - #1298
Merged
Merged
Conversation
Instead of failing the whole process enumeration when a process runs as a uid that getpwuid() cannot resolve. Also always provide the uid, like the Linux backend does.
oleavr
force-pushed
the
fix/android-helper-unresolvable-uid
branch
from
November 23, 2026 14:49
700cafe to
e56e865
Compare
Member
|
Thanks! 🙌 Amended slightly so we're consistent with the other backends. |
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.
Listing processes on Android with scope
metadataorfullfails completely when any process runs as a uid thatgetpwuid()cannot resolve:resolveUserIdToName()wraps the exception fromgetpwuid()in aRuntimeException, which propagates out ofenumerateProcesses(), so one such process loses the whole list. Scopeminimalis unaffected, as it never looks the user up.I hit this on an arm64 device running Android 17, where
com.google.android.asruns as uid 30145, which has no passwd entry (id -nu 30145fails there too).The fix makes the Android helper behave like the Linux backend: it always provides
uid, and leavesuserout when the uid has no passwd entry.The dex
helper.dexis rebuilt with the Makefile. The original revision of this PR was built with d8 8.10.9-dev from build-tools 36.0.0, the android-37 jar, and JDK 25, which reproduced the committed dex from the unmodified source. The amended revision was rebuilt with d8 9.0.3-dev from build-tools 36.1.0, the android-36 jar (ANDROID_API_LEVEL=36), and JDK 25. Rebuilding the previous revision's source with that setup gives identical bytecode, differing only in the D8 version marker, so the dex differs only by this change.Testing
A small program against the devkit that gets the local device and lists processes with
FRIDA_SCOPE_FULL, run as root on the device:user="30145"for that oneThe amended revision, which reports
uid=30145and nouserfor that process instead, has not yet been tested on a device.