Know Android Phone rooted through programme

 

To know weather the android phone is rooted or not through program, call the below method:

 

    public boolean isRooted() {
        
        boolean rooted = false;
        try {
            File su = new File(“/system/bin/su”);
            if (su.exists() == true) {
                su = new File(“/system/xbin/su”);
                if (su.exists() == true) {
                    rooted = true;
                }
            }
        } catch (Exception e) {
            Log.d(“My Activity”, “Exception is: “+e.getMessage());
            rooted = false;
        }
        return rooted;
    }

 

If the Phone is rooted it returns “true” and if not then “false”.

Advertisements

Leave a comment

Filed under Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s