overlay_attack_detector 0.0.1 copy "overlay_attack_detector: ^0.0.1" to clipboard
overlay_attack_detector: ^0.0.1 copied to clipboard

Flutter plugin to detect overlay attacks and obscured touches for secure payment flows on Android.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:overlay_attack_detector/overlay_attack_detector.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  bool _overlayEnabled = false;

  @override
  void initState() {
    super.initState();
    checkOverlay();
  }

  Future<void> checkOverlay() async {
    final result = await OverlayAttackDetector.isOverlayEnabled();

    if (!mounted) return;

    setState(() {
      _overlayEnabled = result;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Overlay Attack Detector Example')),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(
                _overlayEnabled
                    ? "Overlay permission enabled"
                    : "Overlay permission disabled",
              ),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () {
                  OverlayAttackDetector.openOverlaySettings();
                },
                child: const Text("Open Overlay Settings"),
              )
            ],
          ),
        ),
      ),
    );
  }
}
4
likes
0
points
139
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter plugin to detect overlay attacks and obscured touches for secure payment flows on Android.

Repository (GitHub)
View/report issues

Topics

#flutter-plugin #android-security #overlay-detection #tapjacking

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on overlay_attack_detector

Packages that implement overlay_attack_detector