Skip to content

Commit 0c05e80

Browse files
committed
* **YouTube - SponsorBlock:** Add "Undo automatic skip toast" * **YouTube - Hide ads:** Hide new type of product ad in video description * **Spotify - Unlock Premium:** Fix hiding context menu ads on newest versions
1 parent d351c72 commit 0c05e80

File tree

109 files changed

+4965
-2834
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+4965
-2834
lines changed

app/build.gradle.kts

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ android {
1515
applicationId = "io.github.chsbuffer.revancedxposed"
1616
versionCode = 19
1717
versionName = "1.0.$versionCode"
18-
val patchVersion = "5.28.0"
18+
val patchVersion = "5.30.0"
1919
buildConfigField("String", "PATCH_VERSION", "\"$patchVersion\"")
2020
}
2121
flavorDimensions += "abi"
@@ -91,33 +91,53 @@ abstract class GenerateStringsTask @Inject constructor(
9191
@get:OutputDirectory
9292
abstract val outputDirectory: DirectoryProperty
9393

94-
@TaskAction
95-
fun action() {
96-
val inputDir = inputDirectory.get().asFile
97-
98-
inputDir.listFiles()?.forEach {
99-
val name = it.name
100-
val inputFile = File(it, "strings.xml")
101-
val genResDir = File(outputDirectory.get().asFile, name).apply { mkdirs() }
102-
val outputFile = File(genResDir, "strings.xml")
103-
104-
val inputXml = XmlSlurper().parse(inputFile)
105-
106-
outputFile.writer().use { writer ->
107-
MarkupBuilder(writer).run {
108-
doubleQuotes = true
94+
private fun unwrapPatch(input: File, output: File) {
95+
val inputXml = XmlSlurper().parse(input)
96+
output.writer().use { writer ->
97+
MarkupBuilder(writer).run {
98+
fun writeNode(node: Any?) {
99+
if (node !is NodeChild) return
100+
val attributes = node.attributes()
109101
withGroovyBuilder {
110-
"resources" {
111-
inputXml.children().children().children().forEach {
112-
val node = it as NodeChild
113-
"string"("name" to node.getProperty("@name")) { mkp.yield(it.text()) }
102+
if (node.children().any()) {
103+
node.name()(attributes) {
104+
node.children().forEach {
105+
writeNode(it)
106+
}
114107
}
108+
} else {
109+
node.name()(attributes) { mkp.yield(node.text()) }
110+
}
111+
}
112+
}
113+
114+
doubleQuotes = true
115+
withGroovyBuilder {
116+
"resources" {
117+
// resources.app.patch.*
118+
inputXml.children().children().children().forEach {
119+
writeNode(it)
115120
}
116121
}
117122
}
118123
}
119124
}
120125
}
126+
127+
@TaskAction
128+
fun action() {
129+
val inputDir = inputDirectory.get().asFile
130+
val outputDir = outputDirectory.get().asFile
131+
132+
inputDir.listFiles()?.forEach { variant ->
133+
val inputFile = File(variant, "strings.xml")
134+
val genResDir = File(outputDir, variant.name).apply { mkdirs() }
135+
val outputFile = File(genResDir, "strings.xml")
136+
unwrapPatch(inputFile, outputFile)
137+
}
138+
139+
unwrapPatch(File(inputDir, "values/arrays.xml"), File(outputDir, "values/arrays.xml"))
140+
}
121141
}
122142

123143
androidComponents {

app/src/main/addresources/values-af-rZA/strings.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ Second \"item\" text"</string>
5555
<!-- Translations of this should not be longer than the original English text, otherwise the text can be clipped and not entirely shown. -->
5656
</patch>
5757
<patch id="ad.general.hideAdsResourcePatch">
58-
<!-- 'Visit store' should be translated with the same localized wording that YouTube displays. -->
5958
<!-- Translations of this should not be longer than the original English text, otherwise the text can be clipped and not entirely shown. -->
59+
<!-- 'View products' should be translated with the same localized wording that YouTube displays. -->
60+
<!-- 'Visit store' should be translated with the same localized wording that YouTube displays. -->
6061
</patch>
6162
<patch id="ad.getpremium.hideGetPremiumPatch">
6263
</patch>
@@ -79,6 +80,7 @@ Second \"item\" text"</string>
7980
</patch>
8081
<patch id="layout.buttons.action.hideButtonsPatch">
8182
<!-- 'Share' should be translated with the same localized wording that YouTube displays. -->
83+
<!-- 'Stop ads' should be translated with the same localized wording that YouTube displays. -->
8284
<!-- 'Report' should be translated with the same localized wording that YouTube displays.
8385
This button usually appears only on live streams. -->
8486
<!-- 'Remix' should be translated with the same localized wording that YouTube displays. -->

app/src/main/addresources/values-am-rET/strings.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ Second \"item\" text"</string>
5555
<!-- Translations of this should not be longer than the original English text, otherwise the text can be clipped and not entirely shown. -->
5656
</patch>
5757
<patch id="ad.general.hideAdsResourcePatch">
58-
<!-- 'Visit store' should be translated with the same localized wording that YouTube displays. -->
5958
<!-- Translations of this should not be longer than the original English text, otherwise the text can be clipped and not entirely shown. -->
59+
<!-- 'View products' should be translated with the same localized wording that YouTube displays. -->
60+
<!-- 'Visit store' should be translated with the same localized wording that YouTube displays. -->
6061
</patch>
6162
<patch id="ad.getpremium.hideGetPremiumPatch">
6263
</patch>
@@ -79,6 +80,7 @@ Second \"item\" text"</string>
7980
</patch>
8081
<patch id="layout.buttons.action.hideButtonsPatch">
8182
<!-- 'Share' should be translated with the same localized wording that YouTube displays. -->
83+
<!-- 'Stop ads' should be translated with the same localized wording that YouTube displays. -->
8284
<!-- 'Report' should be translated with the same localized wording that YouTube displays.
8385
This button usually appears only on live streams. -->
8486
<!-- 'Remix' should be translated with the same localized wording that YouTube displays. -->

0 commit comments

Comments
 (0)