VarunS2002 / Xposed-Disable-FLAG_SECURE

Xposed Module to Disable FLAG_SECURE, enabling screenshots, screen sharing and recording in apps that normally wouldn't allow it.
GNU General Public License v3.0
403 stars 25 forks source link

Disney+ support #1

Closed andrikos closed 3 years ago

andrikos commented 3 years ago

Is this supposed to work with Disney+ ? I still can't take a screenshot

Thanks

VarunS2002 commented 3 years ago

@andrikos Can you share some more details.

  1. What Xposed are you using and in which mode
  2. Xposed module logs
andrikos commented 3 years ago

@VarunS2002

  1. Riru - EdXposed 0.5.2.2_4683-master as Magisk module
  2. How can I gather such logs?

BTW, it works for Chrome incognito and other bank apps. Thus, I believe there is something special with Disney+ app.

VarunS2002 commented 3 years ago

@andrikos image

andrikos commented 3 years ago

EdXposed_Modules_20210413_131623.txt

VarunS2002 commented 3 years ago

@andrikos The module doesn't seem to be activated properly. I have faced this before, this is not a module issue most probably. Try reinstalling the module and reinstalling Riru and EdXposed if the issue still persists. This had fixed it for me.

andrikos commented 3 years ago

I reinstalled:

  1. Riru 25.4.1.r141.22618ad
  2. Riru - EdXposed 0.5.2.2_4683-master
  3. Disable-FLAG_SECURE 2021-04-11

I am able to take screenshots in Chrome incognito correctly. In Disney+ I can also get a screenshot, but the video part is black. You can find attached a screenshot and the updated module logs.

Screenshot_20210414-233029

EdXposed_Modules_20210414_233312.txt

VarunS2002 commented 3 years ago

@andrikos Have you added this app to the blacklist? Then remove it else this module won't work
image If not then Enable Activation Scope for this module and select only Android system and Disney+ and restart Then add the log if it's still not working Also disable "Pass SafetyNet" Tell me if you need help

andrikos commented 3 years ago

It is already as you describe Screenshot_20210415-182112

VarunS2002 commented 3 years ago

@andrikos Did you try Activation Scope?

VarunS2002 commented 3 years ago

@andrikos I will be closing this issue in 2 more days due to inactivity

andrikos commented 3 years ago

Yes I did try. The only app where screenshot/cast doesn't work is Disney. I suspect they really enforce DRM, but I don't know how.

Regards, Nick

-- =Do- N.AND

On Wed, Apr 28, 2021 at 5:30 PM Varun Shanbhag @.***> wrote:

@andrikos https://github.com/andrikos I will be closing this issue in 2 more days due to inactivity

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/VarunS2002/Xposed-Disable-FLAG_SECURE/issues/1#issuecomment-828551303, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAX2VTQZUTHR4WGNDEMGGQ3TLASYLANCNFSM42W74KEA .

VarunS2002 commented 3 years ago

@andrikos I still think this app should support Disney+ as your logs show it's not being enabled for Android System Framework. If this is the main problem then the app shouldn't work in Telegram Secret Chat Disappearing Media either. I saw you have other Disable flag secure modules too. Did you try disabling them?

andrikos commented 3 years ago

Give me a couple of days and I'll provide the new logs, ok? Thanks!

-- =Do- N.AND

On Wed, Apr 28, 2021 at 6:11 PM Varun Shanbhag @.***> wrote:

@andrikos https://github.com/andrikos I still think this app should support Disney+ as your logs show it's not being enabled for Android System Framework. If this is the main problem then the app shouldn't work in Telegram Secret Chat Disappearing Media either. I saw you have other Disable flag secure modules too. Did you try disabling them?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/VarunS2002/Xposed-Disable-FLAG_SECURE/issues/1#issuecomment-828583308, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAX2VTQWO5XGIQMGTBW423TTLAXU3ANCNFSM42W74KEA .

VarunS2002 commented 3 years ago

@andrikos Sure no problem!

andrikos commented 3 years ago

1 Default configuration 1 default.txt

2 After I enabled scope for android system and Disney+ 2 scope.txt

3 After I also disabled " pass safety net" in edexposed manager 3 nopass.txt

In all cases I can get a Disney+ screenshot but the video part is black: Screenshot_20210428-235238

In the first case, I could take screenshot of Chrome incognito mode, in the other two I couldn't.

Lat me know of anything extra you need

VarunS2002 commented 3 years ago

@andrikos Your EdXposed doesn't seem to be working correctly as everything is under the crash section. Only in default configuration, logging seems to have happened correctly.
image

  1. In the Manager Settings, set yours same as this:

image

  1. In the Modules section disable everything except this module

  2. Enable Activation Scope for this module and select the same apps mentioned below:

  3. In the Xposed Hide section enable these apps only: (Disney+ instead of Prime Video in your case)

image image image

  1. Restart and then send logs of both these sections:

image

VarunS2002 commented 3 years ago

@andrikos Also try other modules like to see if they work, keep only 1 disable flag secure module enabled at one time https://github.com/LSPosed/DisableFlagSecure/releases/tag/v1.0.1 https://repo.xposed.info/module/fi.veetipaananen.android.disableflagsecure https://repo.xposed.info/module/fi.veetipaananen.android.disableflagsecure2

