zoukankan      html  css  js  c++  java
  • 获取 room

    引用:http://wiseideal.iteye.com/blog/1166794

    转载自:http://dev.10086.cn/cmdn/bbs/thread-37036-1-1.html 
    Java代码  收藏代码
    1. public static boolean runRootCommand(String command) {  
    2. Process process = null;  
    3. DataOutputStream os = null;  
    4. try {  
    5. process = Runtime.getRuntime().exec("su");   
    6. os = new DataOutputStream(process.getOutputStream());  
    7. os.writeBytes(command+"\n");  
    8. os.writeBytes("exit\n");  
    9. os.flush();  
    10. process.waitFor();  
    11. catch (Exception e) {  
    12. Log.d(TAG, "the device is not rooted, error message: " + e.getMessage());  
    13. return false;  
    14. finally {  
    15. try {  
    16. if (os != null) {  
    17. os.close();  
    18. }  
    19. if(process != null) {  
    20. process.destroy();  
    21. }  
    22. catch (Exception e) {  
    23. e.printStackTrace();  
    24. }  
    25. }  
    26. return true;  
    27. }  
     
  • 相关阅读:
    关于表单的jQuery练习
    jQuery中的综合动画
    jQuery中自定义简单动画的实现
    清除浮动
    定位
    盒子模型
    笔记
    笔记
    翻页
    DOM
  • 原文地址:https://www.cnblogs.com/sode/p/2384496.html
Copyright © 2011-2022 走看看