修改系統時間

最近有一項目要求修改系統時間

try {  

   Process process = Runtime.getRuntime().exec("su");  
   DataOutputStream os = new DataOutputStream(process.getOutputStream());  

   os.writeBytes("date -s 20150319.024012; \n");  

   os.writeBytes(lastTime);  

} catch (Exception e) {  
  e.printStackTrace();  
 } 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章