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

Dude #1

Open
lahed opened this issue May 8, 2020 · 3 comments
Open

Dude #1

lahed opened this issue May 8, 2020 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@lahed
Copy link

lahed commented May 8, 2020

Hey,

Nice project!, it's possible hook WindowManager for accept TYPE_SECURE_SYSTEM_OVERLAY that requires permission INTERNAL_SYSTEM_WINDOW (signature)

Thank u

@SarotecK SarotecK self-assigned this May 8, 2020
@SarotecK
Copy link
Member

SarotecK commented May 9, 2020

Thanks for your request.

As a first step I added the WindowManager hook.

Next step will be to analyze the events needed to bypass this permission check.

@SarotecK SarotecK added the question Further information is requested label May 9, 2020
@SarotecK
Copy link
Member

SarotecK commented May 9, 2020

Can you provide a full example where you add the View / Window / Dialog and the exception you got?

So I can verify that I analyze same issue as yours.

Just put the lines of code and the exception here.

@lahed
Copy link
Author

lahed commented May 9, 2020

Thank you!, yeah:

  1. I add new window type SYSTEM_OVERLAY
    //public static final int TYPE_SECURE_SYSTEM_OVERLAY = FIRST_SYSTEM_WINDOW+15; WindowManager.LayoutParams params; params = new WindowManager.LayoutParams( WindowManager.LayoutParams.FIRST_SYSTEM_WINDOW+15, WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT ); WindowManager.LayoutParams layoutParams = params; WindowManager windowManager = (WindowManager) getSystemService(WINDOW_SERVICE); windowManager.addView(mainView, layoutParams);

  2. TYPE_SECURE_SYSTEM_OVERLAY requires permission of app system, so, Idk if can bypass, error it's:
    Caused by: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@27dec2f -- permission denied for window type 2015

(ref:https://gitlab.tubit.tu-berlin.de/justus.beyer/streamagame_platform_frameworks_base/blob/streamagame-lollipop-x86/core/java/android/view/ViewRootImpl.java#L586)

  1. Permission required for TYPE_SECURE_SYSTEM_OVERLAY is permission app system INTERNAL_SYSTEM_WINDOW, so idk how bypass this.

EDIT1: Maybe hooking pakagemanager?, because when I add permission I receive: INTERNAL_SYSTEM_WINDOW requested by ... app is not changeable permission type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants