Commit ae47ae9
committed
Fix SecurityException crash in work profiles for getPackagesForUid
In work profiles (e.g. Shelter), getPackagesForUid() throws
SecurityException for cross-user UIDs because the app lacks
INTERACT_ACROSS_USERS_FULL permission. This was already known and
handled in AdapterLog.java but NOT in the critical packet processing
path.
The unhandled exception in shouldTrackApp() propagates up through
blockKnownTracker() and log(), causing BOTH tracker blocking AND
traffic logging to silently fail for every packet - the exception
is caught by the outer handleMessage() try-catch and swallowed.
Fix: wrap getPackagesForUid() in try-catch SecurityException at all
three unprotected call sites in ServiceSinkhole:
- shouldTrackApp() (blocking + logging pipeline) - default to tracking
- prepareUidIPFilters() (lockdown check) - skip lockdown filter
- showNewInstallNotification() - skip notification gracefully
This is very likely the root cause of the reported work profile issue
where "tracker blocking and traffic log doesn't work in Shelter."
https://claude.ai/code/session_013NayXYhZViADqMfUXT4VuF1 parent 4583b66 commit ae47ae9
1 file changed
Lines changed: 20 additions & 2 deletions
Lines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1879 | 1879 | | |
1880 | 1880 | | |
1881 | 1881 | | |
1882 | | - | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
1883 | 1889 | | |
1884 | 1890 | | |
1885 | 1891 | | |
| |||
2230 | 2236 | | |
2231 | 2237 | | |
2232 | 2238 | | |
2233 | | - | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
2234 | 2249 | | |
2235 | 2250 | | |
2236 | 2251 | | |
| |||
2743 | 2758 | | |
2744 | 2759 | | |
2745 | 2760 | | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
2746 | 2764 | | |
2747 | 2765 | | |
2748 | 2766 | | |
| |||
0 commit comments