|
|
@ -1563,6 +1563,23 @@ public class MicroPhotoService extends Service {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Log.w(TAG, "Recv REBOOT command");
|
|
|
|
Log.w(TAG, "Recv REBOOT command");
|
|
|
|
SysApi.reboot(MicroPhotoService.this.getApplicationContext());
|
|
|
|
SysApi.reboot(MicroPhotoService.this.getApplicationContext());
|
|
|
|
|
|
|
|
new Thread(new Runnable() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
|
|
|
sleep(5000);
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
Process process = Runtime.getRuntime().exec("/system/xbin/su root");
|
|
|
|
|
|
|
|
DataOutputStream os = new DataOutputStream(process.getOutputStream());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
os.writeBytes("/system/bin/reboot\n");
|
|
|
|
|
|
|
|
os.writeBytes("exit\n"); // 重要:退出su shell
|
|
|
|
|
|
|
|
os.flush();
|
|
|
|
|
|
|
|
int exitValue = process.waitFor();
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|