8000 ps: fall back to a listing without icons when icon loading fails by tubibibo · Pull Request #211 · frida/frida-tools · GitHub
[go: up one dir, main page]

Skip to content
< 8000 meta name="react-app-name" content="pull-requests"/>

ps: fall back to a listing without icons when icon loading fails - #211

Merged
oleavr merged 1 commit into
frida:mainfrom
tubibibo:ps/icon-fallback
Nov 5, 2026
Merged

oleavr merged 1 commit into
frida:mainfrom
tubibibo:ps/icon-fallback

Conversation

@tubibibo
@tubibibo tubibibo commented Nov 5, 2026 •
Copy link
Copy Markdown
Contributor

When the terminal asks for icons, frida-ps enumerates with scope="full". If the device fails to load an app icon, the whole call fails, so the listing is lost over an icon. In frida/frida#3762 that is Android raising Resources$NotFoundException: Drawable android:drawable/sym_def_app_icon, and piping the output "fixes" it only because that skips the icon request.

This retries with the minimal scope and warns, so the process/application list is still shown without icons.

def _enumerate_with_icon_fallback(enumerate_fn, scope, warn):
    if scope != "full":
        return enumerate_fn(scope=scope)

    try:
        return enumerate_fn(scope="full")
    except Exception as e:
        try:
            result = enumerate_fn(scope="minimal")
        except Exception:
            raise
        warn(e)
        return result
  • the retry only applies to the full scope
  • if the retry fails too, that failure is surfaced as before and no icon warning is printed, so a transport error is not mistaken for an icon problem
  • warnings go through _log("warning", ...) in both _list_processes and _list_applications
  • tests/test_ps.py covers the retry, the success path, a failing minimal scope, and the "not an icon problem" case

Refs frida/frida#3762

Verification: python -m unittest tests.test_ps -v -> 4 tests OK; black, isort and pyflakes are clean. With a stub device that raises the exception above on full scope, the previous code path is calls=['full'] followed by "Failed to enumerate processes", the new one is calls=['full', 'minimal'] followed by the warning and a normal listing.

Some devices fail the whole full-scope enumeration when an app icon
cannot be loaded, e.g. Android raising Resources$NotFoundException for
sym_def_app_icon. Retry with the minimal scope and warn, so the listing
still works.

Refs frida/frida#3762
@oleavr
oleavr merged commit 280fb9e into frida:main Nov 5, 2026
@oleavr
oleavr commented Nov 5, 2026
Copy link
Copy Markdown
Member

Thanks! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0