• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Grant SU to app before it accesses root

mcohen3

Lurker
I am trying to create an application that takes advantage of Dynamic Voltage and Frequency Scaling (DVFS). My phone is rooted and I can successfully scale my device with the following command:

psProc = Runtime.getRuntime().exec(new String[]{"su", "-c", "echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"});

However, this command is executed frequently since it appears within the repaint method of a game. I would like to execute "echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed 300000", without using "su", "-c", since switching to the root user may be slow. Can I grant an entire application super user privileges before hand so that I may omit "su", "-c", in my execution?
 
Back
Top Bottom