secure_application
secure_application copied to clipboard
Android - Screenshot while secured
For Android, it would be awesome to allow screenshots while secured.
Is there any planned development on that front?
I have to look into (it would be opt-in)
Is there any update on this feature?
i need this function
We don't have the possibility to provide custom screenshots for iOS either, do we?
Any news about this possible feature? :)
still waiting for this option parameter @neckaros
We don't have the possibility to provide custom screenshots for iOS either, do we?
This is outside the scope of the package (if I understand the request correctly : personalize the content when you take a screenshot)
still waiting for this option parameter @neckaros
Sorry I had no time to look at it. I need to reinstall a flutter env. But it will be my priority when I do
I'm open to pull request
如果你的需求是打开APP时可以截图,切到后台是屏幕保护,你可以这样做
1.在android/secureApplicationPlugin.kt 下注释掉作者的功能代码
override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
if (call.method == "secure") {
// activity?.window?.addFlags(LayoutParams.FLAG_SECURE)
result.success(true)
} else if (call.method == "open") {
// activity?.window?.clearFlags(LayoutParams.FLAG_SECURE)
result.success(true)
} else {
result.success(true)
}
}
2.添加 生命周期的监听
@OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
fun connectListener() {
// not used for now but might be used to add some features in the future
// 回到app清除 Flag
instance.activity?.window?.clearFlags(LayoutParams.FLAG_SECURE)
}
@OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
fun connectPauseListener() {
//切到后台添加 Flag
instance.activity?.window?.addFlags(LayoutParams.FLAG_SECURE)
}
这样就能实现我上述的功能了,但是我不推荐这样做,因为修改了作者本来的意愿,期待作者有更好的处理方式