Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android - Screenshot while secured #11

Open
pgulegin opened this issue Oct 27, 2020 · 9 comments
Open

Android - Screenshot while secured #11

pgulegin opened this issue Oct 27, 2020 · 9 comments

Comments

@pgulegin
Copy link

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

Is there any planned development on that front?

@neckaros
Copy link
Owner

neckaros commented Nov 3, 2020

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

@agarrido19
Copy link

Is there any update on this feature?

@CatEatFishs
Copy link

i need this function

@qbait
Copy link

qbait commented Oct 15, 2021

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

@baku-apps
Copy link

Any news about this possible feature? :)

@adnankhan74444
Copy link

still waiting for this option parameter @neckaros

@neckaros
Copy link
Owner

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
Copy link
Owner

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
Copy link

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants