Skip to main content

flutter_anti_virtuals 0.4.0 copy "flutter_anti_virtuals: ^0.4.0" to clipboard
flutter_anti_virtuals: ^0.4.0 copied to clipboard

Detects VPNs, proxies, mock location, virtual cameras, root, hooks and emulators on Android and iOS, with basic checks on desktop and the web.

0.4.0 #

  • AntiVirtualGuard and AntiVirtualMonitor have a scanTimeout, 10 seconds by default. A scan that takes longer counts as a failed scan with a TimeoutException, so a check that hangs no longer keeps the app on the loading screen: it is let through, or blocked with failClosed. Pass null for the previous behavior.
  • Android: every check has 3 seconds and a scan 8 seconds in total. A check that runs out of time is reported as failed instead of holding up the scan and the verify() and rebindDevice() calls behind it.
  • Fix: AntiVirtualMonitor.rescan() and AntiVirtualGuard.rescan(context) returned at once when a scan was already running, before the result was in. The future now completes with the scan that runs after it, so the state after await monitor.rescan() is up to date.
  • Fix: an open port 27042 alone no longer reports hooked (Android and iOS). Any app may listen there. The port is still reported next to other hooking evidence.
  • doc/server-verification.md: only the leaf of a key attestation chain may carry the attestation, and a server has to decide which signals it insists on. anti_virtuals_verifier 0.3.0 fixes a forged chain it accepted.
  • The repository has a security policy, SECURITY.md.

0.3.0 #

  • Four new signals. activeCall fires while a phone or VoIP call is in progress (Android audio mode, iOS CallKit), and on Android 12+ a call starting or ending emits on environmentChanges. noScreenLock fires on a device without a PIN, pattern, password or passcode. appDataMigrated fires when the app's data was restored from a backup or moved from another device; FlutterAntiVirtuals.instance.rebindDevice() accepts it again. automation (Android and web) reports the monkey tester, test harness mode, a connected UiAutomation, installed automation tools, WebDriver and headless Chrome. None of them blocks by default.
  • FlutterAntiVirtuals.instance.screenshots emits after the user takes a screenshot (Android 14+, iOS). Android declares the DETECT_SCREEN_CAPTURE permission for it, granted at install.
  • showPlayIntegrityDialog() shows Google Play's remediation dialogs (PlayIntegrityDialog: get the app from Play, close risky apps, fix device integrity) for the last token of the session. The Play Integrity library is now 1.5.0.
  • iOS: signatureMismatch checks the team ID that signed the app against the new ScanOptions.expectedTeamIds, and reports an App Store build whose binary is no longer encrypted.
  • iOS: AttestationOptions(deviceCheck: true) adds a DeviceCheck token (PlatformAttestation.deviceCheckToken) for Apple's per-device two bits.
  • macOS, Windows and Linux now check vpn, proxy, debugger, emulator (a virtual machine) and clockTampering against a trustedTime, and the web checks automation and clockTampering. A guard on these platforms can now block: one with the default blockOn blocks a desktop app behind a VPN or proxy, as it does on Android and iOS. On the web, forceExit keeps the blocking screen up instead of throwing.
  • README: a platform support table for every platform, and sections on the fraud context checks, screenshot events and the desktop and web checks.

