code: protected static Boolean isRooted() {
          if (android.os.Build.TAGS != null && android.os.Build.TAGS.contains("test-keys")) {
              return true;
          }
  
          String[] probableRootPaths = {
              "/data/local/bin/su",
              "/data/local/su",
              "/data/local/xbin/su",
              "/sbin/su",
              "/su/bin",
              "/su/bin/su",
              "/system/app/SuperSU",
              "/system/app/SuperSU.apk",
              "/system/app/Superuser",
              "/system/app/Superuser.apk",
              "/system/bin/failsafe/su",
              "/system/bin/su",
              "/system/sd/xbin/su",
              "/system/xbin/daemonsu",
              "/system/xbin/su"
          };
  
          for (String probableRootPath : probableRootPaths) {
              try {
                  if (new File(probableRootPath).exists()) {
                      return true;
                  }
              } catch (Exception e) {
                  Log.e(TAG, "Exception while attempting to detect whether the device is rooted", e);
              }
          }
  
          return false;
      }
docs: Attempt to discover if this device is currently rooted. From:
  https://stackoverflow.com/questions/1101380/determine-if-running-on-a-rooted-device
  
  @return true if heuristics show the device is probably rooted, otherwise false