Dexter
Dexter copied to clipboard
Blocking Screenshots and Screen Recording
Our Application need to block all the screenshots and Recording of screen. com.karumi.dexter.DexterActivity is not having FLAG_SECURE for the Screenshot protection. Shall we expect change in next version?
Version of the library
4.2.0
@chaitanya-vanapamala as soon as that flag doesn't modify the observable behavior of the lib feel free to send a PR adding the flag to the activity when needed.
Flags can be add at ActivityLifecycleCallbacks
.
just registerActivityLifecycleCallbacks on application onCreate
registerActivityLifecycleCallbacks(object:ActivityLifecycleCallbacks {
override fun onActivityPaused(activity: Activity) {
}
override fun onActivityStarted(activity: Activity) {
}
override fun onActivityDestroyed(activity: Activity) {
}
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {
}
override fun onActivityStopped(activity: Activity) {
}
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
//add window flag
activity.window?.addFlags(WindowManager.LayoutParams.FLAG_SECURE)
}
override fun onActivityResumed(activity: Activity) {
}
})
Nice workaround @fanxxxx!