mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-29 05:31:02 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7a4ad76ea | ||
|
|
7e6ee73908 | ||
|
|
87954a1aaf | ||
|
|
e5a2ed0f70 | ||
|
|
2295aaebf4 | ||
|
|
a72bf150c2 | ||
|
|
0290cd3d36 | ||
|
|
e8d61e0c0e | ||
|
|
19769d80eb | ||
|
|
12c16d4644 | ||
|
|
75f4653c16 | ||
|
|
3286d26996 | ||
|
|
edbc36e90f |
1
.idea/.gitignore
generated
vendored
1
.idea/.gitignore
generated
vendored
@@ -6,3 +6,4 @@
|
|||||||
/dataSources.local.xml
|
/dataSources.local.xml
|
||||||
# Editor-based HTTP Client requests
|
# Editor-based HTTP Client requests
|
||||||
/httpRequests/
|
/httpRequests/
|
||||||
|
/kotlinc.xml
|
||||||
|
|||||||
13
CHANGELOG.md
13
CHANGELOG.md
@@ -1,3 +1,16 @@
|
|||||||
|
## [2.50.7](https://github.com/revanced/revanced-patches/compare/v2.50.6...v2.50.7) (2022-09-08)
|
||||||
|
|
||||||
|
## [2.50.6](https://github.com/revanced/revanced-patches/compare/v2.50.5...v2.50.6) (2022-09-07)
|
||||||
|
|
||||||
|
## [2.50.5](https://github.com/revanced/revanced-patches/compare/v2.50.4...v2.50.5) (2022-09-07)
|
||||||
|
|
||||||
|
## [2.50.4](https://github.com/revanced/revanced-patches/compare/v2.50.3...v2.50.4) (2022-09-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* don't respect primary color for the download button icon ([#424](https://github.com/revanced/revanced-patches/issues/424)) ([3fa70f4](https://github.com/revanced/revanced-patches/commit/3fa70f48a206c56f6ca8aed88baed722e76281e2))
|
||||||
|
|
||||||
## [2.50.3](https://github.com/revanced/revanced-patches/compare/v2.50.2...v2.50.3) (2022-09-01)
|
## [2.50.3](https://github.com/revanced/revanced-patches/compare/v2.50.2...v2.50.3) (2022-09-01)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib"))
|
implementation("app.revanced:revanced-patcher:4.1.3")
|
||||||
|
|
||||||
implementation("app.revanced:revanced-patcher:3.4.0")
|
|
||||||
implementation("app.revanced:multidexlib2:2.5.2.r2")
|
implementation("app.revanced:multidexlib2:2.5.2.r2")
|
||||||
|
|
||||||
// Required for meta
|
// Required for meta
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.50.3
|
version = 2.50.7
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import app.revanced.patcher.patch.impl.ResourcePatch
|
|||||||
import app.revanced.patches.youtube.layout.amoled.annotations.AmoledCompatibility
|
import app.revanced.patches.youtube.layout.amoled.annotations.AmoledCompatibility
|
||||||
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||||
import org.w3c.dom.Element
|
import org.w3c.dom.Element
|
||||||
import java.io.File
|
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@DependsOn([FixLocaleConfigErrorPatch::class])
|
@DependsOn([FixLocaleConfigErrorPatch::class])
|
||||||
@@ -22,7 +21,7 @@ import java.io.File
|
|||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class AmoledPatch : ResourcePatch() {
|
class AmoledPatch : ResourcePatch() {
|
||||||
override fun execute(data: ResourceData): PatchResult {
|
override fun execute(data: ResourceData): PatchResult {
|
||||||
data.xmlEditor["res${File.separator}values${File.separator}colors.xml"].use { editor ->
|
data.xmlEditor["res/values/colors.xml"].use { editor ->
|
||||||
val resourcesNode = editor.file.getElementsByTagName("resources").item(0) as Element
|
val resourcesNode = editor.file.getElementsByTagName("resources").item(0) as Element
|
||||||
|
|
||||||
for (i in 0 until resourcesNode.childNodes.length) {
|
for (i in 0 until resourcesNode.childNodes.length) {
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import app.revanced.patcher.patch.annotations.Patch
|
|||||||
import app.revanced.patcher.patch.impl.ResourcePatch
|
import app.revanced.patcher.patch.impl.ResourcePatch
|
||||||
import app.revanced.patches.youtube.layout.branding.icon.annotations.CustomBrandingCompatibility
|
import app.revanced.patches.youtube.layout.branding.icon.annotations.CustomBrandingCompatibility
|
||||||
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||||
import java.io.ByteArrayOutputStream
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.FileInputStream
|
import java.io.FileInputStream
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
@@ -42,27 +41,18 @@ class CustomBrandingPatch : ResourcePatch() {
|
|||||||
"hdpi" to 72,
|
"hdpi" to 72,
|
||||||
"mdpi" to 48
|
"mdpi" to 48
|
||||||
).forEach { (iconDirectory, size) ->
|
).forEach { (iconDirectory, size) ->
|
||||||
iconNames.forEach iconLoop@{ iconName ->
|
iconNames.forEach { iconName ->
|
||||||
val iconFile = getIconStream("branding/$size/$iconName.png")
|
val iconFile = getIconStream("branding/$size/$iconName.png")
|
||||||
?: return PatchResultError("The icon $iconName can not be found.")
|
?: return PatchResultError("The icon $iconName can not be found.")
|
||||||
|
|
||||||
val outputStream = ByteArrayOutputStream()
|
|
||||||
iconFile.use { input ->
|
|
||||||
outputStream.use { output ->
|
|
||||||
input.copyTo(output)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Files.write(
|
Files.write(
|
||||||
resDirectory.resolve("mipmap-$iconDirectory").resolve("$iconName.png").toPath(),
|
resDirectory.resolve("mipmap-$iconDirectory").resolve("$iconName.png").toPath(),
|
||||||
outputStream.toByteArray()
|
iconFile.readBytes()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Name branding
|
// Name branding
|
||||||
val appName: String by options[keyAppName]
|
|
||||||
|
|
||||||
val manifest = data["AndroidManifest.xml"]
|
val manifest = data["AndroidManifest.xml"]
|
||||||
manifest.writeText(
|
manifest.writeText(
|
||||||
manifest.readText()
|
manifest.readText()
|
||||||
@@ -75,24 +65,7 @@ class CustomBrandingPatch : ResourcePatch() {
|
|||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
override val options = PatchOptions(
|
|
||||||
PatchOption.StringOption(
|
|
||||||
key = keyAppName,
|
|
||||||
default = "YouTube ReVanced",
|
|
||||||
title = "Application Name",
|
|
||||||
description = "The name of the application it will show on your home screen.",
|
|
||||||
required = true
|
|
||||||
),
|
|
||||||
PatchOption.StringOption(
|
|
||||||
key = keyAppIconPath,
|
|
||||||
default = null,
|
|
||||||
title = "Application Icon Path",
|
|
||||||
description = "A path to the icon of the application."
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
private fun getIconStream(iconPath: String): InputStream? {
|
private fun getIconStream(iconPath: String): InputStream? {
|
||||||
val appIconPath: String? by options[keyAppIconPath]
|
|
||||||
if (appIconPath == null) {
|
if (appIconPath == null) {
|
||||||
return this.javaClass.classLoader.getResourceAsStream(iconPath)
|
return this.javaClass.classLoader.getResourceAsStream(iconPath)
|
||||||
}
|
}
|
||||||
@@ -101,8 +74,24 @@ class CustomBrandingPatch : ResourcePatch() {
|
|||||||
return FileInputStream(file)
|
return FileInputStream(file)
|
||||||
}
|
}
|
||||||
|
|
||||||
private companion object {
|
companion object : OptionsContainer() {
|
||||||
private const val keyAppName = "appName"
|
private var appName: String by option(
|
||||||
private const val keyAppIconPath = "appIconPath"
|
PatchOption.StringOption(
|
||||||
|
key = "appName",
|
||||||
|
default = "YouTube ReVanced",
|
||||||
|
title = "Application Name",
|
||||||
|
description = "The name of the application it will show on your home screen.",
|
||||||
|
required = true
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
private var appIconPath: String? by option(
|
||||||
|
PatchOption.StringOption(
|
||||||
|
key = "appIconPath",
|
||||||
|
default = null,
|
||||||
|
title = "Application Icon Path",
|
||||||
|
description = "A path to the icon of the application."
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:tint="?attr/ytTextPrimary" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:tint="#FFFFFF" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||||
<path android:fillColor="#ff000000" android:pathData="M19,9h-4V3H9v6H5l7,7 7,-7zM5,18v2h14v-2H5z"/>
|
<path android:fillColor="#FFFFFF" android:pathData="M19,9h-4V3H9v6H5l7,7 7,-7zM5,18v2h14v-2H5z"/>
|
||||||
</vector>
|
</vector>
|
||||||
Reference in New Issue
Block a user