Skip to content

Commit

Permalink
chore: Merge branch dev to main (#2644)
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX authored Jan 27, 2024
2 parents fcf5fe6 + ad5dbd7 commit e5f621c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 8 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion patches.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -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) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
)

Expand Down
8 changes: 8 additions & 0 deletions src/main/kotlin/app/revanced/util/Utils.kt
Original file line number Diff line number Diff line change
@@ -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.
}

0 comments on commit e5f621c

Please sign in to comment.