Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
react-native-screenshot-prevent
Advanced tools
This fork contains fully working blank screenshot on IOS13+ including screen recording
$ npm install react-native-screenshot-prevent --save
pod install
in your ios folder$ react-native link react-native-screenshot-prevent
Libraries
➜ Add Files to [your project's name]
node_modules
➜ react-native-screenshot-prevent
and add RNScreenshotPrevent.xcodeproj
libRNScreenshotPrevent.a
to your project's Build Phases
➜ Link Binary With Libraries
Cmd+R
)<android/app/src/main/java/[...]/MainApplication.java
import com.killserver.screenshotprev.RNScreenshotPreventPackage;
to the imports at the top of the filenew RNScreenshotPreventPackage()
to the list returned by the getPackages()
methodandroid/settings.gradle
:
include ':react-native-screenshot-prevent'
project(':react-native-screenshot-prevent').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-screenshot-prevent/android')
android/app/build.gradle
:
implementation project(':react-native-screenshot-prevent')
// sample code
import RNScreenshotPrevent, { addListener } from 'react-native-screenshot-prevent';
/* (IOS, Android) for android might be the only step to get secureView
* on IOS enables blurry view when app goes into inactive state
*/
RNScreenshotPrevent.enabled(true/false);
/* (IOS) enableSecureView for IOS13+
* creates a hidden secureTextField which prevents Application UI capture on screenshots
*/
if(!__DEV__) RNScreenshotPrevent.enableSecureView();
/* (IOS) enableSecureView for IOS13+
* creates a hidden secureTextField which prevents Application UI capture on screenshots
* and uses imgUri as the source of the background image (can be both https://, file:///)
*/
if(!__DEV__) RNPreventScreenshot.enableSecureView(imgUri);
/* (IOS) disableSecureView for IOS13+
* remove a hidden secureTextField which prevents Application UI capture on screenshots
*/
if(!__DEV__) RNScreenshotPrevent.disableSecureView();
/* (IOS) notification handler
* notifies when user has taken screenshot (yes, after taking) - you can show alert or do some actions
*
* @param {function} callback fn
* @returns object with .remove() method
*/
addListener(fn);
/** example using the listener */
useEffect(() => {
const subscription = RNScreenshotPrevent.addListener(() => {
console.log('Screenshot taken');
showAlert({
title: 'Warning',
message: 'You have taken a screenshot of the app. This is prohibited due to security reasons.',
confirmText: 'I understand'
});
})
return () => {
subscription.remove();
}
}, []);
FAQs
This fork contains fully working blank screenshot on IOS13+ including screen recording
The npm package react-native-screenshot-prevent receives a total of 5,314 weekly downloads. As such, react-native-screenshot-prevent popularity was classified as popular.
We found that react-native-screenshot-prevent demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.