Is it possible to add a property on a non-rooted android phone?
Asked Answered
K

2

6

For my non-rooted device (which I am not allowed to root, so I need to find another way around), if I do

adb shell setprop MY_PROP 1

followed by

adb shell getprop MY_PROP

I get a blank line.

How can I set a property?

Kweilin answered 28/4, 2014 at 12:32 Comment(1)
Ifound the same issue ... I think it is not possible ... even if you try > su cd /something you will get a white line ...Picro
A
2

By default the shell user is not 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
Annapolis answered 7/8, 2017 at 19:26 Comment(0)
P
2

Without root you can only add props that start with debug.

adb shell setprop debug.my.prop newProp
Preclude answered 20/1, 2023 at 0:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.