public boolean detectRootManagementApps ( String [ ] additionalRootManagementApps ) { // Create a list of package names to iterate over from constants any others provided ArrayList < String > packages = new ArrayList <> ( Arrays . asList ( Const . knownRootAppsPackages ) ) ; if ( additionalRootManagementApps != null && additionalRootManagementApps . length > 0 ) { packages . addAll ( Arrays . asList ( additionalRootManagementApps ) ) ; } return isAnyPackageFromListInstalled ( packages ) ; }
Using the PackageManager check for a list of well known root apps .