इस पैकेज में iOS सिम्युलेटर, एंड्रॉइड इमुलेटर और डीबग मोड का पता लगाने में मदद मिलती है। इस पैकेज में एंड्रॉइड डिवाइस पर मॉक लोकेशन/फेक जीपीएस लोकेशन का पता लगाने में भी मदद मिलती है। साथ ही यह जाँचता है कि डिवाइस असली है या नहीं।
सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
safe_device पैकेज विकासकर्ताओं को यह पता लगाने में मदद करता है कि क्या एप्लिकेशन ऐसे सिमुलेटेड वातावरण में चल रहा है जैसे कि iOS सिमुलेटर, Android इमुलेटर, या डीबग मोड में। यह एंड्रॉइड डिवाइस पर झूठे जीपीएस स्थानों की पहचान करता है और यह भी तय करता है कि डिवाइस असली है या नहीं। यह सुरक्षा को बढ़ावा देता है जिससे सिमुलेटेड या फर्जी वातावरणों से अनधिकृत पहुंच को रोका जा सके। यह पैकेज ऐसे एप्लिकेशन के लिए उपयोगी है जिनमें मजबूत डिवाइस अखंडता जांच की आवश्यकता होती है, खासकर वित्तीय या संवेदनशील डेटा के संदर्भ में।
उपयोग
एमूलेटर के उपयोग के खिलाफ ऐप्स को सुरक्षित करना
झांसा GPS स्थान का पता लगाना
डिबग मोड के दुरुपयोग से बचाव
वास्तविक उपकरण की उपस्थिति की पुष्टि करना
घोटाले का पता लगाने में सुधार
संवेदनशील डेटा पहुँच की रक्षा
मुख्य विशेषताएँ
iOS सिमुलेटर का पता लगाता है
एंड्रॉइड एम्युलेटर की पहचान करता है
डिबग मोड की जांच करें
मॉकलोकेशन/फेक जीपीएस का पता लगाता है
डिवाइस की ऑथेंटिसिटी की पुष्टि करता है
हल्का और प्लेटफॉर्म-अनुकूल
इनके लिए उपयुक्त
सुरक्षा-केंद्रित अनुप्रयोग
वित्तीय या बैंकिंग ऐप्स
धोखाधड़ी रोकथाम प्रणालियाँ
उपकरण अखंडता की आवश्यकता होती है
विकासकर्ता रनटाइम सुरक्षा को प्राथमिकता देते हैं
उच्च सुरक्षा आवश्यकताओं वाले मोबाइल एप्प्स
विचार योग्य बातें
Android और iOS प्लेटफॉर्म तक सीमित
सभी प्रकार के स्पूफिंग को रोकता नहीं है
उपकरण-विशिष्ट संकेतकों पर निर्भर करता है
रूटेड डिवाइस पर गलत सक्रियता का कारण बन सकता है
Android पर सही अनुमति प्रबंधन की आवश्यकता होती है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
safe_device (Null-Safety)
Flutter (Null-Safety) Jailbroken, root, emulator and mock location detection.
Getting Started
In your flutter project add the dependency:
dependencies:...safe_device:^1.4.1
Usage
Importing package
import'package:safe_device/safe_device.dart';
Configuration
You can configure the plugin at startup using SafeDevice.init and SafeDeviceConfig. This is useful if you want to disable automatic check such as the mock location detection.
import'package:safe_device/safe_device.dart';
import'package:safe_device/safe_device_config.dart';
voidmain() async {
SafeDevice.init(
SafeDeviceConfig(mockLocationCheckEnabled: false), // disables mock location check on Android
);
// ...rest of your app
}
It's not mandatory to configure the plugin at the start, if not provided a default configuration with everything enable is provided automatically
Using it
Checks whether device JailBroken on iOS/Android?
bool isJailBroken = awaitSafeDevice.isJailBroken;
(iOS ONLY) Enhanced jailbreak detection with custom path checking
Android: If mock location check is disabled via config, the check always returns false and no location updates are started. If enabled (default), the check is active.
iOS: The config is stored for future use but does not affect current detection logic. Mock location detection on iOS is based on jailbreak/emulator status.
(ANDROID ONLY) Check if application is running on external storage
Detects a wide range of Android emulators including:
Android SDK Emulator, Genymotion
LDPlayer, MEmu, BlueStacks, MuMu Player (NetEase), Nox, Droid4X
Known Limitations
Root and jailbreak detection is a best-effort approach. A determined attacker using tools such as Magisk Hide or Zygisk can bypass detection. This plugin is intended as a security layer — not a guarantee.
Device-specific handling: Some manufacturers (Samsung, Xiaomi, Vivo) ship with system properties or Knox security components that can cause false positives. The plugin applies conservative multi-indicator checks for these brands to balance accuracy and reliability.
Notes
Mock location detection
Android — Location permission is required to detect mock location. The check can be disabled at runtime via config.
iOS — Mock location detection is based on jailbreak/emulator status.
Development Mode
Development Options in emulator is always true by default.
❗Since emulators are usually rooted, you might want to bypass these checks during development. Unless you're keen on constant false alarms ⏰