Skip to content

fix(sfa): resolve per-app proxy package list truncation#63

Open
hrn6z4wbe wants to merge 25 commits into
SagerNet:devfrom
hrn6z4wbe:fix/per-app-proxy-package-list
Open

fix(sfa): resolve per-app proxy package list truncation#63
hrn6z4wbe wants to merge 25 commits into
SagerNet:devfrom
hrn6z4wbe:fix/per-app-proxy-package-list

Conversation

@hrn6z4wbe

Copy link
Copy Markdown

Summary

When querying installed packages in PerAppProxyScreen, requesting unnecessary component flags (GET_ACTIVITIES, GET_SERVICES, GET_RECEIVERS, GET_PROVIDERS) significantly inflates the Binder transaction payload size per application. On devices with a large number of installed applications, this causes Binder transaction buffer limit issues (TransactionTooLargeException) and truncates the package list.

This PR removes these unused flags as PerAppProxyScreen only requires basic application info and INTERNET permission status, reducing IPC payload size and improving load performance. It also safely handles null requestedPermissions in AppSelectionComponents.

Changes

  • PerAppProxyScreen.kt: Remove GET_ACTIVITIES, GET_SERVICES, GET_RECEIVERS, and GET_PROVIDERS flags when retrieving package info.
  • AppSelectionComponents.kt: Safely evaluate isOffline when requestedPermissions is null.

nekohasekai and others added 25 commits June 25, 2026 17:45
The download progress indicator passed a deferred lambda
`progress = { progress!! }` reading UpdateState.downloadProgress
(MutableState<Float?>). Material3 invokes the lambda during
layout/draw, outside the composition snapshot that guarded it, so it
re-read the live state. ApkDownloader sets the value to null when the
response has no content length (total <= 0), and it can also flip while
the screen is being torn down, causing the `!!` to throw NPE.

Capture the value into an immutable local before branching so the
lambda closes over a non-null Float instead of re-reading live state.
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