secure_application icon indicating copy to clipboard operation
secure_application copied to clipboard

Android - Screenshot while secured

Open pgulegin opened this issue 4 years ago • 9 comments

For Android, it would be awesome to allow screenshots while secured.

Is there any planned development on that front?

pgulegin avatar Oct 27 '20 16:10 pgulegin

I have to look into (it would be opt-in)

neckaros avatar Nov 03 '20 15:11 neckaros

Is there any update on this feature?

agarrido19 avatar Jun 11 '21 23:06 agarrido19

i need this function

CatEatFishs avatar Sep 10 '21 07:09 CatEatFishs

We don't have the possibility to provide custom screenshots for iOS either, do we?

qbait avatar Oct 15 '21 15:10 qbait

Any news about this possible feature? :)

baku-apps avatar Apr 19 '22 07:04 baku-apps

still waiting for this option parameter @neckaros

adnankhan74444 avatar Jun 12 '22 07:06 adnankhan74444

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)

neckaros avatar Jun 12 '22 07:06 neckaros

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

neckaros avatar Jun 12 '22 07:06 neckaros

如果你的需求是打开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)
  }

这样就能实现我上述的功能了,但是我不推荐这样做,因为修改了作者本来的意愿,期待作者有更好的处理方式

CatEatFishs avatar Aug 01 '22 08:08 CatEatFishs