Compare commits

..

8 Commits

Author SHA1 Message Date
semantic-release-bot
6c4a69fcfb chore(release): 2.12.2 [skip ci]
## [2.12.2](https://github.com/revanced/revanced-patches/compare/v2.12.1...v2.12.2) (2022-07-10)

### Bug Fixes

* display codename for patch names ([7107ee8](7107ee87d9))
* incorrect package name in gradle task ([8ce3a6b](8ce3a6b4e3))
* invalid regex ([b39d60f](b39d60f46c))
2022-07-10 18:00:21 +00:00
oSumAtrIX
4129fcf8a8 refactor: add missing space in generated string 2022-07-10 19:58:32 +02:00
oSumAtrIX
b39d60f46c fix: invalid regex 2022-07-10 19:58:32 +02:00
oSumAtrIX
8ce3a6b4e3 fix: incorrect package name in gradle task 2022-07-10 19:58:32 +02:00
oSumAtrIX
7107ee87d9 fix: display codename for patch names 2022-07-10 19:58:32 +02:00
semantic-release-bot
7ea5d87fa2 chore(release): 2.12.1 [skip ci]
## [2.12.1](https://github.com/revanced/revanced-patches/compare/v2.12.0...v2.12.1) (2022-07-10)
2022-07-10 16:14:45 +00:00
TheJeterLP
471a3d3263 build: fix readme autogeneration not working 2022-07-10 18:12:52 +02:00
bogadana
b95fe30c78 docs: templated readme (#138) 2022-07-10 15:28:18 +02:00
9 changed files with 109 additions and 58 deletions

View File

@@ -33,7 +33,7 @@ jobs:
- name: Build with Gradle
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build clean
run: ./gradlew build clean generateReadme
- name: Install Android build-tools
run: sdkmanager "build-tools;32.0.0"
- name: Setup semantic-release

View File

@@ -1,3 +1,14 @@
## [2.12.2](https://github.com/revanced/revanced-patches/compare/v2.12.1...v2.12.2) (2022-07-10)
### Bug Fixes
* display codename for patch names ([10c53f7](https://github.com/revanced/revanced-patches/commit/10c53f720df3e70b9d59e8bc3219d56b996f03db))
* incorrect package name in gradle task ([152b2c9](https://github.com/revanced/revanced-patches/commit/152b2c90cf102170648fcc168da10f46743bdc63))
* invalid regex ([26bf1d8](https://github.com/revanced/revanced-patches/commit/26bf1d818f953abc061126d8b91f17cd9008ba1d))
## [2.12.1](https://github.com/revanced/revanced-patches/compare/v2.12.0...v2.12.1) (2022-07-10)
# [2.12.0](https://github.com/revanced/revanced-patches/compare/v2.11.0...v2.12.0) (2022-07-10)

9
README-template.md Normal file
View File

@@ -0,0 +1,9 @@
# ReVanced Patches
🧩 Official patches by ReVanced
# List of available patches
| 💊 Patch | 📜 Description | 🎯 Target Package | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|:-----------------:|
{{ table }}

View File

@@ -1,2 +1,36 @@
# ReVanced Patches
🧩 Official patches by ReVanced
# List of available patches
| 💊 Patch | 📜 Description | 🎯 Target Package | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|:-----------------:|
| `fenster-swipe-controls` | Adds volume and brightness swipe controls. | `com.google.android.youtube` | 17.26.35 |
| `seekbar-tapping` | Enables tapping on the seekbar of the YouTube player. | `com.google.android.youtube` | 17.26.35 |
| `general-ads` | Removes general ads in bytecode. | `com.google.android.youtube` | 17.26.35 |
| `video-ads` | Removes ads in the YouTube video player. | `com.google.android.youtube` | 17.26.35 |
| `hide-infocard-suggestions` | Hides infocards in videos. | `com.google.android.youtube` | 17.26.35 |
| `autorepeat-by-default` | Enables auto repeating of videos by default. | `com.google.android.youtube` | 17.26.35 |
| `custom-branding` | Changes the branding of YouTube. | `com.google.android.youtube` | all |
| `premium-heading` | Shows premium branding on the YouTube home screen. | `com.google.android.youtube` | all |
| `minimized-playback` | Enables minimized and background playback. | `com.google.android.youtube` | 17.26.35 |
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | `com.google.android.youtube` | 17.26.35 |
| `disable-fullscreen-panels` | Disables comments panel in fullscreen view. | `com.google.android.youtube` | 17.26.35 |
| `old-quality-layout` | Enables the original quality flyout menu. | `com.google.android.youtube` | 17.26.35 |
| `hide-autoplay-button` | Disables the autoplay button. | `com.google.android.youtube` | 17.26.35 |
| `disable-create-button` | Disables the create button. | `com.google.android.youtube` | 17.26.35 |
| `amoled` | Enables pure black theme. | `com.google.android.youtube` | 17.26.35 |
| `hide-shorts-button` | Hides the shorts button. | `com.google.android.youtube` | 17.26.35 |
| `hide-cast-button` | Hides the cast button. | `com.google.android.youtube` | all |
| `hide-watermark` | Hides the creator's watermark on videos. | `com.google.android.youtube` | 17.26.35 |
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name. | `com.google.android.youtube` | 17.26.35 |
| `custom-playback-speed` | Allows to change the default playback speed options. | `com.google.android.youtube` | 17.26.35 |
| `hdr-max-brightness` | Sets brightness to max for HDR videos in fullscreen mode. | `com.google.android.youtube` | 17.26.35 |
| `enable-debugging` | Enables app debugging by patching the manifest file. | `com.google.android.youtube` | all |
| `background-play` | Enables playing music in the background. | `com.google.android.apps.youtube.music` | 5.03.50 |
| `exclusive-audio-playback` | Adds the option to play music without video. | `com.google.android.apps.youtube.music` | 5.03.50 |
| `codecs-unlock` | Enables more audio codecs. Usually results in better audio quality but may depend on song and device. | `com.google.android.apps.youtube.music` | 5.03.50 |
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar in YouTube music. | `com.google.android.apps.youtube.music` | 5.03.50 |
| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the Home screen. The same functionality can be triggered from the settings anyway. | `com.google.android.apps.youtube.music` | 5.03.50 |

View File

@@ -54,7 +54,7 @@ tasks {
dependsOn(build)
classpath = sourceSets["main"].runtimeClasspath
mainClass.set("app.revanced.patches.meta.ReadmeGenerator")
mainClass.set("app.revanced.meta.readme.Generator")
}
// Dummy task to fix the Gradle semantic-release plugin.
// Remove this if you forked it to support building only.

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.12.0
version = 2.12.2

View File

@@ -1,55 +0,0 @@
package app.revanced.patches.meta
import java.io.File
import kotlin.io.writeText
import kotlin.collections.first
import app.revanced.patcher.util.patch.implementation.JarPatchBundle
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
import app.revanced.patcher.extensions.PatchExtensions.patchName
import app.revanced.patcher.extensions.PatchExtensions.description
class ReadmeGenerator {
companion object {
@JvmStatic
fun main(args: Array<String>) {
//should be moved to a file?
val generalReadme =
"""
# ReVanced Patches
🧩 Official patches by ReVanced
# Patch list
""".trimIndent()
val tableHeader =
"""
| 💊 Patch | 📜 Description | 🎯 Target Package | 🏹 Target Version |
|:-----:|:-----------:|:--------------:|:----------------------:|
""".trimIndent()
val readmeFile = File("README.md")
val buildDir = File("build/libs/")
val buildJar = buildDir.listFiles().first { it.name.startsWith("revanced-patches-") && it.name.endsWith(".jar") }
val bundle = JarPatchBundle(buildJar.absolutePath).loadPatches()
val builder = StringBuilder()
builder.appendLine(generalReadme)
builder.appendLine(tableHeader)
for (patch in bundle) {
val humanName =
patch.patchName.split('-').map { it.replaceFirstChar { it.uppercase() } }.joinToString(" ")
val compatiblePackage = patch.compatiblePackages?.first()
val latestVersion = compatiblePackage?.versions?.maxByOrNull { it.replace(".", "").toInt() } ?: "all"
builder.appendLine("|$humanName|${patch.description}|`${compatiblePackage?.name}`|$latestVersion|")
}
readmeFile.writeText(builder.toString())
}
}
}

View File

@@ -0,0 +1,38 @@
package app.revanced.meta.readme
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
import app.revanced.patcher.extensions.PatchExtensions.description
import app.revanced.patcher.extensions.PatchExtensions.patchName
import app.revanced.patcher.util.patch.implementation.JarPatchBundle
import java.io.File
class Generator {
companion object {
@JvmStatic
fun main(args: Array<String>) {
val buildDir = File("build/libs/")
val buildJar =
buildDir.listFiles()?.first { it.name.startsWith("revanced-patches-") && it.name.endsWith(".jar") }!!
val bundle = JarPatchBundle(buildJar.absolutePath).loadPatches()
val patches = StringBuilder()
for (patch in bundle) {
val patchName = patch.patchName
val compatiblePackage = patch.compatiblePackages?.first()
val latestVersion = compatiblePackage?.versions?.maxByOrNull { it.replace(".", "").toInt() } ?: "all"
patches.appendLine("| `$patchName` | ${patch.description} | `${compatiblePackage?.name}` | $latestVersion |")
}
val readMeTemplateFile = File("README-template.md")
val readmeTemplate = Template(readMeTemplateFile.readText())
readmeTemplate.replaceVariable("table", patches.toString())
val readme = File("README.md")
readme.writeText(readmeTemplate.toString())
}
}
}

View File

@@ -0,0 +1,14 @@
package app.revanced.meta.readme
class Template(template: String) {
val result: StringBuilder = StringBuilder(template)
fun replaceVariable(name: String, value: String) {
val regex = Regex("\\{\\{\\s?$name\\s?}}")
val range = regex.find(result)!!.range
result.replace(range.first, range.last + 1, value)
}
override fun toString(): String = result.toString()
}