mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-04-29 22:24:31 +02:00
fix(YouTube - Theme): Change method to fix dark theme in YouTube 19.32+
This commit is contained in:
parent
5c743c299a
commit
df41f035b6
@ -1,9 +1,12 @@
|
|||||||
package app.revanced.patches.youtube.utils.fix.splash
|
package app.revanced.patches.youtube.utils.fix.splash
|
||||||
|
|
||||||
import app.revanced.patcher.patch.resourcePatch
|
import app.revanced.patcher.patch.resourcePatch
|
||||||
|
import app.revanced.patches.youtube.utils.compatibility.Constants.YOUTUBE_PACKAGE_NAME
|
||||||
import app.revanced.patches.youtube.utils.playservice.is_19_32_or_greater
|
import app.revanced.patches.youtube.utils.playservice.is_19_32_or_greater
|
||||||
import app.revanced.patches.youtube.utils.playservice.versionCheckPatch
|
import app.revanced.patches.youtube.utils.playservice.versionCheckPatch
|
||||||
import app.revanced.patches.youtube.utils.settings.ResourceUtils.restoreOldSplashAnimationIncluded
|
import app.revanced.patches.youtube.utils.settings.ResourceUtils.restoreOldSplashAnimationIncluded
|
||||||
|
import app.revanced.patches.youtube.utils.settings.ResourceUtils.youtubePackageName
|
||||||
|
import app.revanced.util.findElementByAttributeValueOrThrow
|
||||||
import org.w3c.dom.Element
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -25,6 +28,19 @@ val darkModeSplashScreenPatch = resourcePatch(
|
|||||||
return@finalize
|
return@finalize
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GmsCore support included
|
||||||
|
if (youtubePackageName != YOUTUBE_PACKAGE_NAME) {
|
||||||
|
document("AndroidManifest.xml").use { document ->
|
||||||
|
val mainActivityElement = document.childNodes.findElementByAttributeValueOrThrow(
|
||||||
|
"android:name",
|
||||||
|
"com.google.android.apps.youtube.app.watchwhile.MainActivity",
|
||||||
|
)
|
||||||
|
|
||||||
|
mainActivityElement.setAttribute("android:launchMode", "singleTask")
|
||||||
|
}
|
||||||
|
return@finalize
|
||||||
|
}
|
||||||
|
|
||||||
if (restoreOldSplashAnimationIncluded) {
|
if (restoreOldSplashAnimationIncluded) {
|
||||||
document("res/values-night/styles.xml").use { document ->
|
document("res/values-night/styles.xml").use { document ->
|
||||||
val resourcesNode = document.getElementsByTagName("resources").item(0) as Element
|
val resourcesNode = document.getElementsByTagName("resources").item(0) as Element
|
||||||
|
Loading…
x
Reference in New Issue
Block a user