chore: Merge branch dev to main (#2644)

This commit is contained in:
oSumAtrIX 2024-01-27 04:11:54 +01:00 committed by GitHub
commit e5f621c442
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 29 additions and 8 deletions

View File

@ -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)

View File

@ -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

View File

@ -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) }
}

View File

@ -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) {

View File

@ -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,
)

View 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.
}