Understood.
The only other idea that comes to mind is to use the which
command which is used to locate the executable su
file. Since that command isn't part of Android by default if it completes successfully then the device is rooted.
As mentioned before there are just too many rooting exploits and you most likely will have to consistently upgrade your app to match them. One way to do that is to keep a list of applications related to rooting and test to see in any are installed using the pm
(package manager) command