VarunS2002 commented 3 years ago

@andrikos The problem seems to be that the module is not getting applied on Android System. It is only getting applied on Disney+ Logs contain this: EdXposed-Bridge: Disabled FLAG_SECURE for: com.disney.disneyplus It should also contain this: EdXposed-Bridge: Disabled FLAG_SECURE for: android Only then it is expected to work correctly

andrikos commented 3 years ago

modules.txt verbose.txt

The logs after I followed your instructions. I still get black on the video part. The logs show that your module is properly applied, no?

VarunS2002 commented 3 years ago

@andrikos This time the log is perfect and the app is expected to function properly. But it's still black, well that's unfortunate ☹️. I'll try to see what the issue is, meanwhile try the other 3 apps I suggested. If any of them work I can check the code and find the problem in my app to fix it.

VarunS2002 commented 3 years ago

@andrikos When you try these 3 apps, do the same steps that I mentioned that you did for this.

VarunS2002 commented 3 years ago

@andrikos app-debug.zip Extract the apk from the zip Uninstall the existing app and try this one with the same steps above

VarunS2002 commented 3 years ago

@andrikos Did you try the test version?

andrikos commented 3 years ago

EdXposed_Modules_20210511_131227.txt

Screenshot_20210511-131145

Logs and screenshot with your file

VarunS2002 commented 3 years ago

@andrikos Did any of those 3 work for you? Because if not, I'm unable to fix this :( The last thing you can do is try LSPosed

andrikos commented 3 years ago

I'm afraid none of them worked :( BTW, are the exceptions in the logs expected?

VarunS2002 commented 3 years ago

@andrikos That's very unfortunate. Yes they are expected. I suggest you to open an issue here as this was active recently. Probably he can solve the problem. Consequently I can integrate the solution in my app too.

VarunS2002 commented 3 years ago

@andrikos Try this as it worked out for #3

VarunS2002 commented 3 years ago

@andrikos Nevermind the app doesn't seem to support Disney+

@andrikos That's very unfortunate. Yes they are expected. I suggest you to open an issue here as this was active recently. Probably he can solve the problem. Consequently I can integrate the solution in my app too.

This seems like the best bet

programminghoch10 commented 3 years ago

Hello, I got some news on this topic. A friend and me did two days of research, searching through the decompiled source code of Disney+. We've found out that Disney uses proprietary DRM decoding of the device and somehow pushes this directly to the internal display. This has nothing to do with flag secure. When testing the same on a very old phone, which does not have this hardware DRM stuff, it works normally as it should. So this is more of deep DRM android stuff than flag secure.

programminghoch10 commented 3 years ago

Okay so we found the culprit.

When testing the same on a very old phone, which does not have this hardware DRM stuff, it works normally as it should.

This was a very important piece of information. It told us, that the device must be using hardware decryption capabilites.

Now onto the point of how to prevent this. I thought those hardware decryption libraries must be placed in vendor files/partition. And there is actually a Magisk module, which does systemlessly replace those files with a zero-byte replacement.

It is called liboemcrypto.so disabler and with this installed and this module (v2.0.0) screensharing Disney+ works too.

@andrikos Please install liboemcrypto.so disabler in Magisk and make sure the Flag-Secure v2 XPosed module is enabled on system framework and Disney+ and try it again.

If it works @VarunS2002 can include this as a notice in the README (or please let me do it so I can be listed as a contributor ;) and we can close this issue.

Also here is screenshot proof: image

andrikos commented 3 years ago

@programminghoch10 Thanks for all the analysis! Your solution does indeed work in that I can make screenshots of Disney+ content.

The problem is that my DRM level falls to L3 which makes Disney+ show in low resolution. This is equivalent to watch low resolution on PC through a web browser. What I'm really trying to accomplish here is watch high quality video on my PC, and I've been trying to stream the high quality content from my Android through Cast capability :(

programminghoch10 commented 3 years ago

@andrikos

The problem is that my DRM level falls to L3 which makes Disney+ show in low resolution. This is equivalent to watch low resolution on PC through a web browser.

Well it seems this is a limit of this method... I don't know if I am capable of doing anything about it; DRM is not made to be easily broken or modded as you might guess... Also the whole DRM thing is proprietary and without the source it will be hard to see what it does at all. Aaaaand the big companies fund this to be secure, so as soon as we break L1 in a way it's not intended to they will probably introduce L0 and downgrade L1 to low quality, so it's all over again...

Your original problem is solved though, as you are now able to cast Disney+.

VarunS2002 commented 3 years ago

@programminghoch10 That's very impressive thanks mate! I'll merge it shortly and make some changes. @andrikos Thanks to you too for your testing.

VarunS2002 commented 3 years ago

@andrikos @programminghoch10 Does Netflix also require the magisk module?

VarunS2002 commented 3 years ago

@programminghoch10 Also out of curiosity, what did you use to decompile the app?

programminghoch10 commented 3 years ago

@VarunS2002

Does Netflix also require the magisk module?

On some devices, yes.

what did you use to decompile the app?

jadx

VarunS2002 commented 3 years ago

@programminghoch10 Thanks. I've merged your PR and made some changes too.