Skip to content

Instantly share code, notes, and snippets.

@silverzhaojr
Created January 15, 2023 14:13
Show Gist options
  • Save silverzhaojr/754d69d5900ca89bf8754d8529389fd7 to your computer and use it in GitHub Desktop.
Save silverzhaojr/754d69d5900ca89bf8754d8529389fd7 to your computer and use it in GitHub Desktop.
# pm list users
# Users:
# UserInfo{0:机主:c13} running
# UserInfo{11:工作资料:1030} running
# ls /data/system/packages.list
# com.android.vending 10082
# com.google.android.gms 10080
# com.google.android.gms.location.history 10096
# com.google.android.gms.policy_sidecar_aps 10078
# com.microsoft.emmx 10259
# com.microsoft.office.outlook 10258
# com.microsoft.windowsintune.companyportal 10254
netid=$(dumpsys netd | grep 'VIRTUAL ' | awk '{print $1}')
if [[ -n "$netid" ]]; then
for uid in 10078 10080 10082 10096 10254 10258 10259 ; do
ndc network users add $netid "11$uid"
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment