RootTools.isAccessGiven() not only checks if a device is rooted, but it also runs su for your app, requests permission, and returns true if your programme was granted root permissions successfully. This might be the first check in your app to ensure that you'll have access when you need it.