neckaros / secure_application

Secure your application from prying eyes
MIT License
102 stars 57 forks source link

Android - Screenshot while secured #11

Open pgulegin opened 3 years ago

pgulegin commented 3 years ago

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

Is there any planned development on that front?

neckaros commented 3 years ago

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

agarrido19 commented 3 years ago

Is there any update on this feature?

CatEatFishs commented 3 years ago

i need this function

qbait commented 2 years ago

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

baku-apps commented 2 years ago

Any news about this possible feature? :)

adnankhan74444 commented 2 years ago

still waiting for this option parameter @neckaros

neckaros commented 2 years ago

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 commented 2 years ago

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

CatEatFishs commented 2 years ago

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

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