app_security 1.0.7 copy "app_security: ^1.0.7" to clipboard
app_security: ^1.0.7 copied to clipboard

App Security SDK

πŸ”’ App Security SDK for Flutter #

MIT License pub dart

App Security SDK is a Flutter plugin that helps you secure your application by detecting unsafe environments like rooted/jailbroken devices, cloned apps, piracy, debugging, and more. It also validates the app’s integrity, detects VPN usage, and ensures the app is installed from trusted sources.

πŸ“· Screenshots #

gif

βœ… Android Permissions #

If you want to access IMEI (available only on Android versions below 10), you need to add the following permission in your AndroidManifest.xml:

<uses-permission android:name="android.permission.READ_PHONE_STATE" />

⚠️ On Android 10 (API 29) and above, IMEI access is restricted for privacy reasons, so this feature will return null on newer devices.

✨ Features #

  • βœ… Root/Jailbreak Detection Detect if the device is rooted (Android) or jailbroken (iOS).

  • βœ… VPN Detection Identify active VPN connections for network safety.

  • βœ… Real Device Check Ensure the app runs on a real device and not on an emulator/simulator.

  • βœ… Developer Mode & Debugging Check Detect whether the device is in developer mode or being debugged.

  • βœ… Piracy Detection Validate app integrity and detect pirate apps using Kevlar.

  • βœ… Install Source Verification Ensure the app was installed from trusted sources like Play Store, App Store, or TestFlight.

  • βœ… Clone Detection Detect cloned or dual apps using sandbox validation.

  • βœ… Device Identifier Access Fetch Device ID (Android ID) and Identifier for Vendor (iOS).

πŸ“¦ Installation #

Add the package to your pubspec.yaml:

dependencies:
  app_security: ^latest_version
dependencies:
  flutter pub get

πŸš€ Usage #

Import the package:

import 'package:app_security/app_security.dart';

βœ… Root/Jailbreak Detection #

bool isRooted = await AppSecurity.isUseJailBrokenOrRoot();

πŸ”’ Check VPN Usage #

bool vpnActive = await AppSecurity.isDeviceUseVPN();

πŸ›‘οΈ Validate App Environment #

List<String>? issues = await AppSecurity.isSafeEnvironment();
print(issues); // e.g., ["JAILBREAK", "VPN_ACTIVE"]

πŸ“² Get Device ID #

String? deviceId = await AppSecurity.getDeviceId();

πŸ›  Check Install Source #

String? source = await AppSecurity.installSource();
print(source); // e.g., "playstore", "appstore", "testflight"

πŸ›  Open developer Options #

String? source = await AppSecurity.openDeveloperSettings();

πŸ” Detect Cloned App #

bool isCloned = await AppSecurity.isClonedApp();

πŸ›  Add a Window Flag #

import 'package:app_security/window_flags.dart';

bool isCloned = await AppSecurity.addFlags(WindowFlags.FLAG_SECURE);

πŸ›  Clear a Window Flag #

import 'package:app_security/window_flags.dart';

bool isCloned = await AppSecurity.clearFlags(WindowFlags.FLAG_SECURE);

πŸ›‘ Supported Platforms #

  • βœ… Android: Uses Kevlar for root and piracy detection.
  • βœ… iOS: Implements native checks for jailbreak, VPN, and integrity.

πŸ› οΈ Customization #

  • Configure allowed installers: Play Store, App Store, TestFlight.
  • Extend detection for enterprise distribution or sideloaded apps.

πŸ“„ License #

This project is licensed under the MIT License. See the LICENSE file for details.

πŸ’¬ Contributing #

Feel free to submit issues or pull requests. Contributions are welcome!

🌐 Author #

Made with ❀️ by Deepak.