Question

Is there any function/method that I can use that'll add lines to the devices build.prop?

For example there is a build.prop line - pm.sleep_mode=1

And I want that line to be added to my device's build.prop when I click a button. How can I achieve this? Have searched but it only come sup with scripts?:S

Was it helpful?

Solution

1st, you need a rooted android device. 2nd, use Runtime.getRuntime().exec() to invoke the script as root user. the script may like:

mount -o remount,rw ... #depends on your system partition block device
cat "pm.sleep_mode=1" >> /system/build.prop
setprop pm.sleep_mode 1
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top