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

Does not work with apps that block screenshots #36

Closed
nvllsvm opened this issue Mar 11, 2018 · 21 comments
Closed

Does not work with apps that block screenshots #36

nvllsvm opened this issue Mar 11, 2018 · 21 comments

Comments

@nvllsvm
Copy link
Contributor

nvllsvm commented Mar 11, 2018

Apps such as Bitwarden and Silence block screenshots. Attemtping to take a screenshot on the device results in this error.

screenshot_kiss_launcher_20180310-224624

Using scrcpy, the app functions normally on the device, but scrcpy displays a black background with the status bar visible. No notification or log output indicates anything abnormal. The screenshot notifciation does not appear.

out

Strangely enough, LineageOS's built-in screen recording app captures these applications without problems. The device is not rooted.

Tested on a OnePlus 3T running LineageOS 15.1 20180305.

@nvllsvm nvllsvm changed the title Does not work with apps that block screenschots Does not work with apps that block screenshots Mar 11, 2018
@rom1v
Copy link
Collaborator

rom1v commented Mar 11, 2018

You can disable it in Silence settings → Privacy → Screen security.

Strangely enough, LineageOS's built-in screen recording app captures these applications without problems.

They probably modified the feature in the ROM, because on AOSP, even screenrecord do not display the screen content.

@rom1v
Copy link
Collaborator

rom1v commented Mar 23, 2018

Since I added an entry in the FAQ, I'm closing.

@rom1v
Copy link
Collaborator

rom1v commented Jan 16, 2019

Now you can (on dev branch): 1fdde49

@npes87184
Copy link
Contributor

Now you can (on dev branch): 1fdde49

After Testing SafeInCloud and Enpass, I can confirm that it works.

@inxomnyaa
Copy link

inxomnyaa commented Nov 29, 2019

Very great, thanks for fixing! I now can finally see the password field for paypal on my phone with broken screen ❤️

@abele17
Copy link

abele17 commented May 22, 2020

I really enjoy using scrcpy. I think that it's a great product. Unfortunately I am having the black screen issue mentioned above on some specific apps. I am new to coding so I apologize. I was wondering if someone could explain more in details how you fixed the issue so that I can do it myself.
Thanks for the help!

@rom1v
Copy link
Collaborator

rom1v commented May 22, 2020

The apps which remain black could not be mirrored with scrcpy (some drm prevent it to be captured).

@abele17
Copy link

abele17 commented May 30, 2020

Thank you. Great app.

@arekolek
Copy link

@rom1v Do you know if an app is able to detect the case when an app such as scrcpy is pretending to be a secure display even though it's not?

The problem I have is that scrcpy allows taking screenshots and screen recordings, even though it pretends to be a secure screen, which creates a security vulnerability.

Furthermore, even if scrcpy filtered out protected content from screenshots and recordings, it would be possible to record the whole screen on the computer, unless scrcpy would filter that too.

But even then, anybody could build scrcpy from source as it is currently and use it to take screenshots of content that was supposed to be protected. So do you know if it's possible to detect "fake" secure displays?

(I know that it's always possible to take a photo of the phone with an ordinary camera, but I don't need to worry about that, I just need to prevent taking screenshots)

@rom1v
Copy link
Collaborator

rom1v commented Nov 12, 2020

I don't know.

FWIW, I think that the users should always be able to take screenshots or videos of ther screen (it's their own device). It's ok that app developers provide a hint that some screen should not be captured by default, but device users should always have the possibility to easily bypass this setting. (I know that this is not the current trend from Google or others.)

@Rajssss
Copy link

Rajssss commented Dec 24, 2021

I am having the same issue again with some banking app, which prevents taking screenshots too. I am using android 12. Tried the latest dev branch.

@kwanice
Copy link

kwanice commented Mar 14, 2022

any update onhow to bypass that? some Bank app are black..even on v 1.23
thanks for help

@rom1v
Copy link
Collaborator

rom1v commented Mar 14, 2022

It's not possible on Android >= 12. See #2129

@rom1v
Copy link
Collaborator

rom1v commented Dec 4, 2022

Not since Android 12 #2129.

@CoolSpot
Copy link

CoolSpot commented Feb 9, 2023

Any updates on this issue? Is there any possibility to bypass it?

You can bypass it by decompiling the APK, disabling FLAG_SECURE for the main view, and recompiling the APK back.
It is very easy to do using "APKLab" extension for Visual Studio Code.

  1. Open APK using APKLab, it decompiles it into a folder structure with smali files
  2. in the resulting folder structure search for RegExp android/view/Window;->(set|add)Flag
  3. Ignore all occurrences in androidx/* or any third-party namespaces
  4. find (usually only one per app) occurrence that is preceded by setting register to 0x2000 like this:
    .line 143
    invoke-virtual {p0}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v0

    const/16 v1, 0x2000

    # invoke-virtual {v0, v1, v1}, Landroid/view/Window;->setFlags(II)V
  1. comment out whole line calling addFlag/setFlags (as shown above)
  2. rebuild&sign APK back by right clicking on the "apktool.yml" file and clicking "APKLab: Rebuild the APK"
  3. install the APK on your device
  4. enjoy

This approach has been tested on both RSA Authenticator and MS Athenticator apps running on Android 12.

@Ddfulton
Copy link

Addendum to @CoolSpot's comment for Duo Mobile

From grepping android/view/Window;->(set|add)Flag I got five hits. None of them were prefixed with 0x2000. They were prefixed with other register addresses.

I just commented out all of them and it worked like a charm.

@KaKi87
Copy link

KaKi87 commented May 26, 2023

Hello,

Rooted users can bypass FLAG_SECURE using this LSPosed plugin.

Just tested it successfully.

Thanks

@RiggiG
Copy link

RiggiG commented Jun 23, 2023

Root users may also use this fork which simply runs the scrcpy-server as the system user: #3049 (comment)

@ZwieslerLehrer
Copy link

ZwieslerLehrer commented Sep 3, 2023

Root users may also use this fork which simply runs the scrcpy-server as the system user: #3049 (comment)

Is there a non root version for some apps which do not run on rooted devices such as banking apps. Editing the banking app apk to remove the secure flag as suggested above does not seem advisable.

@KaKi87
Copy link

KaKi87 commented Sep 3, 2023

In order to make a banking app work on a rooted device, you just have to add it to Magisk's DenyList.

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

No branches or pull requests