mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-08 18:33:57 +01:00
Compare commits
25 Commits
v2.191.0-d
...
v2.191.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7383bdf67 | ||
|
|
01e36428a0 | ||
|
|
187c1eb14a | ||
|
|
acadac3049 | ||
|
|
bf5c197eb8 | ||
|
|
73e8b3f81b | ||
|
|
1c2f499b1c | ||
|
|
32599ab13d | ||
|
|
19519d1d06 | ||
|
|
2ff70e8b8f | ||
|
|
1e21b0b572 | ||
|
|
18180745bc | ||
|
|
aa89b8d20c | ||
|
|
287648cf1e | ||
|
|
c4554b3564 | ||
|
|
1532d899b4 | ||
|
|
8ac18e6e23 | ||
|
|
54aa358b9f | ||
|
|
147d0eef34 | ||
|
|
fb60603782 | ||
|
|
18a2a4ceb4 | ||
|
|
7d822ddbec | ||
|
|
e74e65364a | ||
|
|
ef241671bd | ||
|
|
096fc12123 |
2
.github/workflows/pull_request.yml
vendored
2
.github/workflows/pull_request.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Open pull request
|
- name: Open pull request
|
||||||
uses: repo-sync/pull-request@v2
|
uses: repo-sync/pull-request@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
# Make sure the release step uses its own credentials:
|
# Make sure the release step uses its own credentials:
|
||||||
# https://github.com/cycjimmy/semantic-release-action#private-packages
|
# https://github.com/cycjimmy/semantic-release-action#private-packages
|
||||||
|
|||||||
77
CHANGELOG.md
77
CHANGELOG.md
@@ -1,3 +1,80 @@
|
|||||||
|
# [2.191.0-dev.19](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.18...v2.191.0-dev.19) (2023-09-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube:** Add `Bypass URL redirects` patch ([125cac5](https://github.com/ReVanced/revanced-patches/commit/125cac5928c9b71d35253f1fd7651f4a30e15529))
|
||||||
|
|
||||||
|
# [2.191.0-dev.18](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.17...v2.191.0-dev.18) (2023-09-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube - Premium heading:** Allow using default heading ([#3029](https://github.com/ReVanced/revanced-patches/issues/3029)) ([d5ab35a](https://github.com/ReVanced/revanced-patches/commit/d5ab35a444523baa0586fcb9513d6ae4f2518946))
|
||||||
|
|
||||||
|
# [2.191.0-dev.17](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.16...v2.191.0-dev.17) (2023-09-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube:** Bump compatibility to `18.37.36` ([#3028](https://github.com/ReVanced/revanced-patches/issues/3028)) ([eda28e5](https://github.com/ReVanced/revanced-patches/commit/eda28e507e7fb5171eeb15a5a0532929ee611211))
|
||||||
|
|
||||||
|
# [2.191.0-dev.16](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.15...v2.191.0-dev.16) (2023-09-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **YouTube - Hide info cards:** Fix info cards not hiding for some users ([#3039](https://github.com/ReVanced/revanced-patches/issues/3039)) ([cb38637](https://github.com/ReVanced/revanced-patches/commit/cb38637e6be968d54561a1e0466b9259dbf0b4ee))
|
||||||
|
|
||||||
|
# [2.191.0-dev.15](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.14...v2.191.0-dev.15) (2023-09-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **YouTube - Client spoof:** adjust settings text ([#3035](https://github.com/ReVanced/revanced-patches/issues/3035)) ([59a2e96](https://github.com/ReVanced/revanced-patches/commit/59a2e9617fc4f898e87cefeb3d2c6996b925fa90))
|
||||||
|
|
||||||
|
# [2.191.0-dev.14](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.13...v2.191.0-dev.14) (2023-09-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **YouTube - Client spoof:** Show seekbar thumbnail for age restricted and paid videos ([1a79300](https://github.com/ReVanced/revanced-patches/commit/1a793007c919753a8c31ab2382d86c0546eefe20))
|
||||||
|
|
||||||
|
# [2.191.0-dev.13](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.12...v2.191.0-dev.13) (2023-09-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **YouTube - Client spoof:** Removed unused code ([#3030](https://github.com/ReVanced/revanced-patches/issues/3030)) ([15e27bf](https://github.com/ReVanced/revanced-patches/commit/15e27bf93e6366ba8a59091409c4271c8230edb6))
|
||||||
|
|
||||||
|
# [2.191.0-dev.12](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.11...v2.191.0-dev.12) (2023-09-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **YouTube - Client spoof:** Display seekbar thumbnails in high quality ([5e8a2d3](https://github.com/ReVanced/revanced-patches/commit/5e8a2d3fe77a4a08ea32e7dc22f2c8e4048b7a6b))
|
||||||
|
|
||||||
|
# [2.191.0-dev.11](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.10...v2.191.0-dev.11) (2023-09-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Add notice for thumbnails for age restricted or paid videos ([f7cf70b](https://github.com/ReVanced/revanced-patches/commit/f7cf70b5d3f415411fa767931a33e84df9df6c16))
|
||||||
|
|
||||||
|
# [2.191.0-dev.10](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.9...v2.191.0-dev.10) (2023-09-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **YouTube - Client spoof:** Restore seekbar thumbnails ([bf4a115](https://github.com/ReVanced/revanced-patches/commit/bf4a1159ff745f8f91e11f30db4651d85769227b))
|
||||||
|
|
||||||
|
# [2.191.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.8...v2.191.0-dev.9) (2023-09-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **Strava:** Add `Disable subscription suggestions` patch ([#2997](https://github.com/ReVanced/revanced-patches/issues/2997)) ([af02175](https://github.com/ReVanced/revanced-patches/commit/af0217594d9c7526f550fc7e6f09f8a9232e72cf))
|
||||||
|
|
||||||
# [2.191.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.7...v2.191.0-dev.8) (2023-09-24)
|
# [2.191.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.7...v2.191.0-dev.8) (2023-09-24)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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 = 2.191.0-dev.8
|
version = 2.191.0-dev.19
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -12,8 +12,8 @@ import app.revanced.util.microg.MicroGBytecodeHelper
|
|||||||
|
|
||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
name = "MicroG support",
|
name = "Vanced MicroG support",
|
||||||
description = "Allows YouTube Music ReVanced to run without root and under a different package name.",
|
description = "Allows YouTube Music to run without root and under a different package name.",
|
||||||
dependencies = [MicroGResourcePatch::class],
|
dependencies = [MicroGResourcePatch::class],
|
||||||
compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")]
|
compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import app.revanced.patches.strava.subscription.fingerprints.GetSubscribedFinger
|
|||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
name = "Unlock subscription features",
|
name = "Unlock subscription features",
|
||||||
description = "Unlocks \"Matched Runs\" and \"Segment Efforts\".",
|
description = "Unlocks \"Routes\", \"Matched Runs\" and \"Segment Efforts\".",
|
||||||
compatiblePackages = [CompatiblePackage("com.strava", ["320.12"])]
|
compatiblePackages = [CompatiblePackage("com.strava", ["320.12"])]
|
||||||
)
|
)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
@@ -19,4 +19,4 @@ object UnlockSubscriptionPatch : BytecodePatch(setOf(GetSubscribedFingerprint))
|
|||||||
val isSubscribedIndex = result.scanResult.patternScanResult!!.startIndex
|
val isSubscribedIndex = result.scanResult.patternScanResult!!.startIndex
|
||||||
result.mutableMethod.replaceInstruction(isSubscribedIndex, "const/4 v0, 0x1")
|
result.mutableMethod.replaceInstruction(isSubscribedIndex, "const/4 v0, 0x1")
|
||||||
} ?: throw GetSubscribedFingerprint.exception
|
} ?: throw GetSubscribedFingerprint.exception
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,6 @@ import com.android.tools.smali.dexlib2.Opcode
|
|||||||
object GetSubscribedFingerprint : MethodFingerprint(
|
object GetSubscribedFingerprint : MethodFingerprint(
|
||||||
opcodes = listOf(Opcode.IGET_BOOLEAN),
|
opcodes = listOf(Opcode.IGET_BOOLEAN),
|
||||||
customFingerprint = { methodDef, classDef ->
|
customFingerprint = { methodDef, classDef ->
|
||||||
classDef.type.endsWith("SubscriptionDetailResponse;") && methodDef.name == "getSubscribed"
|
classDef.type.endsWith("/SubscriptionDetailResponse;") && methodDef.name == "getSubscribed"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package app.revanced.patches.strava.upselling
|
||||||
|
|
||||||
|
import app.revanced.extensions.exception
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||||
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable
|
||||||
|
import app.revanced.patches.strava.upselling.fingerprints.GetModulesFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation
|
||||||
|
import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
|
||||||
|
|
||||||
|
@Patch(
|
||||||
|
name = "Disable subscription suggestions",
|
||||||
|
compatiblePackages = [CompatiblePackage("com.strava", ["320.12"])]
|
||||||
|
)
|
||||||
|
@Suppress("unused")
|
||||||
|
object DisableSubscriptionSuggestionsPatch : BytecodePatch(
|
||||||
|
setOf(GetModulesFingerprint)
|
||||||
|
) {
|
||||||
|
private const val HELPER_METHOD_NAME = "getModulesIfNotUpselling"
|
||||||
|
private const val PAGE_SUFFIX = "_upsell"
|
||||||
|
private const val LABEL = "original"
|
||||||
|
|
||||||
|
override fun execute(context: BytecodeContext) = GetModulesFingerprint.result?.let { result ->
|
||||||
|
val className = result.classDef.type
|
||||||
|
val originalMethod = result.mutableMethod
|
||||||
|
val returnType = originalMethod.returnType
|
||||||
|
|
||||||
|
result.mutableClass.methods.add(ImmutableMethod(
|
||||||
|
className,
|
||||||
|
HELPER_METHOD_NAME,
|
||||||
|
emptyList(),
|
||||||
|
returnType,
|
||||||
|
AccessFlags.PRIVATE.value,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
MutableMethodImplementation(3)
|
||||||
|
).toMutable().apply {
|
||||||
|
addInstructions(
|
||||||
|
"""
|
||||||
|
iget-object v0, p0, $className->page:Ljava/lang/String;
|
||||||
|
const-string v1, "$PAGE_SUFFIX"
|
||||||
|
invoke-virtual {v0, v1}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z
|
||||||
|
move-result v0
|
||||||
|
if-eqz v0, :$LABEL
|
||||||
|
invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;
|
||||||
|
move-result-object v0
|
||||||
|
return-object v0
|
||||||
|
:$LABEL
|
||||||
|
iget-object v0, p0, $className->modules:Ljava/util/List;
|
||||||
|
return-object v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
val getModulesIndex = result.scanResult.patternScanResult!!.startIndex
|
||||||
|
with(originalMethod) {
|
||||||
|
removeInstruction(getModulesIndex)
|
||||||
|
addInstructions(
|
||||||
|
getModulesIndex,
|
||||||
|
"""
|
||||||
|
invoke-direct {p0}, $className->$HELPER_METHOD_NAME()$returnType
|
||||||
|
move-result-object v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} ?: throw GetModulesFingerprint.exception
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package app.revanced.patches.strava.upselling.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
object GetModulesFingerprint : MethodFingerprint(
|
||||||
|
opcodes = listOf(Opcode.IGET_OBJECT),
|
||||||
|
customFingerprint = { methodDef, classDef ->
|
||||||
|
classDef.type.endsWith("/GenericLayoutEntry;") && methodDef.name == "getModules"
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -31,7 +31,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -18,7 +18,17 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||||||
name = "Hide get premium",
|
name = "Hide get premium",
|
||||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||||
compatiblePackages = [
|
compatiblePackages = [
|
||||||
CompatiblePackage("com.google.android.youtube", ["18.16.37", "18.19.35", "18.20.39", "18.23.35", "18.29.38", "18.32.39"])
|
CompatiblePackage(
|
||||||
|
"com.google.android.youtube", [
|
||||||
|
"18.16.37",
|
||||||
|
"18.19.35",
|
||||||
|
"18.20.39",
|
||||||
|
"18.23.35",
|
||||||
|
"18.29.38",
|
||||||
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
|
]
|
||||||
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
object HideGetPremiumPatch : BytecodePatch(setOf(GetPremiumViewFingerprint)) {
|
object HideGetPremiumPatch : BytecodePatch(setOf(GetPremiumViewFingerprint)) {
|
||||||
@@ -29,7 +29,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ import app.revanced.util.resources.ResourceUtils.mergeStrings
|
|||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
dependencies = [
|
dependencies = [
|
||||||
BottomControlsResourcePatch::class,
|
SettingsPatch::class,
|
||||||
SettingsPatch::class
|
BottomControlsResourcePatch::class
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
object CopyVideoUrlResourcePatch : ResourcePatch() {
|
object CopyVideoUrlResourcePatch : ResourcePatch() {
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package app.revanced.patches.youtube.layout.autocaptions
|
package app.revanced.patches.youtube.layout.autocaptions
|
||||||
|
|
||||||
|
import app.revanced.extensions.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.addInstructionsWithLabels
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
@@ -28,7 +29,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@@ -47,38 +49,32 @@ object AutoCaptionsPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
val startVideoInformerMethod = StartVideoInformerFingerprint.result!!.mutableMethod
|
mapOf(
|
||||||
|
StartVideoInformerFingerprint to 0,
|
||||||
|
SubtitleButtonControllerFingerprint to 1
|
||||||
|
).forEach { (fingerprint, enabled) ->
|
||||||
|
fingerprint.result?.mutableMethod?.addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const/4 v0, 0x$enabled
|
||||||
|
sput-boolean v0, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->captionsButtonDisabled:Z
|
||||||
|
"""
|
||||||
|
) ?: throw fingerprint.exception
|
||||||
|
}
|
||||||
|
|
||||||
startVideoInformerMethod.addInstructions(
|
SubtitleTrackFingerprint.result?.mutableMethod?.addInstructionsWithLabels(
|
||||||
0, """
|
0,
|
||||||
const/4 v0, 0x0
|
"""
|
||||||
sput-boolean v0, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->captionsButtonDisabled:Z
|
invoke-static {}, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->autoCaptionsEnabled()Z
|
||||||
"""
|
move-result v0
|
||||||
)
|
if-eqz v0, :auto_captions_enabled
|
||||||
|
sget-boolean v0, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->captionsButtonDisabled:Z
|
||||||
val subtitleButtonControllerMethod = SubtitleButtonControllerFingerprint.result!!.mutableMethod
|
if-nez v0, :auto_captions_enabled
|
||||||
|
const/4 v0, 0x1
|
||||||
subtitleButtonControllerMethod.addInstructions(
|
return v0
|
||||||
0, """
|
:auto_captions_enabled
|
||||||
const/4 v0, 0x1
|
nop
|
||||||
sput-boolean v0, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->captionsButtonDisabled:Z
|
"""
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
val subtitleTrackMethod = SubtitleTrackFingerprint.result!!.mutableMethod
|
|
||||||
|
|
||||||
subtitleTrackMethod.addInstructionsWithLabels(
|
|
||||||
0, """
|
|
||||||
invoke-static {}, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->autoCaptionsEnabled()Z
|
|
||||||
move-result v0
|
|
||||||
if-eqz v0, :auto_captions_enabled
|
|
||||||
sget-boolean v0, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->captionsButtonDisabled:Z
|
|
||||||
if-nez v0, :auto_captions_enabled
|
|
||||||
const/4 v0, 0x1
|
|
||||||
return v0
|
|
||||||
:auto_captions_enabled
|
|
||||||
nop
|
|
||||||
"""
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,25 +6,11 @@ import com.android.tools.smali.dexlib2.AccessFlags
|
|||||||
import com.android.tools.smali.dexlib2.Opcode
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
object StartVideoInformerFingerprint : MethodFingerprint(
|
object StartVideoInformerFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L", "L", "L", "L"), listOf(
|
returnType = "V",
|
||||||
Opcode.INVOKE_STATIC,
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
Opcode.IGET_OBJECT,
|
opcodes = listOf(
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.NEW_INSTANCE,
|
|
||||||
Opcode.INVOKE_DIRECT,
|
|
||||||
Opcode.INVOKE_INTERFACE,
|
Opcode.INVOKE_INTERFACE,
|
||||||
Opcode.IF_EQZ,
|
Opcode.RETURN_VOID
|
||||||
Opcode.CONST_STRING,
|
),
|
||||||
Opcode.INVOKE_INTERFACE,
|
strings = listOf("pc")
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.MOVE_RESULT,
|
|
||||||
Opcode.IF_EQZ,
|
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.MOVE_RESULT,
|
|
||||||
Opcode.CONST_4,
|
|
||||||
Opcode.IF_EQ,
|
|
||||||
Opcode.GOTO,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
@@ -5,39 +5,57 @@ import app.revanced.patcher.patch.PatchException
|
|||||||
import app.revanced.patcher.patch.ResourcePatch
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||||
import app.revanced.patcher.patch.annotation.Patch
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
import java.nio.file.Files
|
import app.revanced.patcher.patch.options.types.BooleanPatchOption.Companion.booleanPatchOption
|
||||||
import java.nio.file.StandardCopyOption
|
import kotlin.io.path.copyTo
|
||||||
import kotlin.io.path.exists
|
|
||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
name = "Premium heading",
|
name = "Premium heading",
|
||||||
description = "Shows premium branding on the home screen.",
|
description = "Show or hide the premium heading.",
|
||||||
compatiblePackages = [
|
compatiblePackages = [
|
||||||
CompatiblePackage("com.google.android.youtube")
|
CompatiblePackage("com.google.android.youtube")
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
object PremiumHeadingPatch : ResourcePatch() {
|
object PremiumHeadingPatch : ResourcePatch() {
|
||||||
|
private const val DEFAULT_HEADING_RES = "yt_wordmark_header"
|
||||||
|
private const val PREMIUM_HEADING_RES = "yt_premium_wordmark_header"
|
||||||
|
|
||||||
|
private val usePremiumHeading by booleanPatchOption(
|
||||||
|
key = "usePremiumHeading",
|
||||||
|
default = true,
|
||||||
|
title = "Use premium heading",
|
||||||
|
description = "Whether to use the premium heading.",
|
||||||
|
required = true,
|
||||||
|
)
|
||||||
|
|
||||||
override fun execute(context: ResourceContext) {
|
override fun execute(context: ResourceContext) {
|
||||||
val resDirectory = context["res"]
|
val resDirectory = context["res"]
|
||||||
if (!resDirectory.isDirectory) throw PatchException("The res folder can not be found.")
|
|
||||||
|
|
||||||
val (original, replacement) = "yt_premium_wordmark_header" to "yt_wordmark_header"
|
val (original, replacement) = if (usePremiumHeading!!)
|
||||||
val modes = arrayOf("light", "dark")
|
DEFAULT_HEADING_RES to PREMIUM_HEADING_RES
|
||||||
|
else
|
||||||
|
PREMIUM_HEADING_RES to DEFAULT_HEADING_RES
|
||||||
|
|
||||||
arrayOf("xxxhdpi", "xxhdpi", "xhdpi", "hdpi", "mdpi").forEach { size ->
|
val variants = arrayOf("light", "dark")
|
||||||
val headingDirectory = resDirectory.resolve("drawable-$size")
|
|
||||||
modes.forEach { mode ->
|
|
||||||
val fromPath = headingDirectory.resolve("${original}_$mode.png").toPath()
|
|
||||||
val toPath = headingDirectory.resolve("${replacement}_$mode.png").toPath()
|
|
||||||
|
|
||||||
if (!fromPath.exists())
|
arrayOf(
|
||||||
throw PatchException("The file $fromPath does not exist in the resources. Therefore, this patch can not succeed.")
|
"xxxhdpi",
|
||||||
Files.copy(
|
"xxhdpi",
|
||||||
fromPath,
|
"xhdpi",
|
||||||
toPath,
|
"hdpi",
|
||||||
StandardCopyOption.REPLACE_EXISTING
|
"mdpi"
|
||||||
)
|
).mapNotNull { dpi ->
|
||||||
|
resDirectory.resolve("drawable-$dpi").takeIf { it.exists() }?.toPath()
|
||||||
|
}.also {
|
||||||
|
if (it.isEmpty())
|
||||||
|
throw PatchException("The drawable folder can not be found. Therefore, the patch can not be applied.")
|
||||||
|
}.forEach { path ->
|
||||||
|
|
||||||
|
variants.forEach { mode ->
|
||||||
|
val fromPath = path.resolve("${original}_$mode.png")
|
||||||
|
val toPath = path.resolve("${replacement}_$mode.png")
|
||||||
|
|
||||||
|
fromPath.copyTo(toPath, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ import com.android.tools.smali.dexlib2.Opcode
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import com.android.tools.smali.dexlib2.Opcode
|
|||||||
object LayoutIconFingerprint : LiteralValueFingerprint(
|
object LayoutIconFingerprint : LiteralValueFingerprint(
|
||||||
returnType = "Landroid/view/View;",
|
returnType = "Landroid/view/View;",
|
||||||
opcodes = listOf(
|
opcodes = listOf(
|
||||||
Opcode.CONST_4,
|
|
||||||
Opcode.CONST,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
Opcode.CHECK_CAST,
|
Opcode.CHECK_CAST,
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -27,7 +27,14 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
|||||||
LithoFilterPatch::class,
|
LithoFilterPatch::class,
|
||||||
SettingsPatch::class
|
SettingsPatch::class
|
||||||
],
|
],
|
||||||
compatiblePackages = [CompatiblePackage("com.google.android.youtube", ["18.32.39"])]
|
compatiblePackages = [
|
||||||
|
CompatiblePackage(
|
||||||
|
"com.google.android.youtube", [
|
||||||
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
]
|
||||||
)
|
)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
object HideLayoutComponentsPatch : BytecodePatch(
|
object HideLayoutComponentsPatch : BytecodePatch(
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import app.revanced.patches.youtube.layout.hide.infocards.fingerprints.Infocards
|
|||||||
import app.revanced.patches.youtube.layout.hide.infocards.fingerprints.InfocardsIncognitoParentFingerprint
|
import app.revanced.patches.youtube.layout.hide.infocards.fingerprints.InfocardsIncognitoParentFingerprint
|
||||||
import app.revanced.patches.youtube.layout.hide.infocards.fingerprints.InfocardsMethodCallFingerprint
|
import app.revanced.patches.youtube.layout.hide.infocards.fingerprints.InfocardsMethodCallFingerprint
|
||||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||||
|
import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
|
||||||
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.ReferenceInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||||
@@ -22,6 +23,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
|||||||
description = "Hides info cards in videos.",
|
description = "Hides info cards in videos.",
|
||||||
dependencies = [
|
dependencies = [
|
||||||
IntegrationsPatch::class,
|
IntegrationsPatch::class,
|
||||||
|
LithoFilterPatch::class,
|
||||||
HideInfocardsResourcePatch::class
|
HideInfocardsResourcePatch::class
|
||||||
],
|
],
|
||||||
compatiblePackages = [
|
compatiblePackages = [
|
||||||
@@ -33,7 +35,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
@@ -45,6 +48,9 @@ object HideInfoCardsPatch : BytecodePatch(
|
|||||||
InfocardsMethodCallFingerprint,
|
InfocardsMethodCallFingerprint,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
private const val FILTER_CLASS_DESCRIPTOR =
|
||||||
|
"Lapp/revanced/integrations/patches/components/HideInfoCardsFilterPatch;"
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
InfocardsIncognitoFingerprint.also {
|
InfocardsIncognitoFingerprint.also {
|
||||||
it.resolve(context, InfocardsIncognitoParentFingerprint.result!!.classDef)
|
it.resolve(context, InfocardsIncognitoParentFingerprint.result!!.classDef)
|
||||||
@@ -79,5 +85,8 @@ object HideInfoCardsPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Info cards can also appear as litho components.
|
||||||
|
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
@@ -54,8 +55,6 @@ object HideShortsComponentsPatch : BytecodePatch(
|
|||||||
private const val FILTER_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/components/ShortsFilter;"
|
private const val FILTER_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/components/ShortsFilter;"
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
|
||||||
|
|
||||||
// region Hide the Shorts shelf.
|
// region Hide the Shorts shelf.
|
||||||
|
|
||||||
ReelConstructorFingerprint.result?.let {
|
ReelConstructorFingerprint.result?.let {
|
||||||
@@ -74,13 +73,20 @@ object HideShortsComponentsPatch : BytecodePatch(
|
|||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region Hide the Shorts buttons.
|
// region Hide the Shorts buttons in older versions of YouTube.
|
||||||
|
|
||||||
// Some Shorts buttons are views, hide them by setting their visibility to GONE.
|
// Some Shorts buttons are views, hide them by setting their visibility to GONE.
|
||||||
CreateShortsButtonsFingerprint.result?.let {
|
CreateShortsButtonsFingerprint.result?.let {
|
||||||
ShortsButtons.values().forEach { button -> button.injectHideCall(it.mutableMethod) }
|
ShortsButtons.entries.forEach { button -> button.injectHideCall(it.mutableMethod) }
|
||||||
} ?: throw CreateShortsButtonsFingerprint.exception
|
} ?: throw CreateShortsButtonsFingerprint.exception
|
||||||
|
|
||||||
|
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region Hide the Shorts buttons in newer versions of YouTube.
|
||||||
|
|
||||||
|
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
// region Hide the navigation bar.
|
// region Hide the navigation bar.
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ import org.w3c.dom.Element
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||||||
PlayerTypeHookPatch::class,
|
PlayerTypeHookPatch::class,
|
||||||
],
|
],
|
||||||
compatiblePackages = [
|
compatiblePackages = [
|
||||||
CompatiblePackage("com.google.android.youtube", ["18.32.39"])
|
CompatiblePackage("com.google.android.youtube", ["18.37.36"])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
@@ -51,7 +51,9 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
|||||||
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.
|
||||||
|
|
||||||
VideoIdPatch.injectCall("$INTEGRATIONS_CLASS_DESCRIPTOR->newVideoLoaded(Ljava/lang/String;)V")
|
// This patch needs a few adjustments and lots of testing before it can change to the new video id hook.
|
||||||
|
// There's a few corner cases and some weirdness when loading new videos (specifically with detecting shorts).
|
||||||
|
VideoIdPatch.legacyInjectCall("$INTEGRATIONS_CLASS_DESCRIPTOR->newVideoLoaded(Ljava/lang/String;)V")
|
||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
@@ -89,49 +91,40 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
|||||||
throw TextComponentAtomicReferenceFingerprint.exception
|
throw TextComponentAtomicReferenceFingerprint.exception
|
||||||
}?.let { textComponentContextFingerprintResult ->
|
}?.let { textComponentContextFingerprintResult ->
|
||||||
val conversionContextIndex = textComponentContextFingerprintResult
|
val conversionContextIndex = textComponentContextFingerprintResult
|
||||||
.scanResult.patternScanResult!!.startIndex
|
.scanResult.patternScanResult!!.endIndex
|
||||||
val atomicReferenceStartIndex = TextComponentAtomicReferenceFingerprint.result!!
|
val atomicReferenceStartIndex = TextComponentAtomicReferenceFingerprint.result!!
|
||||||
.scanResult.patternScanResult!!.startIndex
|
.scanResult.patternScanResult!!.startIndex
|
||||||
|
|
||||||
val insertIndex = atomicReferenceStartIndex + 6
|
val insertIndex = atomicReferenceStartIndex + 9
|
||||||
|
|
||||||
textComponentContextFingerprintResult.mutableMethod.apply {
|
textComponentContextFingerprintResult.mutableMethod.apply {
|
||||||
// Get the conversion context obfuscated field name, and the registers for the AtomicReference and CharSequence
|
// Get the conversion context obfuscated field name
|
||||||
val conversionContextFieldReference =
|
val conversionContextFieldReference =
|
||||||
getInstruction<ReferenceInstruction>(conversionContextIndex).reference
|
getInstruction<ReferenceInstruction>(conversionContextIndex).reference
|
||||||
|
|
||||||
// Reuse the free register to make room for the atomic reference register.
|
// Free register to hold the conversion context
|
||||||
val freeRegister =
|
val freeRegister =
|
||||||
getInstruction<TwoRegisterInstruction>(atomicReferenceStartIndex).registerB
|
getInstruction<TwoRegisterInstruction>(atomicReferenceStartIndex).registerB
|
||||||
|
|
||||||
val atomicReferenceRegister =
|
val atomicReferenceRegister =
|
||||||
getInstruction<FiveRegisterInstruction>(atomicReferenceStartIndex + 1).registerC
|
getInstruction<FiveRegisterInstruction>(atomicReferenceStartIndex + 6).registerC
|
||||||
|
|
||||||
val moveCharSequenceInstruction = getInstruction<TwoRegisterInstruction>(insertIndex - 1)
|
// Instruction that is replaced, and also has the CharacterSequence register.
|
||||||
|
val moveCharSequenceInstruction = getInstruction<TwoRegisterInstruction>(insertIndex)
|
||||||
val charSequenceSourceRegister = moveCharSequenceInstruction.registerB
|
val charSequenceSourceRegister = moveCharSequenceInstruction.registerB
|
||||||
val charSequenceTargetRegister = moveCharSequenceInstruction.registerA
|
val charSequenceTargetRegister = moveCharSequenceInstruction.registerA
|
||||||
|
|
||||||
// In order to preserve the atomic reference register, because it is overwritten,
|
|
||||||
// use another free register to store it.
|
|
||||||
replaceInstruction(
|
|
||||||
atomicReferenceStartIndex + 2,
|
|
||||||
"move-result-object v$freeRegister"
|
|
||||||
)
|
|
||||||
replaceInstruction(
|
|
||||||
atomicReferenceStartIndex + 3,
|
|
||||||
"move-object v$charSequenceSourceRegister, v$freeRegister"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Move the current instance to the free register, and get the conversion context from it.
|
// Move the current instance to the free register, and get the conversion context from it.
|
||||||
replaceInstruction(insertIndex - 1, "move-object/from16 v$freeRegister, p0")
|
// Must replace the instruction to preserve the control flow label.
|
||||||
|
replaceInstruction(insertIndex, "move-object/from16 v$freeRegister, p0")
|
||||||
addInstructions(
|
addInstructions(
|
||||||
insertIndex,
|
insertIndex + 1,
|
||||||
"""
|
"""
|
||||||
# Move context to free register
|
# Move context to free register
|
||||||
iget-object v$freeRegister, v$freeRegister, $conversionContextFieldReference
|
iget-object v$freeRegister, v$freeRegister, $conversionContextFieldReference
|
||||||
invoke-static {v$freeRegister, v$atomicReferenceRegister, v$charSequenceSourceRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->onLithoTextLoaded(Ljava/lang/Object;Ljava/util/concurrent/atomic/AtomicReference;Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
|
invoke-static {v$freeRegister, v$atomicReferenceRegister, v$charSequenceSourceRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->onLithoTextLoaded(Ljava/lang/Object;Ljava/util/concurrent/atomic/AtomicReference;Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
|
||||||
move-result-object v$freeRegister
|
move-result-object v$freeRegister
|
||||||
# Replace the original char sequence with the modified one.
|
# Replace the original instruction
|
||||||
move-object v${charSequenceTargetRegister}, v${freeRegister}
|
move-object v${charSequenceTargetRegister}, v${freeRegister}
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
@@ -150,7 +143,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
|||||||
val isDisLikesBooleanReference = getInstruction<ReferenceInstruction>(patternResult.endIndex).reference
|
val isDisLikesBooleanReference = getInstruction<ReferenceInstruction>(patternResult.endIndex).reference
|
||||||
|
|
||||||
val textViewFieldReference = // Like/Dislike button TextView field
|
val textViewFieldReference = // Like/Dislike button TextView field
|
||||||
getInstruction<ReferenceInstruction>(patternResult.endIndex - 2).reference
|
getInstruction<ReferenceInstruction>(patternResult.endIndex - 1).reference
|
||||||
|
|
||||||
// Check if the hooked TextView object is that of the dislike button.
|
// Check if the hooked TextView object is that of the dislike button.
|
||||||
// If RYD is disabled, or the TextView object is not that of the dislike button, the execution flow is not interrupted.
|
// If RYD is disabled, or the TextView object is not that of the dislike button, the execution flow is not interrupted.
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints
|
package app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
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
|
||||||
|
|
||||||
object ShortsTextViewFingerprint : MethodFingerprint(
|
object ShortsTextViewFingerprint : MethodFingerprint(
|
||||||
// 18.29.38 method is public final visibility, but in 18.23.35 and older it's protected final.
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
// If 18.23.35 is dropped then accessFlags should be specified here.
|
|
||||||
returnType = "V",
|
returnType = "V",
|
||||||
parameters = listOf("L", "L"),
|
parameters = listOf("L", "L"),
|
||||||
opcodes = listOf(
|
opcodes = listOf(
|
||||||
@@ -27,7 +27,6 @@ object ShortsTextViewFingerprint : MethodFingerprint(
|
|||||||
Opcode.IF_EQ,
|
Opcode.IF_EQ,
|
||||||
Opcode.RETURN_VOID,
|
Opcode.RETURN_VOID,
|
||||||
Opcode.IGET_OBJECT, // TextView field
|
Opcode.IGET_OBJECT, // TextView field
|
||||||
Opcode.CHECK_CAST,
|
|
||||||
Opcode.IGET_BOOLEAN, // boolean field
|
Opcode.IGET_BOOLEAN, // boolean field
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -13,13 +13,17 @@ object TextComponentAtomicReferenceFingerprint : MethodFingerprint(
|
|||||||
accessFlags = AccessFlags.PROTECTED or AccessFlags.FINAL,
|
accessFlags = AccessFlags.PROTECTED or AccessFlags.FINAL,
|
||||||
parameters = listOf("L"),
|
parameters = listOf("L"),
|
||||||
opcodes = listOf(
|
opcodes = listOf(
|
||||||
Opcode.MOVE_OBJECT, // Register A and B is context, use B as context, reuse A as free register
|
Opcode.MOVE_OBJECT, // Register B is free register
|
||||||
|
Opcode.MOVE_OBJECT_FROM16,
|
||||||
|
Opcode.MOVE_OBJECT_FROM16,
|
||||||
|
Opcode.MOVE_OBJECT_FROM16,
|
||||||
|
Opcode.MOVE_OBJECT_FROM16,
|
||||||
|
Opcode.MOVE_OBJECT_FROM16,
|
||||||
Opcode.INVOKE_VIRTUAL, // Register C is atomic reference
|
Opcode.INVOKE_VIRTUAL, // Register C is atomic reference
|
||||||
Opcode.MOVE_RESULT_OBJECT, // Register A is char sequence
|
Opcode.MOVE_RESULT_OBJECT, // Register A is char sequence
|
||||||
Opcode.MOVE_OBJECT,
|
|
||||||
Opcode.CHECK_CAST,
|
Opcode.CHECK_CAST,
|
||||||
Opcode.MOVE_OBJECT,
|
Opcode.MOVE_OBJECT, // Replace this instruction with patch code
|
||||||
Opcode.INVOKE_INTERFACE, // Insert hook here
|
Opcode.INVOKE_INTERFACE,
|
||||||
Opcode.MOVE_RESULT,
|
Opcode.MOVE_RESULT,
|
||||||
Opcode.IF_EQZ,
|
Opcode.IF_EQZ,
|
||||||
Opcode.INVOKE_INTERFACE,
|
Opcode.INVOKE_INTERFACE,
|
||||||
|
|||||||
@@ -13,12 +13,14 @@ object TextComponentContextFingerprint : MethodFingerprint(
|
|||||||
accessFlags = AccessFlags.PROTECTED or AccessFlags.FINAL,
|
accessFlags = AccessFlags.PROTECTED or AccessFlags.FINAL,
|
||||||
parameters = listOf("L"),
|
parameters = listOf("L"),
|
||||||
opcodes = listOf(
|
opcodes = listOf(
|
||||||
|
Opcode.MOVE_OBJECT_FROM16,
|
||||||
|
Opcode.MOVE_OBJECT_FROM16,
|
||||||
|
Opcode.INVOKE_STATIC_RANGE,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.IGET_OBJECT,
|
||||||
|
Opcode.IGET_OBJECT,
|
||||||
|
Opcode.IGET_OBJECT,
|
||||||
|
Opcode.IGET_OBJECT,
|
||||||
Opcode.IGET_OBJECT, // conversion context field name
|
Opcode.IGET_OBJECT, // conversion context field name
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.IGET_BOOLEAN,
|
|
||||||
Opcode.IGET,
|
|
||||||
Opcode.IGET,
|
|
||||||
Opcode.IGET,
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -27,7 +27,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@@ -94,9 +95,12 @@ object SponsorBlockBytecodePatch : BytecodePatch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set current video id
|
* Set current video id.
|
||||||
|
*
|
||||||
|
* The new video id hook seems to work without issues,
|
||||||
|
* but it's easier to keep using this hook as it's well tested and has no known problems.
|
||||||
*/
|
*/
|
||||||
VideoIdPatch.injectCallBackgroundPlay("$INTEGRATIONS_SEGMENT_PLAYBACK_CONTROLLER_CLASS_DESCRIPTOR->setCurrentVideoId(Ljava/lang/String;)V")
|
VideoIdPatch.legacyInjectCallBackgroundPlay("$INTEGRATIONS_SEGMENT_PLAYBACK_CONTROLLER_CLASS_DESCRIPTOR->setCurrentVideoId(Ljava/lang/String;)V")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Seekbar drawing
|
* Seekbar drawing
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -3,103 +3,174 @@ package app.revanced.patches.youtube.misc.fix.playback
|
|||||||
import app.revanced.extensions.exception
|
import app.revanced.extensions.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.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.annotation.Patch
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
import app.revanced.patcher.util.smali.ExternalLabel
|
||||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.ProtobufParameterBuilderFingerprint
|
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.ScrubbedPreviewLayoutFingerprint
|
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.StoryboardThumbnailFingerprint
|
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.StoryboardThumbnailParentFingerprint
|
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.*
|
||||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
|
||||||
import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
|
import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||||
|
import app.revanced.patches.youtube.video.playerresponse.PlayerResponseMethodHookPatch
|
||||||
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
description = "Spoofs the signature to prevent playback issues.",
|
description = "Spoofs the signature to prevent playback issues.",
|
||||||
dependencies = [
|
dependencies = [
|
||||||
SpoofSignatureResourcePatch::class,
|
SettingsPatch::class,
|
||||||
IntegrationsPatch::class,
|
PlayerTypeHookPatch::class,
|
||||||
PlayerTypeHookPatch::class
|
PlayerResponseMethodHookPatch::class,
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
object SpoofSignaturePatch : BytecodePatch(
|
object SpoofSignaturePatch : BytecodePatch(
|
||||||
setOf(
|
setOf(
|
||||||
ProtobufParameterBuilderFingerprint,
|
PlayerResponseModelImplFingerprint,
|
||||||
StoryboardThumbnailParentFingerprint,
|
StoryboardThumbnailParentFingerprint,
|
||||||
ScrubbedPreviewLayoutFingerprint
|
StoryboardRendererSpecFingerprint,
|
||||||
|
StoryboardRendererInitFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||||
"Lapp/revanced/integrations/patches/SpoofSignaturePatch;"
|
"Lapp/revanced/integrations/patches/spoof/SpoofSignaturePatch;"
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
// hook parameter
|
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||||
ProtobufParameterBuilderFingerprint.result?.let {
|
PreferenceScreen(
|
||||||
val setParamMethod = context
|
key = "revanced_spoof_signature_verification",
|
||||||
.toMethodWalker(it.method)
|
title = StringResource(
|
||||||
.nextMethod(it.scanResult.patternScanResult!!.startIndex, true).getMethod() as MutableMethod
|
"revanced_spoof_signature_verification_title",
|
||||||
|
"Spoof app signature"
|
||||||
|
),
|
||||||
|
preferences = listOf(
|
||||||
|
SwitchPreference(
|
||||||
|
"revanced_spoof_signature_verification_enabled",
|
||||||
|
StringResource("revanced_spoof_signature_verification_enabled_title", "Spoof app signature"),
|
||||||
|
StringResource(
|
||||||
|
"revanced_spoof_signature_verification_enabled_summary_on",
|
||||||
|
"App signature spoofed\\n\\n"
|
||||||
|
+ "Side effects include:\\n"
|
||||||
|
+ "• Enhanced bitrate is not available\\n"
|
||||||
|
+ "• Videos cannot be downloaded\\n"
|
||||||
|
+ "• No seekbar thumbnails for paid videos"
|
||||||
|
),
|
||||||
|
StringResource(
|
||||||
|
"revanced_spoof_signature_verification_enabled_summary_off",
|
||||||
|
"App signature not spoofed\\n\\nVideo playback may not work"
|
||||||
|
),
|
||||||
|
StringResource(
|
||||||
|
"revanced_spoof_signature_verification_enabled_user_dialog_message",
|
||||||
|
"Turning off this setting will cause video playback issues."
|
||||||
|
)
|
||||||
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"revanced_spoof_signature_in_feed_enabled",
|
||||||
|
StringResource("revanced_spoof_signature_in_feed_enabled_title", "Spoof app signature in feed"),
|
||||||
|
StringResource(
|
||||||
|
"revanced_spoof_signature_in_feed_enabled_summary_on",
|
||||||
|
"App signature spoofed\\n\\n"
|
||||||
|
+ "Side effects include:\\n"
|
||||||
|
+ "• Feed videos are missing subtitles\\n"
|
||||||
|
+ "• Automatically played feed videos will show up in your watch history"
|
||||||
|
),
|
||||||
|
StringResource(
|
||||||
|
"revanced_spoof_signature_in_feed_enabled_summary_off",
|
||||||
|
"App signature not spoofed for feed videos\\n\\n"
|
||||||
|
+ "Feed videos will play for less than 1 minute before encountering playback issues"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
setParamMethod.apply {
|
// Hook the player parameters.
|
||||||
val protobufParameterRegister = 3
|
PlayerResponseMethodHookPatch.injectProtoBufferHook("$INTEGRATIONS_CLASS_DESCRIPTOR->spoofParameter(Ljava/lang/String;)Ljava/lang/String;")
|
||||||
|
|
||||||
|
// Force the seekbar time and chapters to always show up.
|
||||||
|
// This is used only if the storyboard spec fetch fails, or when viewing paid videos.
|
||||||
|
StoryboardThumbnailParentFingerprint.result?.classDef?.let { classDef ->
|
||||||
|
StoryboardThumbnailFingerprint.also {
|
||||||
|
it.resolve(
|
||||||
|
context,
|
||||||
|
classDef
|
||||||
|
)
|
||||||
|
}.result?.let {
|
||||||
|
val endIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
|
// Replace existing instruction to preserve control flow label.
|
||||||
|
// The replaced return instruction always returns false
|
||||||
|
// (it is the 'no thumbnails found' control path),
|
||||||
|
// so there is no need to pass the existing return value to integrations.
|
||||||
|
it.mutableMethod.replaceInstruction(
|
||||||
|
endIndex,
|
||||||
|
"""
|
||||||
|
invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->getSeekbarThumbnailOverrideValue()Z
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
// Since this is end of the method must replace one line then add the rest.
|
||||||
|
it.mutableMethod.addInstructions(
|
||||||
|
endIndex + 1,
|
||||||
|
"""
|
||||||
|
move-result v0
|
||||||
|
return v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
} ?: throw StoryboardThumbnailFingerprint.exception
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hook StoryBoard renderer url
|
||||||
|
*/
|
||||||
|
PlayerResponseModelImplFingerprint.result?.let {
|
||||||
|
it.mutableMethod.apply {
|
||||||
|
val getStoryBoardIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
|
val getStoryBoardRegister = getInstruction<OneRegisterInstruction>(getStoryBoardIndex).registerA
|
||||||
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
|
getStoryBoardIndex,
|
||||||
|
"""
|
||||||
|
invoke-static { v$getStoryBoardRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getStoryboardRendererSpec(Ljava/lang/String;)Ljava/lang/String;
|
||||||
|
move-result-object v$getStoryBoardRegister
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} ?: throw PlayerResponseModelImplFingerprint.exception
|
||||||
|
|
||||||
|
StoryboardRendererSpecFingerprint.result?.let {
|
||||||
|
it.mutableMethod.apply {
|
||||||
|
val storyBoardUrlParams = 0
|
||||||
|
|
||||||
|
addInstructionsWithLabels(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
invoke-static {p$protobufParameterRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->spoofParameter(Ljava/lang/String;)Ljava/lang/String;
|
if-nez p$storyBoardUrlParams, :ignore
|
||||||
move-result-object p$protobufParameterRegister
|
invoke-static { p$storyBoardUrlParams }, $INTEGRATIONS_CLASS_DESCRIPTOR->getStoryboardRendererSpec(Ljava/lang/String;)Ljava/lang/String;
|
||||||
"""
|
move-result-object p$storyBoardUrlParams
|
||||||
|
""",
|
||||||
|
ExternalLabel("ignore", getInstruction(0))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} ?: throw ProtobufParameterBuilderFingerprint.exception
|
} ?: throw StoryboardRendererSpecFingerprint.exception
|
||||||
|
|
||||||
|
// Hook recommended value
|
||||||
|
StoryboardRendererInitFingerprint.result?.let {
|
||||||
|
val moveOriginalRecommendedValueIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
|
|
||||||
// When signature spoofing is enabled, the seekbar when tapped does not show
|
val originalValueRegister = it.mutableMethod
|
||||||
// the video time, chapter names, or the video thumbnail.
|
.getInstruction<OneRegisterInstruction>(moveOriginalRecommendedValueIndex).registerA
|
||||||
// Changing the value returned of this method forces all of these to show up,
|
|
||||||
// except the thumbnails are blank, which is handled with the patch below.
|
|
||||||
StoryboardThumbnailParentFingerprint.result ?: throw StoryboardThumbnailParentFingerprint.exception
|
|
||||||
StoryboardThumbnailFingerprint.resolve(context, StoryboardThumbnailParentFingerprint.result!!.classDef)
|
|
||||||
StoryboardThumbnailFingerprint.result?.apply {
|
|
||||||
val endIndex = scanResult.patternScanResult!!.endIndex
|
|
||||||
// Replace existing instruction to preserve control flow label.
|
|
||||||
// The replaced return instruction always returns false
|
|
||||||
// (it is the 'no thumbnails found' control path),
|
|
||||||
// so there is no need to pass the existing return value to integrations.
|
|
||||||
mutableMethod.replaceInstruction(
|
|
||||||
endIndex,
|
|
||||||
"""
|
|
||||||
invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->getSeekbarThumbnailOverrideValue()Z
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
// Since this is end of the method must replace one line then add the rest.
|
|
||||||
mutableMethod.addInstructions(
|
|
||||||
endIndex + 1,
|
|
||||||
"""
|
|
||||||
move-result v0
|
|
||||||
return v0
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
} ?: throw StoryboardThumbnailFingerprint.exception
|
|
||||||
|
|
||||||
|
it.mutableMethod.apply {
|
||||||
// Seekbar thumbnail now show up but are always a blank image.
|
|
||||||
// Additional changes are needed to force the client to generate the thumbnails (assuming it's possible),
|
|
||||||
// but for now hide the empty thumbnail.
|
|
||||||
ScrubbedPreviewLayoutFingerprint.result?.apply {
|
|
||||||
val endIndex = scanResult.patternScanResult!!.endIndex
|
|
||||||
mutableMethod.apply {
|
|
||||||
val imageViewFieldName = getInstruction<ReferenceInstruction>(endIndex).reference
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
implementation!!.instructions.lastIndex,
|
moveOriginalRecommendedValueIndex + 1,
|
||||||
"""
|
|
||||||
iget-object v0, p0, $imageViewFieldName # copy imageview field to a register
|
|
||||||
invoke-static {v0}, $INTEGRATIONS_CLASS_DESCRIPTOR->seekbarImageViewCreated(Landroid/widget/ImageView;)V
|
|
||||||
"""
|
"""
|
||||||
|
invoke-static { v$originalValueRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getRecommendedLevel(I)I
|
||||||
|
move-result v$originalValueRegister
|
||||||
|
"""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} ?: throw ScrubbedPreviewLayoutFingerprint.exception
|
} ?: throw StoryboardRendererInitFingerprint.exception
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,69 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.misc.fix.playback
|
|
||||||
|
|
||||||
import app.revanced.patcher.data.ResourceContext
|
|
||||||
import app.revanced.patcher.patch.ResourcePatch
|
|
||||||
import app.revanced.patcher.patch.annotation.Patch
|
|
||||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
|
||||||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
|
||||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
|
||||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
|
||||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|
||||||
|
|
||||||
@Patch(dependencies = [SettingsPatch::class, ResourceMappingPatch::class])
|
|
||||||
object SpoofSignatureResourcePatch : ResourcePatch() {
|
|
||||||
internal var scrubbedPreviewThumbnailResourceId: Long = -1
|
|
||||||
|
|
||||||
override fun execute(context: ResourceContext) {
|
|
||||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
|
||||||
PreferenceScreen(
|
|
||||||
key = "revanced_spoof_signature_verification",
|
|
||||||
title = StringResource(
|
|
||||||
"revanced_spoof_signature_verification_title",
|
|
||||||
"Spoof app signature"
|
|
||||||
),
|
|
||||||
preferences = listOf(
|
|
||||||
SwitchPreference(
|
|
||||||
"revanced_spoof_signature_verification_enabled",
|
|
||||||
StringResource("revanced_spoof_signature_verification_enabled_title", "Spoof app signature"),
|
|
||||||
StringResource(
|
|
||||||
"revanced_spoof_signature_verification_enabled_summary_on",
|
|
||||||
"App signature spoofed\\n\\n"
|
|
||||||
+ "Side effects include:\\n"
|
|
||||||
+ "• No ambient mode\\n"
|
|
||||||
+ "• Videos can't be downloaded\\n"
|
|
||||||
+ "• Seekbar thumbnails are hidden"
|
|
||||||
),
|
|
||||||
StringResource(
|
|
||||||
"revanced_spoof_signature_verification_enabled_summary_off",
|
|
||||||
"App signature not spoofed\\n\\nVideo playback may not work"
|
|
||||||
),
|
|
||||||
StringResource(
|
|
||||||
"revanced_spoof_signature_verification_enabled_user_dialog_message",
|
|
||||||
"Turning off this setting will cause video playback issues."
|
|
||||||
)
|
|
||||||
),
|
|
||||||
SwitchPreference(
|
|
||||||
"revanced_spoof_signature_in_feed_enabled",
|
|
||||||
StringResource("revanced_spoof_signature_in_feed_enabled_title", "Spoof app signature in feed"),
|
|
||||||
StringResource(
|
|
||||||
"revanced_spoof_signature_in_feed_enabled_summary_on",
|
|
||||||
"App signature spoofed\\n\\n"
|
|
||||||
+ "Side effects include:\\n"
|
|
||||||
+ "• Feed videos are missing subtitles\\n"
|
|
||||||
+ "• Automatically played feed videos will show up in your watch history"
|
|
||||||
),
|
|
||||||
StringResource(
|
|
||||||
"revanced_spoof_signature_in_feed_enabled_summary_off",
|
|
||||||
"App signature not spoofed for feed videos\n\n"
|
|
||||||
+ "Feed videos will play for less than 1 minute before encountering playback issues"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
scrubbedPreviewThumbnailResourceId = ResourceMappingPatch.resourceMappings.single {
|
|
||||||
it.type == "id" && it.name == "thumbnail"
|
|
||||||
}.id
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.extensions.containsConstantInstructionValue
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
object PlayerResponseModelImplFingerprint : MethodFingerprint(
|
||||||
|
returnType = "Ljava/lang/String;",
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
parameters = emptyList(),
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.RETURN_OBJECT,
|
||||||
|
Opcode.CONST_4,
|
||||||
|
Opcode.RETURN_OBJECT
|
||||||
|
),
|
||||||
|
customFingerprint = handler@{ methodDef, _ ->
|
||||||
|
if (!methodDef.definingClass.endsWith("/PlayerResponseModelImpl;")) return@handler false
|
||||||
|
|
||||||
|
methodDef.containsConstantInstructionValue(55735497)
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
import app.revanced.patches.youtube.misc.fix.playback.SpoofSignatureResourcePatch
|
|
||||||
import app.revanced.util.patch.LiteralValueFingerprint
|
|
||||||
import com.android.tools.smali.dexlib2.AccessFlags
|
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
|
||||||
|
|
||||||
object ScrubbedPreviewLayoutFingerprint : LiteralValueFingerprint(
|
|
||||||
accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL,
|
|
||||||
returnType = "V",
|
|
||||||
parameters = listOf("Landroid/content/Context;", "Landroid/util/AttributeSet;", "I", "I"),
|
|
||||||
opcodes = listOf(
|
|
||||||
Opcode.INVOKE_STATIC,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.MOVE_RESULT,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.CONST,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
|
||||||
Opcode.CHECK_CAST,
|
|
||||||
Opcode.IPUT_OBJECT, // preview imageview
|
|
||||||
),
|
|
||||||
// This resource is used in ~ 40 different locations, but this method has a distinct list of parameters to match to.
|
|
||||||
literalSupplier = { SpoofSignatureResourcePatch.scrubbedPreviewThumbnailResourceId }
|
|
||||||
)
|
|
||||||
@@ -3,11 +3,13 @@ package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
|||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
object ProtobufParameterBuilderFingerprint : MethodFingerprint(
|
object StoryboardRendererInitFingerprint : MethodFingerprint(
|
||||||
|
strings = listOf("#-1#"),
|
||||||
opcodes = listOf(
|
opcodes = listOf(
|
||||||
Opcode.INVOKE_VIRTUAL_RANGE,
|
Opcode.INVOKE_INTERFACE,
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
Opcode.IPUT_OBJECT
|
Opcode.IPUT_OBJECT,
|
||||||
),
|
Opcode.INVOKE_INTERFACE,
|
||||||
strings = listOf("Unexpected empty videoId.", "Prefetch request are disabled.")
|
Opcode.MOVE_RESULT
|
||||||
)
|
)
|
||||||
|
)
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
object StoryboardRendererSpecFingerprint : MethodFingerprint(
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||||
|
returnType = "L",
|
||||||
|
parameters = listOf("Ljava/lang/String;", "J"),
|
||||||
|
strings = listOf("\\|"),
|
||||||
|
)
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.links
|
||||||
|
|
||||||
|
import app.revanced.extensions.exception
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||||
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
|
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||||
|
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||||
|
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||||
|
import app.revanced.patches.youtube.misc.links.fingerprints.OpenLinksDirectlyPrimaryFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.links.fingerprints.OpenLinksDirectlySecondaryFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||||
|
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||||
|
|
||||||
|
@Patch(
|
||||||
|
name = "Bypass URL redirects",
|
||||||
|
description = "Bypass URL redirects and open the original URL directly.",
|
||||||
|
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||||
|
compatiblePackages = [
|
||||||
|
CompatiblePackage(
|
||||||
|
"com.google.android.youtube",
|
||||||
|
[
|
||||||
|
"18.16.37",
|
||||||
|
"18.19.35",
|
||||||
|
"18.20.39",
|
||||||
|
"18.23.35",
|
||||||
|
"18.29.38",
|
||||||
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
object BypassURLRedirectsPatch : BytecodePatch(
|
||||||
|
setOf(OpenLinksDirectlyPrimaryFingerprint, OpenLinksDirectlySecondaryFingerprint)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext) {
|
||||||
|
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||||
|
SwitchPreference(
|
||||||
|
"revanced_bypass_url_redirects",
|
||||||
|
StringResource("revanced_bypass_url_redirects_title", "Bypass URL redirects"),
|
||||||
|
StringResource("revanced_bypass_url_redirects_summary_on", "URL redirects are bypassed"),
|
||||||
|
StringResource("revanced_bypass_url_redirects_summary_off", "URL redirects are not bypassed"),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
arrayOf(
|
||||||
|
OpenLinksDirectlyPrimaryFingerprint,
|
||||||
|
OpenLinksDirectlySecondaryFingerprint
|
||||||
|
).map {
|
||||||
|
it.result ?: throw it.exception
|
||||||
|
}.forEach { result ->
|
||||||
|
result.mutableMethod.apply {
|
||||||
|
val insertIndex = result.scanResult.patternScanResult!!.startIndex
|
||||||
|
val uriStringRegister = getInstruction<FiveRegisterInstruction>(insertIndex).registerC
|
||||||
|
|
||||||
|
replaceInstruction(
|
||||||
|
insertIndex,
|
||||||
|
"invoke-static {v$uriStringRegister}," +
|
||||||
|
"Lapp/revanced/integrations/patches/BypassURLRedirectsPatch;" +
|
||||||
|
"->" +
|
||||||
|
"parseRedirectUri(Ljava/lang/String;)Landroid/net/Uri;"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,7 +19,20 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
|
|||||||
@Patch(
|
@Patch(
|
||||||
name = "Open links externally",
|
name = "Open links externally",
|
||||||
description = "Open links outside of the app directly in your browser.",
|
description = "Open links outside of the app directly in your browser.",
|
||||||
compatiblePackages = [CompatiblePackage("com.google.android.youtube", ["18.16.37", "18.19.35", "18.20.39", "18.23.35", "18.29.38", "18.32.39"])]
|
compatiblePackages = [
|
||||||
|
CompatiblePackage(
|
||||||
|
"com.google.android.youtube",
|
||||||
|
[
|
||||||
|
"18.16.37",
|
||||||
|
"18.19.35",
|
||||||
|
"18.20.39",
|
||||||
|
"18.23.35",
|
||||||
|
"18.29.38",
|
||||||
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
]
|
||||||
)
|
)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
object OpenLinksExternallyPatch : AbstractTransformInstructionsPatch<Pair<Int, Int>>(
|
object OpenLinksExternallyPatch : AbstractTransformInstructionsPatch<Pair<Int, Int>>(
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.links.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
object OpenLinksDirectlyPrimaryFingerprint : MethodFingerprint(
|
||||||
|
returnType = "Ljava/lang/Object",
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
parameters = listOf("Ljava/lang/Object"),
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.INVOKE_STATIC,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.RETURN_OBJECT,
|
||||||
|
Opcode.CHECK_CAST,
|
||||||
|
Opcode.SGET,
|
||||||
|
Opcode.SGET_OBJECT
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.links.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
object OpenLinksDirectlySecondaryFingerprint : MethodFingerprint(
|
||||||
|
returnType = "Landroid/net/Uri",
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||||
|
parameters = listOf("Ljava/lang/String"),
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.INVOKE_STATIC,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT
|
||||||
|
),
|
||||||
|
strings = listOf("://")
|
||||||
|
)
|
||||||
@@ -103,7 +103,7 @@ object LithoFilterPatch : BytecodePatch(
|
|||||||
val emptyComponentFieldIndex = builderMethodIndex + 2
|
val emptyComponentFieldIndex = builderMethodIndex + 2
|
||||||
|
|
||||||
bytesToComponentContextMethod.mutableMethod.apply {
|
bytesToComponentContextMethod.mutableMethod.apply {
|
||||||
val insertHookIndex = bytesToComponentContextMethod.scanResult.patternScanResult!!.endIndex
|
val insertHookIndex = bytesToComponentContextMethod.scanResult.patternScanResult!!.endIndex + 1
|
||||||
|
|
||||||
// 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.
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import com.android.tools.smali.dexlib2.Opcode
|
|||||||
|
|
||||||
object ComponentContextParserFingerprint : MethodFingerprint(
|
object ComponentContextParserFingerprint : MethodFingerprint(
|
||||||
opcodes = listOf(
|
opcodes = listOf(
|
||||||
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.IPUT_OBJECT,
|
Opcode.IPUT_OBJECT,
|
||||||
Opcode.NEW_INSTANCE
|
|
||||||
),
|
),
|
||||||
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.")
|
||||||
)
|
)
|
||||||
@@ -14,7 +14,7 @@ import app.revanced.util.microg.MicroGBytecodeHelper
|
|||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
name = "Vanced MicroG support",
|
name = "Vanced MicroG support",
|
||||||
description = "Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG.",
|
description = "Allows YouTube to run without root and under a different package name with Vanced MicroG.",
|
||||||
dependencies = [
|
dependencies = [
|
||||||
MicroGResourcePatch::class,
|
MicroGResourcePatch::class,
|
||||||
HideCastButtonPatch::class,
|
HideCastButtonPatch::class,
|
||||||
@@ -28,7 +28,8 @@ import app.revanced.util.microg.MicroGBytecodeHelper
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ object PlayerControlsBytecodePatch : BytecodePatch(
|
|||||||
|
|
||||||
private var moveToRegisterInstructionIndex: Int = 0
|
private var moveToRegisterInstructionIndex: Int = 0
|
||||||
private var viewRegister: Int = 0
|
private var viewRegister: Int = 0
|
||||||
|
private lateinit var inflateFingerprintResult: MethodFingerprintResult
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
LayoutConstructorFingerprint.result?.let {
|
LayoutConstructorFingerprint.result?.let {
|
||||||
@@ -31,17 +32,13 @@ object PlayerControlsBytecodePatch : BytecodePatch(
|
|||||||
} ?: throw LayoutConstructorFingerprint.exception
|
} ?: throw LayoutConstructorFingerprint.exception
|
||||||
|
|
||||||
showPlayerControlsFingerprintResult = PlayerControlsVisibilityFingerprint.result!!
|
showPlayerControlsFingerprintResult = PlayerControlsVisibilityFingerprint.result!!
|
||||||
inflateFingerprintResult = BottomControlsInflateFingerprint.result!!
|
|
||||||
}
|
|
||||||
|
|
||||||
private var inflateFingerprintResult: MethodFingerprintResult? = null
|
inflateFingerprintResult = BottomControlsInflateFingerprint.result!!.also {
|
||||||
set(fingerprint) {
|
moveToRegisterInstructionIndex = it.scanResult.patternScanResult!!.endIndex
|
||||||
field = fingerprint!!.also {
|
viewRegister =
|
||||||
moveToRegisterInstructionIndex = it.scanResult.patternScanResult!!.endIndex
|
(it.mutableMethod.implementation!!.instructions[moveToRegisterInstructionIndex] as OneRegisterInstruction).registerA
|
||||||
viewRegister =
|
|
||||||
(it.mutableMethod.implementation!!.instructions[moveToRegisterInstructionIndex] as OneRegisterInstruction).registerA
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Injects the code to change the visibility of controls.
|
* Injects the code to change the visibility of controls.
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -111,9 +111,7 @@ object VideoInformationPatch : BytecodePatch(
|
|||||||
/*
|
/*
|
||||||
* Inject call for video id
|
* Inject call for video id
|
||||||
*/
|
*/
|
||||||
val videoIdMethodDescriptor = "$INTEGRATIONS_CLASS_DESCRIPTOR->setVideoId(Ljava/lang/String;)V"
|
VideoIdPatch.injectCall("$INTEGRATIONS_CLASS_DESCRIPTOR->setVideoId(Ljava/lang/String;)V")
|
||||||
VideoIdPatch.injectCall(videoIdMethodDescriptor)
|
|
||||||
VideoIdPatch.injectCallBackgroundPlay(videoIdMethodDescriptor)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the video time method
|
* Set the video time method
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package app.revanced.patches.youtube.video.playerresponse
|
||||||
|
|
||||||
|
import app.revanced.extensions.exception
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
|
import app.revanced.patches.youtube.misc.fix.playback.SpoofSignaturePatch
|
||||||
|
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||||
|
import app.revanced.patches.youtube.video.playerresponse.fingerprint.PlayerParameterBuilderFingerprint
|
||||||
|
import app.revanced.patches.youtube.video.videoid.VideoIdPatch
|
||||||
|
|
||||||
|
@Patch(
|
||||||
|
dependencies = [IntegrationsPatch::class],
|
||||||
|
)
|
||||||
|
object PlayerResponseMethodHookPatch : BytecodePatch(
|
||||||
|
setOf(
|
||||||
|
PlayerParameterBuilderFingerprint,
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
private const val playerResponseVideoIdParameter = 1
|
||||||
|
private const val playerResponseProtoBufferParameter = 3
|
||||||
|
/**
|
||||||
|
* Insert index when adding a video id hook.
|
||||||
|
*/
|
||||||
|
private var playerResponseVideoIdInsertIndex = 0
|
||||||
|
/**
|
||||||
|
* Insert index when adding a proto buffer override.
|
||||||
|
* Must be after all video id hooks in the same method.
|
||||||
|
*/
|
||||||
|
private var playerResponseProtoBufferInsertIndex = 0
|
||||||
|
private lateinit var playerResponseMethod: MutableMethod
|
||||||
|
|
||||||
|
override fun execute(context: BytecodeContext) {
|
||||||
|
|
||||||
|
// Hook player parameter.
|
||||||
|
PlayerParameterBuilderFingerprint.result?.let {
|
||||||
|
playerResponseMethod = it.mutableMethod
|
||||||
|
} ?: throw PlayerParameterBuilderFingerprint.exception
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modify the player parameter proto buffer value.
|
||||||
|
* Used exclusively by [SpoofSignaturePatch].
|
||||||
|
*/
|
||||||
|
fun injectProtoBufferHook(methodDescriptor: String) {
|
||||||
|
playerResponseMethod.addInstructions(
|
||||||
|
playerResponseProtoBufferInsertIndex,
|
||||||
|
"""
|
||||||
|
invoke-static {p$playerResponseProtoBufferParameter}, $methodDescriptor
|
||||||
|
move-result-object p$playerResponseProtoBufferParameter
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
playerResponseProtoBufferInsertIndex += 2
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used by [VideoIdPatch].
|
||||||
|
*/
|
||||||
|
internal fun injectVideoIdHook(methodDescriptor: String) {
|
||||||
|
playerResponseMethod.addInstruction(
|
||||||
|
// Keep injection calls in the order they're added,
|
||||||
|
// and all video id hooks run before proto buffer hooks.
|
||||||
|
playerResponseVideoIdInsertIndex++,
|
||||||
|
"invoke-static {p$playerResponseVideoIdParameter}, $methodDescriptor"
|
||||||
|
)
|
||||||
|
playerResponseProtoBufferInsertIndex++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package app.revanced.patches.youtube.video.playerresponse.fingerprint
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
object PlayerParameterBuilderFingerprint : MethodFingerprint(
|
||||||
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
returnType = "L",
|
||||||
|
parameters = listOf(
|
||||||
|
"Ljava/lang/String;", // VideoId.
|
||||||
|
"[B",
|
||||||
|
"Ljava/lang/String;", // Player parameters proto buffer.
|
||||||
|
"Ljava/lang/String;",
|
||||||
|
"I",
|
||||||
|
"I",
|
||||||
|
"Ljava/util/Set;",
|
||||||
|
"Ljava/lang/String;",
|
||||||
|
"Ljava/lang/String;",
|
||||||
|
"L",
|
||||||
|
"Z",
|
||||||
|
"Z",
|
||||||
|
"Z"
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -36,7 +36,8 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
@@ -122,7 +123,6 @@ object RememberVideoQualityPatch : BytecodePatch(
|
|||||||
* It also hooks the method which is called when the video quality to set is determined.
|
* It also hooks the method which is called when the video quality to set is determined.
|
||||||
* Conveniently, at this point the video quality is overridden to the remembered playback speed.
|
* Conveniently, at this point the video quality is overridden to the remembered playback speed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
VideoInformationPatch.onCreateHook(INTEGRATIONS_CLASS_DESCRIPTOR, "newVideoStarted")
|
VideoInformationPatch.onCreateHook(INTEGRATIONS_CLASS_DESCRIPTOR, "newVideoStarted")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ object SetQualityByIndexMethodClassFieldReferenceFingerprint : MethodFingerprint
|
|||||||
parameters = listOf("L"),
|
parameters = listOf("L"),
|
||||||
opcodes = listOf(
|
opcodes = listOf(
|
||||||
Opcode.IGET_OBJECT,
|
Opcode.IGET_OBJECT,
|
||||||
Opcode.INVOKE_INTERFACE,
|
Opcode.IPUT_OBJECT,
|
||||||
Opcode.RETURN_VOID
|
Opcode.IGET_OBJECT,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -18,7 +18,8 @@ import app.revanced.patches.youtube.video.speed.remember.RememberPlaybackSpeedPa
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -9,16 +9,21 @@ import app.revanced.patcher.patch.BytecodePatch
|
|||||||
import app.revanced.patcher.patch.annotation.Patch
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||||
|
import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
|
||||||
|
import app.revanced.patches.youtube.video.playerresponse.PlayerResponseMethodHookPatch
|
||||||
import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdFingerprint
|
import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdFingerprint
|
||||||
import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdFingerprintBackgroundPlay
|
import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdFingerprintBackgroundPlay
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
description = "Hooks to detect when the video id changes",
|
description = "Hooks to detect when the video id changes",
|
||||||
dependencies = [IntegrationsPatch::class],
|
dependencies = [IntegrationsPatch::class, PlayerResponseMethodHookPatch::class],
|
||||||
)
|
)
|
||||||
object VideoIdPatch : BytecodePatch(
|
object VideoIdPatch : BytecodePatch(
|
||||||
setOf(VideoIdFingerprint, VideoIdFingerprintBackgroundPlay)
|
setOf(
|
||||||
|
VideoIdFingerprint,
|
||||||
|
VideoIdFingerprintBackgroundPlay
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
private var videoIdRegister = 0
|
private var videoIdRegister = 0
|
||||||
private var insertIndex = 0
|
private var insertIndex = 0
|
||||||
@@ -29,6 +34,7 @@ object VideoIdPatch : BytecodePatch(
|
|||||||
private lateinit var backgroundPlaybackMethod: MutableMethod
|
private lateinit var backgroundPlaybackMethod: MutableMethod
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Supplies the method and register index of the video id register.
|
* Supplies the method and register index of the video id register.
|
||||||
*
|
*
|
||||||
@@ -45,10 +51,10 @@ object VideoIdPatch : BytecodePatch(
|
|||||||
}
|
}
|
||||||
} ?: throw VideoIdFingerprint.exception
|
} ?: throw VideoIdFingerprint.exception
|
||||||
|
|
||||||
VideoIdFingerprint.setFields { method, insertIndex, videoIdRegister ->
|
VideoIdFingerprint.setFields { method, index, register ->
|
||||||
insertMethod = method
|
insertMethod = method
|
||||||
VideoIdPatch.insertIndex = insertIndex
|
insertIndex = index
|
||||||
VideoIdPatch.videoIdRegister = videoIdRegister
|
videoIdRegister = register
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoIdFingerprintBackgroundPlay.setFields { method, insertIndex, videoIdRegister ->
|
VideoIdFingerprintBackgroundPlay.setFields { method, insertIndex, videoIdRegister ->
|
||||||
@@ -58,42 +64,53 @@ object VideoIdPatch : BytecodePatch(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds an invoke-static instruction, called with the new id when the video changes.
|
||||||
|
*
|
||||||
|
* Called as soon as the player response is parsed, and called before many other hooks are
|
||||||
|
* updated such as [PlayerTypeHookPatch].
|
||||||
|
*
|
||||||
|
* Supports all videos and functions in all situations.
|
||||||
|
*
|
||||||
|
* Be aware, this can be called multiple times for the same video id.
|
||||||
|
*
|
||||||
|
* @param methodDescriptor which method to call. Params have to be `Ljava/lang/String;`
|
||||||
|
*/
|
||||||
|
fun injectCall(methodDescriptor: String) = PlayerResponseMethodHookPatch.injectVideoIdHook(methodDescriptor)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds an invoke-static instruction, called with the new id when the video changes.
|
* Adds an invoke-static instruction, called with the new id when the video changes.
|
||||||
*
|
*
|
||||||
* Supports all videos (regular videos, Shorts and Stories).
|
* Supports all videos (regular videos and Shorts).
|
||||||
*
|
*
|
||||||
* _Does not function if playing in the background with no video visible_.
|
* _Does not function if playing in the background with no video visible_.
|
||||||
*
|
*
|
||||||
* Be aware, this can be called multiple times for the same video id.
|
* Be aware, this can be called multiple times for the same video id.
|
||||||
*
|
*
|
||||||
* @param methodDescriptor which method to call. Params have to be `Ljava/lang/String;`
|
* @param methodDescriptor which method to call. Params have to be `Ljava/lang/String;`
|
||||||
*/
|
*/
|
||||||
fun injectCall(
|
fun legacyInjectCall(
|
||||||
methodDescriptor: String
|
methodDescriptor: String
|
||||||
) = insertMethod.addInstruction(
|
) = insertMethod.addInstruction(
|
||||||
// Keep injection calls in the order they're added:
|
insertIndex++,
|
||||||
// Increment index. So if additional injection calls are added, those calls run after this injection call.
|
"invoke-static {v$videoIdRegister}, $methodDescriptor"
|
||||||
insertIndex++,
|
)
|
||||||
"invoke-static {v$videoIdRegister}, $methodDescriptor"
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Alternate hook that supports only regular videos, but hook supports changing to new video
|
* Alternate hook that supports only regular videos, but hook supports changing to new video
|
||||||
* during background play when no video is visible.
|
* during background play when no video is visible.
|
||||||
*
|
*
|
||||||
* _Does not support Shorts or Stories_.
|
* _Does not support Shorts_.
|
||||||
*
|
*
|
||||||
* Be aware, the hook can be called multiple times for the same video id.
|
* Be aware, the hook can be called multiple times for the same video id.
|
||||||
*
|
*
|
||||||
* @param methodDescriptor which method to call. Params have to be `Ljava/lang/String;`
|
* @param methodDescriptor which method to call. Params have to be `Ljava/lang/String;`
|
||||||
*/
|
*/
|
||||||
fun injectCallBackgroundPlay(
|
fun legacyInjectCallBackgroundPlay(
|
||||||
methodDescriptor: String
|
methodDescriptor: String
|
||||||
) = backgroundPlaybackMethod.addInstruction(
|
) = backgroundPlaybackMethod.addInstruction(
|
||||||
backgroundPlaybackInsertIndex++, // move-result-object offset
|
backgroundPlaybackInsertIndex++, // move-result-object offset
|
||||||
"invoke-static {v$backgroundPlaybackVideoIdRegister}, $methodDescriptor"
|
"invoke-static {v$backgroundPlaybackVideoIdRegister}, $methodDescriptor"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
"18.20.39",
|
"18.20.39",
|
||||||
"18.23.35",
|
"18.23.35",
|
||||||
"18.29.38",
|
"18.29.38",
|
||||||
"18.32.39"
|
"18.32.39",
|
||||||
|
"18.37.36"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user