npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-private-screen

v0.2.0

Published

React Native screen privacy for Android, including capture protection and Samsung Knox Privacy Display readiness.

Readme

react-native-private-screen

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.

What it supports

  • 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 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

npm install react-native-private-screen

Rebuild the Android app after installation. iOS is intentionally unsupported; protection calls are no-ops and support detection returns unavailable.

Protect sensitive screens

import { useEffect } from 'react';
import { PrivateScreen } from 'react-native-private-screen';

export function SensitiveScreen() {
  useEffect(() => {
    void PrivateScreen.setScreenCaptureProtection('flagSecure');
    void PrivateScreen.setContentSensitivity('sensitive');

    return () => {
      void PrivateScreen.setScreenCaptureProtection('off');
      void PrivateScreen.setContentSensitivity('notSensitive');
    };
  }, []);

  return null;
}

FLAG_SECURE blocks screenshots, screen recording, and presentation on non-secure displays at the window level. Android content sensitivity is best-effort and silently does nothing on unsupported OS builds.

Prepare Samsung Privacy Display

First, inspect whether the current device is eligible and obtain the host application's package name:

import { PrivateScreen } from 'react-native-private-screen';

const support = await PrivateScreen.getSamsungPrivacyDisplaySupport();

console.log(support.availability);
console.log(support.appPackageName);
console.log(support.device?.kspVersionName);

Then generate the values an administrator should map into the Knox Service Plugin managed configuration:

import {
  createSamsungPrivacyDisplayDeploymentPlan,
} from 'react-native-private-screen';

const plan = createSamsungPrivacyDisplayDeploymentPlan({
  scope: 'deviceWide',
  target: 'selectedApps',
  packageNames: ['com.example.securebanking'],
  enableCredentialEntry: true,
  allowUserToChangePrivacyDisplay: false,
  allowUserToChangeApps: false,
  allowUserToChangeCredentialEntry: false,
});

console.log(plan.policyPath);
console.log(plan.values);

The generated object is a typed deployment guide, not a raw Android Management API payload. KSP's managed-configuration keys are supplied dynamically to compatible UEM consoles, so the administrator should map the returned values in the KSP configuration UI.

Samsung requirements

  • Galaxy S26 Ultra (SM-S948*)
  • Android 16 and One UI 8.5
  • Knox 3.13 or newer
  • First One UI 8.5 maintenance release or newer
  • Knox Service Plugin 26.05 (1.5.64) or newer, deployed through a compatible UEM

getSamsungPrivacyDisplaySupport() can verify the manufacturer, model, Android API level, and installed KSP version. It cannot prove that the required One UI maintenance release, Knox version, license, enrollment, or policy assignment is active.

API

PrivateScreen.setScreenCaptureProtection(mode)

Modes: 'off', 'flagSecure', and 'flagSecureOnDemand'. The two secure modes currently apply the same Android window flag; flagSecureOnDemand is retained for API compatibility.

PrivateScreen.setContentSensitivity(mode)

Modes: 'notSensitive', 'sensitive', and 'auto'.

PrivateScreen.getSamsungPrivacyDisplaySupport()

Returns device eligibility, KSP installation/version information, the host package name, documented requirements, and canToggleFromApp: false.

PrivateScreen.openSamsungPrivacyDisplaySettings()

Opens the closest documented Android settings screen available. Samsung does not publish a dedicated Privacy Display intent.

createSamsungPrivacyDisplayDeploymentPlan(options)

Validates package names and returns a device-wide or work-profile KSP configuration guide for all screens or selected applications.

Official Samsung documentation

License

MIT