safe_device 1.1.4 safe_device: ^1.1.4 copied to clipboard
With the Flutter safe_device package, you can easily implement security steps such as Jailbroken, root, emulator and fake location detection.
safe_device (Null-Safety) #
Getting Started #
In your flutter project add the dependency:
dependencies: ... safe_device: ^1.1.4
Checks whether device JailBroken on iOS/Android?
bool isJailBroken = await SafeDevice.isJailBroken;
Checks whether device is real or emulator
bool isRealDevice = await SafeDevice.isRealDevice;
Can this device mock location - no need to root!
bool canMockLocation = await SafeDevice.canMockLocation;
(ANDROID ONLY) Check if application is running on external storage
bool isOnExternalStorage = await SafeDevice.isOnExternalStorage;
Check if device violates any of the above
bool isSafeDevice = await SafeDevice.isSafeDevice;
(ANDROID ONLY) Check if development Options is enable on device
bool isDevelopmentModeEnable = await SafeDevice.isDevelopmentModeEnable;
Mock location detection
- Android - Location permission needs to be granted in app in order to detect mock location properly
- iOS - For now we are checking if device is Jail Broken or if it's not real device. There is no strong detection of mock location in iOS (Open the PR if you have better way for mock location detection in iOS)
- -Development Options in emulator always is true for default