Package 

Class RootBeer


  • 
    public class RootBeer
    
                        

    A simple root checker that gives an *indication* if the device is rooted or not. Disclaimer: **root==god**, so there's no 100% way to check for root.

    • Constructor Summary

      Constructors 
      Constructor Description
      RootBeer(Context context)
    • Method Summary

      Modifier and Type Method Description
      boolean isRooted() Run all the root detection checks.
      boolean isRootedWithoutBusyBoxCheck()
      boolean isRootedWithBusyBoxCheck() Run all the checks including checking for the busybox binary.
      boolean detectTestKeys() Release-Keys and Test-Keys has to do with how the kernel is signed when it is compiled.Test-Keys means it was signed with a custom key generated by a third-party developer.
      boolean detectRootManagementApps() Using the PackageManager, check for a list of well known root apps.
      boolean detectRootManagementApps(Array<String> additionalRootManagementApps) Using the PackageManager, check for a list of well known root apps.
      boolean detectPotentiallyDangerousApps() Using the PackageManager, check for a list of well known apps that require root.
      boolean detectPotentiallyDangerousApps(Array<String> additionalDangerousApps) Using the PackageManager, check for a list of well known apps that require root.
      boolean detectRootCloakingApps() Using the PackageManager, check for a list of well known root cloak apps.
      boolean detectRootCloakingApps(Array<String> additionalRootCloakingApps) Using the PackageManager, check for a list of well known root cloak apps.
      boolean checkForSuBinary() Checks various (Const.
      boolean checkForMagiskBinary() Checks various (Const.
      boolean checkForBusyBoxBinary() Checks various (Const.
      boolean checkForBinary(String filename)
      void setLogging(boolean logging)
      boolean checkForDangerousProps() Checks for several system properties for
      boolean checkForRWPaths() When you're root you can change the permissions on common system directories, this method checks if any of these patha Const.pathsThatShouldNotBeWritable are writable.
      boolean checkSuExists() A variation on the checking for SU, this attempts a 'which su'
      boolean checkForNativeLibraryReadAccess() Checks if device has ReadAccess to the Native LibraryPrecondition: canLoadNativeLibrary() ran before this and returned trueDescription: RootCloak automatically blocks read access to the Native Libraries, howeverallows for them to be loaded into memory.
      boolean canLoadNativeLibrary() Checks if it is possible to load our native library
      boolean checkForRootNative() Native checks are often harder to cloak/trick so here we call through to our native root checker
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RootBeer

        RootBeer(Context context)
    • Method Detail

      • isRooted

         boolean isRooted()

        Run all the root detection checks.

      • isRootedWithBusyBoxCheck

         boolean isRootedWithBusyBoxCheck()

        Run all the checks including checking for the busybox binary.Warning: Busybox binary is not always an indication of root, many manufacturers leave thisbinary on production devices

      • detectTestKeys

         boolean detectTestKeys()

        Release-Keys and Test-Keys has to do with how the kernel is signed when it is compiled.Test-Keys means it was signed with a custom key generated by a third-party developer.

      • detectRootManagementApps

         boolean detectRootManagementApps()

        Using the PackageManager, check for a list of well known root apps. @link {Const.knownRootAppsPackages}

      • detectRootManagementApps

         boolean detectRootManagementApps(Array<String> additionalRootManagementApps)

        Using the PackageManager, check for a list of well known root apps. @link {Const.knownRootAppsPackages}

        Parameters:
        additionalRootManagementApps - - array of additional packagenames to search for
      • detectPotentiallyDangerousApps

         boolean detectPotentiallyDangerousApps()

        Using the PackageManager, check for a list of well known apps that require root. @link {Const.knownRootAppsPackages}

      • detectPotentiallyDangerousApps

         boolean detectPotentiallyDangerousApps(Array<String> additionalDangerousApps)

        Using the PackageManager, check for a list of well known apps that require root. @link {Const.knownRootAppsPackages}

        Parameters:
        additionalDangerousApps - - array of additional packagenames to search for
      • detectRootCloakingApps

         boolean detectRootCloakingApps()

        Using the PackageManager, check for a list of well known root cloak apps. @link {Const.knownRootAppsPackages}and checks for native library read access

      • detectRootCloakingApps

         boolean detectRootCloakingApps(Array<String> additionalRootCloakingApps)

        Using the PackageManager, check for a list of well known root cloak apps. @link {Const.knownRootAppsPackages}

        Parameters:
        additionalRootCloakingApps - - array of additional packagenames to search for
      • checkForSuBinary

         boolean checkForSuBinary()

        Checks various (Const.suPaths) common locations for the SU binary

      • checkForMagiskBinary

         boolean checkForMagiskBinary()

        Checks various (Const.suPaths) common locations for the magisk binary (a well know root level program)

      • checkForBusyBoxBinary

         boolean checkForBusyBoxBinary()

        Checks various (Const.suPaths) common locations for the busybox binary (a well know root level program)

      • checkForBinary

         boolean checkForBinary(String filename)
        Parameters:
        filename - - check for this existence of this file
      • setLogging

         void setLogging(boolean logging)
        Parameters:
        logging - - set to true for logging
      • checkForRWPaths

         boolean checkForRWPaths()

        When you're root you can change the permissions on common system directories, this method checks if any of these patha Const.pathsThatShouldNotBeWritable are writable.

      • checkSuExists

         boolean checkSuExists()

        A variation on the checking for SU, this attempts a 'which su'

      • checkForNativeLibraryReadAccess

         boolean checkForNativeLibraryReadAccess()

        Checks if device has ReadAccess to the Native LibraryPrecondition: canLoadNativeLibrary() ran before this and returned trueDescription: RootCloak automatically blocks read access to the Native Libraries, howeverallows for them to be loaded into memory. This check is an indication that RootCloak isinstalled onto the device.

      • canLoadNativeLibrary

         boolean canLoadNativeLibrary()

        Checks if it is possible to load our native library

      • checkForRootNative

         boolean checkForRootNative()

        Native checks are often harder to cloak/trick so here we call through to our native root checker