0.2.0 #

  • AntiVirtualMonitor runs the guard's scans and blocking decision without a widget. It is a ValueListenable<GuardState> (GuardScanning, GuardAllowed, GuardBlocked) with a reports stream, for state management layers and for gating single actions. AntiVirtualGuard is now built on it and exposes it with AntiVirtualGuard.monitorOf(context).
  • The built-in blocked screen has a Try again button (showRetry, translated in all four languages), and a custom screen can call AntiVirtualGuard.rescan(context).
  • Web, macOS, Windows and Linux are registered platforms. Every check reports unsupported there instead of throwing MissingPluginException, and the guard compiles for the web.
  • Play Integrity standard requests: AttestationOptions(playIntegrity: PlayIntegrityRequest.standard) and FlutterAntiVirtuals.instance.preparePlayIntegrity(). The token binds the payload through requestHash, and the attestation JSON has standard: true. Classic requests stay the default.
  • Android: mockLocation reports the app selected as mock location app in the developer options as an active detection.
  • The signed payload marks a detection that rests only on an installed tool with "installedOnly": true.
  • New anti_virtuals_verifier package (in packages/) that checks signed reports on a Dart server: nonce, age, signature, Android key attestation, Play Integrity verdicts and a signal policy.
  • CI runs the integration tests on an Android emulator and the iOS Simulator.
  • The README is reorganized.
  • Failed checks are no longer clean. A native check that throws, a signal the native side leaves out and a null scan reply used to read as "not detected". Now a failed check is SignalResult.failed (with error), report.failed lists them, report.isClean is false while any check failed, a null reply throws PlatformException(no_result), and the signed payload marks it with "failed": true. AntiVirtualGuard(failClosed: true) blocks when the check of a blocking signal fails.
  • Fix: untrustedInstaller could be spoofed with adb install -i com.android.vending. On Android 11+ an install whose initiating package (which the caller cannot choose) is the shell is reported even when the claimed installer is trusted.
  • Fix: screen protection no longer clears window flags the app set itself (Android only undoes what the plugin set), and requests from several guards and protectScreen() are combined instead of switching each other off.
  • mockLocation and virtualCamera report installed tools separately (SignalResult.installedApps, onlyInstalledApps). The guard no longer blocks when an installed but unused tool is the only evidence; pass blockOnInstalledApps: true for the previous behavior.
  • iOS: the privacy manifest is now bundled (CocoaPods and SwiftPM) and declares the UserDefaults API. The App Attest key id moved to the Keychain (this device only), a key App Attest no longer accepts is replaced by a new enrollment automatically, and attestation requests run one at a time.
  • iOS: capture state is read from the app's window scene instead of the deprecated UIScreen.main. The stale Swift unit test was replaced with real tests, which CI now runs on the Simulator.
  • verify() throws UnsupportedError on platforms other than Android and iOS instead of labelling them android. SignalResult compares by value and has toJson().
  • Android: the Xposed class check also asks the system class loader, and the getprop fallback no longer leaks its process.

