mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-09 19:03:55 +01:00
Compare commits
14 Commits
v4.3.0-dev
...
v4.4.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d71f23471 | ||
|
|
122ef68a4b | ||
|
|
b2a7a65bc0 | ||
|
|
32139f151b | ||
|
|
e55364ca87 | ||
|
|
5cca42121a | ||
|
|
7b0365360e | ||
|
|
7f8b7c08b2 | ||
|
|
058acff28c | ||
|
|
060b2c2323 | ||
|
|
bcce7bee9a | ||
|
|
d3f83230f8 | ||
|
|
0ad377bb4c | ||
|
|
9917ddd9c1 |
62
CHANGELOG.md
62
CHANGELOG.md
@@ -1,3 +1,65 @@
|
|||||||
|
# [4.4.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v4.4.0-dev.4...v4.4.0-dev.5) (2024-03-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube:** Support version `19.05`, `19.06`, `19.07`, `19.08` and `19.09` ([#2862](https://github.com/ReVanced/revanced-patches/issues/2862)) ([f044dde](https://github.com/ReVanced/revanced-patches/commit/f044dde054861ff16846a6be6287f86fa3afb3d8))
|
||||||
|
|
||||||
|
# [4.4.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v4.4.0-dev.3...v4.4.0-dev.4) (2024-03-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube :** Remove `HDR auto brightness` patch ([#2863](https://github.com/ReVanced/revanced-patches/issues/2863)) ([b4c7bf4](https://github.com/ReVanced/revanced-patches/commit/b4c7bf48084184e5f031f7f5139a9a29341d8ebf))
|
||||||
|
|
||||||
|
# [4.4.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v4.4.0-dev.2...v4.4.0-dev.3) (2024-03-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **YouTube - Downloads:** Use new task context ([#2841](https://github.com/ReVanced/revanced-patches/issues/2841)) ([6d88cb4](https://github.com/ReVanced/revanced-patches/commit/6d88cb49ec739700866290babcba5fb3032dbced))
|
||||||
|
|
||||||
|
# [4.4.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v4.4.0-dev.1...v4.4.0-dev.2) (2024-03-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube - External downloader:** Add ability to use in-app download button ([d900011](https://github.com/ReVanced/revanced-patches/commit/d9000113a905c14f8409aa75008f1ef6a1aecd0c))
|
||||||
|
|
||||||
|
# [4.4.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v4.3.0...v4.4.0-dev.1) (2024-03-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube Vanced:** Remove `Hide ads` patch ([87887e4](https://github.com/ReVanced/revanced-patches/commit/87887e4163dd9e242209f4d0fefb415f9bc7ca75))
|
||||||
|
|
||||||
|
# [4.3.0](https://github.com/ReVanced/revanced-patches/compare/v4.2.0...v4.3.0) (2024-03-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Compile DEX without debugging information ([f5df957](https://github.com/ReVanced/revanced-patches/commit/f5df9578669f71a67411bc93a25a7e8da43610d0))
|
||||||
|
* **Override certificate pinning:** Always overwrite with a generic network security configuration ([2a842a1](https://github.com/ReVanced/revanced-patches/commit/2a842a1e14e1993eb028ae0bd1a93e227bb929a6))
|
||||||
|
* Remove extra space from patch description ([#2780](https://github.com/ReVanced/revanced-patches/issues/2780)) ([96a3f35](https://github.com/ReVanced/revanced-patches/commit/96a3f359266ff8d16ae9ee3c6ce2f16ce67a3b93))
|
||||||
|
* Use deprecated members to ensure backwards compatibility ([083bd40](https://github.com/ReVanced/revanced-patches/commit/083bd4009231b9612394b4496ca1d329947d6577))
|
||||||
|
* **YouTube - Spoof app version:** Remove broken versions ([#2776](https://github.com/ReVanced/revanced-patches/issues/2776)) ([9466d97](https://github.com/ReVanced/revanced-patches/commit/9466d973c6d7a2891e3fa9f283107b64399152ea))
|
||||||
|
* **YouTube - Spoof signature:** Fix tracking such as history or watch time ([bcd8b48](https://github.com/ReVanced/revanced-patches/commit/bcd8b48e70693dac1bfcc0bf4971d6b526065b59))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **OpeningHours:** Add `Fix crash` patch ([#2697](https://github.com/ReVanced/revanced-patches/issues/2697)) ([0d011b8](https://github.com/ReVanced/revanced-patches/commit/0d011b876ecf05031a7daa54ab7e6d3506728a47))
|
||||||
|
* Remove unnecessary description from patch ([1a89dd9](https://github.com/ReVanced/revanced-patches/commit/1a89dd9f8cd0c614055a9da97338839b77a25ed1))
|
||||||
|
* **Sync for Reddit:** Add `Fix /s/ links` patch ([f15ef3f](https://github.com/ReVanced/revanced-patches/commit/f15ef3f63460254236185f8e22c9395db4db9465))
|
||||||
|
* **Twitter - Unlock downloads:** Unlock GIF downloads ([d0f91c8](https://github.com/ReVanced/revanced-patches/commit/d0f91c8550592723e1252e1af2971b508591dd59))
|
||||||
|
* **VSCO - Unlock pro:** Constrain to last working version ([6dd4a7c](https://github.com/ReVanced/revanced-patches/commit/6dd4a7c29e48c3bc517bbdd7ed160624c36c2333))
|
||||||
|
* **X:** Add `Open links as query` patch ([#2730](https://github.com/ReVanced/revanced-patches/issues/2730)) ([ba75a51](https://github.com/ReVanced/revanced-patches/commit/ba75a51b71dbb9157db230b3e97a90361019fe30))
|
||||||
|
* **YouTube - Change header:** Improve patch option description ([3b8bc08](https://github.com/ReVanced/revanced-patches/commit/3b8bc08d4ed3a3a0f96d2f476e5059840b9f9d9b))
|
||||||
|
* **YouTube - Change start page:** Add more start pages ([cc1d9b7](https://github.com/ReVanced/revanced-patches/commit/cc1d9b743633c619fb6acc428e884c1c9b53e10b))
|
||||||
|
* **YouTube - Custom branding:** Improve patch option description ([e27f56c](https://github.com/ReVanced/revanced-patches/commit/e27f56c8a34d41167b290f47280276c1c6003876))
|
||||||
|
* **YouTube - Spoof app version:** Add target versions ([#2787](https://github.com/ReVanced/revanced-patches/issues/2787)) ([83a7bd8](https://github.com/ReVanced/revanced-patches/commit/83a7bd8d69e62623fc4d2ba73d9fb49e92751d89))
|
||||||
|
* **YouTube:** Reorganize settings menu ([#2737](https://github.com/ReVanced/revanced-patches/issues/2737)) ([36132df](https://github.com/ReVanced/revanced-patches/commit/36132df4be6a04c08b6f3dd79de1bcea93a80fb8))
|
||||||
|
|
||||||
# [4.3.0-dev.13](https://github.com/ReVanced/revanced-patches/compare/v4.3.0-dev.12...v4.3.0-dev.13) (2024-03-02)
|
# [4.3.0-dev.13](https://github.com/ReVanced/revanced-patches/compare/v4.3.0-dev.12...v4.3.0-dev.13) (2024-03-02)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1194,8 +1194,8 @@ public final class app/revanced/patches/youtube/interaction/dialog/RemoveViewerD
|
|||||||
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
|
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/youtube/interaction/downloads/ExternalDownloadsBytecodePatch : app/revanced/patcher/patch/BytecodePatch {
|
public final class app/revanced/patches/youtube/interaction/downloads/DownloadsPatch : app/revanced/patcher/patch/BytecodePatch {
|
||||||
public static final field INSTANCE Lapp/revanced/patches/youtube/interaction/downloads/ExternalDownloadsBytecodePatch;
|
public static final field INSTANCE Lapp/revanced/patches/youtube/interaction/downloads/DownloadsPatch;
|
||||||
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
|
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||||
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
|
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
|
||||||
}
|
}
|
||||||
@@ -1748,6 +1748,7 @@ public final class app/revanced/util/BytecodeUtilsKt {
|
|||||||
public static final fun indexOfFirstInstruction (Lcom/android/tools/smali/dexlib2/iface/Method;Lkotlin/jvm/functions/Function1;)I
|
public static final fun indexOfFirstInstruction (Lcom/android/tools/smali/dexlib2/iface/Method;Lkotlin/jvm/functions/Function1;)I
|
||||||
public static final fun indexOfFirstWideLiteralInstructionValue (Lcom/android/tools/smali/dexlib2/iface/Method;J)I
|
public static final fun indexOfFirstWideLiteralInstructionValue (Lcom/android/tools/smali/dexlib2/iface/Method;J)I
|
||||||
public static final fun injectHideViewCall (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;IILjava/lang/String;Ljava/lang/String;)V
|
public static final fun injectHideViewCall (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;IILjava/lang/String;Ljava/lang/String;)V
|
||||||
|
public static final fun resultOrThrow (Lapp/revanced/patcher/fingerprint/MethodFingerprint;)Lapp/revanced/patcher/fingerprint/MethodFingerprintResult;
|
||||||
public static final fun returnEarly (Ljava/util/List;Z)V
|
public static final fun returnEarly (Ljava/util/List;Z)V
|
||||||
public static synthetic fun returnEarly$default (Ljava/util/List;ZILjava/lang/Object;)V
|
public static synthetic fun returnEarly$default (Ljava/util/List;ZILjava/lang/Object;)V
|
||||||
public static final fun transformMethods (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableClass;Lkotlin/jvm/functions/Function1;)V
|
public static final fun transformMethods (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableClass;Lkotlin/jvm/functions/Function1;)V
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import org.gradle.kotlin.dsl.support.listFilesOrdered
|
import org.gradle.kotlin.dsl.support.listFilesOrdered
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.kotlin)
|
alias(libs.plugins.kotlin)
|
||||||
@@ -33,7 +34,13 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvmToolchain(11)
|
compilerOptions {
|
||||||
|
jvmTarget.set(JvmTarget.JVM_11)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
org.gradle.parallel = true
|
org.gradle.parallel = true
|
||||||
org.gradle.caching = true
|
org.gradle.caching = true
|
||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 4.3.0-dev.13
|
version = 4.4.0-dev.5
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[versions]
|
[versions]
|
||||||
revanced-patcher = "19.3.1"
|
revanced-patcher = "19.3.1"
|
||||||
smali = "3.0.4"
|
smali = "3.0.5"
|
||||||
guava = "33.0.0-jre"
|
guava = "33.0.0-jre"
|
||||||
gson = "2.10.1"
|
gson = "2.10.1"
|
||||||
binary-compatibility-validator = "0.14.0"
|
binary-compatibility-validator = "0.14.0"
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ abstract class BaseIntegrationsPatch(
|
|||||||
|
|
||||||
method.addInstruction(
|
method.addInstruction(
|
||||||
0,
|
0,
|
||||||
"sput-object v$contextRegister, " +
|
"invoke-static/range { v$contextRegister .. v$contextRegister }, " +
|
||||||
"$integrationsDescriptor->context:Landroid/content/Context;",
|
"$integrationsDescriptor->setContext(Landroid/content/Context;)V",
|
||||||
)
|
)
|
||||||
} ?: throw PatchException("Could not find hook target fingerprint.")
|
} ?: throw PatchException("Could not find hook target fingerprint.")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,9 +36,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37",
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -30,9 +30,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -35,9 +35,13 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -23,9 +23,13 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37",
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -39,7 +43,6 @@ object CopyVideoUrlBytecodePatch : BytecodePatch(emptySet()) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
// Initialize buttons and inject visibility control
|
|
||||||
BUTTONS_DESCRIPTORS.forEach { descriptor ->
|
BUTTONS_DESCRIPTORS.forEach { descriptor ->
|
||||||
PlayerControlsBytecodePatch.initializeControl("$descriptor->initializeButton(Landroid/view/View;)V")
|
PlayerControlsBytecodePatch.initializeControl("$descriptor->initializeButton(Landroid/view/View;)V")
|
||||||
PlayerControlsBytecodePatch.injectVisibilityCheckCall("$descriptor->changeVisibility(Z)V")
|
PlayerControlsBytecodePatch.injectVisibilityCheckCall("$descriptor->changeVisibility(Z)V")
|
||||||
|
|||||||
@@ -32,9 +32,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package app.revanced.patches.youtube.interaction.downloads
|
||||||
|
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||||
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
|
import app.revanced.patches.youtube.interaction.downloads.fingerprints.DownloadActionCommandResolverFingerprint
|
||||||
|
import app.revanced.patches.youtube.interaction.downloads.fingerprints.DownloadActionCommandResolverParentFingerprint
|
||||||
|
import app.revanced.patches.youtube.interaction.downloads.fingerprints.LegacyDownloadCommandResolverFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.playercontrols.PlayerControlsBytecodePatch
|
||||||
|
import app.revanced.patches.youtube.shared.fingerprints.MainActivityFingerprint
|
||||||
|
import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
||||||
|
import app.revanced.util.resultOrThrow
|
||||||
|
|
||||||
|
@Patch(
|
||||||
|
name = "Downloads",
|
||||||
|
description = "Adds support to download videos with an external downloader app" +
|
||||||
|
"using the in-app download button or a video player action button.",
|
||||||
|
dependencies = [
|
||||||
|
DownloadsResourcePatch::class,
|
||||||
|
PlayerControlsBytecodePatch::class,
|
||||||
|
VideoInformationPatch::class,
|
||||||
|
],
|
||||||
|
compatiblePackages = [
|
||||||
|
CompatiblePackage(
|
||||||
|
"com.google.android.youtube",
|
||||||
|
[
|
||||||
|
"18.48.39",
|
||||||
|
"18.49.37",
|
||||||
|
"19.01.34",
|
||||||
|
"19.02.39",
|
||||||
|
"19.03.36",
|
||||||
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
@Suppress("unused")
|
||||||
|
object DownloadsPatch : BytecodePatch(
|
||||||
|
setOf(
|
||||||
|
DownloadActionCommandResolverParentFingerprint,
|
||||||
|
LegacyDownloadCommandResolverFingerprint,
|
||||||
|
MainActivityFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/DownloadsPatch;"
|
||||||
|
private const val BUTTON_DESCRIPTOR = "Lapp/revanced/integrations/youtube/videoplayer/ExternalDownloadButton;"
|
||||||
|
|
||||||
|
override fun execute(context: BytecodeContext) {
|
||||||
|
PlayerControlsBytecodePatch.initializeControl("$BUTTON_DESCRIPTOR->initializeButton(Landroid/view/View;)V")
|
||||||
|
PlayerControlsBytecodePatch.injectVisibilityCheckCall("$BUTTON_DESCRIPTOR->changeVisibility(Z)V")
|
||||||
|
|
||||||
|
// Main activity is used to launch downloader intent.
|
||||||
|
MainActivityFingerprint.resultOrThrow().mutableMethod.apply {
|
||||||
|
addInstruction(
|
||||||
|
implementation!!.instructions.lastIndex,
|
||||||
|
"invoke-static { p0 }, $INTEGRATIONS_CLASS_DESCRIPTOR->activityCreated(Landroid/app/Activity;)V"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
val commonInstructions = """
|
||||||
|
move-result v0
|
||||||
|
if-eqz v0, :show_native_downloader
|
||||||
|
return-void
|
||||||
|
:show_native_downloader
|
||||||
|
nop
|
||||||
|
"""
|
||||||
|
|
||||||
|
DownloadActionCommandResolverFingerprint.resolve(context,
|
||||||
|
DownloadActionCommandResolverParentFingerprint.resultOrThrow().classDef)
|
||||||
|
DownloadActionCommandResolverFingerprint.resultOrThrow().mutableMethod.apply {
|
||||||
|
addInstructionsWithLabels(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->inAppDownloadButtonOnClick()Z
|
||||||
|
$commonInstructions
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Legacy fingerprint is used for old spoofed versions,
|
||||||
|
// or if download playlist is pressed on any version.
|
||||||
|
// Downloading playlists is not yet supported,
|
||||||
|
// as the code this hooks does not easily expost the playlist id.
|
||||||
|
LegacyDownloadCommandResolverFingerprint.resultOrThrow().mutableMethod.apply {
|
||||||
|
addInstructionsWithLabels(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
invoke-static/range {p1 .. p1}, $INTEGRATIONS_CLASS_DESCRIPTOR->inAppDownloadPlaylistLegacyOnClick(Ljava/lang/String;)Z
|
||||||
|
$commonInstructions
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@ import app.revanced.util.copyResources
|
|||||||
AddResourcesPatch::class,
|
AddResourcesPatch::class,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
internal object ExternalDownloadsResourcePatch : ResourcePatch() {
|
internal object DownloadsResourcePatch : ResourcePatch() {
|
||||||
override fun execute(context: ResourceContext) {
|
override fun execute(context: ResourceContext) {
|
||||||
AddResourcesPatch(this::class)
|
AddResourcesPatch(this::class)
|
||||||
|
|
||||||
@@ -31,6 +31,7 @@ internal object ExternalDownloadsResourcePatch : ResourcePatch() {
|
|||||||
sorting = Sorting.UNSORTED,
|
sorting = Sorting.UNSORTED,
|
||||||
preferences = setOf(
|
preferences = setOf(
|
||||||
SwitchPreference("revanced_external_downloader"),
|
SwitchPreference("revanced_external_downloader"),
|
||||||
|
SwitchPreference("revanced_external_downloader_action_button"),
|
||||||
TextPreference("revanced_external_downloader_name", inputType = InputType.TEXT),
|
TextPreference("revanced_external_downloader_name", inputType = InputType.TEXT),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.interaction.downloads
|
|
||||||
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
|
||||||
import app.revanced.patcher.patch.annotation.Patch
|
|
||||||
import app.revanced.patches.youtube.misc.playercontrols.PlayerControlsBytecodePatch
|
|
||||||
import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
|
||||||
|
|
||||||
@Patch(
|
|
||||||
name = "External downloads",
|
|
||||||
description = "Adds support to download and save YouTube videos using an external downloader app.",
|
|
||||||
dependencies = [
|
|
||||||
ExternalDownloadsResourcePatch::class,
|
|
||||||
PlayerControlsBytecodePatch::class,
|
|
||||||
VideoInformationPatch::class,
|
|
||||||
],
|
|
||||||
compatiblePackages = [
|
|
||||||
CompatiblePackage(
|
|
||||||
"com.google.android.youtube",
|
|
||||||
[
|
|
||||||
"18.48.39",
|
|
||||||
"18.49.37",
|
|
||||||
"19.01.34",
|
|
||||||
"19.02.39",
|
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
|
||||||
"19.04.37",
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
@Suppress("unused")
|
|
||||||
object ExternalDownloadsBytecodePatch : BytecodePatch(emptySet()) {
|
|
||||||
private const val BUTTON_DESCRIPTOR = "Lapp/revanced/integrations/youtube/videoplayer/ExternalDownloadButton;"
|
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext) {
|
|
||||||
/*
|
|
||||||
initialize the control
|
|
||||||
*/
|
|
||||||
|
|
||||||
PlayerControlsBytecodePatch.initializeControl(
|
|
||||||
"$BUTTON_DESCRIPTOR->initializeButton(Landroid/view/View;)V",
|
|
||||||
)
|
|
||||||
|
|
||||||
/*
|
|
||||||
add code to change the visibility of the control
|
|
||||||
*/
|
|
||||||
|
|
||||||
PlayerControlsBytecodePatch.injectVisibilityCheckCall(
|
|
||||||
"$BUTTON_DESCRIPTOR->changeVisibility(Z)V",
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package app.revanced.patches.youtube.interaction.downloads.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves to the class found in [DownloadActionCommandResolverParentFingerprint].
|
||||||
|
*/
|
||||||
|
internal object DownloadActionCommandResolverFingerprint : MethodFingerprint(
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
returnType = "V",
|
||||||
|
parameters = listOf("L", "Ljava/util/Map;")
|
||||||
|
)
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package app.revanced.patches.youtube.interaction.downloads.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.util.patch.LiteralValueFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
internal object DownloadActionCommandResolverParentFingerprint : LiteralValueFingerprint(
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
returnType = "V",
|
||||||
|
parameters = listOf("L", "L"),
|
||||||
|
strings = listOf(
|
||||||
|
// Strings are not unique and found in other methods.
|
||||||
|
"com.google.android.libraries.youtube.logging.interaction_logger",
|
||||||
|
"Unknown command"
|
||||||
|
),
|
||||||
|
literalSupplier = { 16 }
|
||||||
|
)
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package app.revanced.patches.youtube.interaction.downloads.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For spoofing to older versions. Also called if download playlist is pressed for any version.
|
||||||
|
*/
|
||||||
|
internal object LegacyDownloadCommandResolverFingerprint : MethodFingerprint(
|
||||||
|
accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL,
|
||||||
|
returnType = "V",
|
||||||
|
parameters = listOf("Ljava/lang/String;", "Ljava/lang/String;", "L", "L"),
|
||||||
|
strings = listOf(""),
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.MOVE_OBJECT_FROM16,
|
||||||
|
Opcode.MOVE_OBJECT_FROM16,
|
||||||
|
Opcode.NEW_INSTANCE,
|
||||||
|
Opcode.INVOKE_DIRECT,
|
||||||
|
Opcode.IGET_OBJECT,
|
||||||
|
Opcode.IF_NEZ,
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -32,9 +32,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -34,9 +34,13 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -30,9 +30,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -36,9 +36,13 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -34,9 +34,13 @@ import app.revanced.util.exception
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -33,9 +33,13 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -43,9 +43,13 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -34,9 +34,13 @@ import com.android.tools.smali.dexlib2.Opcode
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -41,9 +41,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37",
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -38,9 +38,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -32,9 +32,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -32,9 +32,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -32,9 +32,13 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -32,9 +32,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -35,9 +35,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -32,9 +32,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -28,9 +28,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -28,9 +28,13 @@ import app.revanced.util.exception
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -48,9 +48,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37",
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -39,9 +39,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -28,9 +28,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -33,9 +33,13 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -30,9 +30,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -35,9 +35,13 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -40,9 +40,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -27,9 +27,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -28,9 +28,13 @@ import app.revanced.util.exception
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -29,9 +29,13 @@ import app.revanced.util.exception
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -24,9 +24,13 @@ import org.w3c.dom.Element
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37",
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import app.revanced.patches.youtube.video.videoid.VideoIdPatch
|
|||||||
import app.revanced.util.exception
|
import app.revanced.util.exception
|
||||||
import app.revanced.util.getReference
|
import app.revanced.util.getReference
|
||||||
import app.revanced.util.indexOfFirstInstruction
|
import app.revanced.util.indexOfFirstInstruction
|
||||||
|
import app.revanced.util.resultOrThrow
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
@@ -57,9 +58,13 @@ import com.android.tools.smali.dexlib2.iface.reference.TypeReference
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
@@ -88,8 +93,6 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
|||||||
private const val FILTER_CLASS_DESCRIPTOR =
|
private const val FILTER_CLASS_DESCRIPTOR =
|
||||||
"Lapp/revanced/integrations/youtube/patches/components/ReturnYouTubeDislikeFilterPatch;"
|
"Lapp/revanced/integrations/youtube/patches/components/ReturnYouTubeDislikeFilterPatch;"
|
||||||
|
|
||||||
private fun MethodFingerprint.resultOrThrow() = result ?: throw exception
|
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
// region Inject newVideoLoaded event handler to update dislikes when a new video is loaded.
|
// region Inject newVideoLoaded event handler to update dislikes when a new video is loaded.
|
||||||
|
|
||||||
|
|||||||
@@ -33,9 +33,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -29,9 +29,13 @@ import app.revanced.util.exception
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -42,9 +42,13 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -32,9 +32,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -38,9 +38,13 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -37,9 +37,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -41,9 +41,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import app.revanced.patches.youtube.layout.thumbnails.fingerprints.cronet.reques
|
|||||||
import app.revanced.patches.youtube.layout.thumbnails.fingerprints.cronet.request.callback.OnSucceededFingerprint
|
import app.revanced.patches.youtube.layout.thumbnails.fingerprints.cronet.request.callback.OnSucceededFingerprint
|
||||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||||
import app.revanced.util.exception
|
import app.revanced.util.resultOrThrow
|
||||||
import com.android.tools.smali.dexlib2.AccessFlags
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation
|
import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation
|
||||||
@@ -53,9 +53,13 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37",
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -144,11 +148,8 @@ object AlternativeThumbnailsPatch : BytecodePatch(
|
|||||||
NonInteractivePreference("revanced_alt_thumbnail_stills_about"),
|
NonInteractivePreference("revanced_alt_thumbnail_stills_about"),
|
||||||
)
|
)
|
||||||
|
|
||||||
fun MethodFingerprint.getResultOrThrow() =
|
|
||||||
result ?: throw exception
|
|
||||||
|
|
||||||
fun MethodFingerprint.alsoResolve(fingerprint: MethodFingerprint) =
|
fun MethodFingerprint.alsoResolve(fingerprint: MethodFingerprint) =
|
||||||
also { resolve(context, fingerprint.getResultOrThrow().classDef) }.getResultOrThrow()
|
also { resolve(context, fingerprint.resultOrThrow().classDef) }.resultOrThrow()
|
||||||
|
|
||||||
fun MethodFingerprint.resolveAndLetMutableMethod(
|
fun MethodFingerprint.resolveAndLetMutableMethod(
|
||||||
fingerprint: MethodFingerprint,
|
fingerprint: MethodFingerprint,
|
||||||
@@ -172,7 +173,7 @@ object AlternativeThumbnailsPatch : BytecodePatch(
|
|||||||
|
|
||||||
// The URL is required for the failure callback hook, but the URL field is obfuscated.
|
// The URL is required for the failure callback hook, but the URL field is obfuscated.
|
||||||
// Add a helper get method that returns the URL field.
|
// Add a helper get method that returns the URL field.
|
||||||
RequestFingerprint.getResultOrThrow().apply {
|
RequestFingerprint.resultOrThrow().apply {
|
||||||
// The url is the only string field that is set inside the constructor.
|
// The url is the only string field that is set inside the constructor.
|
||||||
val urlFieldInstruction = mutableMethod.getInstructions().first {
|
val urlFieldInstruction = mutableMethod.getInstructions().first {
|
||||||
if (it.opcode != Opcode.IPUT_OBJECT) return@first false
|
if (it.opcode != Opcode.IPUT_OBJECT) return@first false
|
||||||
|
|||||||
@@ -33,9 +33,13 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -28,9 +28,13 @@ import app.revanced.util.exception
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -21,9 +21,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -38,9 +38,13 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch(
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -30,9 +30,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -34,9 +34,13 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -10,14 +10,20 @@ import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchException
|
||||||
import app.revanced.patcher.patch.annotation.Patch
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
import app.revanced.patcher.util.smali.ExternalLabel
|
import app.revanced.patcher.util.smali.ExternalLabel
|
||||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.litho.filter.fingerprints.*
|
import app.revanced.patches.youtube.misc.litho.filter.fingerprints.*
|
||||||
|
import app.revanced.util.getReference
|
||||||
|
import app.revanced.util.indexOfFirstInstruction
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.Instruction
|
import com.android.tools.smali.dexlib2.iface.instruction.Instruction
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||||
|
import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
||||||
|
import com.android.tools.smali.dexlib2.iface.reference.TypeReference
|
||||||
import java.io.Closeable
|
import java.io.Closeable
|
||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
@@ -102,7 +108,11 @@ object LithoFilterPatch : BytecodePatch(
|
|||||||
val emptyComponentFieldIndex = builderMethodIndex + 2
|
val emptyComponentFieldIndex = builderMethodIndex + 2
|
||||||
|
|
||||||
bytesToComponentContextMethod.mutableMethod.apply {
|
bytesToComponentContextMethod.mutableMethod.apply {
|
||||||
val insertHookIndex = bytesToComponentContextMethod.scanResult.patternScanResult!!.endIndex + 1
|
val insertHookIndex = indexOfFirstInstruction {
|
||||||
|
opcode == Opcode.IPUT_OBJECT &&
|
||||||
|
getReference<FieldReference>()?.type == "Ljava/lang/StringBuilder;"
|
||||||
|
} + 1
|
||||||
|
if (insertHookIndex <= 0) throw PatchException("Could not find insert index")
|
||||||
|
|
||||||
// region Get free registers that this patch uses.
|
// region Get free registers that this patch uses.
|
||||||
// Registers are overwritten right after they are used in this patch, therefore free to clobber.
|
// Registers are overwritten right after they are used in this patch, therefore free to clobber.
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
package app.revanced.patches.youtube.misc.litho.filter.fingerprints
|
package app.revanced.patches.youtube.misc.litho.filter.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
|
||||||
|
|
||||||
internal object ComponentContextParserFingerprint : MethodFingerprint(
|
internal object ComponentContextParserFingerprint : MethodFingerprint(
|
||||||
opcodes = listOf(
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.IPUT_OBJECT,
|
|
||||||
),
|
|
||||||
strings = listOf("Component was not found %s because it was removed due to duplicate converter bindings.")
|
strings = listOf("Component was not found %s because it was removed due to duplicate converter bindings.")
|
||||||
)
|
)
|
||||||
@@ -39,9 +39,13 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -3,30 +3,31 @@ package app.revanced.patches.youtube.misc.playeroverlay
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
|
||||||
import app.revanced.patcher.patch.annotation.Patch
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.playeroverlay.fingerprint.PlayerOverlaysOnFinishInflateFingerprint
|
import app.revanced.patches.youtube.misc.playeroverlay.fingerprint.PlayerOverlaysOnFinishInflateFingerprint
|
||||||
|
import app.revanced.util.exception
|
||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
description = "Hook for adding custom overlays to the video player.",
|
description = "Hook for the video player overlay",
|
||||||
dependencies = [IntegrationsPatch::class],
|
dependencies = [IntegrationsPatch::class],
|
||||||
compatiblePackages = [
|
|
||||||
CompatiblePackage("com.google.android.youtube", [
|
|
||||||
"18.32.39"
|
|
||||||
])
|
|
||||||
]
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit: This patch is not in use and may not work.
|
||||||
|
*/
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
object PlayerOverlaysHookPatch : BytecodePatch( // TODO: delete this unused outdated patch and its integration code.
|
object PlayerOverlaysHookPatch : BytecodePatch(
|
||||||
setOf(PlayerOverlaysOnFinishInflateFingerprint)
|
setOf(PlayerOverlaysOnFinishInflateFingerprint)
|
||||||
) {
|
) {
|
||||||
|
private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/PlayerOverlaysHookPatch;"
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
// hook YouTubePlayerOverlaysLayout.onFinishInflate()
|
PlayerOverlaysOnFinishInflateFingerprint.result?.mutableMethod?.apply {
|
||||||
val method = PlayerOverlaysOnFinishInflateFingerprint.result!!.mutableMethod
|
addInstruction(
|
||||||
method.addInstruction(
|
implementation!!.instructions.lastIndex,
|
||||||
method.implementation!!.instructions.size - 2,
|
"invoke-static { p0 }, $INTEGRATIONS_CLASS_DESCRIPTOR->playerOverlayInflated(Landroid/view/ViewGroup;)V"
|
||||||
"invoke-static { p0 }, Lapp/revanced/integrations/youtube/patches/PlayerOverlaysHookPatch;->YouTubePlayerOverlaysLayout_onFinishInflateHook(Ljava/lang/Object;)V"
|
)
|
||||||
)
|
} ?: throw PlayerOverlaysOnFinishInflateFingerprint.exception
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,14 @@
|
|||||||
package app.revanced.patches.youtube.misc.playeroverlay.fingerprint
|
package app.revanced.patches.youtube.misc.playeroverlay.fingerprint
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
|
||||||
internal object PlayerOverlaysOnFinishInflateFingerprint : MethodFingerprint(
|
internal object PlayerOverlaysOnFinishInflateFingerprint : MethodFingerprint(
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
returnType = "V",
|
||||||
customFingerprint = { methodDef, _ ->
|
customFingerprint = { methodDef, _ ->
|
||||||
methodDef.definingClass.endsWith("YouTubePlayerOverlaysLayout;") && methodDef.name == "onFinishInflate"
|
methodDef.definingClass.endsWith("/YouTubePlayerOverlaysLayout;")
|
||||||
}
|
&& methodDef.name == "onFinishInflate"
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -35,9 +35,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -10,17 +10,19 @@ import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
|||||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||||
import app.revanced.patches.youtube.video.hdrbrightness.fingerprints.HDRBrightnessFingerprint
|
import app.revanced.patches.youtube.video.hdrbrightness.fingerprints.HDRBrightnessFingerprint
|
||||||
|
import app.revanced.util.exception
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||||
import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
||||||
|
|
||||||
|
@Deprecated("Patch is obsolete and the hooked code is no longer present in 19.09+")
|
||||||
@Patch(
|
@Patch(
|
||||||
name = "HDR auto brightness",
|
|
||||||
description = "Adds an option to make the brightness of HDR videos follow the system default.",
|
description = "Adds an option to make the brightness of HDR videos follow the system default.",
|
||||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||||
compatiblePackages = [
|
compatiblePackages = [
|
||||||
CompatiblePackage(
|
CompatiblePackage(
|
||||||
"com.google.android.youtube", [
|
"com.google.android.youtube",
|
||||||
|
[
|
||||||
"18.32.39",
|
"18.32.39",
|
||||||
"18.37.36",
|
"18.37.36",
|
||||||
"18.38.44",
|
"18.38.44",
|
||||||
@@ -31,41 +33,49 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
// 19.09+ is dramatically different and the patched code is not present.
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
object HDRBrightnessPatch : BytecodePatch(
|
object HDRBrightnessPatch : BytecodePatch(
|
||||||
setOf(HDRBrightnessFingerprint)
|
setOf(HDRBrightnessFingerprint),
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
AddResourcesPatch(this::class)
|
AddResourcesPatch(this::class)
|
||||||
|
|
||||||
|
if (HDRBrightnessFingerprint.result == null) throw HDRBrightnessFingerprint.exception
|
||||||
|
|
||||||
SettingsPatch.PreferenceScreen.VIDEO.addPreferences(
|
SettingsPatch.PreferenceScreen.VIDEO.addPreferences(
|
||||||
SwitchPreference("revanced_hdr_auto_brightness")
|
SwitchPreference("revanced_hdr_auto_brightness"),
|
||||||
)
|
)
|
||||||
|
|
||||||
val method = HDRBrightnessFingerprint.result!!.mutableMethod
|
// FIXME
|
||||||
|
// One of the changes made here effectively does nothing:
|
||||||
method.implementation!!.instructions.filter { instruction ->
|
// It calls getHDRBrightness() and ignores the results.
|
||||||
val fieldReference = (instruction as? ReferenceInstruction)?.reference as? FieldReference
|
HDRBrightnessFingerprint.result?.mutableMethod?.apply {
|
||||||
fieldReference?.let { it.name == "screenBrightness" } == true
|
implementation!!.instructions.filter { instruction ->
|
||||||
}.forEach { instruction ->
|
((instruction as? ReferenceInstruction)?.reference as? FieldReference)
|
||||||
val brightnessRegisterIndex = method.implementation!!.instructions.indexOf(instruction)
|
?.name == "screenBrightness"
|
||||||
val register = (instruction as TwoRegisterInstruction).registerA
|
}.forEach { instruction ->
|
||||||
|
val brightnessRegisterIndex = implementation!!.instructions.indexOf(instruction)
|
||||||
val insertIndex = brightnessRegisterIndex + 1
|
val register = (instruction as TwoRegisterInstruction).registerA
|
||||||
method.addInstructions(
|
val insertIndex = brightnessRegisterIndex + 1
|
||||||
insertIndex,
|
addInstructions(
|
||||||
"""
|
insertIndex,
|
||||||
invoke-static {v$register}, Lapp/revanced/integrations/youtube/patches/HDRAutoBrightnessPatch;->getHDRBrightness(F)F
|
"""
|
||||||
move-result v$register
|
invoke-static {v$register}, Lapp/revanced/integrations/youtube/patches/HDRAutoBrightnessPatch;->getHDRBrightness(F)F
|
||||||
"""
|
move-result v$register
|
||||||
)
|
""",
|
||||||
}
|
)
|
||||||
|
}
|
||||||
|
} ?: throw HDRBrightnessFingerprint.exception
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,9 +39,13 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -19,9 +19,13 @@ import app.revanced.patches.youtube.video.speed.remember.RememberPlaybackSpeedPa
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37",
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -35,9 +35,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.49.37",
|
"18.49.37",
|
||||||
"19.01.34",
|
"19.01.34",
|
||||||
"19.02.39",
|
"19.02.39",
|
||||||
"19.03.35",
|
|
||||||
"19.03.36",
|
"19.03.36",
|
||||||
"19.04.37"
|
"19.04.38",
|
||||||
|
"19.05.36",
|
||||||
|
"19.06.39",
|
||||||
|
"19.07.40",
|
||||||
|
"19.08.36",
|
||||||
|
"19.09.37"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package app.revanced.patches.youtubevanced.ad.general
|
package app.revanced.patches.youtubevanced.ad.general
|
||||||
|
|
||||||
import app.revanced.util.exception
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
@@ -9,17 +8,19 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
|
|||||||
import app.revanced.patcher.patch.annotation.Patch
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
import app.revanced.patches.shared.misc.fix.verticalscroll.VerticalScrollPatch
|
import app.revanced.patches.shared.misc.fix.verticalscroll.VerticalScrollPatch
|
||||||
import app.revanced.patches.youtubevanced.ad.general.fingerprints.ContainsAdFingerprint
|
import app.revanced.patches.youtubevanced.ad.general.fingerprints.ContainsAdFingerprint
|
||||||
|
import app.revanced.util.exception
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c
|
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c
|
||||||
|
|
||||||
|
@Deprecated("This patch is going to be removed in the future.")
|
||||||
@Patch(
|
@Patch(
|
||||||
name = "Hide ads",
|
|
||||||
description = "Removes general ads.",
|
description = "Removes general ads.",
|
||||||
dependencies = [VerticalScrollPatch::class],
|
dependencies = [VerticalScrollPatch::class],
|
||||||
compatiblePackages = [CompatiblePackage("com.vanced.android.youtube")]
|
compatiblePackages = [CompatiblePackage("com.vanced.android.youtube")],
|
||||||
|
use = false,
|
||||||
)
|
)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
object HideAdsPatch : BytecodePatch(
|
object HideAdsPatch : BytecodePatch(
|
||||||
setOf(ContainsAdFingerprint)
|
setOf(ContainsAdFingerprint),
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
ContainsAdFingerprint.result?.let { result ->
|
ContainsAdFingerprint.result?.let { result ->
|
||||||
@@ -40,14 +41,14 @@ object HideAdsPatch : BytecodePatch(
|
|||||||
"hero_promo_image",
|
"hero_promo_image",
|
||||||
"statement_banner",
|
"statement_banner",
|
||||||
"primetime_promo",
|
"primetime_promo",
|
||||||
"carousel_footered_layout"
|
"carousel_footered_layout",
|
||||||
).forEach { component ->
|
).forEach { component ->
|
||||||
addInstructions(
|
addInstructions(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
"""
|
"""
|
||||||
const-string v$adsListRegister, "$component"
|
const-string v$adsListRegister, "$component"
|
||||||
invoke-interface {v0, v$adsListRegister}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
invoke-interface {v0, v$adsListRegister}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
||||||
"""
|
""",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.WideLiteralInstruction
|
|||||||
import com.android.tools.smali.dexlib2.iface.reference.Reference
|
import com.android.tools.smali.dexlib2.iface.reference.Reference
|
||||||
import com.android.tools.smali.dexlib2.util.MethodUtil
|
import com.android.tools.smali.dexlib2.util.MethodUtil
|
||||||
|
|
||||||
|
|
||||||
|
fun MethodFingerprint.resultOrThrow() = result ?: throw exception
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The [PatchException] of failing to resolve a [MethodFingerprint].
|
* The [PatchException] of failing to resolve a [MethodFingerprint].
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -226,12 +226,15 @@
|
|||||||
<string name="revanced_remove_viewer_discretion_dialog_summary_off">Dialog will be shown</string>
|
<string name="revanced_remove_viewer_discretion_dialog_summary_off">Dialog will be shown</string>
|
||||||
<string name="revanced_remove_viewer_discretion_dialog_user_dialog_message">This does not bypass the age restriction. It just accepts it automatically.</string>
|
<string name="revanced_remove_viewer_discretion_dialog_user_dialog_message">This does not bypass the age restriction. It just accepts it automatically.</string>
|
||||||
</patch>
|
</patch>
|
||||||
<patch id="interaction.downloads.ExternalDownloadsResourcePatch">
|
<patch id="interaction.downloads.DownloadsResourcePatch">
|
||||||
<string name="revanced_external_downloader_screen_title">External downloads</string>
|
<string name="revanced_external_downloader_screen_title">External downloads</string>
|
||||||
<string name="revanced_external_downloader_screen_summary">Settings for using an external downloader</string>
|
<string name="revanced_external_downloader_screen_summary">Settings for using an external downloader</string>
|
||||||
<string name="revanced_external_downloader_title">Show external download button</string>
|
<string name="revanced_external_downloader_title">Show external download button</string>
|
||||||
<string name="revanced_external_downloader_summary_on">Download button shown in player</string>
|
<string name="revanced_external_downloader_summary_on">Download button shown in player</string>
|
||||||
<string name="revanced_external_downloader_summary_off">Download button not shown in player</string>
|
<string name="revanced_external_downloader_summary_off">Download button not shown in player</string>
|
||||||
|
<string name="revanced_external_downloader_action_button_title">Override download action button</string>
|
||||||
|
<string name="revanced_external_downloader_action_button_summary_on">Download button opens your external downloader</string>
|
||||||
|
<string name="revanced_external_downloader_action_button_summary_off">Download button opens the native in-app downloader</string>
|
||||||
<string name="revanced_external_downloader_name_title">Downloader package name</string>
|
<string name="revanced_external_downloader_name_title">Downloader package name</string>
|
||||||
<string name="revanced_external_downloader_name_summary">Package name of your installed external downloader app, such as NewPipe or Seal</string>
|
<string name="revanced_external_downloader_name_summary">Package name of your installed external downloader app, such as NewPipe or Seal</string>
|
||||||
<string name="revanced_external_downloader_not_installed_warning">%s is not installed. Please install it.</string>
|
<string name="revanced_external_downloader_not_installed_warning">%s is not installed. Please install it.</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user