Expo-device library Android Kotlin needs modifcations

EXPO SDK 44.0.6:
Android

The expo-device library with version 4.1.0 has a method used to check root access on any mobile, it is written in Kotlin, but it doesn’t cover all of rooted devices and it needs modifications

Hi @steadypoint

I suspect this is much more likely to be fixed if you specify which rooted devices it doesn’t cover and which changes are needed.

Thanks, @wodin for the reply,
We have tried on many Xiaomi rooted devices and it didn’t catch them, I think the method called “isRootedExperimentalAsync” which is written for Android in Kotlin needs modifications by checking if the “su” command can be executed or not instead of the current logic which is just checking if the “Superuser.apk” is installed or not, I appreciate your help.

I see.

I suspect it would be better to use a dedicated React Native library for this. Here’s one that I found which looks like it should work:

It will not work in Expo Go or if you build with expo build. But it should work if you build with EAS Build. Instead of Expo Go you can build a custom dev client with EAS Build.

Otherwise, maybe you could create a feature request to improve detection of rooted devices using expo-device. If you do that it seems like this Stack Overflow answer might be a good place to link to.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.