-
-
Notifications
You must be signed in to change notification settings - Fork 426
feat: Add Set target SDK version 34
patch (Disable edge-to-edge display)
#4780
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
feat: Add Set target SDK version 34
patch (Disable edge-to-edge display)
#4780
Conversation
642b111
to
0e20724
Compare
0e20724
to
08f2cdd
Compare
patches/src/main/kotlin/app/revanced/patches/all/misc/display/EdgeToEdgeDisplayPatch.kt
Outdated
Show resolved
Hide resolved
patches/src/main/kotlin/app/revanced/patches/all/misc/display/EdgeToEdgeDisplayPatch.kt
Outdated
Show resolved
Hide resolved
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.
Is there no way to control the behaviour directly without downgrading the SDK version?
…EdgeToEdgeDisplayPatch.kt Co-authored-by: oSumAtrIX <[email protected]>
It appears the theme file can set Setting the target SDK automatically opts out of the behavior. |
In this case, iterate through all the themes XML files and set windowOptOutEdgeToEdgeEnforcement to true instead of downgrading the SDK. If there is a non deprecated way of disabling edge to edge, you can do that instead. |
https://developer.android.com/about/versions/16/behavior-changes-16#edge-to-edge It seems opting out is only for Android 15. Android 16 ignores the flag. So, changing the target sdk appears to be the only way for Android 16+ |
Disable edge-to-edge display
patchDisable edge-to-edge display
patch
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.
This patch should be turned into a changeTargetSdkPatch as it is mainly doing that. A patch option can control the SDK version and could use the compileSdk version by default.
A generic patch doesn't appear to have any use case except for this specific situation (edge-to-edge display). Using an older target sdk may cause unknown and undesirable backwards compatibility behavior. Users already get confused enough and apply universal patches without understanding what they are doing: "I applied remove screenshot patch and the app is crashing" (the unpatched app doesn't even restrict screenshot usage). If other purposes for changing the target sdk is found then the patch can be made generic. But for now I think it's much simpler to keep the patch focused on this one specific change. |
Users getting confused by universal patches is not a concern patches is supposed to fix by labeling patches something they arent really doing. The business logic of the patch implies a different name than currently given. It is a patch that changes the target SDK and as such should be named like that. Naming it like something else on the other hand is where issues start to happen. The patch is not just disabling edge to edge display, it is downgrading the SDK, so "unknown and undesired backwards compatibility behaviour" still applies regardless. If the patch is named according to what it does, this side effect would be expected behaviour as the patch did what it was named after, which is changing the target SDK. The user confusion with universal patches is not this repositories or patches concern and should not be a supporting argument to name the patch after something else than it really does. |
The patch explains what it does (changes target sdk), but if it's generic that means the user now needs to know that using sdk 34 turns off edge to edge display. And if there's no other use case except this, then why give the user an option (target sdk) when there is literally only one value that is useful? Making the patch a generic |
Thats what the description or even patch option values are for. You can add SDK 34 as a value and mention that it disables edge to edge display.
There may be other use cases, I don't know what new Android SDK versions add but let alone for scalability and future possible usecases, this change would be useful.
The patch is already a "generic change target SDK" patch, just that it now should provide an option to change to any SDK and not an arbitrary value like 34 which makes the primary and only business logic the patch has, dynamic and scalable. The name "Disable edge-to-edge display" is not the actual name of the patch according to the core business logic. If there was some Android API to disable edge-to-edge display, and the patch would use that to disable this feature, then the name would be appropriate. |
I'm searching now, and I can't find another other compatibility behavior that could be desirable to revert. And some of the backwards compatibility would be bad to revert. Such as changing to sdk 33 that reverts 34's behavior of allowing a an app to run in the background less time before it's paused/hibernated. Revering that behavior will cause the app to use more battery (if the user wants to allow more background time, the app should instead be whitelisted for battery usage). Another is Android 33 has lower range for accessibility text size (34 is up to 200%, 33 is up to 130%) Yet another is early versions of Android sdk turns off various hardware acceleration functionality. I don't think letting the user pick a version is a good idea. If we cannot find a single use case outside of forcing sdk 34, then there is no reason to let them. If we find another use case, then sure change this to a generic patch. But until then let's not make this complicated. |
@MarcaDian what's wrong with the third photo? |
The user can choose a higher SDK value. There is no reason to cripple the patch in its core logic. |
In the third screenshot, the GitHub mobile client, I just wanted to show that this bug is not only in the settings of the revanced, but also in third-party programs. |
Setting the sdk higher than unpatched has a high likelihood the app won't work correctly (or even launch at all), because nearly every new sdk has new requirements such as declaring exports/permissions and some classes will throw exceptions if not used in the 'new' way. Forcing to 35 or above will break nearly all old apps because edge-to-edge is then forced on but the UI isn't updated to handle edge to edge. If the patch name must be explicitly based on what it does, it can be |
"Change target SDK" would call for the option. If the patch is restricted to SDK 34, it is noteworthy for the name to be "Set target SDK version 34" with a description motivating this arbitrary SDK version. |
Disable edge-to-edge display
patchSet target SDK version 34
patch (Disable edge-to-edge display)
Set target SDK version 34
patch (Disable edge-to-edge display)Set target SDK version 34
patch (Disables edge-to-edge display)
Set target SDK version 34
patch (Disables edge-to-edge display)Set target SDK version 34
patch (Disable edge-to-edge display)
# [5.20.0-dev.1](v5.19.1...v5.20.0-dev.1) (2025-04-13) ### Features * Add `Set target SDK version 34` patch (Disable edge-to-edge display) ([#4780](#4780)) ([dcf6178](dcf6178))
# [5.20.0](v5.19.1...v5.20.0) (2025-04-15) ### Bug Fixes * **Duolingo - Hide ads:** Support lastest app release ([#4790](#4790)) ([215fccb](215fccb)) * **Spotify - Unlock Spotify Premium:** Remove premium restriction for 'Spotify Connect' ([#4782](#4782)) ([50f5b1a](50f5b1a)) * **Spotify:** Fix login by replacing `Spoof signature` patch with new `Spoof package info` patch ([#4794](#4794)) ([d639151](d639151)) * **YouTube - Remove background playback restrictions:** Restore PiP button functionality after screen is unlocked ([6837348](6837348)) ### Features * Add `Set target SDK version 34` patch (Disable edge-to-edge display) ([#4780](#4780)) ([dcf6178](dcf6178)) * **Spotify - Custom theme:** Add option to use unmodified player background gradient ([#4741](#4741)) ([0ee3693](0ee3693)) * **YouTube - Swipe controls:** Add option to change volume swipe sensitivity (step size) ([#4557](#4557)) ([8957325](8957325))
Forces off Android 15 edge to edge display by changing the target SDK version to Android 14.
Effectively, this will restore opaque nav/status bars.
Before: Photo Math (bottom nav bar is transparent)
