device_root_jail_state_check 0.0.2
device_root_jail_state_check: ^0.0.2 copied to clipboard
A comprehensive Flutter package to detect device mode, developer mode, emulator, root/jailbreak status, network connection type, and real-time network speed.
A comprehensive Flutter package to detect device security status, operation mode, network information, and real-time monitoring. Perfect for security-sensitive applications, compliance checks, and device integrity verification.
🚀 Features 🔒 Security Detection
Root detection (Android)
Jailbreak detection (iOS)
Developer mode detection
Emulator/Simulator detection
📱 Device Information
Device mode detection (Normal, Safe, Airplane, Power Saving)
Real-time device status monitoring
Platform and version information
🌐 Network Monitoring
Network type detection (WiFi, Mobile, Ethernet, VPN, Bluetooth)
Real-time network speed monitoring
Connection status tracking
Signal strength measurement
🛡️ Security Compliance
Comprehensive security status reporting
Real-time monitoring streams
Custom security checks
📦 Installation Add this to your pubspec.yaml:
yaml dependencies: device_root_jail_state_check: ^0.0.2 Then run:
bash flutter pub get 🎯 Usage Basic Usage dart import 'package:device_root_jail_state_check/device_root_jail_state_check.dart';
final detector = DeviceRootJailStateCheck();
// Get comprehensive device information DeviceInfo deviceInfo = await detector.getDeviceInfo();
print('Device Mode: ${deviceInfo.deviceMode}'); print('Is Emulator: ${deviceInfo.isEmulator}'); print('Security Status: ${deviceInfo.securityStatus}'); print('Network Type: ${deviceInfo.networkInfo.type}'); Security Status Check dart // Check if device is rooted or jailbroken SecurityStatus status = await detector.getSecurityStatus();
switch (status) { case SecurityStatus.normal: print('Device is secure'); break; case SecurityStatus.rooted: print('Android device is rooted!'); break; case SecurityStatus.jailbroken: print('iOS device is jailbroken!'); break; case SecurityStatus.potentiallyCompromised: print('Device might be compromised'); break; case SecurityStatus.unknown: print('Unable to determine security status'); break; } Real-time Network Monitoring dart // Monitor network changes detector.getNetworkInfoStream().listen((networkInfo) { print('Network changed: ${networkInfo.type}'); print('Connected: ${networkInfo.isConnected}'); print('Signal Strength: ${networkInfo.signalStrength}dBm'); });
// Monitor network speed detector.getNetworkSpeedStream().listen((speedInfo) { print('Download: ${speedInfo.downloadSpeed.toStringAsFixed(2)} Mbps'); print('Upload: ${speedInfo.uploadSpeed.toStringAsFixed(2)} Mbps'); }); Individual Checks dart // Check specific conditions bool isEmulator = await detector.isEmulator(); bool isDevMode = await detector.isDeveloperModeEnabled(); DeviceMode deviceMode = await detector.getDeviceMode();
if (isEmulator) { print('Running on emulator - security restrictions may apply'); }
if (isDevMode) { print('Developer mode is enabled'); } 📋 API Reference Main Class DeviceRootJailStateCheck The main class providing all detection capabilities.
Methods:
Future
Future
Future
Future
Future
Stream
Stream
void dispose() - Clean up resources
Data Models DeviceInfo dart class DeviceInfo { final DeviceMode deviceMode; final bool isDeveloperModeEnabled; final bool isEmulator; final SecurityStatus securityStatus; final NetworkInfo networkInfo; final String platform; final String platformVersion; final String deviceModel; final String deviceBrand; } SecurityStatus dart enum SecurityStatus { normal, // Device is secure rooted, // Android device is rooted jailbroken, // iOS device is jailbroken potentiallyCompromised, // Suspicious activity detected unknown // Unable to determine status } DeviceMode dart enum DeviceMode { normal, // Standard operation mode safeMode, // Safe mode (Android) emergencyMode, // Emergency mode airplaneMode, // Airplane mode powerSavingMode, // Power saving mode unknown // Unknown mode } NetworkInfo dart class NetworkInfo { final NetworkType type; // wifi, mobile, ethernet, vpn, bluetooth, none final bool isConnected; // Connection status final double downloadSpeed; // in Mbps final double uploadSpeed; // in Mbps final int latency; // in milliseconds final String ssid; // WiFi SSID final String bssid; // WiFi BSSID final int signalStrength; // in dBm } 🛠️ Platform Support Platform Root/Jailbreak Device Mode Network Info Real-time Speed Android ✅ ✅ ✅ ✅ iOS ✅ ✅ ✅ ✅ Web ❌ ❌ ⚠️ Limited ❌ Desktop ❌ ❌ ⚠️ Limited ❌ 🔒 Permissions Android Add these permissions to your android/app/src/main/AndroidManifest.xml:
xml
xml 📱 Example App Check out the example app in the example/ directory for a complete implementation.
dart class SecurityCheckScreen extends StatefulWidget { @override _SecurityCheckScreenState createState() => _SecurityCheckScreenState(); }
class _SecurityCheckScreenState extends State
@override void initState() { super.initState(); _loadDeviceInfo(); }
void _loadDeviceInfo() async { final info = await _detector.getDeviceInfo(); setState(() { _deviceInfo = info; }); }
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text('Security Check')), body: _deviceInfo == null ? Center(child: CircularProgressIndicator()) : SecurityStatusWidget(deviceInfo: _deviceInfo!), ); }
@override void dispose() { _detector.dispose(); super.dispose(); } } 🚨 Security Considerations This package provides detection mechanisms but cannot prevent security breaches
Always use additional security measures in production apps
Consider implementing certificate pinning, code obfuscation, and runtime integrity checks
Regular updates are recommended as root/jailbreak methods evolve
🔧 Troubleshooting Common Issues Network info not available on iOS 14+
Ensure proper permissions in Info.plist
Request location permissions for precise network info
Root detection false positives
Some legitimate devices might trigger false positives
Consider implementing custom verification logic
Performance concerns
Use streams efficiently and dispose when not needed
Consider throttling network speed monitoring
Error Handling dart try { SecurityStatus status = await detector.getSecurityStatus(); } catch (e) { print('Error checking security status: $e'); // Fallback logic } 🤝 Contributing We welcome contributions! Please see our Contributing Guide for details.
Fork the repository
Create your feature branch (git checkout -b feature/AmazingFeature)
Commit your changes (git commit -m 'Add some AmazingFeature')
Push to the branch (git push origin feature/AmazingFeature)
Open a Pull Request
📄 License This project is licensed under the MIT License - see the LICENSE file for details.
👨💻 Author Anupam Das
GitHub: @https://github.com/danupam822
Package: device_root_jail_state_check
🌟 Show your support Give a ⭐️ if this project helped you!
📮 Issues and Feedback If you encounter any problems or have suggestions, please file an issue on the GitHub repository.
Note: This package is designed for security assessment and should be used responsibly. Always respect user privacy and comply with applicable laws and regulations.