【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; }
相关文章
相关标签/搜索