Read and Write System Properties (prop)

This interface is used to read or modify system properties, similar to the functionality of the getprop and setprop commands. You might wonder: why use this instead of the standard commands? What makes it special?

Indeed, but you should understand that this interface can directly set Android properties starting with ro., which cannot be modified using the built-in system commands.

Get Property

You can use the following interface to retrieve the value of ro.secure. Of course, this is just an example—this interface can read all system properties, not just this one.

d.getprop("ro.secure")

Set Property

You can also use the following interface to set the value of ro.secure to 0. In fact, you can use this interface to set any system property, including ro. read-only properties. This capability is precisely what makes this interface particularly valuable.

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