Can I add a property on an unmanaged Android phone?

For my unloaded device (which I don’t allow root, so I need to find another way) if I do

adb shell setprop MY_PROP 1

followed by

adb shell getprop MY_PROP

I get an empty string.

How to set a property?

+4
source share
1 answer

By default, the user is shellnot allowed to create properties:

$ adb shell "setprop test.test 1; dmesg | grep test\.test"
[  271.706897,0] init: avc:  denied  { set } for property=test.test scontext=u:r:shell:s0 tcontext=u:object_r:default_prop:s0 tclass=property_service
[  271.707157,0] init: sys_prop: permission denied uid:2000  name:test.test
0
source

Source: https://habr.com/ru/post/1538398/


All Articles