chore: Merge branch dev
to main
(#2644)
This commit is contained in:
commit
e5f621c442
14
CHANGELOG.md
14
CHANGELOG.md
|
@ -1,3 +1,17 @@
|
|||
## [4.0.1-dev.2](https://github.com/ReVanced/revanced-patches/compare/v4.0.1-dev.1...v4.0.1-dev.2) (2024-01-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Only set Android key if not null to prevent build errors ([1181b0b](https://github.com/ReVanced/revanced-patches/commit/1181b0bca24c524c376f7ea26ae02ee771645e6b))
|
||||
|
||||
## [4.0.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v4.0.0...v4.0.1-dev.1) (2024-01-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Indent patch option description correctly ([bd86ef6](https://github.com/ReVanced/revanced-patches/commit/bd86ef6fc2344fa049077e9aa4bcd5d7ffa4c7f9))
|
||||
|
||||
# [4.0.0](https://github.com/ReVanced/revanced-patches/compare/v3.2.0...v4.0.0) (2024-01-27)
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
org.gradle.parallel = true
|
||||
org.gradle.caching = true
|
||||
kotlin.code.style = official
|
||||
version = 4.0.0
|
||||
version = 4.0.1-dev.2
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -30,7 +30,7 @@ abstract class BasePreference(
|
|||
*/
|
||||
open fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit): Element =
|
||||
ownerDocument.createElement(tag).apply {
|
||||
setAttribute("android:key", key)
|
||||
key?.let { setAttribute("android:key", it) }
|
||||
setAttribute("android:title", "@string/${titleKey}")
|
||||
summaryKey?.let { addSummary(it) }
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
|
|||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
|
||||
import app.revanced.util.ResourceGroup
|
||||
import app.revanced.util.Utils.trimIndentMultiline
|
||||
import app.revanced.util.copyResources
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
|
@ -64,10 +65,7 @@ object CustomBrandingPatch : ResourcePatch() {
|
|||
Each of these folders has to have the following files:
|
||||
|
||||
${iconResourceFileNames.joinToString("\n") { "- $it" }}
|
||||
"""
|
||||
.split("\n")
|
||||
.joinToString("\n") { it.trimIndent() } // Remove the leading whitespace from each line.
|
||||
.trimIndent(), // Remove the leading newline.
|
||||
""".trimIndentMultiline()
|
||||
)
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
|
|||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
|
||||
import app.revanced.util.ResourceGroup
|
||||
import app.revanced.util.Utils.trimIndentMultiline
|
||||
import app.revanced.util.copyResources
|
||||
import java.io.File
|
||||
|
||||
|
@ -56,7 +57,7 @@ object ChangeHeaderPatch : ResourcePatch() {
|
|||
These folders must contain the following files:
|
||||
|
||||
${variants.joinToString("\n") { variant -> "- ${HEADER_NAME}_$variant.png" }}
|
||||
""".trimIndent(),
|
||||
""".trimIndentMultiline(),
|
||||
required = true,
|
||||
)
|
||||
|
||||
|
|
8
src/main/kotlin/app/revanced/util/Utils.kt
Normal file
8
src/main/kotlin/app/revanced/util/Utils.kt
Normal file
|
@ -0,0 +1,8 @@
|
|||
package app.revanced.util
|
||||
|
||||
internal object Utils {
|
||||
internal fun String.trimIndentMultiline() =
|
||||
this.split("\n")
|
||||
.joinToString("\n") { it.trimIndent() } // Remove the leading whitespace from each line.
|
||||
.trimIndent() // Remove the leading newline.
|
||||
}
|
Loading…
Reference in a new issue