diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b713dea --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +lib/ +node_modules/ +android/build/ +*.tgz +PROMOTION.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..494d3bf --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## 0.2.0 - 2026-07-20 + +- Add Android `FLAG_SECURE` capture protection. +- Add best-effort Android content sensitivity controls. +- Detect Galaxy S26 Ultra and Knox Service Plugin Privacy Display readiness. +- Add typed KSP Privacy Display deployment-plan helpers for device-wide and work-profile policies. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5558627 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Lech Kalinowski and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 0db3bd9..b1a0876 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,15 @@ # react-native-private-screen -React Native privacy toolkit for Android with a fast-track API focused on: +Screen privacy for React Native on Android: block capture, mark sensitive content, and prepare Samsung Knox Privacy Display policies for managed Galaxy S26 Ultra devices. -- Screen capture blocking (`FLAG_SECURE`) -- Best-effort content sensitivity (`View.setContentSensitivity(...)` where available) -- Samsung Privacy Display support detection and Settings guidance (no third-party Samsung toggle API assumed) +## What it supports -## Why This Project Exists +- `FLAG_SECURE` screenshot and non-secure display protection +- Best-effort Android content sensitivity +- Galaxy S26 Ultra and Knox Service Plugin readiness detection +- Typed Samsung Privacy Display deployment plans for UEM administrators -Samsung Privacy Display on Galaxy S26 Ultra is a hardware privacy feature, but there is no documented public third-party API (yet) for apps to toggle it programmatically. - -This project exists to provide immediate value now: - -- expose Android privacy protections apps can use today (`FLAG_SECURE`, best-effort content sensitivity) -- give apps a clean Samsung-specific integration path (support detection + Settings guidance) -- preserve a stable API surface that can later grow into official Samsung Privacy Display controls if Samsung publishes supported APIs - -## Scope - -This library intentionally separates different privacy controls: - -- `FLAG_SECURE`: blocks screenshots and non-secure displays/casting at the window level -- `setContentSensitivity`: best-effort selective screen-sharing privacy on newer Android versions -- Samsung Privacy Display: hardware shoulder-surfing/privacy-angle feature on supported Samsung devices, exposed here only as support detection + Settings navigation until Samsung documents a public app API +Samsung Privacy Display is not a normal app API. Samsung exposes it through Knox Service Plugin 26.05 as an enterprise OEMConfig policy. An app cannot toggle the hardware feature directly; a UEM administrator must deploy the policy. ## Install @@ -30,18 +17,17 @@ This library intentionally separates different privacy controls: npm install react-native-private-screen ``` -Rebuild your Android app after installation. +Rebuild the Android app after installation. iOS is intentionally unsupported; protection calls are no-ops and support detection returns `unavailable`. -## Usage +## Protect sensitive screens ```tsx -import React, { useEffect } from 'react'; -import { Button, Text, View } from 'react-native'; +import { useEffect } from 'react'; import { PrivateScreen } from 'react-native-private-screen'; export function SensitiveScreen() { useEffect(() => { - void PrivateScreen.setScreenCaptureProtection('flagSecureOnDemand'); + void PrivateScreen.setScreenCaptureProtection('flagSecure'); void PrivateScreen.setContentSensitivity('sensitive'); return () => { @@ -50,52 +36,87 @@ export function SensitiveScreen() { }; }, []); - return ( - - Sensitive content -