Skip to content

worker: freeze only app uids, in the right user - #10

Draft
ash-iir wants to merge 1 commit into
mainfrom
fix-freeze-uid
Draft

ash-iir wants to merge 1 commit into
mainfrom
fix-freeze-uid

Conversation

@ash-iir

@ash-iir ash-iir commented Nov 19, 2026

Copy link
Copy Markdown
Owner

freeze() SIGKILLs every process whose uid owns /data/data/<pkg>.

  • A system app with sharedUserId=android.uid.system (e.g. com.android.settings) is uid 1000, the same as system_server, so backing it up killed system_server and soft-rebooted the phone.
  • /data/data is always user 0, so an op for a secondary user killed the user-0 instance and left the right one running.

Now reads the uid from /data/user/$U/<pkg> and only does the uid sweep for app uids (uid % 100000 >= 10000); anything below falls back to the existing pidof match.

Testing

  • sh -n on worker.sh.
  • uid check under mksh and busybox sh: 1000, 1001000, 0 → pidof; 10123, 1010123 → uid sweep.
  • Not tested on a rooted device.

freeze() killed every process of the uid that owns /data/data/<pkg>. For
a system app sharing uid 1000 that includes system_server (soft reboot),
and /data/data is always user 0, so a secondary-user op stopped the
user-0 instance. Read /data/user/$U and fall back to pidof below 10000.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
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.

1 participant