rayray

【Android】Android 代码判断是否获取ROOT权限

方法比较简单,直接粘贴代码

 

   /**
     * 判断当前手机是否有ROOT权限
     * @return
     */
    public boolean isRoot(){
        boolean bool = false;

        try{
            if ((!new File("/system/bin/su").exists()) && (!new File("/system/xbin/su").exists())){
                bool = false;
            } else {
                bool = true;
            }
            Log.d(TAG, "bool = " + bool);
        } catch (Exception e) {
} return bool; }

 

本文出自 Ray-Ray的博客

文章地址 http://www.cnblogs.com/rayray/p/3229265.html 

感谢大家的推荐和收藏

你的支持! 我们的动力!

分类:

技术点:

相关文章:

  • 2021-12-04
  • 2022-02-20
  • 2021-10-05
  • 2022-12-23
  • 2021-11-30
  • 2021-10-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-13
  • 2021-10-05
  • 2021-07-24
  • 2021-10-05
  • 2022-12-23
相关资源
相似解决方案