-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
Add --root option to bypass AID_SHELL secure display restriction starting in A12 #5014
Conversation
…f FakeContext.FakeContext Also fix Server.java to actually import android.system.Os as an if statement requires it
…settings put/get if ran as UID 1000
Signed-off-by: Giantvince1 <giantvince1@protonmail.com>
This reverts commit 85a94dd.
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.
I've left a few comments, mostly nitpicks and styling problems. Haven't actually tested the code.
PS: I haven't contributed to scrcpy before, but I've been following this issue for a while, so take my review with a grain of salt.
Signed-off-by: Giantvince1 <giantvince1@protonmail.com>
Signed-off-by: Giantvince1 <giantvince1@protonmail.com>
This reverts commit 5c29967. I'm doing this as I initially did the revert because Ubuntu's packaged version of ```meson``` is 0.61.2. Pip's version is 1.41, WAY more up-to-date. Un-reverting initial commit as this follows the new convention.
Is there anyone able to test the |
I've tested this on Android 14 rooted (real hardware), but it doesn't seem to work (apps with the secure flag are still black). |
That's strange. I had used the previous PR made by RiggiG to workaround My PR is just a cleanup and rework of some things based on his PR, which is why I credited him both in the git cherry-picks and in the initial posting of the PR. Edit: I plan on going back and testing this myself in my rooted A14 AVD, just to double-check that |
I'm gonna try to see if I can find the capabilities of different system-level users (UIDs below 10000), and compare them from stock AOSP and/or LineageOS to DerpFest's own code. Maybe they stripped the perms for creating a Edit: Also, the main reason we can't use UID 0 (acutal root) for this is due to ART and SEPolicy limitations. For one, the clipboard will refuse to work, as no Android package is registered with UID 0, at all, ever. Next is the fact that most system services don't treat UID 0 specially, but will treat UID 1000 specially, but only because it's supposed to represent |
The relevant code is in SurfaceFlinger, and has not changed in 4 years.
This is not accurate, this setting toggles Props for picking this up, I haven't been able to prioritize any effort on this for a long while. I haven't tested this build, but my original build (with |
@RiggiG thank you for providing that info, that's actually really helpful. However, I'm not sure what you mean by "stock A14 Pixel 5", do you mean no root access, or do you mean it's running the stock ROM with Magisk installed? Either way, I'll try out a different app to test However, with the Settings part, it would actually black out on A14 without |
dumpsys display:Pixel 5 A14 scrcpy with --root:
Pixel 5 A13 AVD (Magisk): scrcpy does not appear dumpsys SurfaceFlinger:Pixel 5 A14 scrcpy with --root:
Pixel 5 A13 AVD (Magisk):
|
That explains it; the display is not being marked with It's gonna take some extra testing to see what happens with which changes; I already tried overriding the At least, that's what I gathered from the AOSP docs on the whole bit when I tried to make sense of them. |
Unless someone can take the time to figure out how to specify the desired display flag(s) needed for this to work, I'm gonna close this PR before it gets to be far too outdated and nothing more than a cumbersome patch set for a feature few would use. I will still keep my repo open to the public in case anyone wants to create a PR against it, but as it stands, it's already a fair bit behind upstream, and a rebase isn't in my immediate plans, especially considering only half the |
Hello everyone! I am creating this pull request in hopes of merging this feature before the 2.5.x release window, as many would benefit from being able to use
scrcpy
with root access, without being able to runadb root
since Android's new restrictions on theadbd
daemon now being an APEX module. The initial idea and most of the groundwork was done by @RiggiG and I mainly just fixed up a few things that would have prevented it from merging with the current state of thedev
branch, as well as a few things that caused other problems.During testing, I have found that on an Android 14 AVD rooted with Magisk (instead of
adb root
), I was able to see bidirectional clipboard access working, along with display, audio, and even settings changes working without problems. The only thing that is somewhat janky about the settings changes is that sinceAID_SYSTEM
does NOT have write access to the settings database, actual root access is required byAID_SYSTEM
so the server-side executable can handle cleanup on exit properly. This was just rebased usinggit cherry-pick
to be able to get the necessary changes pulled in, without having to see nearly 100 commits that duplicated the progress on the origindev
branch in the meantime.