Coder Social home page Coder Social logo

Comments (21)

rom1v avatar rom1v commented on May 12, 2024 13

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.)

from scrcpy.

CoolSpot avatar CoolSpot commented on May 12, 2024 7

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.

from scrcpy.

rom1v avatar rom1v commented on May 12, 2024 4

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

from scrcpy.

npes87184 avatar npes87184 commented on May 12, 2024 3

Now you can (on dev branch): 1fdde49

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

from scrcpy.

inxomnyaa avatar inxomnyaa commented on May 12, 2024 3

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

from scrcpy.

rom1v avatar rom1v commented on May 12, 2024 2

Now you can (on dev branch): 1fdde49

from scrcpy.

KaKi87 avatar KaKi87 commented on May 12, 2024 2

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

from scrcpy.

KaKi87 avatar KaKi87 commented on May 12, 2024 1

Hello,

Rooted users can bypass FLAG_SECURE using this LSPosed plugin.

Just tested it successfully.

Thanks

from scrcpy.

RiggiG avatar RiggiG commented on May 12, 2024 1

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

from scrcpy.

rom1v avatar rom1v commented on May 12, 2024

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.

from scrcpy.

abele17 avatar abele17 commented on May 12, 2024

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!

from scrcpy.

rom1v avatar rom1v commented on May 12, 2024

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

from scrcpy.

abele17 avatar abele17 commented on May 12, 2024

Thank you. Great app.

from scrcpy.

arekolek avatar arekolek commented on May 12, 2024

@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)

from scrcpy.

Rajssss avatar Rajssss commented on May 12, 2024

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.

from scrcpy.

kwanice avatar kwanice commented on May 12, 2024

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

from scrcpy.

rom1v avatar rom1v commented on May 12, 2024

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

from scrcpy.

hmcomer avatar hmcomer commented on May 12, 2024

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

from scrcpy.

rom1v avatar rom1v commented on May 12, 2024

Not since Android 12 #2129.

from scrcpy.

Ddfulton avatar Ddfulton commented on May 12, 2024

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.

from scrcpy.

ZwieslerLehrer avatar ZwieslerLehrer commented on May 12, 2024

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.

from scrcpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.