mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-28 05:01:03 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1eedc02ab | ||
|
|
9be32e10f6 | ||
|
|
87996f67a8 | ||
|
|
0822383271 | ||
|
|
0934af1ccd | ||
|
|
b3ad6fb8af | ||
|
|
87f5ebce9b | ||
|
|
a35d7c8951 | ||
|
|
3c8d3edff4 | ||
|
|
c35734bec2 | ||
|
|
e2b634053b | ||
|
|
3e6df0c96d |
@@ -7,7 +7,11 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"@semantic-release/commit-analyzer",
|
["@semantic-release/commit-analyzer", {
|
||||||
|
"releaseRules": [
|
||||||
|
{"type": "build", "release": "patch"}
|
||||||
|
]
|
||||||
|
}],
|
||||||
"@semantic-release/release-notes-generator",
|
"@semantic-release/release-notes-generator",
|
||||||
"@semantic-release/changelog",
|
"@semantic-release/changelog",
|
||||||
"gradle-semantic-release-plugin",
|
"gradle-semantic-release-plugin",
|
||||||
@@ -15,6 +19,7 @@
|
|||||||
"@semantic-release/git",
|
"@semantic-release/git",
|
||||||
{
|
{
|
||||||
"assets": [
|
"assets": [
|
||||||
|
"README.md",
|
||||||
"CHANGELOG.md",
|
"CHANGELOG.md",
|
||||||
"gradle.properties"
|
"gradle.properties"
|
||||||
]
|
]
|
||||||
|
|||||||
35
CHANGELOG.md
35
CHANGELOG.md
@@ -1,3 +1,38 @@
|
|||||||
|
# [2.11.0](https://github.com/revanced/revanced-patches/compare/v2.10.2...v2.11.0) (2022-07-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* `autorepeat-by-default` patch ([#106](https://github.com/revanced/revanced-patches/issues/106)) ([e0ac9f3](https://github.com/revanced/revanced-patches/commit/e0ac9f385fc360f4dd2451e26676633120356c10))
|
||||||
|
|
||||||
|
## [2.10.2](https://github.com/revanced/revanced-patches/compare/v2.10.1...v2.10.2) (2022-07-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* trigger release on `build` commits ([be8bd1b](https://github.com/revanced/revanced-patches/commit/be8bd1b2a4b91f9763448661a802a5dc4a6b1d1d))
|
||||||
|
|
||||||
|
## [2.10.1](https://github.com/revanced/revanced-patches/compare/v2.10.0...v2.10.1) (2022-07-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* patch description consistency ([#134](https://github.com/revanced/revanced-patches/issues/134)) ([da5896d](https://github.com/revanced/revanced-patches/commit/da5896dde0a2b2b9ffe65e486402e4ef92ec1ce9))
|
||||||
|
|
||||||
|
# [2.10.0](https://github.com/revanced/revanced-patches/compare/v2.9.4...v2.10.0) (2022-07-07)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* implement `wide-searchbar` Patch ([#130](https://github.com/revanced/revanced-patches/issues/130)) ([332f4d1](https://github.com/revanced/revanced-patches/commit/332f4d12d06316d65db252a280fe1f263e65c3a8))
|
||||||
|
|
||||||
|
## [2.9.4](https://github.com/revanced/revanced-patches/compare/v2.9.3...v2.9.4) (2022-07-06)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add 17.25.34 as supported version for swipe-controls patch ([4d84c19](https://github.com/revanced/revanced-patches/commit/4d84c1914f8ecf51cee25667219bc6cf635a6c1c))
|
||||||
|
|
||||||
## [2.9.3](https://github.com/revanced/revanced-patches/compare/v2.9.2...v2.9.3) (2022-07-06)
|
## [2.9.3](https://github.com/revanced/revanced-patches/compare/v2.9.2...v2.9.3) (2022-07-06)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
Repo for all ReVanced patches
|
# ReVanced Patches
|
||||||
|
🧩 Official patches by ReVanced
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib"))
|
implementation(kotlin("stdlib"))
|
||||||
|
|
||||||
implementation("app.revanced:revanced-patcher:2.3.0")
|
implementation("app.revanced:revanced-patcher:2.4.0")
|
||||||
implementation("app.revanced:multidexlib2:2.5.2.r2")
|
implementation("app.revanced:multidexlib2:2.5.2.r2")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,12 +49,19 @@ tasks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
register<JavaExec>("generateReadme") {
|
||||||
|
description = "Generate README.md"
|
||||||
|
dependsOn(build)
|
||||||
|
|
||||||
|
classpath = sourceSets["main"].runtimeClasspath
|
||||||
|
mainClass.set("app.revanced.patches.meta.ReadmeGenerator")
|
||||||
|
}
|
||||||
// Dummy task to fix the Gradle semantic-release plugin.
|
// Dummy task to fix the Gradle semantic-release plugin.
|
||||||
// Remove this if you forked it to support building only.
|
// Remove this if you forked it to support building only.
|
||||||
// Tracking issue: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
|
// Tracking issue: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
|
||||||
register<DefaultTask>("publish") {
|
register<DefaultTask>("publish") {
|
||||||
group = "publish"
|
group = "publish"
|
||||||
description = "Dummy task"
|
description = "Dummy task"
|
||||||
dependsOn(named("generateDex"))
|
dependsOn(named("generateDex"), named("generateReadme"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.9.3
|
version = 2.11.0
|
||||||
|
|||||||
55
src/main/kotlin/app/revanced/meta/ReadmeGenerator.kt
Normal file
55
src/main/kotlin/app/revanced/meta/ReadmeGenerator.kt
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
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())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@ import app.revanced.patches.music.audio.exclusiveaudio.fingerprints.ExclusiveAud
|
|||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("exclusive-audio-playback")
|
@Name("exclusive-audio-playback")
|
||||||
@Description("Add the option to play music without video.")
|
@Description("Adds the option to play music without video.")
|
||||||
@ExclusiveAudioCompatibility
|
@ExclusiveAudioCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class ExclusiveAudioPatch : BytecodePatch(
|
class ExclusiveAudioPatch : BytecodePatch(
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
|||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("upgrade-button-remover")
|
@Name("upgrade-button-remover")
|
||||||
@Description("Remove the upgrade tab from the pivot bar in YouTube music.")
|
@Description("Removes the upgrade tab from the pivot bar in YouTube music.")
|
||||||
@RemoveUpgradeButtonCompatibility
|
@RemoveUpgradeButtonCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class RemoveUpgradeButtonPatch : BytecodePatch(
|
class RemoveUpgradeButtonPatch : BytecodePatch(
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ import org.jf.dexlib2.immutable.reference.ImmutableMethodReference
|
|||||||
dependencies = [ResourceIdMappingProviderResourcePatch::class, IntegrationsPatch::class]
|
dependencies = [ResourceIdMappingProviderResourcePatch::class, IntegrationsPatch::class]
|
||||||
)
|
)
|
||||||
@Name("general-ads")
|
@Name("general-ads")
|
||||||
@Description("Patch to remove general ads in bytecode.")
|
@Description("Removes general ads in bytecode.")
|
||||||
@GeneralAdsCompatibility
|
@GeneralAdsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class GeneralBytecodeAdsPatch : BytecodePatch() {
|
class GeneralBytecodeAdsPatch : BytecodePatch() {
|
||||||
|
|||||||
@@ -4,10 +4,8 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.impl.BytecodeData
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
import app.revanced.patcher.extensions.removeInstruction
|
||||||
import app.revanced.patcher.extensions.removeInstructions
|
|
||||||
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
|
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
|
||||||
import app.revanced.patcher.patch.annotations.Dependencies
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
@@ -15,18 +13,12 @@ import app.revanced.patcher.patch.impl.BytecodePatch
|
|||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.util.smali.toBuilderInstruction
|
|
||||||
import app.revanced.patches.youtube.ad.infocardsuggestions.annotations.HideInfocardSuggestionsCompatibility
|
import app.revanced.patches.youtube.ad.infocardsuggestions.annotations.HideInfocardSuggestionsCompatibility
|
||||||
import app.revanced.patches.youtube.ad.infocardsuggestions.fingerprints.HideInfocardSuggestionsFingerprint
|
import app.revanced.patches.youtube.ad.infocardsuggestions.fingerprints.HideInfocardSuggestionsFingerprint
|
||||||
import app.revanced.patches.youtube.ad.infocardsuggestions.fingerprints.HideInfocardSuggestionsParentFingerprint
|
import app.revanced.patches.youtube.ad.infocardsuggestions.fingerprints.HideInfocardSuggestionsParentFingerprint
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
|
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
|
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
|
||||||
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
|
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||||
import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
|
|
||||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
|
||||||
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
|
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Dependencies(dependencies = [IntegrationsPatch::class])
|
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
|||||||
@Patch
|
@Patch
|
||||||
@Dependencies(dependencies = [IntegrationsPatch::class])
|
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||||
@Name("video-ads")
|
@Name("video-ads")
|
||||||
@Description("Patch to remove ads in the YouTube video player.")
|
@Description("Removes ads in the YouTube video player.")
|
||||||
@VideoAdsCompatibility
|
@VideoAdsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class VideoAdsPatch : BytecodePatch(
|
class VideoAdsPatch : BytecodePatch(
|
||||||
@@ -40,4 +40,4 @@ class VideoAdsPatch : BytecodePatch(
|
|||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,11 @@ package app.revanced.patches.youtube.interaction.fenster.annotation
|
|||||||
import app.revanced.patcher.annotation.Compatibility
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
import app.revanced.patcher.annotation.Package
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
//TODO the patch may be compatible with more versions, but this is the one i'm testing on right now...
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.24.34")
|
"com.google.android.youtube", arrayOf("17.24.34", "17.25.34")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
internal annotation class FensterCompatibility
|
internal annotation class FensterCompatibility
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import org.jf.dexlib2.immutable.reference.ImmutableMethodReference
|
|||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("fenster-swipe-controls")
|
@Name("fenster-swipe-controls")
|
||||||
@Description("volume and brightness swipe controls")
|
@Description("Adds volume and brightness swipe controls.")
|
||||||
@FensterCompatibility
|
@FensterCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
@Dependencies(dependencies = [IntegrationsPatch::class])
|
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||||
@@ -118,4 +118,4 @@ class FensterPatch : BytecodePatch(
|
|||||||
throw PatchResultError("failed to inject onTouchEvent hook into NextGenWatchLayout: none found")
|
throw PatchResultError("failed to inject onTouchEvent hook into NextGenWatchLayout: none found")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
|||||||
@Patch
|
@Patch
|
||||||
@Dependencies(dependencies = [IntegrationsPatch::class])
|
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||||
@Name("seekbar-tapping")
|
@Name("seekbar-tapping")
|
||||||
@Description("Enable tapping on the seekbar of the YouTube player.")
|
@Description("Enables tapping on the seekbar of the YouTube player.")
|
||||||
@SeekbarTappingCompatibility
|
@SeekbarTappingCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class EnableSeekbarTappingPatch : BytecodePatch(
|
class EnableSeekbarTappingPatch : BytecodePatch(
|
||||||
@@ -92,4 +92,4 @@ class EnableSeekbarTappingPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
|||||||
@Patch
|
@Patch
|
||||||
@Dependencies(dependencies = [ResourceIdMappingProviderResourcePatch::class])
|
@Dependencies(dependencies = [ResourceIdMappingProviderResourcePatch::class])
|
||||||
@Name("hide-autoplay-button")
|
@Name("hide-autoplay-button")
|
||||||
@Description("Disable the autoplay button.")
|
@Description("Disables the autoplay button.")
|
||||||
@AutoplayButtonCompatibility
|
@AutoplayButtonCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class HideAutoplayButton : BytecodePatch(
|
class HideAutoplayButton : BytecodePatch(
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.autorepeat.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility(
|
||||||
|
[Package(
|
||||||
|
"com.google.android.youtube", arrayOf("17.24.35", "17.25.34")
|
||||||
|
)]
|
||||||
|
)
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class AutoRepeatCompatibility
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.autorepeat.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.youtube.layout.autorepeat.annotations.AutoRepeatCompatibility
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
@Name("auto-repeat-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Laamp;", "ae"
|
||||||
|
)
|
||||||
|
@FuzzyPatternScanMethod(2)
|
||||||
|
@AutoRepeatCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
//Finds method:
|
||||||
|
/*
|
||||||
|
public final void ae() {
|
||||||
|
aq(aabj.ENDED);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
object AutoRepeatFingerprint : MethodFingerprint(
|
||||||
|
"V",
|
||||||
|
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
customFingerprint = { methodDef -> methodDef.implementation!!.instructions.count() == 3 }
|
||||||
|
)
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.autorepeat.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.youtube.layout.autorepeat.annotations.AutoRepeatCompatibility
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
@Name("auto-repeat-parent-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Laamp;", "E"
|
||||||
|
)
|
||||||
|
@FuzzyPatternScanMethod(2)
|
||||||
|
@AutoRepeatCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
//This Fingerprints finds the play() method needed to be called when AutoRepeatPatch.shouldAutoRepeat() == true
|
||||||
|
/*
|
||||||
|
public final void E() {
|
||||||
|
Stuff happens
|
||||||
|
String str = "play() called when the player wasn't loaded.";
|
||||||
|
String str2 = "play() blocked because Background Playability failed";
|
||||||
|
Stuff happens again
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
object AutoRepeatParentFingerprint : MethodFingerprint(
|
||||||
|
"V",
|
||||||
|
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
listOf("play() called when the player wasn't loaded.", "play() blocked because Background Playability failed"),
|
||||||
|
null
|
||||||
|
)
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.autorepeat.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.extensions.removeInstruction
|
||||||
|
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
|
import app.revanced.patches.youtube.layout.autorepeat.annotations.AutoRepeatCompatibility
|
||||||
|
import app.revanced.patches.youtube.layout.autorepeat.fingerprints.AutoRepeatFingerprint
|
||||||
|
import app.revanced.patches.youtube.layout.autorepeat.fingerprints.AutoRepeatParentFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
|
|
||||||
|
@Patch(include = false)
|
||||||
|
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||||
|
@Name("autorepeat-by-default")
|
||||||
|
@Description("Enables auto repeating of videos by default.")
|
||||||
|
@AutoRepeatCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class AutoRepeatPatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
AutoRepeatParentFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
|
//Get Result from the ParentFingerprint which is the playMethod we need to get.
|
||||||
|
val parentResult = AutoRepeatParentFingerprint.result
|
||||||
|
?: return PatchResultError("ParentFingerprint did not resolve.")
|
||||||
|
|
||||||
|
//this one needs to be called when app/revanced/integrations/patches/AutoRepeatPatch;->shouldAutoRepeat() returns true
|
||||||
|
val playMethod = parentResult.mutableMethod
|
||||||
|
AutoRepeatFingerprint.resolve(data, parentResult.classDef)
|
||||||
|
//String is: Laamp;->E()V
|
||||||
|
val methodToCall = playMethod.definingClass + "->" + playMethod.name + "()V";
|
||||||
|
|
||||||
|
//This is the method we search for
|
||||||
|
val result = AutoRepeatFingerprint.result
|
||||||
|
?: return PatchResultError("FingerPrint did not resolve.")
|
||||||
|
val method = result.mutableMethod
|
||||||
|
|
||||||
|
//Instructions to add to the smali code
|
||||||
|
val instructions = """
|
||||||
|
invoke-static {}, Lapp/revanced/integrations/patches/AutoRepeatPatch;->shouldAutoRepeat()Z
|
||||||
|
move-result v0
|
||||||
|
if-eqz v0, :noautorepeat
|
||||||
|
const/4 v0, 0x0
|
||||||
|
invoke-virtual {}, $methodToCall
|
||||||
|
:noautorepeat
|
||||||
|
return-void
|
||||||
|
"""
|
||||||
|
|
||||||
|
//Get the implementation so we can do a check for null and get instructions size.
|
||||||
|
val implementation = method.implementation
|
||||||
|
?: return PatchResultError("No Method Implementation found!")
|
||||||
|
|
||||||
|
//Since addInstructions needs an index which starts counting at 0 and size starts counting at 1,
|
||||||
|
//we have to remove 1 to get the latest instruction
|
||||||
|
val index = implementation.instructions.size-1
|
||||||
|
|
||||||
|
|
||||||
|
//remove last instruction which is return-void
|
||||||
|
method.removeInstruction(index)
|
||||||
|
// Add our own instructions there
|
||||||
|
method.addInstructions(index, instructions)
|
||||||
|
|
||||||
|
//Everything worked as expected, return Success
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,7 +16,7 @@ import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
|||||||
@Patch
|
@Patch
|
||||||
@Dependencies(dependencies = [IntegrationsPatch::class])
|
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||||
@Name("hide-cast-button")
|
@Name("hide-cast-button")
|
||||||
@Description("Patch to hide the cast button.")
|
@Description("Hides the cast button.")
|
||||||
@CastButtonCompatibility
|
@CastButtonCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class HideCastButtonPatch : BytecodePatch() {
|
class HideCastButtonPatch : BytecodePatch() {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import org.jf.dexlib2.iface.reference.MethodReference
|
|||||||
@Patch
|
@Patch
|
||||||
@Dependencies(dependencies = [IntegrationsPatch::class, ResourceIdMappingProviderResourcePatch::class])
|
@Dependencies(dependencies = [IntegrationsPatch::class, ResourceIdMappingProviderResourcePatch::class])
|
||||||
@Name("disable-create-button")
|
@Name("disable-create-button")
|
||||||
@Description("Disable the create button.")
|
@Description("Disables the create button.")
|
||||||
@CreateButtonCompatibility
|
@CreateButtonCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class CreateButtonRemoverPatch : BytecodePatch(
|
class CreateButtonRemoverPatch : BytecodePatch(
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import org.jf.dexlib2.iface.reference.MethodReference
|
|||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("disable-fullscreen-panels")
|
@Name("disable-fullscreen-panels")
|
||||||
@Description("Disable comments panel in fullscreen view.")
|
@Description("Disables comments panel in fullscreen view.")
|
||||||
@FullscreenPanelsCompatibility
|
@FullscreenPanelsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class FullscreenPanelsRemovalPatch : BytecodePatch(
|
class FullscreenPanelsRemovalPatch : BytecodePatch(
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import org.jf.dexlib2.iface.reference.MethodReference
|
|||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("minimized-playback")
|
@Name("minimized-playback")
|
||||||
@Description("Enable minimized and background playback.")
|
@Description("Enables minimized and background playback.")
|
||||||
@MinimizedPlaybackCompatibility
|
@MinimizedPlaybackCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class MinimizedPlaybackPatch : BytecodePatch(
|
class MinimizedPlaybackPatch : BytecodePatch(
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
|
|||||||
@Patch
|
@Patch
|
||||||
@Dependencies(dependencies = [IntegrationsPatch::class])
|
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||||
@Name("old-quality-layout")
|
@Name("old-quality-layout")
|
||||||
@Description("Enable the original quality flyout menu.")
|
@Description("Enables the original quality flyout menu.")
|
||||||
@OldQualityLayoutCompatibility
|
@OldQualityLayoutCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class OldQualityLayoutPatch : BytecodePatch(
|
class OldQualityLayoutPatch : BytecodePatch(
|
||||||
@@ -51,4 +51,4 @@ class OldQualityLayoutPatch : BytecodePatch(
|
|||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import app.revanced.patches.youtube.layout.reels.fingerprints.HideReelsFingerpri
|
|||||||
|
|
||||||
//@Patch TODO: this is currently in the general-bytecode-ads patch due to the integrations having a preference for including reels or not. Move it here.
|
//@Patch TODO: this is currently in the general-bytecode-ads patch due to the integrations having a preference for including reels or not. Move it here.
|
||||||
@Name("hide-reels")
|
@Name("hide-reels")
|
||||||
@Description("Hide reels on the page.")
|
@Description("Hides reels on the page.")
|
||||||
@HideReelsCompatibility
|
@HideReelsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class HideReelsPatch : BytecodePatch(
|
class HideReelsPatch : BytecodePatch(
|
||||||
@@ -33,4 +33,4 @@ class HideReelsPatch : BytecodePatch(
|
|||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
@Patch
|
@Patch
|
||||||
@Dependencies(dependencies = [IntegrationsPatch::class])
|
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||||
@Name("hide-shorts-button")
|
@Name("hide-shorts-button")
|
||||||
@Description("Hide the shorts button.")
|
@Description("Hides the shorts button.")
|
||||||
@ShortsButtonCompatibility
|
@ShortsButtonCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class ShortsButtonRemoverPatch : BytecodePatch(
|
class ShortsButtonRemoverPatch : BytecodePatch(
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
|||||||
@Patch
|
@Patch
|
||||||
@Dependencies(dependencies = [IntegrationsPatch::class])
|
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||||
@Name("hide-watermark")
|
@Name("hide-watermark")
|
||||||
@Description("Hide the creator's watermark on video's.")
|
@Description("Hides the creator's watermark on videos.")
|
||||||
@HideWatermarkCompatibility
|
@HideWatermarkCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class HideWatermarkPatch : BytecodePatch(
|
class HideWatermarkPatch : BytecodePatch(
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.widesearchbar.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility(
|
||||||
|
[Package(
|
||||||
|
"com.google.android.youtube", arrayOf("17.25.34")
|
||||||
|
)]
|
||||||
|
)
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class WideSearchbarCompatibility
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.widesearchbar.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patches.youtube.layout.reels.annotations.HideReelsCompatibility
|
||||||
|
import app.revanced.patches.youtube.layout.widesearchbar.annotations.WideSearchbarCompatibility
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
@Name("wide-searchbar-methodone-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Ljkg;", "i"
|
||||||
|
)
|
||||||
|
@DirectPatternScanMethod
|
||||||
|
@WideSearchbarCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
|
||||||
|
/*
|
||||||
|
This finds the following method:
|
||||||
|
public final View i(akrl akrlVar, adpd adpdVar) {
|
||||||
|
}
|
||||||
|
|
||||||
|
Method we search for is located in smali now.
|
||||||
|
See:
|
||||||
|
.method public final i(Lakrl;Ladpd;)Landroid/view/View;
|
||||||
|
iget-object v0, p0, Ljkg;->a:Landroid/app/Activity;
|
||||||
|
invoke-static {v0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
|
||||||
|
move-result-object v0
|
||||||
|
iget-object v1, p0, Ljkg;->g:Ljis;
|
||||||
|
const/4 v2, 0x0
|
||||||
|
invoke-interface {v1, v2}, Ljis;->h(Z)V
|
||||||
|
iget-object p1, p1, Lakrl;->f:Lahnq;
|
||||||
|
if-nez p1, :cond_12
|
||||||
|
sget-object p1, Lahnq;->a:Lahnq;
|
||||||
|
:cond_12
|
||||||
|
iget-object v1, p0, Ljkg;->x:Ltxm;
|
||||||
|
invoke-static {v1}, Lfbn;->aF(Ltxm;)Z //THIS IS WHAT WE SEARCH FOR (Method fbn.aF)
|
||||||
|
move-result v1
|
||||||
|
*/
|
||||||
|
|
||||||
|
object WideSearchbarOneFingerprint : MethodFingerprint(
|
||||||
|
"L", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L", "L"), listOf(Opcode.IF_NEZ, Opcode.SGET_OBJECT, Opcode.IGET_OBJECT, Opcode.INVOKE_STATIC),
|
||||||
|
null, null
|
||||||
|
)
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.widesearchbar.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.youtube.layout.reels.annotations.HideReelsCompatibility
|
||||||
|
import app.revanced.patches.youtube.layout.widesearchbar.annotations.WideSearchbarCompatibility
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
@Name("wide-searchbar-methodone-parent-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Ljkg;", "l"
|
||||||
|
)
|
||||||
|
@FuzzyPatternScanMethod(3)
|
||||||
|
@WideSearchbarCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This finds the following method:
|
||||||
|
private final void l(PaneDescriptor paneDescriptor) {
|
||||||
|
Class cls = null;
|
||||||
|
ahat f = paneDescriptor != null ? paneDescriptor.f() : null;
|
||||||
|
if (paneDescriptor != null) {
|
||||||
|
cls = paneDescriptor.a;
|
||||||
|
}
|
||||||
|
ftu k = k();
|
||||||
|
if ((k == null || !k.bk()) && ((!frx.k(f) && !((Boolean) aqer.S(this.n).X(new fac(this, f, 19)).K(irx.i).aH(false)).booleanValue()) || (f != null && f.qA(ReelWatchEndpointOuterClass$ReelWatchEndpoint.reelWatchEndpoint)))) {
|
||||||
|
String j = frx.j(f);
|
||||||
|
if ((j != null && ("FEhistory".equals(j) || "FEmy_videos".equals(j) || "FEpurchases".equals(j) || j.startsWith("VL"))) || cls == this.I.E() || cls == this.G.a) {
|
||||||
|
this.F = 3;
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
this.F = 2;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.F = 1;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
object WideSearchbarOneParentFingerprint : MethodFingerprint(
|
||||||
|
"V", AccessFlags.PRIVATE or AccessFlags.FINAL, listOf("L"), null,
|
||||||
|
listOf("FEhistory", "FEmy_videos", "FEpurchases")
|
||||||
|
)
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.widesearchbar.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patches.youtube.layout.reels.annotations.HideReelsCompatibility
|
||||||
|
import app.revanced.patches.youtube.layout.widesearchbar.annotations.WideSearchbarCompatibility
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
@Name("wide-searchbar-methodtwo-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Lkrf;", "h"
|
||||||
|
)
|
||||||
|
@DirectPatternScanMethod
|
||||||
|
@WideSearchbarCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
|
||||||
|
/*
|
||||||
|
public static jis h(Context context, txm txmVar, uag uagVar, txp txpVar) {
|
||||||
|
return fbn.aB(txmVar) ? new jhx(context, txmVar, uagVar, txpVar) : jis.d;
|
||||||
|
}
|
||||||
|
|
||||||
|
Method we search for is located in smali now.
|
||||||
|
See:
|
||||||
|
.method public static h(Landroid/content/Context;Ltxm;Luag;Ltxp;)Ljis;
|
||||||
|
invoke-static {p1}, Lfbn;->aB(Ltxm;)Z //this is the method we want to change. fbn.aB
|
||||||
|
move-result v0
|
||||||
|
if-eqz v0, :cond_c
|
||||||
|
new-instance v0, Ljhx;
|
||||||
|
invoke-direct {v0, p0, p1, p2, p3}, Ljhx;-><init>(Landroid/content/Context;Ltxm;Luag;Ltxp;)V
|
||||||
|
goto :goto_e
|
||||||
|
:cond_c
|
||||||
|
sget-object v0, Ljis;->d:Ljis;
|
||||||
|
:goto_e
|
||||||
|
return-object v0
|
||||||
|
.end method
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
object WideSearchbarTwoFingerprint : MethodFingerprint(
|
||||||
|
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "L", "L", "L"), listOf(
|
||||||
|
Opcode.INVOKE_STATIC, Opcode.MOVE_RESULT, Opcode.IF_EQZ, Opcode.NEW_INSTANCE
|
||||||
|
),
|
||||||
|
null, null
|
||||||
|
)
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.widesearchbar.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.youtube.layout.reels.annotations.HideReelsCompatibility
|
||||||
|
import app.revanced.patches.youtube.layout.widesearchbar.annotations.WideSearchbarCompatibility
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
@Name("wide-searchbar-methodtwo-parent-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Lkrf;", "i"
|
||||||
|
)
|
||||||
|
@FuzzyPatternScanMethod(3)
|
||||||
|
@WideSearchbarCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
|
||||||
|
/*
|
||||||
|
This finds following method:
|
||||||
|
public static ies i(br brVar) {
|
||||||
|
bp f = brVar.getSupportFragmentManager().f("VIDEO_QUALITIES_QUICK_MENU_BOTTOM_SHEET_FRAGMENT");
|
||||||
|
if (f != null) {
|
||||||
|
return (kga) f;
|
||||||
|
}
|
||||||
|
return new kga();
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
object WideSearchbarTwoParentFingerprint : MethodFingerprint(
|
||||||
|
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), null,
|
||||||
|
listOf("VIDEO_QUALITIES_QUICK_MENU_BOTTOM_SHEET_FRAGMENT")
|
||||||
|
)
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.widesearchbar.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
|
import app.revanced.patcher.data.impl.toMethodWalker
|
||||||
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
|
import app.revanced.patches.youtube.layout.widesearchbar.annotations.WideSearchbarCompatibility
|
||||||
|
import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.WideSearchbarOneFingerprint
|
||||||
|
import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.WideSearchbarOneParentFingerprint
|
||||||
|
import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.WideSearchbarTwoFingerprint
|
||||||
|
import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.WideSearchbarTwoParentFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
|
|
||||||
|
@Patch(include = false)
|
||||||
|
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||||
|
@Name("enable-wide-searchbar")
|
||||||
|
@Description("Replaces the search icon with a wide search bar. This will hide the YouTube logo when active.")
|
||||||
|
@WideSearchbarCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class WideSearchbarPatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
WideSearchbarOneParentFingerprint, WideSearchbarTwoParentFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
|
WideSearchbarOneFingerprint.resolve(data, WideSearchbarOneParentFingerprint.result!!.classDef)
|
||||||
|
WideSearchbarTwoFingerprint.resolve(data, WideSearchbarTwoParentFingerprint.result!!.classDef)
|
||||||
|
|
||||||
|
val resultOne = WideSearchbarOneFingerprint.result
|
||||||
|
|
||||||
|
//This should be the method aF in class fbn
|
||||||
|
val targetMethodOne =
|
||||||
|
data.toMethodWalker(resultOne!!.method).nextMethod(resultOne.patternScanResult!!.endIndex, true).getMethod() as MutableMethod
|
||||||
|
|
||||||
|
//Since both methods have the same smali code, inject instructions using a method.
|
||||||
|
addInstructions(targetMethodOne)
|
||||||
|
|
||||||
|
val resultTwo = WideSearchbarTwoFingerprint.result
|
||||||
|
|
||||||
|
//This should be the method aB in class fbn
|
||||||
|
val targetMethodTwo =
|
||||||
|
data.toMethodWalker(resultTwo!!.method).nextMethod(resultTwo.patternScanResult!!.startIndex, true).getMethod() as MutableMethod
|
||||||
|
|
||||||
|
//Since both methods have the same smali code, inject instructions using a method.
|
||||||
|
addInstructions(targetMethodTwo)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun addInstructions(method: MutableMethod) {
|
||||||
|
val index = method.implementation!!.instructions.size - 1
|
||||||
|
method.addInstructions(
|
||||||
|
index, """
|
||||||
|
invoke-static {}, Lapp/revanced/integrations/patches/NewActionbarPatch;->getNewActionBar()Z
|
||||||
|
move-result p0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
//targetMethodOne: in class fbn
|
||||||
|
/*
|
||||||
|
.method public static aF(Ltxm;)Z
|
||||||
|
invoke-virtual {p0}, Ltxm;->b()Lahah;
|
||||||
|
move-result-object p0
|
||||||
|
iget-object p0, p0, Lahah;->e:Lakfd;
|
||||||
|
if-nez p0, :cond_a
|
||||||
|
sget-object p0, Lakfd;->a:Lakfd;
|
||||||
|
:cond_a
|
||||||
|
iget-boolean p0, p0, Lakfd;->V:Z
|
||||||
|
//added code here:
|
||||||
|
invoke-static {}, app/revanced/integrations/patches/NewActionbarPatch;->getNewActionBar()Z
|
||||||
|
move-result p0
|
||||||
|
//original code here:
|
||||||
|
return p0
|
||||||
|
.end method
|
||||||
|
*/
|
||||||
|
|
||||||
|
//targetMethodTwo: in class fbn
|
||||||
|
/*
|
||||||
|
.method public static aB(Ltxm;)Z
|
||||||
|
invoke-virtual {p0}, Ltxm;->b()Lahah;
|
||||||
|
move-result-object p0
|
||||||
|
iget-object p0, p0, Lahah;->e:Lakfd;
|
||||||
|
if-nez p0, :cond_a
|
||||||
|
sget-object p0, Lakfd;->a:Lakfd;
|
||||||
|
:cond_a
|
||||||
|
iget-boolean p0, p0, Lakfd;->y:Z
|
||||||
|
//added code here:
|
||||||
|
invoke-static {}, app/revanced/integrations/patches/NewActionbarPatch;->getNewActionBar()Z
|
||||||
|
move-result p0
|
||||||
|
//original code here:
|
||||||
|
return p0
|
||||||
|
.end method
|
||||||
|
|
||||||
|
*/
|
||||||
|
}
|
||||||
@@ -13,7 +13,7 @@ import org.w3c.dom.Element
|
|||||||
|
|
||||||
@Patch(false)
|
@Patch(false)
|
||||||
@Name("enable-debugging")
|
@Name("enable-debugging")
|
||||||
@Description("Enable app debugging by patching the manifest file")
|
@Description("Enables app debugging by patching the manifest file.")
|
||||||
@EnableDebuggingCompatibility
|
@EnableDebuggingCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class EnableDebuggingPatch : ResourcePatch() {
|
class EnableDebuggingPatch : ResourcePatch() {
|
||||||
@@ -32,4 +32,4 @@ class EnableDebuggingPatch : ResourcePatch() {
|
|||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,23 @@
|
|||||||
package app.revanced.patches.youtube.misc.hdrbrightness.patch;
|
package app.revanced.patches.youtube.misc.hdrbrightness.patch
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description;
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name;
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version;
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.impl.BytecodeData
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.Patch;
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.impl.BytecodePatch;
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.util.smali.toBuilderInstruction
|
import app.revanced.patches.youtube.misc.hdrbrightness.annotations.HDRBrightnessCompatibility
|
||||||
import app.revanced.patches.youtube.misc.hdrbrightness.annotations.HDRBrightnessCompatibility;
|
|
||||||
import app.revanced.patches.youtube.misc.hdrbrightness.fingerprints.HDRBrightnessFingerprint
|
import app.revanced.patches.youtube.misc.hdrbrightness.fingerprints.HDRBrightnessFingerprint
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
|
import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
|
||||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("hdr-max-brightness")
|
@Name("hdr-max-brightness")
|
||||||
@Description("Set brightness to max for HDR videos in fullscreen mode.")
|
@Description("Sets brightness to max for HDR videos in fullscreen mode.")
|
||||||
@HDRBrightnessCompatibility
|
@HDRBrightnessCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class HDRBrightnessPatch : BytecodePatch(
|
class HDRBrightnessPatch : BytecodePatch(
|
||||||
@@ -35,7 +32,7 @@ class HDRBrightnessPatch : BytecodePatch(
|
|||||||
|
|
||||||
val method = result.mutableMethod
|
val method = result.mutableMethod
|
||||||
|
|
||||||
//Get the index here so we know where to inject our code to override -1.0f
|
//Get the index here, so we know where to inject our code to override -1.0f
|
||||||
val index = method.implementation!!.instructions.indexOfFirst { ((it as? NarrowLiteralInstruction)?.narrowLiteral == (-1.0f).toRawBits()) }
|
val index = method.implementation!!.instructions.indexOfFirst { ((it as? NarrowLiteralInstruction)?.narrowLiteral == (-1.0f).toRawBits()) }
|
||||||
val register = (method.implementation!!.instructions.get(index) as OneRegisterInstruction).registerA
|
val register = (method.implementation!!.instructions.get(index) as OneRegisterInstruction).registerA
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import app.revanced.patches.youtube.misc.manifest.annotations.FixLocaleConfigErr
|
|||||||
import org.w3c.dom.Element
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
@Name("locale-config-fix")
|
@Name("locale-config-fix")
|
||||||
@Description("Fix an error when building the resources by patching the manifest file.")
|
@Description("Fixes an error when building the resources by patching the manifest file.")
|
||||||
@FixLocaleConfigErrorCompatibility
|
@FixLocaleConfigErrorCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class FixLocaleConfigErrorPatch : ResourcePatch() {
|
class FixLocaleConfigErrorPatch : ResourcePatch() {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import app.revanced.patcher.patch.impl.ResourcePatch
|
|||||||
import org.w3c.dom.Element
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
@Name("resource-id-mapping-provider-resource-patch-dependency")
|
@Name("resource-id-mapping-provider-resource-patch-dependency")
|
||||||
@Description("This patch acts as a provider/ dependency for resource mappings.")
|
@Description("Acts as a provider/dependency for resource mappings.")
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class ResourceIdMappingProviderResourcePatch : ResourcePatch() {
|
class ResourceIdMappingProviderResourcePatch : ResourcePatch() {
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import org.jf.dexlib2.immutable.reference.ImmutableStringReference
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
@Name("microg-support")
|
@Name("microg-support")
|
||||||
@Description("Patch to allow YouTube ReVanced to run without root and under a different package name.")
|
@Description("Allows YouTube ReVanced to run without root and under a different package name.")
|
||||||
@MicroGPatchCompatibility
|
@MicroGPatchCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class MicroGBytecodePatch : BytecodePatch(
|
class MicroGBytecodePatch : BytecodePatch(
|
||||||
@@ -168,4 +168,4 @@ class MicroGBytecodePatch : BytecodePatch(
|
|||||||
index, "const-string v$register, \"$REVANCED_PACKAGE_NAME\""
|
index, "const-string v$register, \"$REVANCED_PACKAGE_NAME\""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user