Skip to content

Commit

Permalink
chore: Merge branch dev to main
Browse files Browse the repository at this point in the history
  • Loading branch information
anddea authored Dec 28, 2024
2 parents b5ca533 + 93a442b commit 70d6697
Show file tree
Hide file tree
Showing 76 changed files with 1,111 additions and 87 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# [3.1.0-dev.2](https://github.com/anddea/revanced-patches/compare/v3.1.0-dev.1...v3.1.0-dev.2) (2024-12-27)


### Bug Fixes

* **YouTube - Custom branding icon:** Missing string for `Xisr Holiday` ([f18649f](https://github.com/anddea/revanced-patches/commit/f18649f8e594e1ecb5744ffc101749065fc3f29c))

# [3.1.0-dev.1](https://github.com/anddea/revanced-patches/compare/v3.0.0...v3.1.0-dev.1) (2024-12-27)


### Features

* **YouTube - Custom branding icon:** Add `Xisr Holiday` icon ([7ca94a6](https://github.com/anddea/revanced-patches/commit/7ca94a664457980346aba83e41a41375a9557bf0))

# [3.0.0](https://github.com/anddea/revanced-patches/compare/v2.231.0...v3.0.0) (2024-12-25)


Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ org.gradle.parallel = true
android.useAndroidX = true
kotlin.code.style = official
kotlin.jvm.target.validation.mode = IGNORE
version = 3.0.0
version = 3.1.0-dev.2
3 changes: 2 additions & 1 deletion patches.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
"description": "The icon to apply to the app.\n\nIf a path to a folder is provided, the folder must contain the following folders:\n\n- mipmap-xxxhdpi\n- mipmap-xxhdpi\n- mipmap-xhdpi\n- mipmap-hdpi\n- mipmap-mdpi\n\nEach of these folders must contain the following files:\n\n- adaptiveproduct_youtube_background_color_108.png\n- adaptiveproduct_youtube_foreground_color_108.png\n- ic_launcher.png\n- ic_launcher_round.png",
"required": true,
"type": "kotlin.String",
"default": "xisr_yellow",
"default": "xisr_holiday",
"values": {
"AFN Blue": "afn_blue",
"AFN Red": "afn_red",
Expand All @@ -367,6 +367,7 @@
"Vanced Black": "vanced_black",
"Vanced Light": "vanced_light",
"Xisr Yellow": "xisr_yellow",
"Xisr Holiday": "xisr_holiday",
"YouTube": "youtube",
"YouTube Black": "youtube_black"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import app.revanced.patches.youtube.utils.playservice.versionCheckPatch
import app.revanced.patches.youtube.utils.settings.ResourceUtils.updatePatchStatusIcon
import app.revanced.patches.youtube.utils.settings.settingsPatch
import app.revanced.util.ResourceGroup
import app.revanced.util.Utils.printWarn
import app.revanced.util.Utils.trimIndentMultiline
import app.revanced.util.copyAdaptiveIcon
import app.revanced.util.copyFile
Expand All @@ -26,7 +27,7 @@ private const val ADAPTIVE_ICON_FOREGROUND_FILE_NAME =
"adaptiveproduct_youtube_foreground_color_108"
private const val ADAPTIVE_ICON_MONOCHROME_FILE_NAME =
"adaptive_monochrome_ic_youtube_launcher"
private const val DEFAULT_ICON = "xisr_yellow"
private const val DEFAULT_ICON = "xisr_holiday"

private val availableIcon = mapOf(
"AFN Blue" to "afn_blue",
Expand All @@ -42,7 +43,8 @@ private val availableIcon = mapOf(
"Revancify Red" to "revancify_red",
"Vanced Black" to "vanced_black",
"Vanced Light" to "vanced_light",
"Xisr Yellow" to DEFAULT_ICON,
"Xisr Yellow" to "xisr_yellow",
"Xisr Holiday" to DEFAULT_ICON,
"YouTube" to "youtube",
"YouTube Black" to "youtube_black",
)
Expand Down Expand Up @@ -216,41 +218,46 @@ val customBrandingIconPatch = resourcePatch(
}
}

val styleMap = mutableMapOf<String, String>()
styleMap["Base.Theme.YouTube.Launcher"] =
"@style/Theme.AppCompat.DayNight.NoActionBar"
val avdAnimPath = get("res").resolve("drawable").resolve("avd_anim.xml")
if (avdAnimPath.exists()) {
val styleMap = mutableMapOf<String, String>()
styleMap["Base.Theme.YouTube.Launcher"] =
"@style/Theme.AppCompat.DayNight.NoActionBar"

if (is_19_32_or_greater) {
styleMap["Theme.YouTube.Home"] = "@style/Base.V27.Theme.YouTube.Home"
}
if (is_19_32_or_greater) {
styleMap["Theme.YouTube.Home"] = "@style/Base.V27.Theme.YouTube.Home"
}

styleMap.forEach { (nodeAttributeName, nodeAttributeParent) ->
document("res/values-v31/styles.xml").use { document ->
val resourcesNode =
document.getElementsByTagName("resources").item(0) as Element

val style = document.createElement("style")
style.setAttribute("name", nodeAttributeName)
style.setAttribute("parent", nodeAttributeParent)

val primaryItem = document.createElement("item")
primaryItem.setAttribute("name", "android:windowSplashScreenAnimatedIcon")
primaryItem.textContent = "@drawable/avd_anim"
val secondaryItem = document.createElement("item")
secondaryItem.setAttribute(
"name",
"android:windowSplashScreenAnimationDuration"
)
secondaryItem.textContent = if (appIcon.startsWith("revancify"))
"1500"
else
"1000"

style.appendChild(primaryItem)
style.appendChild(secondaryItem)

styleMap.forEach { (nodeAttributeName, nodeAttributeParent) ->
document("res/values-v31/styles.xml").use { document ->
val resourcesNode =
document.getElementsByTagName("resources").item(0) as Element

val style = document.createElement("style")
style.setAttribute("name", nodeAttributeName)
style.setAttribute("parent", nodeAttributeParent)

val primaryItem = document.createElement("item")
primaryItem.setAttribute("name", "android:windowSplashScreenAnimatedIcon")
primaryItem.textContent = "@drawable/avd_anim"
val secondaryItem = document.createElement("item")
secondaryItem.setAttribute(
"name",
"android:windowSplashScreenAnimationDuration"
)
secondaryItem.textContent = if (appIcon.startsWith("revancify"))
"1500"
else
"1000"

style.appendChild(primaryItem)
style.appendChild(secondaryItem)

resourcesNode.appendChild(style)
resourcesNode.appendChild(style)
}
}
} else {
printWarn("Splash animation is not available for \"$appIcon\".")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ val seekbarComponentsPatch = bytecodePatch(

val cairoStartColor by stringOption(
key = "cairoStartColor",
default = "#FFFF2791",
default = "#FFFF0033",
title = "Cairo start color",
description = "Set Cairo start color for the seekbar."
)

val cairoEndColor by stringOption(
key = "cairoEndColor",
default = "#FFFF0033",
default = "#FFFF2791",
title = "Cairo end color",
description = "Set Cairo end color for the seekbar."
)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="500"
android:viewportHeight="500">
<path
android:pathData="M 189 210.354 C 189 182.476 216.73 165.147 239.046 179.011 L 302.326 218.693 C 324.558 232.553 324.558 267.442 302.326 281.306 L 239.046 320.988 C 216.73 334.855 189 317.524 189 289.648 L 189 210.354 Z"
android:fillColor="#000000" />
</vector>
Loading

0 comments on commit 70d6697

Please sign in to comment.