mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-29 05:31:02 +00:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb10ea1797 | ||
|
|
6d6a0375c8 | ||
|
|
8541ee0066 | ||
|
|
f7e0b46bc7 | ||
|
|
59af825d0a | ||
|
|
04ffffbdf2 | ||
|
|
ecc131fa4f | ||
|
|
a4f1d3558e | ||
|
|
4cbd58721d | ||
|
|
7cfe43e666 | ||
|
|
c93d7bc212 | ||
|
|
c28fd5cf20 | ||
|
|
069f754d51 | ||
|
|
cba04cf5a6 | ||
|
|
5e358c7319 | ||
|
|
ce69471684 |
37
CHANGELOG.md
37
CHANGELOG.md
@@ -1,3 +1,40 @@
|
|||||||
|
## [2.52.3](https://github.com/revanced/revanced-patches/compare/v2.52.2...v2.52.3) (2022-09-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* path for download icon ([#465](https://github.com/revanced/revanced-patches/issues/465)) ([bff22c3](https://github.com/revanced/revanced-patches/commit/bff22c3a154fd8059f4f8995a303354633a50517))
|
||||||
|
|
||||||
|
## [2.52.2](https://github.com/revanced/revanced-patches/compare/v2.52.1...v2.52.2) (2022-09-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* design language for download icon ([#464](https://github.com/revanced/revanced-patches/issues/464)) ([c24dc17](https://github.com/revanced/revanced-patches/commit/c24dc175f705fd5364b8bcf01f27f3ac8ecc0e64))
|
||||||
|
|
||||||
|
## [2.52.1](https://github.com/revanced/revanced-patches/compare/v2.52.0...v2.52.1) (2022-09-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* multiple compatible pkgs on readme ([3f82a13](https://github.com/revanced/revanced-patches/commit/3f82a1349fb11b1152ac10d76deb930f7325b7c9))
|
||||||
|
|
||||||
|
# [2.52.0](https://github.com/revanced/revanced-patches/compare/v2.51.3...v2.52.0) (2022-09-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add deprecated & options to patches.json ([759315b](https://github.com/revanced/revanced-patches/commit/759315be1b23a6b3655fc87b56a8974ebac648cc))
|
||||||
|
|
||||||
|
## [2.51.3](https://github.com/revanced/revanced-patches/compare/v2.51.2...v2.51.3) (2022-09-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* cleanup & trigger release for ThemePatch ([8d25b21](https://github.com/revanced/revanced-patches/commit/8d25b214e297797092432b5fe1a4ede1f42115c8)), closes [#447](https://github.com/revanced/revanced-patches/issues/447) [revanced/revanced-patcher#99](https://github.com/revanced/revanced-patcher/issues/99)
|
||||||
|
|
||||||
|
## [2.51.2](https://github.com/revanced/revanced-patches/compare/v2.51.1...v2.51.2) (2022-09-08)
|
||||||
|
|
||||||
## [2.51.1](https://github.com/revanced/revanced-patches/compare/v2.51.0...v2.51.1) (2022-09-08)
|
## [2.51.1](https://github.com/revanced/revanced-patches/compare/v2.51.0...v2.51.1) (2022-09-08)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,16 +12,23 @@ This section explains the JSON format for the [patches.json](patches.json) file.
|
|||||||
|
|
||||||
The file contains an array of objects, each object representing a patch. The object contains the following properties:
|
The file contains an array of objects, each object representing a patch. The object contains the following properties:
|
||||||
|
|
||||||
| key | description |
|
| key | description |
|
||||||
|-------------------------------|------------------------------------------------------------------------------------------------------------------|
|
|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `name` | The name of the patch. |
|
| `name` | The name of the patch. |
|
||||||
| `description` | The description of the patch. |
|
| `description` | The description of the patch. |
|
||||||
| `version` | The version of the patch. |
|
| `version` | The version of the patch. |
|
||||||
| `excluded` | Whether a patch is excluded by default. If `true`, the patch must never be included by default. |
|
| `excluded` | Whether the patch is excluded by default. If `true`, the patch must never be included by default. |
|
||||||
| `dependencies` | An array of dependencies, which are patch names. |
|
| `deprecated` | Whether the patch is deprecated. |
|
||||||
| `compatiblePackages` | An array of packages compatible with this patch. |
|
| `options` | An array of options for this patch. |
|
||||||
| `compatiblePackages.name` | The name of the package. |
|
| `options.key` | The key of the option. |
|
||||||
| `compatiblePackages.versions` | An array of versions of the package compatible with this patch. If empty, all versions are seemingly compatible. |
|
| `options.title` | The title of the option. |
|
||||||
|
| `options.description` | The description of the option. |
|
||||||
|
| `options.required` | Whether the option is required. |
|
||||||
|
| `options.choices?` | An array of choices of the option. This may be `null` if this option has no choices. The element type of this array may be any type. It can be a `String`, `Int` or something else. |
|
||||||
|
| `dependencies` | An array of dependencies, which are patch names. |
|
||||||
|
| `compatiblePackages` | An array of packages compatible with this patch. |
|
||||||
|
| `compatiblePackages.name` | The name of the package. |
|
||||||
|
| `compatiblePackages.versions` | An array of versions of the package compatible with this patch. If empty, all versions are seemingly compatible. |
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
@@ -32,6 +39,8 @@ Example:
|
|||||||
"description": "Adds the ability to remember the video quality you chose in the video quality flyout.",
|
"description": "Adds the ability to remember the video quality you chose in the video quality flyout.",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"excluded": false,
|
"excluded": false,
|
||||||
|
"deprecated": false,
|
||||||
|
"options": [],
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"integrations",
|
"integrations",
|
||||||
"video-id-hook"
|
"video-id-hook"
|
||||||
@@ -46,24 +55,67 @@ Example:
|
|||||||
"17.27.39",
|
"17.27.39",
|
||||||
"17.28.34",
|
"17.28.34",
|
||||||
"17.29.34",
|
"17.29.34",
|
||||||
"17.32.35"
|
"17.32.35",
|
||||||
|
"17.33.42"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "client-spoof",
|
"name": "theme",
|
||||||
"description": "Spoofs the YouTube or Vanced client to prevent playback issues.",
|
"description": "Enables a custom theme.",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"excluded": false,
|
"excluded": false,
|
||||||
"dependencies": [],
|
"deprecated": false,
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"key": "theme",
|
||||||
|
"title": "Theme",
|
||||||
|
"description": "Select a theme.",
|
||||||
|
"required": true,
|
||||||
|
"choices": [
|
||||||
|
"Amoled"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": [
|
||||||
|
"locale-config-fix"
|
||||||
|
],
|
||||||
"compatiblePackages": [
|
"compatiblePackages": [
|
||||||
{
|
{
|
||||||
"name": "com.google.android.youtube",
|
"name": "com.google.android.youtube",
|
||||||
"versions": []
|
"versions": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "custom-branding",
|
||||||
|
"description": "Changes the YouTube launcher icon and name to your choice (defaults to ReVanced).",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"excluded": false,
|
||||||
|
"deprecated": false,
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"key": "appName",
|
||||||
|
"title": "Application Name",
|
||||||
|
"description": "The name of the application it will show on your home screen.",
|
||||||
|
"required": true,
|
||||||
|
"choices": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "com.vanced.android.youtube",
|
"key": "appIconPath",
|
||||||
|
"title": "Application Icon Path",
|
||||||
|
"description": "A path to the icon of the application.",
|
||||||
|
"required": false,
|
||||||
|
"choices": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": [
|
||||||
|
"locale-config-fix"
|
||||||
|
],
|
||||||
|
"compatiblePackages": [
|
||||||
|
{
|
||||||
|
"name": "com.google.android.youtube",
|
||||||
"versions": []
|
"versions": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
100
README.md
100
README.md
@@ -64,6 +64,16 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
| `tiktok-ads` | Removes ads from TikTok. | all |
|
| `tiktok-ads` | Removes ads from TikTok. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
### 📦 `com.zhiliaoapp.musically`
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `tiktok-download` | Remove restrictions on downloads video. | all |
|
||||||
|
| `tiktok-seekbar` | Show progress bar for all video. | all |
|
||||||
|
| `tiktok-ads` | Removes ads from TikTok. | all |
|
||||||
|
</details>
|
||||||
|
|
||||||
### 📦 `com.google.android.youtube`
|
### 📦 `com.google.android.youtube`
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
@@ -102,6 +112,14 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
| `hide-infocard-suggestions` | Hides infocards in videos. | 17.33.42 |
|
| `hide-infocard-suggestions` | Hides infocards in videos. | 17.33.42 |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
### 📦 `com.vanced.android.youtube`
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 📝 JSON Format
|
## 📝 JSON Format
|
||||||
@@ -110,16 +128,23 @@ This section explains the JSON format for the [patches.json](patches.json) file.
|
|||||||
|
|
||||||
The file contains an array of objects, each object representing a patch. The object contains the following properties:
|
The file contains an array of objects, each object representing a patch. The object contains the following properties:
|
||||||
|
|
||||||
| key | description |
|
| key | description |
|
||||||
|-------------------------------|------------------------------------------------------------------------------------------------------------------|
|
|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `name` | The name of the patch. |
|
| `name` | The name of the patch. |
|
||||||
| `description` | The description of the patch. |
|
| `description` | The description of the patch. |
|
||||||
| `version` | The version of the patch. |
|
| `version` | The version of the patch. |
|
||||||
| `excluded` | Whether a patch is excluded by default. If `true`, the patch must never be included by default. |
|
| `excluded` | Whether the patch is excluded by default. If `true`, the patch must never be included by default. |
|
||||||
| `dependencies` | An array of dependencies, which are patch names. |
|
| `deprecated` | Whether the patch is deprecated. |
|
||||||
| `compatiblePackages` | An array of packages compatible with this patch. |
|
| `options` | An array of options for this patch. |
|
||||||
| `compatiblePackages.name` | The name of the package. |
|
| `options.key` | The key of the option. |
|
||||||
| `compatiblePackages.versions` | An array of versions of the package compatible with this patch. If empty, all versions are seemingly compatible. |
|
| `options.title` | The title of the option. |
|
||||||
|
| `options.description` | The description of the option. |
|
||||||
|
| `options.required` | Whether the option is required. |
|
||||||
|
| `options.choices?` | An array of choices of the option. This may be `null` if this option has no choices. The element type of this array may be any type. It can be a `String`, `Int` or something else. |
|
||||||
|
| `dependencies` | An array of dependencies, which are patch names. |
|
||||||
|
| `compatiblePackages` | An array of packages compatible with this patch. |
|
||||||
|
| `compatiblePackages.name` | The name of the package. |
|
||||||
|
| `compatiblePackages.versions` | An array of versions of the package compatible with this patch. If empty, all versions are seemingly compatible. |
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
@@ -130,6 +155,8 @@ Example:
|
|||||||
"description": "Adds the ability to remember the video quality you chose in the video quality flyout.",
|
"description": "Adds the ability to remember the video quality you chose in the video quality flyout.",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"excluded": false,
|
"excluded": false,
|
||||||
|
"deprecated": false,
|
||||||
|
"options": [],
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"integrations",
|
"integrations",
|
||||||
"video-id-hook"
|
"video-id-hook"
|
||||||
@@ -144,24 +171,67 @@ Example:
|
|||||||
"17.27.39",
|
"17.27.39",
|
||||||
"17.28.34",
|
"17.28.34",
|
||||||
"17.29.34",
|
"17.29.34",
|
||||||
"17.32.35"
|
"17.32.35",
|
||||||
|
"17.33.42"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "client-spoof",
|
"name": "theme",
|
||||||
"description": "Spoofs the YouTube or Vanced client to prevent playback issues.",
|
"description": "Enables a custom theme.",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"excluded": false,
|
"excluded": false,
|
||||||
"dependencies": [],
|
"deprecated": false,
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"key": "theme",
|
||||||
|
"title": "Theme",
|
||||||
|
"description": "Select a theme.",
|
||||||
|
"required": true,
|
||||||
|
"choices": [
|
||||||
|
"Amoled"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": [
|
||||||
|
"locale-config-fix"
|
||||||
|
],
|
||||||
"compatiblePackages": [
|
"compatiblePackages": [
|
||||||
{
|
{
|
||||||
"name": "com.google.android.youtube",
|
"name": "com.google.android.youtube",
|
||||||
"versions": []
|
"versions": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "custom-branding",
|
||||||
|
"description": "Changes the YouTube launcher icon and name to your choice (defaults to ReVanced).",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"excluded": false,
|
||||||
|
"deprecated": false,
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"key": "appName",
|
||||||
|
"title": "Application Name",
|
||||||
|
"description": "The name of the application it will show on your home screen.",
|
||||||
|
"required": true,
|
||||||
|
"choices": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "com.vanced.android.youtube",
|
"key": "appIconPath",
|
||||||
|
"title": "Application Icon Path",
|
||||||
|
"description": "A path to the icon of the application.",
|
||||||
|
"required": false,
|
||||||
|
"choices": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": [
|
||||||
|
"locale-config-fix"
|
||||||
|
],
|
||||||
|
"compatiblePackages": [
|
||||||
|
{
|
||||||
|
"name": "com.google.android.youtube",
|
||||||
"versions": []
|
"versions": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("app.revanced:revanced-patcher:4.1.5")
|
implementation("app.revanced:revanced-patcher:4.2.3")
|
||||||
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.51.1
|
version = 2.52.3
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -3,14 +3,17 @@ package app.revanced.meta.json
|
|||||||
import app.revanced.meta.Bundle
|
import app.revanced.meta.Bundle
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.dependencies
|
import app.revanced.patcher.extensions.PatchExtensions.dependencies
|
||||||
|
import app.revanced.patcher.extensions.PatchExtensions.deprecated
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.description
|
import app.revanced.patcher.extensions.PatchExtensions.description
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.include
|
import app.revanced.patcher.extensions.PatchExtensions.include
|
||||||
|
import app.revanced.patcher.extensions.PatchExtensions.options
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.version
|
import app.revanced.patcher.extensions.PatchExtensions.version
|
||||||
import com.google.gson.Gson
|
import app.revanced.patcher.patch.PatchOption
|
||||||
|
import com.google.gson.GsonBuilder
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
private val gson = Gson()
|
private val gson = GsonBuilder().serializeNulls().create()
|
||||||
|
|
||||||
fun generateJson(bundle: Bundle) {
|
fun generateJson(bundle: Bundle) {
|
||||||
val patches = bundle.map {
|
val patches = bundle.map {
|
||||||
@@ -19,6 +22,20 @@ fun generateJson(bundle: Bundle) {
|
|||||||
it.description ?: "This patch has no description.",
|
it.description ?: "This patch has no description.",
|
||||||
it.version ?: "0.0.0",
|
it.version ?: "0.0.0",
|
||||||
!it.include,
|
!it.include,
|
||||||
|
it.deprecated != null,
|
||||||
|
it.options?.map { option ->
|
||||||
|
Option(
|
||||||
|
option.key,
|
||||||
|
option.title,
|
||||||
|
option.description,
|
||||||
|
option.required,
|
||||||
|
option.let { lo ->
|
||||||
|
if (lo is PatchOption.ListOption<*>) {
|
||||||
|
lo.options.toMutableList().toTypedArray()
|
||||||
|
} else null
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}?.toTypedArray() ?: emptyArray(),
|
||||||
it.dependencies?.map { dep ->
|
it.dependencies?.map { dep ->
|
||||||
dep.java.patchName
|
dep.java.patchName
|
||||||
}?.toTypedArray() ?: emptyArray(),
|
}?.toTypedArray() ?: emptyArray(),
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ data class JsonPatch(
|
|||||||
val description: String,
|
val description: String,
|
||||||
val version: String,
|
val version: String,
|
||||||
val excluded: Boolean,
|
val excluded: Boolean,
|
||||||
|
val deprecated: Boolean,
|
||||||
|
val options: Array<Option>,
|
||||||
val dependencies: Array<String>,
|
val dependencies: Array<String>,
|
||||||
val compatiblePackages: Array<CompatiblePackage>,
|
val compatiblePackages: Array<CompatiblePackage>,
|
||||||
)
|
)
|
||||||
@@ -15,3 +17,11 @@ data class CompatiblePackage(
|
|||||||
val name: String,
|
val name: String,
|
||||||
val versions: Array<String>,
|
val versions: Array<String>,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
data class Option(
|
||||||
|
val key: String,
|
||||||
|
val title: String,
|
||||||
|
val description: String,
|
||||||
|
val required: Boolean,
|
||||||
|
val choices: Array<*>?,
|
||||||
|
)
|
||||||
@@ -17,13 +17,11 @@ fun generateText(bundle: Bundle) {
|
|||||||
val output = StringBuilder()
|
val output = StringBuilder()
|
||||||
val packages = mutableMapOf<String, MutableList<Class<out Patch<Data>>>>()
|
val packages = mutableMapOf<String, MutableList<Class<out Patch<Data>>>>()
|
||||||
|
|
||||||
bundle.map {
|
for (patch in bundle) {
|
||||||
val packageName = it.compatiblePackages?.first()?.name!!
|
patch.compatiblePackages?.forEach { pkg ->
|
||||||
if (!packages.contains(packageName)) {
|
if (!packages.contains(pkg.name)) packages[pkg.name] = mutableListOf()
|
||||||
packages[packageName] = mutableListOf()
|
packages[pkg.name]!!.add(patch)
|
||||||
}
|
}
|
||||||
|
|
||||||
packages[packageName]?.add(it)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (pkg in packages) {
|
for (pkg in packages) {
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class CustomBrandingPatch : ResourcePatch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object : OptionsContainer() {
|
companion object : OptionsContainer() {
|
||||||
private var appName: String by option(
|
private var appName: String? by option(
|
||||||
PatchOption.StringOption(
|
PatchOption.StringOption(
|
||||||
key = "appName",
|
key = "appName",
|
||||||
default = "YouTube ReVanced",
|
default = "YouTube ReVanced",
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import org.w3c.dom.Element
|
|||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class ThemePatch : ResourcePatch() {
|
class ThemePatch : ResourcePatch() {
|
||||||
override fun execute(data: ResourceData): PatchResult {
|
override fun execute(data: ResourceData): PatchResult {
|
||||||
val theme = Themes.of(theme) ?: return PatchResultError("Theme '$theme' not found.")
|
val theme = Themes.of(theme!!) ?: return PatchResultError("Theme '$theme' not found.")
|
||||||
|
|
||||||
data.xmlEditor["res/values/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
|
||||||
@@ -35,10 +35,10 @@ class ThemePatch : ResourcePatch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object : OptionsContainer() {
|
companion object : OptionsContainer() {
|
||||||
var theme: String by option(
|
var theme: String? by option(
|
||||||
PatchOption.StringListOption(
|
PatchOption.StringListOption(
|
||||||
key = "theme",
|
key = "theme",
|
||||||
default = null,
|
default = Themes.Amoled.name,
|
||||||
options = Themes.names,
|
options = Themes.names,
|
||||||
title = "Theme",
|
title = "Theme",
|
||||||
description = "Select a theme.",
|
description = "Select a theme.",
|
||||||
@@ -50,7 +50,9 @@ class ThemePatch : ResourcePatch() {
|
|||||||
enum class Themes(val apply: (String) -> String?) {
|
enum class Themes(val apply: (String) -> String?) {
|
||||||
Amoled({ attr ->
|
Amoled({ attr ->
|
||||||
when (attr) {
|
when (attr) {
|
||||||
"yt_black1", "yt_black1_opacity95", "yt_black2", "yt_black3", "yt_black4", "yt_status_bar_background_dark" -> "@android:color/black"
|
"yt_black1", "yt_black1_opacity95", "yt_black2", "yt_black3", "yt_black4",
|
||||||
|
"yt_status_bar_background_dark" -> "@android:color/black"
|
||||||
|
|
||||||
"yt_selected_nav_label_dark" -> "#ffdf0000"
|
"yt_selected_nav_label_dark" -> "#ffdf0000"
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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="#FFFFFF" 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="#FFFFFF" android:pathData="M19,9h-4V3H9v6H5l7,7 7,-7zM5,18v2h14v-2H5z"/>
|
<path android:fillColor="#FFFFFF" android:pathData="M5.5,9.3L5.5,0h1v9.3l3.6,-3.7 0.8,0.8 -4.9,4.8 -4.9,-4.8 0.8,-0.8L5.5,9.3ZM0,11h1v1.5h10L11,11h1v2.5L0,13.5L0,11Z"/>
|
||||||
</vector>
|
</vector>
|
||||||
|
|||||||
Reference in New Issue
Block a user