rn-detect-developer-options
v0.1.8
Published
A lightweight React Native library to detect if Developer Options or USB Debugging are enabled on an Android device. It helps developers prevent tampering, improve app security, or show custom warnings or actions (like dialogs or redirects) when Developer
Maintainers
Readme
rn-detect-developer-options
A lightweight React Native library to detect if Developer Options or USB Debugging are enabled on an Android device.
Useful for preventing tampering, improving app security, or showing custom warnings when Developer Mode is active.
🚀 Installation
npm install rn-detect-developer-options
or
yarn add rn-detect-developer-options
After installation, run:
npx pod-install
(iOS will always return false, since Developer Options are Android-only)
📱 Usage Example
import React, { useEffect } from 'react';
import { View, Text, Alert } from 'react-native';
import { isDeveloperOptionsEnabled } from 'rn-detect-developer-options';
export default function App() {
useEffect(() => {
(async () => {
const enabled = await isDeveloperOptionsEnabled();
if (enabled) {
Alert.alert('Warning', 'Developer Options are enabled on this device!');
}
})();
}, []);
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Detect Developer Options (Kotlin) Demo</Text>
</View>
);
}