safe_device
This package helps to detect iOS Simulator, Android Emulator and Debug Mode. This package also detects MockLocation/Fake GPS location on Android Device. Also check device is real or not.
1.4.1
140K downloads/mo
#986 most downloaded on pub.dev
ufukhawk/safe_device
What this package is like to depend on
Last release 1 months ago
07 Jul 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 32 of 35 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
35 releases · first in 2021
7 releases in the last 12 months
see the full history below
Release timeline
35 releases · May 2021 to Jul 2026Releases
latest 35-
1.4.107 Jul 2026Release notes
Open source →- iOS: Fix Xcode failing to resolve Swift Package Manager dependencies with
the package manifest at '/Package.swift' cannot be accessedwhen building on Flutter 3.44.2/3.44.4.DTTJailbreakDetectionis now vendored directly into thesafe_deviceSPM package instead of being referenced as a remote dependency, since its upstream repository ships noPackage.swiftof its own.
- iOS: Fix Xcode failing to resolve Swift Package Manager dependencies with
-
1.4.026 Jun 2026Release notes
Open source →- iOS: Add Swift Package Manager (SPM) support alongside CocoaPods. Resolves the "plugin does not support Swift Package Manager" warning under Flutter 3.44+. Addresses #94.
- iOS: Fix Xcode 16+ semantic compiler error in
SafeDeviceJailbreakDetection.mby replacing file-scope static array literals with class methods. Resolves #98.
-
1.3.1024 Apr 2026Release notes
Open source →- Fixed build error:
checkTestKeys()method was missing fromRootedCheck.java— the call ingetRootDetectionDetails()now uses an inlineBuild.TAGScheck instead.
- Fixed build error:
-
1.3.924 Apr 2026Release notes
Open source →- Resolved #95. Fixed
NullPointerExceptioncrash whenisMockLocationis called before the location listener is initialized (e.g. whenmockLocationCheckEnabledisfalse). - Resolved #83. Fixed GPS running continuously in background — location updates are now properly stopped when the plugin detaches from the Flutter engine.
- Resolved #91. Fixed false positive jailbreak detection on iPad apps running on macOS (Mac Catalyst). Detection now always returns
falseon Mac Catalyst. - Resolved #92 and #93. Improved palera1n rootless jailbreak detection by adding specific indicator paths (
/var/jb/.installed_palera1n,/var/jb/usr/bin/su,/var/jb/usr/lib/apt). - Resolved #85. Added MuMu Player (NetEase) emulator detection.
- Resolved #82. Fixed false positive on Vivo Y11 —
isRealDevicewas incorrectly returningfalsedue to an overly broadBuild.HOSTcheck; added Vivo and other common OEM manufacturers to the exclusion list. Applied conservative multi-indicator root detection for Vivo devices. - Resolved #80. Fixed false positive
isJailBrokenon Samsung Galaxy Z Fold5 — Knox security system was triggering detection on non-rooted devices. Samsung devices now require multiple strong indicators before being flagged as rooted. - iOS: Removed
/bin/shfrom jailbreak paths — this file is present on stock iOS 16+ devices and was causing false positives. - Android: Fixed process leak in
canExecuteCommand—process.destroy()is now always called. - Android: Removed duplicate
checkTestKeys()method (was identical tocheckBuildTags()). - Resolved #86. Fixed
SafeDeviceJailbreakDetectionnot being called byisJailBrokenCustomnorisJailBroken. - Resolved #77. Fixed
jailbreakDetailsmethod channel name. - Added missing bool cast for
isSimulatorvalue injailbreakDetails.
- Resolved #95. Fixed
-
1.3.815 Oct 2025 -
1.3.715 Oct 2025Nothing published for this version
-
1.3.615 Oct 2025Release notes
Open source →- Android Configurable Mock Location Detection: The mock location check on Android is now conditional based on the configuration provided via the
initmethod from Dart. IfmockLocationCheckEnabledis set tofalse, mock location detection is disabled and location updates are not started. If no configuration is provided, the plugin behaves exactly as before for full backward compatibility. - iOS Config Support: The iOS plugin now accepts and stores the configuration from Dart via the
initmethod, mirroring the Android API. While iOS does not currently use the mock location flag, this enables future extensibility and API consistency. - Bug fix for emulator.
Technical Details
- Added
SafeDeviceConfigclass, served to both Platform to includemockLocationCheckEnabledand future possible configuration - Added
initmethod to both Android and iOS native plugins to receive and store configuration from Dart. - Android: Location updates and mock location checks are only started if enabled in config.
- iOS: Configuration is stored for future use, since the only configuration available now is for mock location check which is not supported on iOS.
- Android Configurable Mock Location Detection: The mock location check on Android is now conditional based on the configuration provided via the
-
1.3.514 Jul 2025Nothing published for this version
-
1.3.413 Jul 2025Release notes
Open source →- CRITICAL: Fixed false positive root detection on real Android devices (especially Xiaomi/Redmi devices)
- Removed normal Android system files from emulator root detection that were causing false positives
- Fixed
emulatorSpecificRootcheck to only apply to actual emulators, not real devices - Improved Xiaomi/Redmi/POCO device support with more conservative root detection
Changed
- Emulator-specific root checks now only run on actual emulators, not real devices
- Xiaomi/Redmi/POCO devices now use more conservative root detection methods
- Removed false positive triggers:
/system/bin/app_process32,/system/bin/debuggerd,/system/bin/debuggerd64,/system/bin/rild,/proc/1/maps,/system/recovery-from-boot.p,/system/etc/security/otacerts.zip
Technical Details
- Added
isLikelyEmulator()method to properly identify emulators before applying emulator-specific checks - Xiaomi devices now require multiple strong indicators (obvious root signs + basic check + su binary) before being flagged as rooted
- Better separation between emulator detection and real device root detection
-
1.3.301 Jul 2025Release notes
Open source →- CRITICAL iOS SECURITY FIX: Resolved false positive jailbreak detection in development environment that affected real devices.
- Development Environment Detection: Added intelligent detection to distinguish between legitimate development variables and actual jailbreak indicators.
- DYLD_INSERT_LIBRARIES Fix: Fixed false positive caused by Apple's legitimate development environment variables (DYLD_INSERT_LIBRARIES).
- Real Device Accuracy: iPhone 16 Pro Max, iPhone SE, and other real devices now correctly return
falsefor jailbreak detection during development. - Platform Consistency: Resolved discrepancy where macOS development showed
truewhile Windows development showedfalse. - Type Safety Fix: Fixed
Map<Object?, Object?>casting error injailbreakDetailsmethod. - Enhanced Debug Info: Added comprehensive debugging information including development environment status, legitimate environment variables, and DTT library results.
- Smart Filtering: Added filtering for legitimate Apple framework paths in DYLD_INSERT_LIBRARIES.
- Production Safety: Maintains full jailbreak detection accuracy in production while being lenient in development.
- API Change:
jailbreakDetailsnow returnsMap<String, dynamic>instead ofMap<String, bool>for better debugging info.
-
1.3.227 Jun 2025Release notes
Open source →- Major Architecture Change: Converted iOS jailbreak detection from Swift to Objective-C for complete build stability.
- Eliminated All Bridging Issues: Removed all Swift-Objective-C bridging dependencies that caused compilation errors.
- Simplified iOS Build: No more Swift compiler requirements, bridging headers, or module configurations needed.
- Complete Type Safety: Direct Objective-C implementation eliminates type conversion issues between Swift and Dart.
- Enhanced Compatibility: Works across all iOS project configurations without custom build settings.
- Performance Improvement: Direct Objective-C calls eliminate runtime class resolution overhead.
- Same Functionality: All 20+ jailbreak detection methods preserved with identical behavior.
- Bug Fix: Permanently resolved all Swift-related build errors including bridging header and linker issues.
-
1.3.126 Jun 2025Release notes
Open source →- iOS Build Fix: Resolved Swift bridging header compilation issues that caused build failures.
- Swift Integration Improvement: Replaced compile-time Swift header imports with runtime class resolution for better compatibility.
- Podspec Optimization: Simplified iOS podspec configuration to prevent bridging header path conflicts.
- Enhanced Swift-Objective-C Interoperability: Added
@objcMembersannotation for automatic method exposure. - Bug Fix: Fixed "Build input file cannot be found: safe_device-Bridging-Header.h" error.
- Bug Fix: Resolved "Undefined symbol: OBJC_CLASS$_SafeDeviceJailbreakDetection" linker error.
-
1.3.026 Jun 2025Release notes
Open source →- Enhanced Android Emulator Detection: Improved detection for popular Android emulators including LDPlayer, MEmu, BlueStacks.
- LDPlayer Detection: Added specific detection for LDPlayer emulator with brand, model, and file-based checks.
- Enhanced Root Detection: Improved root detection for emulators with additional checks for:
- Test-keys in build tags
- Emulator-specific root files
- Enhanced su binary detection
- Dangerous system properties (ro.debuggable, ro.secure, service.adb.root)
- Architecture Detection: Added enhanced x86/i686 architecture detection for emulator identification.
- Bug Fix: Resolved issue where rooted LDPlayer was not properly detected as both emulator and rooted device.
- Enhanced iOS Jailbreak Detection: Implemented comprehensive custom jailbreak detection for iOS.
- New Swift Implementation: Added
SafeDeviceJailbreakDetectionclass with advanced detection methods. - Expanded Path Checking: Added detection for 20+ additional jailbreak-related paths including:
- Cydia and package managers (
/Applications/Cydia.app,/private/var/lib/apt, etc.) - System binaries (
/bin/bash,/usr/sbin/sshd,/usr/libexec/ssh-keysign, etc.) - MobileSubstrate files (
/Library/MobileSubstrate/MobileSubstrate.dylib) - Launch daemons (
/System/Library/LaunchDaemons/com.saurik.Cydia.Startup.plist)
- Cydia and package managers (
- Multiple Detection Methods: Added URL scheme detection, sandbox violation testing, environment variable checking, and symbolic link detection.
- New API Methods:
isJailBrokenCustom: iOS-only method using custom detection algorithmjailbreakDetails: Returns detailed breakdown of detection methods
- Improved Reliability: Enhanced main
isJailBrokenmethod now combines DTTJailbreakDetection with custom detection. - Swift 5.0 Support: Updated podspec to support modern Swift development.
- Updated Example App: Enhanced example to demonstrate new jailbreak detection features.
- Bug Fix: Resolved Swift pod integration issue by adding modular headers support for DTTJailbreakDetection dependency.
- Bug Fix: Fixed iOS Simulator false positive detection - custom jailbreak detection now correctly returns false on simulator environment.
-
1.2.120 Mar 2025Release notes
Open source →- Upgraded rootbeer-lib dependency from version 0.1.0 to 0.1.1.
- Corrected the activity name in AndroidManifest.xml from 'MainActivityvvvv' to 'MainActivity'.
-
1.2.006 Jan 2025 -
1.1.928 Sep 2024Release notes
Open source →- Removed the Permission Handler package.
- Updated the example code.
- Upgraded the iOS platform version.
- Updated the Dart version.
- Added location permission request for iOS.
- Integrated Geolocator package for handling location permissions.
-
1.1.820 Aug 2024 -
1.1.722 Apr 2024 -
1.1.629 Feb 2024 -
1.1.529 Feb 2024Release notes
Open source →- Removed trust_location package.
- Updated Flutter and Dart version.
- Updated Gradle version.
-
1.1.416 May 2023 -
1.1.316 May 2023Release notes
Open source →- Updated Flutter and Dart version.
- Changed location permission request package.
-
1.1.214 Nov 2022Nothing published for this version
-
1.1.107 Apr 2022 -
1.1.027 Jan 2022 -
1.0.921 Oct 2021 -
1.0.811 Sep 2021 -
1.0.719 Jul 2021 -
1.0.626 May 2021 -
1.0.526 May 2021Release notes
Open source →- 'Example' codes in the project have been edited and location permission request has been added for Mock Location control.
-
1.0.407 May 2021 -
1.0.305 May 2021 -
1.0.205 May 2021 -
1.0.104 May 2021 -
1.0.004 May 2021