How to prevent a Screen Overlay attack in Flutter or forbid another app to run over the original app - flutter

Flutter masters!
I am designing an app that has sensitive information in it. I want to prevent a screen overlay attack - i.e. another app that mimics my app and instead of in my TextField to enter text into the bad app's TextField.
Is there a way to detect that another app is running on top of my app?
Also - how can I forbid taking screenshots and recording screen video when using the app?
Regards!

Related

Check if any app has Draw over my app in flutter

I am trying to prevent other apps from drawing over my app because it is an educational application and students use the dictionary to translate words directly while the application is running by drawing over the app.
Is there a way to prevent other apps from drawing over the app in flutter?
Or even detect the 'drawing over other apps' event to hide the content from the screen?

How to create the live App Icon like Apple Clock using flutter?

Dynamic App Icon In Flutter
I am expecting for a way to make a similar ui,Put it in the app icon.
want to create the live app icon continuously changing itself, like apple clock app icon shows the current time in the App Icon.
Is There is any way to make that type of App icon in flutter
Similar App Icon like this

Is there a way to display a specific Flutter page when screen is locked?

please is there a way to display or open a Flutter page when screen is locked in Flutter like how WhatsApp displays incoming call page when screen is locked? I used Wake up plugin but can't display the page on screen locked. Please I need a guide to do that. Thanks in advance.
What you are looking for is called a time sensitive notification with a full screen notification. What it does is that if the screen is locked it opens the activity linked to the pending intent used for full screen notification. When the phone is unlocked, it shows a heads up notification instead. You must have seen this behavior with all kinds of telephony apps and alarm apps.
A flutter app runs inside a single activity, so if you mark that as the activity to show during the locked state, the app will show. But it will act similar to how the app would when you launch it from start. Also the behavior is unpredictable as it is behind a wakelock. So a better option would be to move it to a separate activity and do the needful. Example of how to implement full screen notifications.
https://medium.com/android-news/full-screen-intent-notifications-android-85ea2f5b5dc1

Can I hide Flutter app contents when the app is in Background?

I'm developing an app that works with sensitive information.
One of the requirements is that when a user puts the app in background the content that the app is currently displaying has to be hidden, so if another person navigate through the apps in background he can't see the last screen where the user was.
Any ideas on how to do that?
I tried to show an overlay when the app moves to AppLifecycleState.paused, but it doesn't work for me, the app prints a message if I want but it can't update the UI.
Edit
Shameless plug: i did a library for doing just that as I also needed it:
https://pub.dev/packages/secure_application
Answear
Build is not called after paused, at least on Android.
For Android I used a flutter_windowmanager package (modified to still be able to build on IOS):
https://github.com/neckaros/flutter_windowmanager
When my app need securing I add the flag secure:
FlutterWindowManager.addFlags(FlutterWindowManager.FLAG_SECURE)
And my app is now a black screen in the app switcher.
You should still hide content your way for when the user get back to the app.
Otherwise you can go native:
https://medium.com/#mehmetf_71205/securing-flutter-apps-ada13e806a69

How to make my app interact with Android home screen?

I am building an app that uses frontal camera to track where user is looking at the screen. When user blinks, smartphone registers that as a tap. Currently it works "inside" my app. I have a few dots around the screen, when i look at one of them and blink, it changes color.
But how can I make it work on the home screen/with other apps? Say if user looked at the facebook app, blinked, it would open.
I was thinking of a pop up window like Skype. I could design it as a cursor and it would be displayed above the home screen and all apps. But if i would blink(tap) it would perform an action inside that popup/widget and not click "through" it.
Are there any codes that can make my app interact with other apps. Maybe Accessibility services?
There is a similar app that can create a mouse on the homescreen, when user waves his hand (no physical touch) it registers that as a tap. How can I recreate that?
Picture attached...
Picture