Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 1.43 KB

File metadata and controls

55 lines (37 loc) · 1.43 KB


Tap Jacking

@capacitor-community/tap-jacking

Tap Jacking is a technique where a malicious app tricks the user into clicking a security-relevant control (confirmation button etc.) by obscuring the UI with an overlay or by other means.

This plugin prevents tap jacking by calling setFilterTouchesWhenObscured(true) (Android 11 and below) or setHideOverlayWindows (Android 12+) as described in the Android Developer Documentation.

On iOS and web this call does nothing.

Install

npm install @capacitor-community/tap-jacking
npx cap sync

Usage

import { TapJacking } from '@capacitor-community/tap-jacking';
...
await TapJacking.preventOverlays();

API

preventOverlays()

preventOverlays() => Promise<void>

enableOverlays()

enableOverlays() => Promise<void>