You can try using the following:
su -c setprop sys.usb.config <command>
A complete list can be found on this command:
cat init.usb.rc
Function to run the command from the application:
public void RunAsRoot(String[] cmds){ Process p = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(p.getOutputStream()); for (String tmpCmd : cmds) { os.writeBytes(tmpCmd+"\n"); } os.writeBytes("exit\n"); os.flush(); }
Arseniy
source share