Skip to content

Android Behavior

GitHub

On Android, the plugin applies WindowManager.LayoutParams.FLAG_SECURE to the activity window.

That protects your app from:

  • screenshots
  • screen recordings in most normal capture paths
  • the recent apps thumbnail preview

No extra Android manifest or Gradle configuration is required after installation and cap sync.

import { PrivacyScreen } from '@capgo/capacitor-privacy-screen';
await PrivacyScreen.disable();
// Allow a temporary flow where capture is acceptable.
await PrivacyScreen.enable();

FLAG_SECURE is an Android platform feature. If you disable the plugin, users and other apps can capture your content again until you re-enable it.

If you are using Android Behavior to plan security and compliance, connect it with Using @capgo/capacitor-privacy-screen for the native capability in Using @capgo/capacitor-privacy-screen, Encryption for the implementation detail in Encryption, Compliance for the implementation detail in Compliance, Capgo Security Scanner for the product workflow in Capgo Security Scanner, and Capgo Security for the product workflow in Capgo Security.