我已经扎根在我的设备,然后在我的应用问题与调用Runtime.getRuntime()。EXEC()
Process p = Runtime.getRuntime().exec("su");
,它做工精细,我的应用程序将是根模式。然后我尝试添加无线局域网的地址空间,但它不工作,当我在终端退房,以下错误消息显示
busybox ifconfig there is not a new wlan address space.
我尝试用以下方式:
Process p = Runtime.getRuntime().exec("su");
p = Runtime.getRuntime().exec("busybox ifconfig wlan0 add xxxxxxxxxxxx");
p.waitfor();
当我运行我的应用程序,吐司显示该应用程序是根模式,但没有添加wlan0。
当然,如果我在终端苏写的busybox的ifconfig为wlan0添加XXXXXXXX,它工作正常,并有一个新的为wlan0地址空间。 – user760503