-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[mob][photos] Feature - disable screenshot #7833
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
Conversation
|
Rameshwar Bishnoi seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| await _init(false, via: 'mainMethod'); | ||
| final Locale? locale = await getLocale(noFallback: true); | ||
| runApp( | ||
| AppLock( | ||
| builder: (args) => EnteApp(locale, savedThemeMode), | ||
| lockScreen: const LockScreen(), | ||
| enabled: await Configuration.instance.shouldShowLockScreen() || | ||
| localSettings.isOnGuestView(), | ||
| locale: locale, | ||
| lightTheme: lightThemeData, | ||
| darkTheme: darkThemeData, | ||
| savedThemeMode: _themeMode(savedThemeMode), | ||
| SecureApplication( | ||
| child: AppLock( | ||
| builder: (args) => EnteApp(locale, savedThemeMode), | ||
| lockScreen: const LockScreen(), | ||
| enabled: await Configuration.instance.shouldShowLockScreen() || | ||
| localSettings.isOnGuestView(), | ||
| locale: locale, | ||
| lightTheme: lightThemeData, | ||
| darkTheme: darkThemeData, | ||
| savedThemeMode: _themeMode(savedThemeMode), | ||
| ), | ||
| ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap app in SecureGate so screenshots actually blank out
Only wrapping the root widget in SecureApplication does not trigger any visual protection on iOS—the package relies on a SecureGate (or an explicit SecureApplicationController.secure()) inside the widget tree to insert the blurred/blank overlay when screenshots or the app switcher snapshot are generated. Because the new code never adds a gate or calls the controller, the default state remains insecure and screenshots will still capture the UI, so the feature described in the commit message will fail on iOS.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it
builder: (args) => SecureGate(
child: EnteApp(locale, savedThemeMode),
),
|
We already have Hide content setting (defaults to false) in Security > App Lock > Hide Content. Which already blocks screenshot in android. It would be better if you can integrate the iOS implementation of it whenever Hide Content is enabled. |
|
The commits are with a local email that does not match the email associated with your GitHub account, which is why the CLA is not being marked as signed. You'll need to amend the commits (or do a new PR). For now I'll close this PR, since this unconditionally disables the functionality, instead of trying to make it work with the Hide Content functionality that the app already provides. If you do decide to continue on these lines, (a) we'd need something that works for iOS, (b) something that respects the Hide Content setting, and (c) commits are done using an email tied to your GitHub account so that the CLA can be accepted. |
Description
This will disable screenshot feature in android and ios app
android : blocks screenshot all together
ios : On iOS, you cannot stop the user from pressing the "take screenshot" buttons. The secure_application package uses the standard iOS method: it tells the OS the content is "secure," so iOS blanks/black out the app's content in the screenshot file.
Tests
Test 1: Taking the Screenshot
✅ Expected Result (Success): The screenshot image will be a black or blank screen in ios and no screenshot will be taken in case of android. You may see the system status bar (the time, battery, etc.), but your app's entire UI, including your photos, will be completely hidden.
❌ Failure: If the screenshot image clearly shows your app's UI and photos, the implementation is not working.
Test 2: Checking the App Switcher (Multitasking View)
The secure_application package also protects your app's content from being visible in the app switcher.
✅ Expected Result (Success): Your app's "card" or "snapshot" in the app switcher view will be blurred or replaced with a blank screen. All other apps (like Settings or Safari) will look normal.
❌ Failure: If you can clearly see your app's last-viewed screen in the app switcher, the protection is not active.
Performance
only added a lightweight listener that reacts to system events. This is a standard pattern and will not introduce performance problems to your app.