0.1.0 #

  • Docs: README sections for using scan() directly and for the guard, a rewritten Limits section that reflects the checks that now exist (root, hooks, debugger, emulator, screen capture) and the limits that remain, and two new runnable examples (scan_example.dart, guard_example.dart).
  • Android file checks (root, hooking and emulator files) now look through two layers: java.io.File and a direct Os.stat system call. A path found by either counts, and a path only the kernel finds is reported by hooked as file API hides <path>, which catches root-hiding modules and Frida scripts that patch the file API. New doc/hardening.md covers obfuscation and what the checks cannot stop.
  • verify(attestation: AttestationOptions(...)) also requests a Play Integrity token (Android, classic request, new com.google.android.play:integrity dependency) or an App Attest attestation / assertion (iOS) whose nonce or client data hash is the SHA-256 of the signed payload, returned in SignedReport.attestation. A failed request throws.
  • FlutterAntiVirtuals.instance.verify(nonce: ...) returns a SignedReport: a scan bound to a backend-issued nonce and signed with a key created on the device for that request (Android Keystore EC key attested with the SHA-256 of the nonce as challenge, StrongBox then TEE, falling back to no attestation; iOS Secure Enclave key, software on the Simulator). toJson() is what to send to the backend; doc/server-verification.md lists what it must check.
  • Screen protection. FlutterAntiVirtuals.instance.protectScreen() / unprotectScreen() and AntiVirtualGuard(protectScreen: ...): Android sets FLAG_SECURE (no screenshots, recording or casting, blank recents thumbnail), ignores touches through overlay windows and hides overlay windows on Android 12+; iOS, which cannot block capture, covers the app with a blur while it is recorded, mirrored or in the app switcher. New screenCapture signal (checkScreenCapture, on by default, not blocking by default): external and wireless displays, screen recording on Android 15+, iOS isCaptured. Display and capture changes also trigger the guard's live rescan. The Android manifest declares HIDE_OVERLAY_WINDOWS and DETECT_SCREEN_RECORDING (normal permissions).
  • New hooked and debugger signals (checkHooked, checkDebugger, on by default, not blocking by default). hooked: Frida and Xposed/LSPosed/ EdXposed/Substrate libraries in the process, Frida threads, hooking classes, managers and files, a hooked plugin method (framework frames in its own call stack) and the default Frida server port (Android); injected libraries, hooking classes, DYLD_INSERT_LIBRARIES and the Frida port (iOS). debugger: a Java debugger, TracerPid (Android), P_TRACED (iOS).
  • New rooted signal (ScanOptions.checkRooted, on by default) for Android root and iOS jailbreak. Android: one strong indicator (su/Magisk binaries in PATH and the usual directories, root manager and root-hiding apps, root tool files, a writable /system, /vendor or /product, adbd as root, ro.secure=0, permissive SELinux, Magisk/KernelSU/APatch mounts) or two weak ones (a debug build of the system plus an unlocked bootloader). iOS: Cydia, Sileo, Zebra and other jailbreak files (including rootless /var/jb), writing outside the sandbox, injected tweak libraries and DYLD_INSERT_LIBRARIES. Localized for the guard's default screen; not in defaultBlockingSignals.
  • New emulator signal (ScanOptions.checkEmulator, on by default): Android emulators (Android Studio, Genymotion, BlueStacks, Nox, LDPlayer, MEmu, ...) from qemu properties, emulator hardware, files, apps and sensors, needing one strong or two weak indicators so real devices are not reported; the iOS Simulator from the build target, SIMULATOR_* variables and the hardware model. Localized for the guard's default screen; not in defaultBlockingSignals.
  • ScanOptions now has one check* boolean per signal (all on by default) instead of a signals set, and asserts that configured checks receive their configuration (expectedSignatureSha256, trustedInstallers).
  • ScanOptions is no longer const; copyWith was replaced by onlyChecking.
  • Added AntiVirtualGuard: scans at startup and on resume, blocks the app with a localized default screen (en, ar, fr, es) or a custom builder, and can force-exit after a configurable delay (default 5 seconds, off by default).
  • Guard: the app is not built before the first clean scan, blocked apps lose focus and animations, the force-exit countdown pauses in the background, rescans only follow a real background trip, and a failed rescan fails open.
  • Guard: ScanOptions compares by value (no rescan on every parent rebuild); a failed rescan keeps the last result; new failClosed, rescanDebounce, rescanInterval, unmountWhileBlocked and hardExit options; the countdown restarts after a background trip even without a rescan; copyWith keeps textDirection; the screen follows device locale changes.
  • Guard: unmountWhileBlocked is true by default, so a blocked app cannot be reached with the back button; pass false to keep it mounted and keep state.
  • Live detection: FlutterAntiVirtuals.environmentChanges emits when a VPN or proxy may have been switched on or off (Android ConnectivityManager callbacks, iOS NWPathMonitor), and AntiVirtualGuard rescans on it (liveMonitoring, liveDebounce).
  • Live detection review fixes: environmentChanges is one shared stream (a second listener no longer breaks the first), a missing native side is quiet, a change in the background is scanned on resume even without rescanOnResume, bursts are capped at liveDebounce x 4, watcher failures are labelled as such and retried, Android keeps network state from the callback arguments instead of querying on every update, iOS emits on every path update, ignores updates from a cancelled monitor and tears down on engine detach.
  • Fix: Android now reports a proxy set globally (for example with adb shell settings put global http_proxy) through environmentChanges. The settings observer it relied on does not fire when the value is set, so the watcher also listens to the system's proxy-change broadcast.
  • Fix: Android mockLocation ignores mock fixes older than two minutes. The last fix of a provider is cached, so a mock location that had been switched off kept the device flagged (and the app blocked) for several minutes.

0.0.1 #

  • Initial release: scan API with VPN, proxy, mock location, virtual camera, developer options, ADB, clock, installer, signature, accessibility, remote control, clone, user CA and sideload signals.
0
likes
150
points
138
downloads

Documentation

API reference

Publisher

verified publishershewa.tech

Weekly Downloads

Detects VPNs, proxies, mock location, virtual cameras, root, hooks and emulators on Android and iOS, with basic checks on desktop and the web.

Repository (GitHub)
View/report issues

Topics

#security #integrity #vpn #root-detection #anti-fraud

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface

More

Packages that depend on flutter_anti_virtuals

Packages that implement flutter_anti_virtuals