Safe Data Leakage via Application Background Screenshot and Prevent Screenshot for Android and iOS.
- Protect data leakage with image
await ScreenProtector.protectDataLeakageWithImage('LaunchImage');
- Protect data leakage with color ON
await ScreenProtector.protectDataLeakageWithColor(Colors.white);
- Protect data leakage with color OFF
await ScreenProtector.protectDataLeakageWithColorOff();
- Protect data leakage with blur ON
await ScreenProtector.protectDataLeakageWithBlur();
- Protect data leakage with blur OFF
await ScreenProtector.protectDataLeakageWithBlurOff();
- ON
await ScreenProtector.preventScreenshotOn();
- OFF
await ScreenProtector.preventScreenshotOff();
final isRecording = await ScreenProtector.isRecording();
- ON
await ScreenProtector.protectDataLeakageOn();
or
await ScreenProtector.preventScreenshotOn();
- OFF
await ScreenProtector.protectDataLeakageOff();
or
await ScreenProtector.preventScreenshotOff();
https://github.com/prongbang/screen-protector
import com.prongbang.screenprotect.AndroidScreenProtector
class MainActivity : FlutterFragmentActivity() {
private val screenProtector by lazy { AndroidScreenProtector.newInstance(this) }
// For Android 12+
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
screenProtector.process(hasFocus.not())
}
}
- Protect Data Leakage Background Screenshot and Prevent Screenshot.
class _PreventScreenshotPageState extends State<MyApp> {
@override
void initState() async {
await ScreenProtector.protectDataLeakageOn();
super.initState();
}
@override
void dispose() async {
await ScreenProtector.protectDataLeakageOff();
super.dispose();
}
}
- Prevent Screenshot
class _PreventScreenshotPageState extends State<MyApp> {
@override
void initState() async {
await ScreenProtector.preventScreenshotOn();
super.initState();
}
@override
void dispose() async {
await ScreenProtector.preventScreenshotOff();
super.dispose();
}
}
- Protect data leakage with color
class _ProtectDataLeakagePageState extends State<MyApp> {
@override
void initState() async {
await ScreenProtector.protectDataLeakageWithColor(Colors.white);
super.initState();
}
}
- Protect data leakage with image
class _ProtectDataLeakagePageState extends State<MyApp> {
@override
void initState() async {
await ScreenProtector.protectDataLeakageWithImage('LaunchImage');
super.initState();
}
}
- Protect data leakage with blur
class _ProtectDataLeakagePageState extends State<MyApp> {
@override
void initState() async {
await ScreenProtector.protectDataLeakageWithBlur();
super.initState();
}
}