chore: merge branch dev to main (#1523)

This commit is contained in:
oSumAtrIX 2023-01-28 09:02:34 +01:00 committed by GitHub
commit 2c7f2587da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
106 changed files with 803 additions and 530 deletions

View file

@ -1,3 +1,60 @@
# [2.157.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.5...v2.157.0-dev.6) (2023-01-28)
### Bug Fixes
* **youtube/sponsorblock:** replace missing strings ([7b8f0db](https://github.com/revanced/revanced-patches/commit/7b8f0db2c17da6488db1ec2c21a21a14ff8466aa))
# [2.157.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.4...v2.157.0-dev.5) (2023-01-28)
### Features
* **youtube:** show toasts along exceptions ([#1511](https://github.com/revanced/revanced-patches/issues/1511)) ([5817e4d](https://github.com/revanced/revanced-patches/commit/5817e4d27fab692c0e95ab4aa2fa8f13005cb780))
# [2.157.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.3...v2.157.0-dev.4) (2023-01-28)
### Bug Fixes
* **youtube/return-youtube-dislike:** do not fetch voting stats when watching shorts ([#1532](https://github.com/revanced/revanced-patches/issues/1532)) ([f46fcad](https://github.com/revanced/revanced-patches/commit/f46fcadd855a13d9f8916f21980abcf5564e97d7))
# [2.157.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.2...v2.157.0-dev.3) (2023-01-28)
### Bug Fixes
* **youtube/settings:** resolve fingerprints robustly ([8e98605](https://github.com/revanced/revanced-patches/commit/8e98605a7491d69e99c6b1aeb2de3db9396faa20))
* **youtube:** reliably resolve fingerprints ([1598306](https://github.com/revanced/revanced-patches/commit/1598306eb58ae8f8dc38b472628b237e55ec0f1b))
### Features
* **youtube/general-ads:** remove hiding video shelf ([c4c9e5b](https://github.com/revanced/revanced-patches/commit/c4c9e5bb3765d08d6653864d33546c25ba367292))
# [2.157.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.157.0-dev.1...v2.157.0-dev.2) (2023-01-24)
### Features
* **music:** update patches compatibility to v5.40.51 ([#1541](https://github.com/revanced/revanced-patches/issues/1541)) ([13143cb](https://github.com/revanced/revanced-patches/commit/13143cb5260f8793d246633a6a506bdc9f3a3ce7))
# [2.157.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.156.0...v2.157.0-dev.1) (2023-01-23)
### Bug Fixes
* parse any kind of patch version ([66cd88f](https://github.com/revanced/revanced-patches/commit/66cd88f4d8a9161a4c51b70f2384dcee92fe2aea))
* **twitter/hide-views-stats:** constrain to last working version ([#1522](https://github.com/revanced/revanced-patches/issues/1522)) ([bf45817](https://github.com/revanced/revanced-patches/commit/bf45817677fd058f9b255dbef5c1ca9aaec95531))
### Features
* **finanzonline:** `remove-bootloader-detection` patch ([3952138](https://github.com/revanced/revanced-patches/commit/39521386c2296f46479e31c39ab245c2778ebd65))
* **finanzonline:** `remove-root-detection` patch ([1d46d63](https://github.com/revanced/revanced-patches/commit/1d46d63fdcf3cbce53a7719f4490225368c4d5ae))
* **youtube/microg-support:** check if Vanced MicroG is running in the background ([#1531](https://github.com/revanced/revanced-patches/issues/1531)) ([81934ef](https://github.com/revanced/revanced-patches/commit/81934efb39b8ed9b0a523ffd7c4d841227ac141f))
* **youtube:** `open-links-externally` patch ([#1524](https://github.com/revanced/revanced-patches/issues/1524)) ([caf3d70](https://github.com/revanced/revanced-patches/commit/caf3d70c30bc440923c0e76e7331010905f6e729))
# [2.156.0](https://github.com/revanced/revanced-patches/compare/v2.155.0...v2.156.0) (2023-01-17)

103
README.md
View file

@ -9,57 +9,57 @@ The official Patch bundle provided by ReVanced and the community.
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `always-autorepeat` | Always repeats the playing video again. | 17.49.37 |
| `always-autorepeat` | Always repeats the playing video again. | 18.03.36 |
| `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all |
| `comments` | Hides components related to comments. | 17.49.37 |
| `copy-video-url` | Adds buttons in player to copy video links. | 17.49.37 |
| `comments` | Hides components related to comments. | 18.03.36 |
| `copy-video-url` | Adds buttons in player to copy video links. | 18.03.36 |
| `custom-branding` | Changes the YouTube launcher icon and name to your choice (defaults to ReVanced). | all |
| `custom-video-buffer` | Lets you change the buffers of videos. | 17.49.37 |
| `custom-video-speed` | Adds more video speed options. | 17.49.37 |
| `custom-video-buffer` | Lets you change the buffers of videos. | 18.03.36 |
| `custom-video-speed` | Adds more video speed options. | 18.03.36 |
| `debugging` | Adds debugging options. | all |
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 17.49.37 |
| `disable-auto-player-popup-panels` | Disable automatic popup panels (playlist or live chat) on video player. | 17.49.37 |
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 17.49.37 |
| `disable-startup-shorts-player` | Disables playing YouTube Shorts when launching YouTube. | 17.49.37 |
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 18.03.36 |
| `disable-auto-player-popup-panels` | Disable automatic popup panels (playlist or live chat) on video player. | 18.03.36 |
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 18.03.36 |
| `disable-startup-shorts-player` | Disables playing YouTube Shorts when launching YouTube. | 18.03.36 |
| `disable-zoom-haptics` | Disables haptics when zooming. | all |
| `downloads` | Enables downloading music and videos from YouTube. | 17.49.37 |
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.49.37 |
| `general-ads` | Removes general ads. | 17.49.37 |
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 17.49.37 |
| `hide-album-cards` | Hides the album cards below the artist description. | 17.49.37 |
| `hide-artist-card` | Hides the artist card below the searchbar. | 17.49.37 |
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.49.37 |
| `hide-breaking-news-shelf` | Hides the breaking news shelf on the homepage tab. | 17.49.37 |
| `hide-captions-button` | Hides the captions button on video player. | 17.49.37 |
| `downloads` | Enables downloading music and videos from YouTube. | 18.03.36 |
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 18.03.36 |
| `general-ads` | Removes general ads. | 18.03.36 |
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 18.03.36 |
| `hide-album-cards` | Hides the album cards below the artist description. | 18.03.36 |
| `hide-artist-card` | Hides the artist card below the searchbar. | 18.03.36 |
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 18.03.36 |
| `hide-breaking-news-shelf` | Hides the breaking news shelf on the homepage tab. | 18.03.36 |
| `hide-captions-button` | Hides the captions button on video player. | 18.03.36 |
| `hide-cast-button` | Hides the cast button in the video player. | all |
| `hide-create-button` | Hides the create button in the navigation bar. | 17.49.37 |
| `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 17.49.37 |
| `hide-email-address` | Hides the email address in the account switcher. | 17.49.37 |
| `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 17.49.37 |
| `hide-info-cards` | Hides info-cards in videos. | 17.49.37 |
| `hide-my-mix` | Hides mix playlists. | 17.49.37 |
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 17.49.37 |
| `hide-time-and-seekbar` | Hides progress bar and time counter on videos. | 17.49.37 |
| `hide-video-buttons` | Adds options to hide action buttons under a video. | 17.49.37 |
| `hide-watch-in-vr` | Hides the Watch in VR option in the player settings flyout panel. | 17.49.37 |
| `hide-watermark` | Hides creator's watermarks on videos. | 17.49.37 |
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 17.49.37 |
| `minimized-playback` | Enables minimized and background playback. | 17.49.37 |
| `old-quality-layout` | Enables the original video quality flyout in the video player settings | 17.49.37 |
| `open-links-directly` | Bypasses https://youtube.com/redirect URLs. | 17.49.37 |
| `hide-create-button` | Hides the create button in the navigation bar. | 18.03.36 |
| `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 18.03.36 |
| `hide-email-address` | Hides the email address in the account switcher. | 18.03.36 |
| `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 18.03.36 |
| `hide-info-cards` | Hides info-cards in videos. | 18.03.36 |
| `hide-my-mix` | Hides mix playlists. | 18.03.36 |
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 18.03.36 |
| `hide-time-and-seekbar` | Hides progress bar and time counter on videos. | 18.03.36 |
| `hide-video-buttons` | Adds options to hide action buttons under a video. | 18.03.36 |
| `hide-watch-in-vr` | Hides the Watch in VR option in the player settings flyout panel. | 18.03.36 |
| `hide-watermark` | Hides creator's watermarks on videos. | 18.03.36 |
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 18.03.36 |
| `minimized-playback` | Enables minimized and background playback. | 18.03.36 |
| `old-quality-layout` | Enables the original video quality flyout in the video player settings | 18.03.36 |
| `open-links-directly` | Bypasses https://youtube.com/redirect URLs. | 18.03.36 |
| `open-links-externally` | Open links outside of the app directly in your browser. | 18.03.36 |
| `premium-heading` | Shows premium branding on the home screen. | all |
| `remember-playback-rate` | Adds the ability to remember the playback rate you chose in the video playback rate flyout. | 17.49.37 |
| `remember-video-quality` | Adds the ability to remember the video quality you chose in the video quality flyout. | 17.49.37 |
| `remove-player-button-background` | Removes the background from the video player buttons. | 17.49.37 |
| `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 17.49.37 |
| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 17.49.37 |
| `settings` | Adds settings for ReVanced to YouTube. | all |
| `sponsorblock` | Integrate SponsorBlock. | 17.49.37 |
| `spoof-app-version` | Tricks YouTube into thinking, you are running an older version of the app. One of the side effects also includes restoring the old UI. | 17.49.37 |
| `swipe-controls` | Adds volume and brightness swipe controls. | 17.49.37 |
| `tablet-mini-player` | Enables the tablet mini player layout. | 17.49.37 |
| `remember-playback-rate` | Adds the ability to remember the playback rate you chose in the video playback rate flyout. | 18.03.36 |
| `remember-video-quality` | Adds the ability to remember the video quality you chose in the video quality flyout. | 18.03.36 |
| `remove-player-button-background` | Removes the background from the video player buttons. | 18.03.36 |
| `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 18.03.36 |
| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 18.03.36 |
| `sponsorblock` | Integrate SponsorBlock. | 18.03.36 |
| `spoof-app-version` | Tricks YouTube into thinking, you are running an older version of the app. One of the side effects also includes restoring the old UI. | 18.03.36 |
| `swipe-controls` | Adds volume and brightness swipe controls. | 18.03.36 |
| `tablet-mini-player` | Enables the tablet mini player layout. | 18.03.36 |
| `theme` | Applies a custom theme. | all |
| `video-ads` | Removes ads in the video player. | 17.49.37 |
| `video-ads` | Removes ads in the video player. | 18.03.36 |
</details>
### [📦 `com.google.android.apps.youtube.music`](https://play.google.com/store/apps/details?id=com.google.android.apps.youtube.music)
@ -130,7 +130,7 @@ The official Patch bundle provided by ReVanced and the community.
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `dynamic-color` | Replaces the default Twitter Blue with the users Material You palette. | all |
| `hide-views-stats` | Hides the view stats under tweets. | all |
| `hide-views-stats` | Hides the view stats under tweets. | 9.69.1-release.0 |
| `monochrome-icon` | Adds a monochrome icon. | all |
| `timeline-ads` | Removes ads from the Twitter timeline. Might require clearing app data to remove already cached ads. | all |
</details>
@ -154,6 +154,15 @@ The official Patch bundle provided by ReVanced and the community.
| `premium-icon-reddit` | Unlocks premium Reddit app icons. | all |
</details>
### [📦 `at.gv.bmf.bmf2go`](https://play.google.com/store/apps/details?id=at.gv.bmf.bmf2go)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `remove-bootloader-detection` | Removes the check for an unlocked bootloader. | 2.2.0 |
| `remove-root-detection` | Removes the check for root permissions | 2.2.0 |
</details>
### [📦 `at.gv.oe.app`](https://play.google.com/store/apps/details?id=at.gv.oe.app)
<details>
@ -219,7 +228,7 @@ The official Patch bundle provided by ReVanced and the community.
| `unlock-prime` | Unlocks Nova Prime and all functions of the app. | all |
</details>
### [📦 `com.awedea.nyx`](https://play.google.com/store/apps/details?id=com.awedea.nyx)
### [📦 `co.windyapp.android`](https://play.google.com/store/apps/details?id=co.windyapp.android)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
@ -227,7 +236,7 @@ The official Patch bundle provided by ReVanced and the community.
| `unlock-pro` | Unlocks all pro features. | all |
</details>
### [📦 `co.windyapp.android`](https://play.google.com/store/apps/details?id=co.windyapp.android)
### [📦 `com.awedea.nyx`](https://play.google.com/store/apps/details?id=com.awedea.nyx)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |

View file

@ -53,7 +53,7 @@ tasks {
dependsOn(build)
classpath = sourceSets["main"].runtimeClasspath
mainClass.set("app.revanced.meta.Meta")
mainClass.set("app.revanced.meta.PatchesFileGenerator")
}
// 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.156.0
version = 2.157.0-dev.6

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,70 @@
package app.revanced.meta
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
import app.revanced.patcher.extensions.PatchExtensions.dependencies
import app.revanced.patcher.extensions.PatchExtensions.description
import app.revanced.patcher.extensions.PatchExtensions.include
import app.revanced.patcher.extensions.PatchExtensions.options
import app.revanced.patcher.extensions.PatchExtensions.patchName
import app.revanced.patcher.extensions.PatchExtensions.version
import app.revanced.patcher.patch.PatchOption
import com.google.gson.GsonBuilder
import java.io.File
internal class JsonGenerator : PatchesFileGenerator {
override fun generate(bundle: PatchBundlePatches) {
val patches = bundle.map {
JsonPatch(
it.patchName,
it.description ?: "This patch has no description.",
it.version ?: "0.0.0",
!it.include,
it.options?.map { option ->
JsonPatch.Option(
option.key,
option.title,
option.description,
option.required,
option.let { listOption ->
if (listOption is PatchOption.ListOption<*>) {
listOption.options.toMutableList().toTypedArray()
} else null
}
)
}?.toTypedArray() ?: emptyArray(),
it.dependencies?.map { dep ->
dep.java.patchName
}?.toTypedArray() ?: emptyArray(),
it.compatiblePackages?.map { pkg ->
JsonPatch.CompatiblePackage(pkg.name, pkg.versions)
}?.toTypedArray() ?: emptyArray()
)
}
val json = File("patches.json")
json.writeText(GsonBuilder().serializeNulls().create().toJson(patches))
}
private class JsonPatch(
val name: String,
val description: String,
val version: String,
val excluded: Boolean,
val options: Array<Option>,
val dependencies: Array<String>,
val compatiblePackages: Array<CompatiblePackage>,
) {
class CompatiblePackage(
val name: String,
val versions: Array<String>,
)
class Option(
val key: String,
val title: String,
val description: String,
val required: Boolean,
val choices: Array<*>?,
)
}
}

View file

@ -1,27 +0,0 @@
package app.revanced.meta
import app.revanced.meta.json.generateJson
import app.revanced.meta.readme.generateText
import app.revanced.patcher.data.Context
import app.revanced.patcher.patch.Patch
import app.revanced.patcher.util.patch.PatchBundle
import java.io.File
typealias Bundle = List<Class<out Patch<Context>>>
object Meta {
@JvmStatic
fun main(args: Array<String>) {
val patches = accumulatePatches()
if (patches.isEmpty()) throw IllegalStateException("No patches found")
generateText(patches)
generateJson(patches)
}
}
fun accumulatePatches() = PatchBundle.Jar(
File("build/libs/").listFiles()!!.first {
it.name.startsWith("revanced-patches-") && it.name.endsWith(".jar")
}.absolutePath
).loadPatches()

View file

@ -0,0 +1,25 @@
package app.revanced.meta
import app.revanced.patcher.data.Context
import app.revanced.patcher.patch.Patch
import app.revanced.patcher.util.patch.PatchBundle
import java.io.File
typealias PatchBundlePatches = List<Class<out Patch<Context>>>
internal interface PatchesFileGenerator {
fun generate(bundle: PatchBundlePatches)
private companion object {
@JvmStatic
fun main(args: Array<String>) = PatchBundle.Jar(
File("build/libs/").listFiles()!!.first {
it.name.startsWith("revanced-patches-") && it.name.endsWith(".jar")
}.absolutePath
).loadPatches().also {
if (it.isEmpty()) throw IllegalStateException("No patches found")
}.let { bundle ->
arrayOf(JsonGenerator(), ReadmeGenerator()).forEach { it.generate(bundle) }
}
}
}

View file

@ -0,0 +1,69 @@
package app.revanced.meta
import app.revanced.patcher.data.Context
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.patch.Patch
import java.io.File
internal class ReadmeGenerator : PatchesFileGenerator {
private companion object {
private const val TABLE_HEADER =
"| \uD83D\uDC8A Patch | \uD83D\uDCDC Description | \uD83C\uDFF9 Target Version |\n" +
"|:--------:|:--------------:|:-----------------:|"
}
override fun generate(bundle: PatchBundlePatches) {
val output = StringBuilder()
mutableMapOf<String, MutableList<Class<out Patch<Context>>>>()
.apply {
for (patch in bundle) {
patch.compatiblePackages?.forEach { pkg ->
if (!contains(pkg.name)) put(pkg.name, mutableListOf())
this[pkg.name]!!.add(patch)
}
}
}
.entries
.sortedByDescending { it.value.size }
.forEach { (`package`, patches) ->
val mostCommonVersion = buildMap {
patches.forEach { patch ->
patch.compatiblePackages?.single { compatiblePackage -> compatiblePackage.name == `package` }?.versions?.let {
it.forEach { version -> merge(version, 1, Integer::sum) }
}
}
}.let { commonMap ->
commonMap.maxByOrNull { it.value }?.value?.let {
// This is not foolproof, because for example v1.0.0-dev.0 will be returned instead of v1.0.0-release.
// Unfortunately this can not be solved easily because versioning can be complex.
commonMap.entries.filter { mostCommon -> mostCommon.value == it }.maxBy { it.key }.key
} ?: "all"
}
output.apply {
appendLine("### [\uD83D\uDCE6 `${`package`}`](https://play.google.com/store/apps/details?id=${`package`})")
appendLine("<details>\n")
appendLine(TABLE_HEADER)
patches.forEach { patch ->
val recommendedPatchVersion = if (
patch.compatiblePackages?.single { it.name == `package` }?.versions?.isNotEmpty() == true
) mostCommonVersion else "all"
appendLine(
"| `${patch.patchName}` " +
"| ${patch.description} " +
"| $recommendedPatchVersion |"
)
}
appendLine("</details>\n")
}
}
StringBuilder(File("README-template.md").readText())
.replace(Regex("\\{\\{\\s?table\\s?}}"), output.toString())
.let(File("README.md")::writeText)
}
}

View file

@ -1,48 +0,0 @@
package app.revanced.meta.json
import app.revanced.meta.Bundle
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
import app.revanced.patcher.extensions.PatchExtensions.dependencies
import app.revanced.patcher.extensions.PatchExtensions.description
import app.revanced.patcher.extensions.PatchExtensions.include
import app.revanced.patcher.extensions.PatchExtensions.options
import app.revanced.patcher.extensions.PatchExtensions.patchName
import app.revanced.patcher.extensions.PatchExtensions.version
import app.revanced.patcher.patch.PatchOption
import com.google.gson.GsonBuilder
import java.io.File
private val gson = GsonBuilder().serializeNulls().create()
fun generateJson(bundle: Bundle) {
val patches = bundle.map {
JsonPatch(
it.patchName,
it.description ?: "This patch has no description.",
it.version ?: "0.0.0",
!it.include,
it.options?.map { option ->
Option(
option.key,
option.title,
option.description,
option.required,
option.let { lo ->
if (lo is PatchOption.ListOption<*>) {
lo.options.toMutableList().toTypedArray()
} else null
}
)
}?.toTypedArray() ?: emptyArray(),
it.dependencies?.map { dep ->
dep.java.patchName
}?.toTypedArray() ?: emptyArray(),
it.compatiblePackages?.map { pkg ->
CompatiblePackage(pkg.name, pkg.versions)
}?.toTypedArray() ?: emptyArray()
)
}
val json = File("patches.json")
json.writeText(gson.toJson(patches))
}

View file

@ -1,26 +0,0 @@
@file:Suppress("ArrayInDataClass") // We don't need it here.
package app.revanced.meta.json
data class JsonPatch(
val name: String,
val description: String,
val version: String,
val excluded: Boolean,
val options: Array<Option>,
val dependencies: Array<String>,
val compatiblePackages: Array<CompatiblePackage>,
)
data class CompatiblePackage(
val name: String,
val versions: Array<String>,
)
data class Option(
val key: String,
val title: String,
val description: String,
val required: Boolean,
val choices: Array<*>?,
)

View file

@ -1,10 +0,0 @@
package app.revanced.meta.readme
import app.revanced.patcher.data.Context
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
import app.revanced.patcher.patch.Patch
internal fun Class<out Patch<Context>>.getLatestVersion() =
this.compatiblePackages?.first()?.versions?.map {
SemanticVersion.fromString(it)
}?.maxWithOrNull(SemanticVersionComparator)

View file

@ -1,42 +0,0 @@
package app.revanced.meta.readme
import app.revanced.meta.Bundle
import app.revanced.patcher.data.Context
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.patch.Patch
import java.io.File
private const val TABLE_HEADER =
"| \uD83D\uDC8A Patch | \uD83D\uDCDC Description | \uD83C\uDFF9 Target Version |\n" + "|:--------:|:--------------:|:-----------------:|"
private val TABLE_REGEX = Regex("\\{\\{\\s?table\\s?}}")
fun generateText(bundle: Bundle) {
val output = StringBuilder()
val packages = mutableMapOf<String, MutableList<Class<out Patch<Context>>>>()
for (patch in bundle) {
patch.compatiblePackages?.forEach { pkg ->
if (!packages.contains(pkg.name)) packages[pkg.name] = mutableListOf()
packages[pkg.name]!!.add(patch)
}
}
for (pkg in packages.entries.sortedByDescending { it.value.size }) {
output.appendLine("### [\uD83D\uDCE6 `${pkg.key}`](https://play.google.com/store/apps/details?id=${pkg.key})")
output.appendLine("<details>\n")
output.appendLine(TABLE_HEADER)
pkg.value.forEach { output.appendLine("| `${it.patchName}` | ${it.description} | ${it.getLatestVersion() ?: "all"} |") }
output.appendLine("</details>\n")
}
val readmeTemplate = Template(File("README-template.md").readText())
readmeTemplate.replaceVariable(TABLE_REGEX, output.toString())
val readme = File("README.md")
readme.writeText(readmeTemplate.toString())
}

View file

@ -1,22 +0,0 @@
package app.revanced.meta.readme
data class SemanticVersion(val major: Int, val minor: Int, val patch: Int) {
companion object {
fun fromString(version: String): SemanticVersion {
val parts = version.split(".")
if (parts.count() != 3) throw IllegalArgumentException("Invalid semantic version")
val versionNumbers = parts.map { it.toInt() }
return SemanticVersion(versionNumbers[0], versionNumbers[1], versionNumbers[2])
}
}
override fun toString(): String = "$major.$minor.$patch"
}
object SemanticVersionComparator : Comparator<SemanticVersion> {
override fun compare(a: SemanticVersion, b: SemanticVersion): Int = when {
a.major != b.major -> a.major - b.major
a.minor != b.minor -> a.minor - b.minor
else -> a.patch - b.patch
}
}

View file

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

View file

@ -0,0 +1,13 @@
package app.revanced.patches.finanzonline.detection.bootloader.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
object BootStateFingerprint : MethodFingerprint(
"Z",
access = AccessFlags.PUBLIC.value,
strings = listOf("Boot state of device: %s"),
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("/AttestationHelper;")
}
)

View file

@ -0,0 +1,13 @@
package app.revanced.patches.finanzonline.detection.bootloader.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
object BootloaderDetectionFingerprint : MethodFingerprint(
"Z",
access = AccessFlags.PUBLIC.value,
strings = listOf("Creation of attestation key succeeded", "Creation of attestation key failed"),
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("/AttestationHelper;")
}
)

View file

@ -0,0 +1,38 @@
package app.revanced.patches.finanzonline.detection.bootloader.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.finanzonline.detection.bootloader.fingerprints.BootStateFingerprint
import app.revanced.patches.finanzonline.detection.bootloader.fingerprints.BootloaderDetectionFingerprint
import app.revanced.patches.finanzonline.detection.shared.annotations.DetectionCompatibility
@Patch
@Name("remove-bootloader-detection")
@Description("Removes the check for an unlocked bootloader.")
@DetectionCompatibility
@Version("0.0.1")
class BootloaderDetectionPatch : BytecodePatch(
listOf(BootloaderDetectionFingerprint, BootStateFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
arrayOf(BootloaderDetectionFingerprint, BootStateFingerprint).forEach { fingerprint ->
fingerprint.result?.mutableMethod?.addInstruction(
0,
"""
const/4 v0, 0x1
return v0
"""
) ?: return fingerprint.toErrorResult()
}
return PatchResultSuccess()
}
}

View file

@ -0,0 +1,10 @@
package app.revanced.patches.finanzonline.detection.root.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object RootDetectionFingerprint : MethodFingerprint(
"L",
customFingerprint = { methodDef ->
methodDef.definingClass == "Lat/gv/bmf/bmf2go/tools/utils/z;"
}
)

View file

@ -0,0 +1,34 @@
package app.revanced.patches.finanzonline.detection.root.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.finanzonline.detection.root.fingerprints.RootDetectionFingerprint
import app.revanced.patches.finanzonline.detection.shared.annotations.DetectionCompatibility
@Patch
@Name("remove-root-detection")
@Description("Removes the check for root permissions")
@DetectionCompatibility
@Version("0.0.1")
class RootDetectionPatch : BytecodePatch(
listOf(RootDetectionFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
RootDetectionFingerprint.result?.mutableMethod?.addInstructions(
0,
"""
sget-object v0, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean;
return-object v0
"""
) ?: return RootDetectionFingerprint.toErrorResult()
return PatchResultSuccess()
}
}

View file

@ -0,0 +1,9 @@
package app.revanced.patches.finanzonline.detection.shared.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("at.gv.bmf.bmf2go", arrayOf("2.2.0"))])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class DetectionCompatibility

View file

@ -23,7 +23,8 @@ import app.revanced.patcher.annotation.Package
"5.34.51",
"5.36.51",
"5.38.53",
"5.39.52"
"5.39.52",
"5.40.51"
)
)]
)

View file

@ -23,7 +23,8 @@ import app.revanced.patcher.annotation.Package
"5.34.51",
"5.36.51",
"5.38.53",
"5.39.52"
"5.39.52",
"5.40.51"
)
)]
)

View file

@ -23,7 +23,8 @@ import app.revanced.patcher.annotation.Package
"5.34.51",
"5.36.51",
"5.38.53",
"5.39.52"
"5.39.52",
"5.40.51"
)
)]
)

View file

@ -22,7 +22,8 @@ import app.revanced.patcher.annotation.Package
"5.34.51",
"5.36.51",
"5.38.53",
"5.39.52"
"5.39.52",
"5.40.51"
)
)]
)

View file

@ -23,7 +23,8 @@ import app.revanced.patcher.annotation.Package
"5.34.51",
"5.36.51",
"5.38.53",
"5.39.52"
"5.39.52",
"5.40.51"
)
)]
)

View file

@ -25,7 +25,8 @@ import app.revanced.patcher.annotation.Package
"5.34.51",
"5.36.51",
"5.38.53",
"5.39.52"
"5.39.52",
"5.40.51"
)
)]
)

View file

@ -23,7 +23,8 @@ import app.revanced.patcher.annotation.Package
"5.34.51",
"5.36.51",
"5.38.53",
"5.39.52"
"5.39.52",
"5.40.51"
)
)]
)

View file

@ -23,7 +23,8 @@ import app.revanced.patcher.annotation.Package
"5.34.51",
"5.36.51",
"5.38.53",
"5.39.52"
"5.39.52",
"5.40.51"
)
)]
)

View file

@ -23,7 +23,8 @@ import app.revanced.patcher.annotation.Package
"5.34.51",
"5.36.51",
"5.38.53",
"5.39.52"
"5.39.52",
"5.40.51"
)
)]
)

View file

@ -3,7 +3,11 @@ package app.revanced.patches.twitter.layout.hideviews.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("com.twitter.android")])
@Compatibility(
[Package(
"com.twitter.android", arrayOf("9.69.1-release.0")
)]
)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class HideViewsCompatibility

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -197,13 +197,6 @@ class GeneralAdsResourcePatch : ResourcePatch {
StringResource("revanced_adremover_paid_content_enabled_summary_on", "Paid content is hidden"),
StringResource("revanced_adremover_paid_content_enabled_summary_off", "Paid content is shown")
),
SwitchPreference(
"revanced_adremover_hide_suggestions",
StringResource("revanced_adremover_hide_suggestions_enabled_title", "Hide suggestions"),
true,
StringResource("revanced_adremover_hide_suggestions_enabled_summary_on", "Suggestions are hidden"),
StringResource("revanced_adremover_hide_suggestions_enabled_summary_off", "Suggestions are shown")
),
SwitchPreference(
"revanced_adremover_hide_latest_posts",
StringResource("revanced_adremover_hide_latest_posts_enabled_title", "Hide latest posts"),

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[
Package("com.google.android.youtube", arrayOf("17.49.37"))
Package("com.google.android.youtube", arrayOf("17.49.37", "18.03.36"))
]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,10 +5,7 @@ import org.jf.dexlib2.Opcode
object PivotBarCreateButtonViewFingerprint : MethodFingerprint(
opcodes = listOf(
Opcode.MOVE_OBJECT,
Opcode.INVOKE_DIRECT_RANGE, // unique instruction anchor
Opcode.CONST_4,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_STATIC
)
)

View file

@ -22,6 +22,7 @@ import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.REGISTE
import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.injectHook
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import org.jf.dexlib2.Opcode
@Patch
@DependsOn([IntegrationsPatch::class, ResourceMappingPatch::class, SettingsPatch::class, ResolvePivotBarFingerprintsPatch::class])
@ -54,17 +55,24 @@ class CreateButtonRemoverPatch : BytecodePatch() {
return PivotBarCreateButtonViewFingerprint.toErrorResult()
}
val createButtonResult = PivotBarCreateButtonViewFingerprint.result!!
val insertIndex = createButtonResult.scanResult.patternScanResult!!.endIndex
PivotBarCreateButtonViewFingerprint.result!!.apply {
val insertIndex = mutableMethod.implementation!!.instructions.let {
val scanStart = scanResult.patternScanResult!!.endIndex
scanStart + it.subList(scanStart, it.size - 1).indexOfFirst { instruction ->
instruction.opcode == Opcode.INVOKE_STATIC
}
}
/*
* Inject hooks
*/
val hook = "invoke-static { v$REGISTER_TEMPLATE_REPLACEMENT }, " +
"$INTEGRATIONS_CLASS_DESCRIPTOR->hideCreateButton(Landroid/view/View;)V"
createButtonResult.mutableMethod.injectHook(hook, insertIndex)
mutableMethod.injectHook(hook, insertIndex)
}
return PatchResultSuccess()
}

View file

@ -4,7 +4,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[
Package("com.google.android.youtube", arrayOf("17.49.37"))
Package("com.google.android.youtube", arrayOf("17.49.37", "18.03.36"))
]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -4,33 +4,14 @@ import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@FuzzyPatternScanMethod(3)
object EngagementPanelControllerFingerprint : MethodFingerprint(
"L", AccessFlags.PRIVATE or AccessFlags.FINAL, listOf("L", "L", "Z", "Z", "Z"), listOf(
Opcode.MOVE_OBJECT_FROM16,
Opcode.MOVE_OBJECT_FROM16,
Opcode.MOVE_FROM16,
Opcode.IGET_BOOLEAN,
Opcode.CONST_4,
Opcode.IF_NEZ,
Opcode.CONST_STRING,
Opcode.INVOKE_STATIC,
Opcode.SGET_OBJECT,
Opcode.SGET_OBJECT,
Opcode.CONST_STRING,
Opcode.INVOKE_STATIC,
Opcode.RETURN_OBJECT,
Opcode.IGET_OBJECT,
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.CONST_4,
Opcode.CONST_4,
Opcode.CONST_4,
Opcode.CONST_4,
Opcode.CONST_4,
Opcode.CONST_4,
returnType = "L",
access = AccessFlags.PRIVATE or AccessFlags.FINAL,
strings = listOf(
"EngagementPanelController: cannot show EngagementPanel before EngagementPanelController.init() has been called.",
"[EngagementPanel] Cannot show EngagementPanel before EngagementPanelController.init() has been called."
)
)

View file

@ -1,5 +1,6 @@
package app.revanced.patches.youtube.layout.playerpopuppanels.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
@ -10,12 +11,12 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.layout.playerpopuppanels.annotations.PlayerPopupPanelsCompatibility
import app.revanced.patches.youtube.layout.playerpopuppanels.fingerprints.EngagementPanelControllerFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
@Patch
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
@ -39,7 +40,8 @@ class PlayerPopupPanelsPatch : BytecodePatch(
)
)
val engagementPanelControllerMethod = EngagementPanelControllerFingerprint.result!!.mutableMethod
val engagementPanelControllerMethod = EngagementPanelControllerFingerprint
.result?.mutableMethod ?: return EngagementPanelControllerFingerprint.toErrorResult()
engagementPanelControllerMethod.addInstructions(
0, """

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -19,17 +19,28 @@ import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.Retu
import app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints.*
import app.revanced.patches.youtube.layout.returnyoutubedislike.resource.patch.ReturnYouTubeDislikeResourcePatch
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch
@Patch
@DependsOn([IntegrationsPatch::class, VideoIdPatch::class, ReturnYouTubeDislikeResourcePatch::class])
@DependsOn(
[
IntegrationsPatch::class,
VideoIdPatch::class,
ReturnYouTubeDislikeResourcePatch::class,
PlayerTypeHookPatch::class,
]
)
@Name("return-youtube-dislike")
@Description("Shows the dislike count of videos using the Return YouTube Dislike API.")
@ReturnYouTubeDislikeCompatibility
@Version("0.0.1")
class ReturnYouTubeDislikePatch : BytecodePatch(
listOf(
TextComponentSpecParentFingerprint, LikeFingerprint, DislikeFingerprint, RemoveLikeFingerprint
TextComponentSpecParentFingerprint,
LikeFingerprint,
DislikeFingerprint,
RemoveLikeFingerprint,
)
) {
override fun execute(context: BytecodeContext): PatchResult {

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -1,41 +0,0 @@
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.sponsorblock.resource.patch.SponsorBlockResourcePatch
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
@FuzzyPatternScanMethod(3)
object ShortsPlayerConstructorFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
opcodes = listOf(
Opcode.MOVE_OBJECT_FROM16,
Opcode.MOVE_OBJECT_FROM16,
Opcode.MOVE_OBJECT_FROM16,
Opcode.INVOKE_DIRECT_RANGE,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.CONST_4
),
customFingerprint = { methodDef ->
methodDef.implementation?.instructions?.any { instruction ->
instruction.opcode.ordinal == Opcode.CONST.ordinal &&
(instruction as? WideLiteralInstruction)?.wideLiteral == SponsorBlockResourcePatch.reelButtonGroupResourceId
} == true
}
)

View file

@ -19,12 +19,12 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.shared.fingerprints.SeekbarFingerprint
import app.revanced.patches.shared.fingerprints.SeekbarOnDrawFingerprint
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
import app.revanced.patches.youtube.layout.autocaptions.fingerprints.StartVideoInformerFingerprint
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
import app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints.*
import app.revanced.patches.youtube.layout.sponsorblock.resource.patch.SponsorBlockResourcePatch
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.playercontrols.bytecode.patch.PlayerControlsBytecodePatch
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
import app.revanced.patches.youtube.misc.video.information.patch.VideoInformationPatch
import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch
import org.jf.dexlib2.Opcode
@ -39,6 +39,7 @@ import org.jf.dexlib2.iface.reference.StringReference
dependencies = [
VideoInformationPatch::class, // updates video information and adds method to seek in video
PlayerControlsBytecodePatch::class,
PlayerTypeHookPatch::class,
IntegrationsPatch::class,
SponsorBlockResourcePatch::class,
VideoIdPatch::class
@ -54,8 +55,6 @@ class SponsorBlockBytecodePatch : BytecodePatch(
NextGenWatchLayoutFingerprint,
AppendTimeFingerprint,
PlayerOverlaysLayoutInitFingerprint,
ShortsPlayerConstructorFingerprint,
StartVideoInformerFingerprint
)
) {
@ -260,32 +259,15 @@ class SponsorBlockBytecodePatch : BytecodePatch(
if (it.opcode.ordinal != Opcode.CONST_STRING.ordinal) continue
when (((it as ReferenceInstruction).reference as StringReference).string) {
"replaceMeWithsetSponsorBarRect" ->
method.replaceStringInstruction(index, it, rectangleFieldName)
"replaceMeWithsetMillisecondMethod" ->
method.replaceStringInstruction(index, it, "seekHelper")
"replaceMeWithsetSponsorBarRect" -> method.replaceStringInstruction(
index,
it,
rectangleFieldName
)
}
}
} ?: return PatchResultError("Could not find the method which contains the replaceMeWith* strings")
val startVideoInformerMethod = StartVideoInformerFingerprint.result!!.mutableMethod
startVideoInformerMethod.addInstructions(
0, """
const/4 v0, 0x0
sput-boolean v0, $INTEGRATIONS_PLAYER_CONTROLLER_CLASS_DESCRIPTOR->shorts_playing:Z
"""
)
val shortsPlayerConstructorMethod = ShortsPlayerConstructorFingerprint.result!!.mutableMethod
shortsPlayerConstructorMethod.addInstructions(
0, """
const/4 v0, 0x1
sput-boolean v0, $INTEGRATIONS_PLAYER_CONTROLLER_CLASS_DESCRIPTOR->shorts_playing:Z
"""
)
// TODO: isSBChannelWhitelisting implementation
return PatchResultSuccess()

View file

@ -23,9 +23,6 @@ import app.revanced.util.resources.ResourceUtils.mergeStrings
@DependsOn([FixLocaleConfigErrorPatch::class, SettingsPatch::class, ResourceMappingPatch::class])
@Version("0.0.1")
class SponsorBlockResourcePatch : ResourcePatch {
companion object {
internal var reelButtonGroupResourceId: Long = 0
}
override fun execute(context: ResourceContext): PatchResult {
val youtubePackage = "com.google.android.youtube"
@ -107,10 +104,6 @@ class SponsorBlockResourcePatch : ResourcePatch {
}
}.close() // close afterwards
reelButtonGroupResourceId = ResourceMappingPatch.resourceMappings.single {
it.type == "id" && it.name == "reel_persistent_edu_button_group"
}.id
return PatchResultSuccess()
}
}

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -29,7 +29,7 @@ class DebuggingPatch : ResourcePatch {
listOf(
SwitchPreference(
"revanced_debug_enabled",
StringResource("revanced_debug_enabled_title", "Enable debug logs"),
StringResource("revanced_debug_enabled_title", "Debug logging"),
false,
StringResource("revanced_debug_summary_on", "Debug logs are enabled"),
StringResource("revanced_debug_summary_off", "Debug logs are disabled")
@ -38,11 +38,21 @@ class DebuggingPatch : ResourcePatch {
"revanced_debug_stacktrace_enabled",
StringResource(
"revanced_debug_stacktrace_enabled_title",
"Print stack traces"
"Log stack traces"
),
false,
StringResource("revanced_debug_stacktrace_summary_on", "Enabled printing stack traces"),
StringResource("revanced_debug_stacktrace_summary_off", "Disabled printing stack traces")
StringResource("revanced_debug_stacktrace_summary_on", "Debug logs include stack trace"),
StringResource("revanced_debug_stacktrace_summary_off", "Debug logs do not include stack trace")
),
SwitchPreference(
"revanced_debug_toast_on_error_enabled",
StringResource(
"revanced_debug_toast_on_error_enabled_title",
"Show toast on ReVanced error"
),
true,
StringResource("revanced_debug_toast_on_error_summary_on", "Toast shown if error occurs"),
StringResource("revanced_debug_toast_on_error_summary_off", "Toast not shown if error occurs")
),
),
StringResource("revanced_debug_summary", "Enable or disable debugging options")

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -0,0 +1,13 @@
package app.revanced.patches.youtube.misc.links.open.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class OpenLinksExternallyCompatibility

View file

@ -0,0 +1,17 @@
package app.revanced.patches.youtube.misc.links.open.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
object BindSessionServiceFingerprint : MethodFingerprint(
returnType = "L",
access = AccessFlags.PUBLIC or AccessFlags.FINAL,
opcodes = listOf(
Opcode.IPUT_OBJECT,
Opcode.NEW_INSTANCE,
Opcode.CONST_STRING
),
strings = listOf("android.support.customtabs.action.CustomTabsService")
)

View file

@ -0,0 +1,18 @@
package app.revanced.patches.youtube.misc.links.open.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
object GetCustomTabPackageNameFingerprint : MethodFingerprint(
returnType = "L",
access = AccessFlags.PUBLIC or AccessFlags.STATIC,
opcodes = listOf(
Opcode.CHECK_CAST,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.CONST_STRING
),
strings = listOf("android.support.customtabs.action.CustomTabsService")
)

View file

@ -0,0 +1,18 @@
package app.revanced.patches.youtube.misc.links.open.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
object InitializeCustomTabSupportFingerprint : MethodFingerprint(
returnType = "V",
access = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
opcodes = listOf(
Opcode.CHECK_CAST,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.CONST_STRING
),
strings = listOf("android.support.customtabs.action.CustomTabsService")
)

View file

@ -0,0 +1,65 @@
package app.revanced.patches.youtube.misc.links.open.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.misc.links.open.annotations.OpenLinksExternallyCompatibility
import app.revanced.patches.youtube.misc.links.open.fingerprints.BindSessionServiceFingerprint
import app.revanced.patches.youtube.misc.links.open.fingerprints.GetCustomTabPackageNameFingerprint
import app.revanced.patches.youtube.misc.links.open.fingerprints.InitializeCustomTabSupportFingerprint
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import org.jf.dexlib2.iface.instruction.formats.Instruction21c
@Patch
@Name("open-links-externally")
@Description("Open links outside of the app directly in your browser.")
@OpenLinksExternallyCompatibility
@Version("0.0.1")
class OpenLinksExternallyPatch : BytecodePatch(
listOf(
GetCustomTabPackageNameFingerprint,
BindSessionServiceFingerprint,
InitializeCustomTabSupportFingerprint
)
) {
override fun execute(context: BytecodeContext): PatchResult {
SettingsPatch.PreferenceScreen.MISC.addPreferences(
SwitchPreference(
"revanced_enable_external_browser",
StringResource("revanced_enable_external_browser_title", "Open links in browser"),
true,
StringResource("revanced_enable_external_browser_summary_on", "Opening links externally"),
StringResource("revanced_enable_external_browser_summary_off", "Opening links in app")
)
)
arrayOf(
GetCustomTabPackageNameFingerprint,
BindSessionServiceFingerprint,
InitializeCustomTabSupportFingerprint
).forEach {
val result = it.result ?: return it.toErrorResult()
val insertIndex = result.scanResult.patternScanResult!!.endIndex + 1
with(result.mutableMethod) {
val register = (implementation!!.instructions[insertIndex - 1] as Instruction21c).registerA
addInstructions(
insertIndex, """
invoke-static {v$register}, Lapp/revanced/integrations/patches/OpenLinksExternallyPatch;->enableExternalBrowser(Ljava/lang/String;)Ljava/lang/String;
move-result-object v$register
"""
)
}
}
return PatchResultSuccess()
}
}

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -1,9 +0,0 @@
package app.revanced.patches.youtube.misc.settings.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("com.google.android.youtube")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class SettingsCompatibility

View file

@ -1,12 +0,0 @@
package app.revanced.patches.youtube.misc.settings.bytecode.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
object ThemeConstructorFingerprint : MethodFingerprint(
"L",
AccessFlags.PUBLIC or AccessFlags.STATIC,
listOf("L"),
strings = listOf("settings.SettingsActivity", ":android:show_fragment", "settings.GeneralPrefsFragment")
)

View file

@ -6,7 +6,10 @@ import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
object ThemeSetterAppFingerprint : MethodFingerprint(
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, opcodes = listOf(
"L",
AccessFlags.PUBLIC or AccessFlags.STATIC,
parameters = listOf("L", "L", "L", "L"),
opcodes = listOf(
Opcode.CONST, //target reference
Opcode.GOTO,
Opcode.CONST, //target reference

View file

@ -7,24 +7,19 @@ import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.settings.preference.impl.Preference
import app.revanced.patches.shared.settings.util.AbstractPreferenceScreen
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.annotations.SettingsCompatibility
import app.revanced.patches.youtube.misc.settings.bytecode.fingerprints.LicenseActivityFingerprint
import app.revanced.patches.youtube.misc.settings.bytecode.fingerprints.ThemeConstructorFingerprint
import app.revanced.patches.youtube.misc.settings.bytecode.fingerprints.ThemeSetterAppFingerprint
import app.revanced.patches.youtube.misc.settings.bytecode.fingerprints.ThemeSetterSystemFingerprint
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsResourcePatch
import org.jf.dexlib2.util.MethodUtil
@Patch
@DependsOn(
[
IntegrationsPatch::class,
@ -33,10 +28,9 @@ import org.jf.dexlib2.util.MethodUtil
)
@Name("settings")
@Description("Adds settings for ReVanced to YouTube.")
@SettingsCompatibility
@Version("0.0.1")
class SettingsPatch : BytecodePatch(
listOf(LicenseActivityFingerprint, ThemeSetterSystemFingerprint, ThemeConstructorFingerprint)
listOf(LicenseActivityFingerprint, ThemeSetterSystemFingerprint, ThemeSetterAppFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
fun buildInvokeInstructionsString(
@ -60,11 +54,7 @@ class SettingsPatch : BytecodePatch(
}
// set the theme based on the preference of the app
with((ThemeConstructorFingerprint.result?.let {
ThemeSetterAppFingerprint.apply {
if (!resolve(context, it.classDef)) return ThemeSetterAppFingerprint.toErrorResult()
}
} ?: return ThemeConstructorFingerprint.toErrorResult()).result!!) {
ThemeSetterAppFingerprint.result?.apply {
fun buildInstructionsString(theme: Int) = """
const/4 v0, 0x$theme
${buildInvokeInstructionsString(parameters = "I")}
@ -79,7 +69,6 @@ class SettingsPatch : BytecodePatch(
addInstructions(
patternScanResult.endIndex - 7, buildInstructionsString(0)
)
addInstructions(
patternScanResult.endIndex - 9, buildInstructionsString(1)
)
@ -87,12 +76,11 @@ class SettingsPatch : BytecodePatch(
implementation!!.instructions.size - 2, buildInstructionsString(0)
)
}
}
} ?: return ThemeSetterAppFingerprint.toErrorResult()
// set the theme based on the preference of the device
with(LicenseActivityFingerprint.result!!) licenseActivity@{
with(mutableMethod) {
LicenseActivityFingerprint.result!!.apply licenseActivity@{
mutableMethod.apply {
fun buildSettingsActivityInvokeString(
registers: String = "p0",
classDescriptor: String = SETTINGS_ACTIVITY_DESCRIPTOR,
@ -113,7 +101,7 @@ class SettingsPatch : BytecodePatch(
}
// remove method overrides
with(mutableClass) {
mutableClass.apply {
methods.removeIf { it.name != "onCreate" && !MethodUtil.isConstructor(it) }
}
}

View file

@ -15,7 +15,6 @@ import app.revanced.patches.shared.settings.preference.impl.Preference
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.resource.patch.AbstractSettingsResourcePatch
import app.revanced.patches.youtube.misc.settings.annotations.SettingsCompatibility
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.util.resources.ResourceUtils
import app.revanced.util.resources.ResourceUtils.copyResources
@ -23,7 +22,6 @@ import org.w3c.dom.Node
@Name("settings-resource-patch")
@DependsOn([ResourceMappingPatch::class])
@SettingsCompatibility
@Description("Applies mandatory patches to implement ReVanced settings into the application.")
@Version("0.0.1")
class SettingsResourcePatch : AbstractSettingsResourcePatch(

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37")
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)

Some files were not shown because too many files have changed in this diff Show more