safe_device
1.4.1, released 4 months ago by ufuksahin.dev
Detect jailbreak/root, emulator, mock location and other safety flags on iOS/Android devices.
What it does
The plugin provides async methods to check if the device is jail‑broken/rooted, running on an emulator, using mock GPS, on external storage or in development mode. It also aggregates these checks into a single safety flag.
AI-written summary of version 1.4.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to block or warn users on compromised devices
- You want to enforce security policies before allowing sensitive actions
Skip it when
- Precise location tracking is required without extra permissions
- False‑positive risk is unacceptable for your user base
Strengths
- Broad detection of jailbreak, root and many Android emulators
- Configurable at startup to disable mock‑location checks
- Detailed breakdown methods for debugging
Weaknesses
- May produce false positives on some manufacturers
- Requires location permission on Android for mock‑location detection
- iOS mock‑location detection relies on jailbreak/emulator status
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 0
Add safe_device to pubspec, call SafeDevice.init (optional config), request location permission on Android for mock‑location checks, no extra native setup beyond standard plugin integration.
import 'package:safe_device/safe_device.dart';
void main() async {
SafeDevice.init(SafeDeviceConfig(mockLocationCheckEnabled: false));
bool isSafe = await SafeDevice.isSafeDevice;
print('Device safe: $isSafe');
}Alternatives
Packages that do the same job and could replace safe_device.
- location
Flutter plugin to get real-time device location across platforms.
94Compare - is_ios_simulator
Checks whether the app is running in the iOS Simulator or on a physical device
72Compare - google_api_availability
Check the availability of Google Play services on an Android device.
88Compare - print_bluetooth_thermal
Print tickets on 58mm/80mm thermal Bluetooth printers from Flutter apps.
80Compare