h6. What We should expose a function that allows the end developer to check if the underlying device is rooted.
h6. Why A rotted device can be used to modify application code or recover application data. We should provide a function to allow a user to check if the device is rooted so that they can take actions to protect the user and their data.
h6. How We can use the [RootBeer|https://github.com/scottyab/rootbeer] library to check if the user's device is rooted.
{code:java} /** * Detect if the device is rooted. */ public void boolean detectRoot() { RootBeer rootBeer = new RootBeer(context); if (rootBeer.isRooted()) { return true; } else { return false; } }
{code} |
|