权限为 Root 权限

    /**      * 设置系统时间      * @param time 格式为“年月日.时分秒”,例如:20111209.121212      */      public static boolean setTime(String time) {          Process process = null;          DataOutputStream os = null;          try {              process = Runtime.getRuntime().exec("su");              os = new DataOutputStream(process.getOutputStream());              os.writeBytes("date -s " + time + "\n");              os.writeBytes("exit\n");              os.flush();              process.waitFor();          } catch (Exception e) {              return false;          } finally {              try {                  if (os != null) {                      os.close();                  }                  process.destroy();              } catch (Exception e) {              }          }          return true;      }  

更多相关文章

  1. android 权限管理PermissionDispatcher使用
  2. Android SDK Permission大全访问权限
  3. Android 9.0网络权限适配
  4. Android SELinux开发入门指南之正确姿势解决访问data目录权限问
  5. [Android Pro] android root权限破解分析

随机推荐

  1. Android系统框架
  2. Android(安卓)Interface Definition Lang
  3. Android中的人脸检测(静态和动态)
  4. android中的Selector的用法---主要是改变
  5. Android安全机制--四大组件安全
  6. Android——SQLite数据库
  7. Android(安卓)ListView中item之间的分割
  8. 【贪吃蛇—Java程序员写Android游戏】系
  9. Qt on Android: Android(安卓)SDK安装
  10. android makefile prebuild