Skip to content

Instantly share code, notes, and snippets.

@doridori doridori/1
Last active Jan 15, 2018

Embed
What would you like to do?
For Adb shell blogpost
#ps
USER PID PPID VSIZE RSS WCHAN PC NAME
root 1 0 4524 908 SyS_epoll_ 0000000000 S /init
shell 503 1 9952 700 0000000000 S /sbin/adbd
shell 17432 29176 5744 1156 0 7f8b5d6c7c R ps
shell 29176 503 5800 1444 sigsuspend 7f9663f37c S /system/bin/sh
shell@angler:/ $ cat /proc/$$/status
Name: sh
State: R (running)
Tgid: 29176
Pid: 29176
PPid: 503
TracerPid: 0
Uid: 2000 2000 2000 2000
Gid: 2000 2000 2000 2000
FDSize: 64
Groups: 1004 1007 1011 1015 1028 3001 3002 3003 3006 //GIDs
VmPeak: 5800 kB
VmSize: 5800 kB
VmLck: 0 kB
VmPin: 0 kB
VmHWM: 1440 kB
VmRSS: 1440 kB
VmData: 2956 kB
VmStk: 136 kB
VmExe: 276 kB
VmLib: 2068 kB
VmPTE: 24 kB
VmSwap: 0 kB
Threads: 1
SigQ: 0/9445
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000000380000
SigCgt: 000000000801f4ff
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: 00000000000000c0
Seccomp: 0
Cpus_allowed: ff
Cpus_allowed_list: 0-7
Mems_allowed: 1
Mems_allowed_list: 0
voluntary_ctxt_switches: 163
nonvoluntary_ctxt_switches: 69
#ps
USER PID PPID VSIZE RSS WCHAN PC NAME
root 1 0 4524 908 SyS_epoll_ 0000000000 S /init
root 527 1 2098548 62336 poll_sched 0000000000 S zygote64
u0_a89 13493 527 1457592 57276 pipe_wait 0000000000 S com.example.shellpermstest
u0_a89 13515 13493 5920 1164 hrtimer_na 0000000000 S sleep
shell@angler:/ $ cat /proc/13515/status
Name: sleep
State: S (sleeping)
Tgid: 13515
Pid: 13515
PPid: 13493
TracerPid: 0
Uid: 10089 10089 10089 10089
Gid: 10089 10089 10089 10089
FDSize: 64
Groups: 9997 50089
VmPeak: 5920 kB
VmSize: 5920 kB
VmLck: 0 kB
VmPin: 0 kB
VmHWM: 1164 kB
VmRSS: 1164 kB
VmData: 2716 kB
VmStk: 136 kB
VmExe: 292 kB
VmLib: 2376 kB
VmPTE: 24 kB
VmSwap: 0 kB
Threads: 1
SigQ: 0/9445
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000001204
SigIgn: 0000000000001000
SigCgt: 00000000000084f8
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: 0000000000000000
Seccomp: 0
Cpus_allowed: ff
Cpus_allowed_list: 0-7
Mems_allowed: 1
Mems_allowed_list: 0
voluntary_ctxt_switches: 2
nonvoluntary_ctxt_switches: 6
<shared-user name="android.uid.shell" userId="2000">
<sigs count="1">
<cert index="1" />
</sigs>
<perms>
<item name="android.permission.SIGNAL_PERSISTENT_PROCESSES" />
<item name="android.permission.CLEAR_APP_USER_DATA" />
<item name="android.permission.SET_ACTIVITY_WATCHER" />
<item name="android.permission.CALL_PHONE" />
<item name="android.permission.READ_CONTACTS" />
<item name="android.permission.READ_USER_DICTIONARY" />
<item name="android.permission.GET_ACCOUNTS" />
<item name="android.permission.WRITE_CONTACTS" />
<item name="android.permission.BACKUP" />
<item name="android.permission.READ_CALENDAR" />
<item name="android.permission.MANAGE_USERS" />
<item name="android.permission.SET_PREFERRED_APPLICATIONS" />
<item name="android.permission.SET_SCREEN_COMPATIBILITY" />
<item name="android.permission.INTERNAL_SYSTEM_WINDOW" />
<item name="android.permission.ACCESS_FINE_LOCATION" />
<item name="android.permission.ACCESS_NETWORK_STATE" />
<item name="android.permission.INSTALL_PACKAGES" />
<item name="android.permission.INJECT_EVENTS" />
<item name="android.permission.GET_DETAILED_TASKS" />
<item name="android.permission.SEND_SMS" />
<item name="android.permission.WRITE_MEDIA_STORAGE" />
<item name="android.permission.INTERACT_ACROSS_USERS_FULL" />
<item name="android.permission.SET_ALWAYS_FINISH" />
<item name="android.permission.WRITE_SECURE_SETTINGS" />
<item name="android.permission.KILL_BACKGROUND_PROCESSES" />
<item name="android.permission.FORCE_STOP_PACKAGES" />
<item name="android.permission.WRITE_CALENDAR" />
<item name="android.permission.READ_INPUT_STATE" />
<item name="android.permission.INSTALL_LOCATION_PROVIDER" />
<item name="android.permission.EXPAND_STATUS_BAR" />
<item name="android.permission.BLUETOOTH" />
<item name="android.permission.WRITE_SETTINGS" />
<item name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<item name="android.permission.ACCESS_SURFACE_FLINGER" />
<item name="android.permission.DEVICE_POWER" />
<item name="android.permission.CHANGE_CONFIGURATION" />
<item name="android.permission.READ_EXTERNAL_STORAGE" />
<item name="android.permission.DUMP" />
<item name="android.permission.DELETE_PACKAGES" />
<item name="android.permission.GET_TASKS" />
<item name="android.permission.WRITE_EXTERNAL_STORAGE" />
<item name="android.permission.ACCESS_WIFI_STATE" />
<item name="android.permission.ACCESS_COARSE_LOCATION" />
<item name="android.permission.STOP_APP_SWITCHES" />
<item name="android.permission.BROADCAST_STICKY" />
<item name="android.permission.GRANT_REVOKE_PERMISSIONS" />
<item name="android.permission.WRITE_USER_DICTIONARY" />
<item name="android.permission.READ_FRAME_BUFFER" />
<item name="android.permission.SET_KEYBOARD_LAYOUT" />
<item name="android.permission.FORCE_BACK" />
<item name="android.permission.BLUETOOTH_STACK" />
<item name="android.permission.SET_ANIMATION_SCALE" />
<item name="android.permission.SET_ORIENTATION" />
<item name="android.permission.SET_DEBUG_APP" />
<item name="android.permission.DELETE_CACHE_FILES" />
<item name="android.permission.BATTERY_STATS" />
<item name="android.permission.REORDER_TASKS" />
<item name="android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY" />
<item name="android.permission.SET_PROCESS_LIMIT" />
<item name="android.permission.INTERACT_ACROSS_USERS" />
<item name="android.permission.RETRIEVE_WINDOW_CONTENT" />
</perms>
</shared-user>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.