Reading and Writing System Properties (prop)

This interface is used to read or modify system properties, similar to the functionality of the commands getprop and setprop. You might ask, why not use commands? What’s unique about this? Indeed, but you should understand that this interface can directly set Android properties with ro. prefix, which the system’s built-in commands cannot do.

Getting Properties

You can use the following interface to get the value of ro.secure. Of course, not just this one property, all system properties can be read using this interface. This is just an example.

d.getprop("ro.secure")

Setting Properties

You can also use the following interface to set the value of ro.secure to 0. Of course, you can set any property using this interface, including the values of ro. read-only properties. This is the fundamental feature that makes this interface noteworthy.

d.setprop("ro.secure", "0")