Compare commits
47 Commits
v2.183.0
...
v2.186.1-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1df7df2841 | ||
|
|
c14a7fb66f | ||
|
|
6af4e47947 | ||
|
|
ef704fcf7a | ||
|
|
eefa677b1a | ||
|
|
2bf6d693ec | ||
|
|
acc55fff89 | ||
|
|
82e3ebeeff | ||
|
|
47d096399a | ||
|
|
ae990eac6a | ||
|
|
b7f40c3955 | ||
|
|
807a7b01d3 | ||
|
|
b3ff7efdb2 | ||
|
|
098162173f | ||
|
|
a19fa4e087 | ||
|
|
dd7c663df6 | ||
|
|
9bd7773af2 | ||
|
|
4e1c9b9ec2 | ||
|
|
96a6f3f93e | ||
|
|
b74611a6ae | ||
|
|
ae40d87bb3 | ||
|
|
7fdc0d2a70 | ||
|
|
1fade09694 | ||
|
|
90e32eac54 | ||
|
|
a0632c8a92 | ||
|
|
9da2bc32a1 | ||
|
|
89fed3874f | ||
|
|
e4adaebad4 | ||
|
|
0b78e8377b | ||
|
|
6b2f7862d1 | ||
|
|
4668861d65 | ||
|
|
c5c63537ff | ||
|
|
5de8ee51c1 | ||
|
|
65087833b0 | ||
|
|
75fd96f4c3 | ||
|
|
2cac5b1b74 | ||
|
|
180c7775e6 | ||
|
|
d0440c17f6 | ||
|
|
c6f4497031 | ||
|
|
20f24513d5 | ||
|
|
db2fd097f6 | ||
|
|
801584b78c | ||
|
|
8c23fddcca | ||
|
|
eeca09ac78 | ||
|
|
8f22663a7c | ||
|
|
3113bb6599 | ||
|
|
668d1fda49 |
3
.github/workflows/release.yml
vendored
@@ -30,13 +30,12 @@ jobs:
|
||||
${{ runner.home }}/.gradle/caches
|
||||
${{ runner.home }}/.gradle/wrapper
|
||||
.gradle
|
||||
build
|
||||
node_modules
|
||||
key: ${{ runner.os }}-gradle-npm-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'package-lock.json') }}
|
||||
- name: Build with Gradle
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./gradlew generateMeta clean --no-daemon
|
||||
run: ./gradlew generateMeta clean
|
||||
- name: Setup semantic-release
|
||||
run: npm install
|
||||
- name: Release
|
||||
|
||||
167
CHANGELOG.md
@@ -1,3 +1,170 @@
|
||||
## [2.186.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.186.0...v2.186.1-dev.1) (2023-07-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Theme:** only set splash screen color if background colors are set ([f058db4](https://github.com/ReVanced/revanced-patches/commit/f058db4ba4300400ac92b4a9790708eb8bde7092))
|
||||
|
||||
# [2.186.0](https://github.com/ReVanced/revanced-patches/compare/v2.185.0...v2.186.0) (2023-07-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Tiktok - Settings:** get instruction registers dynamically ([#2676](https://github.com/ReVanced/revanced-patches/issues/2676)) ([b34e45b](https://github.com/ReVanced/revanced-patches/commit/b34e45b6dafad8e9d567ad65f58a182b8cc04676))
|
||||
* **YouTube - Spoof app version:** update target app version description ([#2666](https://github.com/ReVanced/revanced-patches/issues/2666)) ([307442e](https://github.com/ReVanced/revanced-patches/commit/307442e654ff5486656319d91e4a5f5fb2b92651))
|
||||
* **YouTube - Theme:** allow setting no background color ([8a4e77a](https://github.com/ReVanced/revanced-patches/commit/8a4e77a290a61a1caf93eb8bccaf728c84a3ef53))
|
||||
* **YouTube - Theme:** apply custom seekbar color to shorts ([#2670](https://github.com/ReVanced/revanced-patches/issues/2670)) ([1f6fe3d](https://github.com/ReVanced/revanced-patches/commit/1f6fe3da4284fd768057ef068c7ddf88d3a11049))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Twitter:** remove `Hide view stats` patch ([f0d3800](https://github.com/ReVanced/revanced-patches/commit/f0d38001b34db63f212209afb91eebf59dad2b24))
|
||||
* **Youtube - Theme:** add a switch to enable/disable custom seekbar color ([#2663](https://github.com/ReVanced/revanced-patches/issues/2663)) ([5c39985](https://github.com/ReVanced/revanced-patches/commit/5c39985888cdfe3acfdd8811ff9b6f80e243704e))
|
||||
|
||||
# [2.186.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v2.186.0-dev.4...v2.186.0-dev.5) (2023-07-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Theme:** allow setting no background color ([8a4e77a](https://github.com/ReVanced/revanced-patches/commit/8a4e77a290a61a1caf93eb8bccaf728c84a3ef53))
|
||||
|
||||
# [2.186.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v2.186.0-dev.3...v2.186.0-dev.4) (2023-07-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Spoof app version:** update target app version description ([#2666](https://github.com/ReVanced/revanced-patches/issues/2666)) ([307442e](https://github.com/ReVanced/revanced-patches/commit/307442e654ff5486656319d91e4a5f5fb2b92651))
|
||||
|
||||
# [2.186.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v2.186.0-dev.2...v2.186.0-dev.3) (2023-07-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Tiktok - Settings:** get instruction registers dynamically ([#2676](https://github.com/ReVanced/revanced-patches/issues/2676)) ([b34e45b](https://github.com/ReVanced/revanced-patches/commit/b34e45b6dafad8e9d567ad65f58a182b8cc04676))
|
||||
|
||||
# [2.186.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.186.0-dev.1...v2.186.0-dev.2) (2023-07-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Theme:** apply custom seekbar color to shorts ([#2670](https://github.com/ReVanced/revanced-patches/issues/2670)) ([1f6fe3d](https://github.com/ReVanced/revanced-patches/commit/1f6fe3da4284fd768057ef068c7ddf88d3a11049))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Youtube - Theme:** add a switch to enable/disable custom seekbar color ([#2663](https://github.com/ReVanced/revanced-patches/issues/2663)) ([5c39985](https://github.com/ReVanced/revanced-patches/commit/5c39985888cdfe3acfdd8811ff9b6f80e243704e))
|
||||
|
||||
# [2.186.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.185.0...v2.186.0-dev.1) (2023-07-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Twitter:** remove `Hide view stats` patch ([f0d3800](https://github.com/ReVanced/revanced-patches/commit/f0d38001b34db63f212209afb91eebf59dad2b24))
|
||||
|
||||
# [2.185.0](https://github.com/ReVanced/revanced-patches/compare/v2.184.0...v2.185.0) (2023-07-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allocate for more than eight `LithoFilter` array items ([#2643](https://github.com/ReVanced/revanced-patches/issues/2643)) ([fc8660b](https://github.com/ReVanced/revanced-patches/commit/fc8660b740bec2747e5f82b7321027bb8a51e0cf))
|
||||
* **Sync for Reddit - Disable ads:** fix compatibility with latest version ([1456577](https://github.com/ReVanced/revanced-patches/commit/1456577f11c4a7e49d6c1ba0103b919dc487f4cf))
|
||||
* **Tiktok - Settings:** bump compatibility ([#2656](https://github.com/ReVanced/revanced-patches/issues/2656)) ([6641356](https://github.com/ReVanced/revanced-patches/commit/6641356d41813a20c77faac67c37ea517690d25b))
|
||||
* **TikTok - Show seekbar:** fix seekbar not always showing ([#2660](https://github.com/ReVanced/revanced-patches/issues/2660)) ([f2742f1](https://github.com/ReVanced/revanced-patches/commit/f2742f1ba117809971a10780823fca99c19a4f34))
|
||||
* **Trakt - Unlock pro:** constraint to last known working version ([#2662](https://github.com/ReVanced/revanced-patches/issues/2662)) ([324bbde](https://github.com/ReVanced/revanced-patches/commit/324bbde92a851e855c11f266e92fa14c39d88160))
|
||||
* **YouTube - Spoof client:** show video time and chapters while using seekbar ([#2607](https://github.com/ReVanced/revanced-patches/issues/2607)) ([9546d12](https://github.com/ReVanced/revanced-patches/commit/9546d126430870d1abd8f43bb687b31b9fcb6fb5))
|
||||
* **youtube/sponsorblock:** fix some segments skipping slightly too late ([#2634](https://github.com/ReVanced/revanced-patches/issues/2634)) ([3175431](https://github.com/ReVanced/revanced-patches/commit/31754311870324b1e245b12965d7486878e9eba4))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube:** rename `video-speed` to `playback-speed` ([#2642](https://github.com/ReVanced/revanced-patches/issues/2642)) ([77e8639](https://github.com/ReVanced/revanced-patches/commit/77e8639b71048f2795f8f32fe18d052b335e3ce4))
|
||||
|
||||
# [2.185.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v2.185.0-dev.6...v2.185.0-dev.7) (2023-07-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Spoof client:** show video time and chapters while using seekbar ([#2607](https://github.com/ReVanced/revanced-patches/issues/2607)) ([9546d12](https://github.com/ReVanced/revanced-patches/commit/9546d126430870d1abd8f43bb687b31b9fcb6fb5))
|
||||
|
||||
# [2.185.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v2.185.0-dev.5...v2.185.0-dev.6) (2023-07-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Tiktok - Settings:** bump compatibility ([#2656](https://github.com/ReVanced/revanced-patches/issues/2656)) ([6641356](https://github.com/ReVanced/revanced-patches/commit/6641356d41813a20c77faac67c37ea517690d25b))
|
||||
|
||||
# [2.185.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v2.185.0-dev.4...v2.185.0-dev.5) (2023-07-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Trakt - Unlock pro:** constraint to last known working version ([#2662](https://github.com/ReVanced/revanced-patches/issues/2662)) ([324bbde](https://github.com/ReVanced/revanced-patches/commit/324bbde92a851e855c11f266e92fa14c39d88160))
|
||||
|
||||
# [2.185.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v2.185.0-dev.3...v2.185.0-dev.4) (2023-07-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **TikTok - Show seekbar:** fix seekbar not always showing ([#2660](https://github.com/ReVanced/revanced-patches/issues/2660)) ([f2742f1](https://github.com/ReVanced/revanced-patches/commit/f2742f1ba117809971a10780823fca99c19a4f34))
|
||||
|
||||
# [2.185.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v2.185.0-dev.2...v2.185.0-dev.3) (2023-07-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Sync for Reddit - Disable ads:** fix compatibility with latest version ([1456577](https://github.com/ReVanced/revanced-patches/commit/1456577f11c4a7e49d6c1ba0103b919dc487f4cf))
|
||||
|
||||
# [2.185.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.185.0-dev.1...v2.185.0-dev.2) (2023-07-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allocate for more than eight `LithoFilter` array items ([#2643](https://github.com/ReVanced/revanced-patches/issues/2643)) ([fc8660b](https://github.com/ReVanced/revanced-patches/commit/fc8660b740bec2747e5f82b7321027bb8a51e0cf))
|
||||
|
||||
# [2.185.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.184.1-dev.1...v2.185.0-dev.1) (2023-07-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube:** rename `video-speed` to `playback-speed` ([#2642](https://github.com/revanced/revanced-patches/issues/2642)) ([77e8639](https://github.com/revanced/revanced-patches/commit/77e8639b71048f2795f8f32fe18d052b335e3ce4))
|
||||
|
||||
## [2.184.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.184.0...v2.184.1-dev.1) (2023-07-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/sponsorblock:** fix some segments skipping slightly too late ([#2634](https://github.com/revanced/revanced-patches/issues/2634)) ([3175431](https://github.com/revanced/revanced-patches/commit/31754311870324b1e245b12965d7486878e9eba4))
|
||||
|
||||
# [2.184.0](https://github.com/revanced/revanced-patches/compare/v2.183.1...v2.184.0) (2023-07-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube/custom-branding:** update logo ([e2187f3](https://github.com/revanced/revanced-patches/commit/e2187f33ff82fce40592517aef31cb191b42987c))
|
||||
|
||||
# [2.184.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.183.1...v2.184.0-dev.1) (2023-07-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube/custom-branding:** update logo ([e2187f3](https://github.com/revanced/revanced-patches/commit/e2187f33ff82fce40592517aef31cb191b42987c))
|
||||
|
||||
## [2.183.1](https://github.com/revanced/revanced-patches/compare/v2.183.0...v2.183.1) (2023-07-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* find resource by correct name ([7e562f3](https://github.com/revanced/revanced-patches/commit/7e562f3fb30d0ef5601114433090b2eebcf04c9e))
|
||||
* use correct patch naming convention ([3d8856b](https://github.com/revanced/revanced-patches/commit/3d8856b29aba4d7436e637bc5778261b4acddeba))
|
||||
|
||||
## [2.183.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.183.0...v2.183.1-dev.1) (2023-07-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* find resource by correct name ([7e562f3](https://github.com/revanced/revanced-patches/commit/7e562f3fb30d0ef5601114433090b2eebcf04c9e))
|
||||
* use correct patch naming convention ([3d8856b](https://github.com/revanced/revanced-patches/commit/3d8856b29aba4d7436e637bc5778261b4acddeba))
|
||||
|
||||
# [2.183.0](https://github.com/revanced/revanced-patches/compare/v2.182.0...v2.183.0) (2023-07-10)
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
org.gradle.parallel = true
|
||||
org.gradle.caching = true
|
||||
kotlin.code.style = official
|
||||
version = 2.183.0
|
||||
version = 2.186.1-dev.1
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
package app.revanced.patches.all.screencapture.removerestriction.resource.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import org.w3c.dom.Element
|
||||
|
||||
@Name("Remove screen capture restriction resource patch")
|
||||
@Description("Sets allowAudioPlaybackCapture in manifest to true.")
|
||||
@Version("0.0.1")
|
||||
internal class RemoveCaptureRestrictionResourcePatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
// create an xml editor instance
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
package app.revanced.patches.music.misc.microg.patch.resource
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patches.music.annotations.MusicCompatibility
|
||||
import app.revanced.patches.music.misc.microg.shared.Constants.MUSIC_PACKAGE_NAME
|
||||
import app.revanced.patches.music.misc.microg.shared.Constants.REVANCED_MUSIC_APP_NAME
|
||||
import app.revanced.patches.music.misc.microg.shared.Constants.REVANCED_MUSIC_PACKAGE_NAME
|
||||
@@ -16,10 +13,7 @@ import app.revanced.patches.music.misc.microg.shared.Constants.SPOOFED_PACKAGE_S
|
||||
import app.revanced.util.microg.MicroGManifestHelper
|
||||
import app.revanced.util.microg.MicroGResourceHelper
|
||||
|
||||
@Name("Vanced MicroG resource patch")
|
||||
@Description("Resource patch to allow YouTube Music ReVanced to run without root and under a different package name.")
|
||||
@MusicCompatibility
|
||||
@Version("0.0.2")
|
||||
class MicroGResourcePatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
// update manifest
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package app.revanced.patches.reddit.customclients
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Patch
|
||||
@Name("Change oauth client id")
|
||||
@Name("Change OAuth client id")
|
||||
annotation class ChangeOAuthClientIdPatchAnnotation
|
||||
@@ -1,11 +1,10 @@
|
||||
package app.revanced.patches.syncforreddit.detection.piracy.fingerprints
|
||||
package app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import org.jf.dexlib2.iface.reference.TypeReference
|
||||
|
||||
object PiracyDetectionFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
package app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patches.syncforreddit.detection.piracy.fingerprints.PiracyDetectionFingerprint
|
||||
import app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.fingerprints.PiracyDetectionFingerprint
|
||||
|
||||
@Description("Disables detection of modified versions.")
|
||||
@Version("0.0.1")
|
||||
class DisablePiracyDetectionPatch : BytecodePatch(listOf(PiracyDetectionFingerprint)) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
// Do not return an error if the fingerprint is not resolved.
|
||||
// This is fine because new versions of the target app do not need this patch.
|
||||
PiracyDetectionFingerprint.result?.mutableMethod?.apply {
|
||||
addInstruction(
|
||||
0,
|
||||
@@ -21,7 +20,7 @@ class DisablePiracyDetectionPatch : BytecodePatch(listOf(PiracyDetectionFingerpr
|
||||
return-void
|
||||
"""
|
||||
)
|
||||
} ?: return PiracyDetectionFingerprint.toErrorResult()
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package app.revanced.patches.shared.mapping.misc.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
@@ -13,9 +10,6 @@ import java.util.concurrent.Executors
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
|
||||
@Name("Resource mapping")
|
||||
@Description("Creates a map of public resources.")
|
||||
@Version("0.0.1")
|
||||
class ResourceMappingPatch : ResourcePatch {
|
||||
companion object {
|
||||
internal lateinit var resourceMappings: List<ResourceElement>
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
package app.revanced.patches.tiktok.interaction.seekbar.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
object AwemeGetVideoControlFingerprint : MethodFingerprint(
|
||||
"L",
|
||||
AccessFlags.PUBLIC.value,
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.definingClass.endsWith("/Aweme;") && methodDef.name == "getVideoControl"
|
||||
}
|
||||
)
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.revanced.patches.tiktok.interaction.seekbar.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object SetSeekBarShowTypeFingerprint : MethodFingerprint(
|
||||
strings = listOf(
|
||||
"seekbar show type change, change to:"
|
||||
),
|
||||
)
|
||||
@@ -6,17 +6,14 @@ import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultError
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.tiktok.interaction.seekbar.annotations.ShowSeekbarCompatibility
|
||||
import app.revanced.patches.tiktok.interaction.seekbar.fingerprints.AwemeGetVideoControlFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction11n
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction22c
|
||||
import app.revanced.patches.tiktok.interaction.seekbar.fingerprints.SetSeekBarShowTypeFingerprint
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction22t
|
||||
|
||||
@Patch
|
||||
@Name("Show seekbar")
|
||||
@@ -25,27 +22,20 @@ import org.jf.dexlib2.builder.instruction.BuilderInstruction22c
|
||||
@Version("0.0.1")
|
||||
class ShowSeekbarPatch : BytecodePatch(
|
||||
listOf(
|
||||
AwemeGetVideoControlFingerprint
|
||||
SetSeekBarShowTypeFingerprint,
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
//Get VideoControl FieldReference
|
||||
val videoControl = context.findClass { it.type.endsWith("/VideoControl;") }
|
||||
?: return PatchResultError("Can not find target class")
|
||||
val fieldList = videoControl.immutableClass.fields.associateBy { field -> field.name }
|
||||
SetSeekBarShowTypeFingerprint.result?.mutableMethod?.apply {
|
||||
val typeRegister = getInstruction<Instruction22t>(1).registerB
|
||||
|
||||
AwemeGetVideoControlFingerprint.result?.mutableMethod?.implementation?.apply {
|
||||
val ifNullLabel = newLabelForIndex(1)
|
||||
addInstructions(
|
||||
1,
|
||||
listOf(
|
||||
BuilderInstruction11n(Opcode.CONST_4, 1, 1),
|
||||
BuilderInstruction21t(Opcode.IF_EQZ, 0, ifNullLabel),
|
||||
BuilderInstruction22c(Opcode.IPUT, 1, 0, fieldList["showProgressBar"]!!),
|
||||
BuilderInstruction22c(Opcode.IPUT, 1, 0, fieldList["draftProgressBar"]!!)
|
||||
)
|
||||
0,
|
||||
"""
|
||||
const/16 v$typeRegister, 0x64
|
||||
"""
|
||||
)
|
||||
} ?: return AwemeGetVideoControlFingerprint.toErrorResult()
|
||||
} ?: return SetSeekBarShowTypeFingerprint.toErrorResult()
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package app.revanced.patches.tiktok.misc.settings.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
object AboutPageFingerprint : MethodFingerprint(
|
||||
opcodes = listOf(
|
||||
Opcode.CONST, // copyrightPolicyLabel resource id
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST_STRING
|
||||
),
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.definingClass == "Lcom/ss/android/ugc/aweme/setting/page/AboutPage;" &&
|
||||
methodDef.name == "onViewCreated"
|
||||
}
|
||||
)
|
||||
@@ -0,0 +1,22 @@
|
||||
package app.revanced.patches.tiktok.misc.settings.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
object AddSettingsEntryFingerprint : MethodFingerprint(
|
||||
opcodes = listOf(
|
||||
Opcode.CONST_CLASS,
|
||||
Opcode.APUT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
),
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.definingClass.endsWith("/SettingNewVersionFragment;") &&
|
||||
methodDef.name == "onViewCreated"
|
||||
}
|
||||
)
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.revanced.patches.tiktok.misc.settings.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object SettingsEntryFingerprint : MethodFingerprint(
|
||||
strings = listOf(
|
||||
"pls pass item or extends the EventUnit"
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,10 @@
|
||||
package app.revanced.patches.tiktok.misc.settings.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object SettingsEntryInfoFingerprint : MethodFingerprint(
|
||||
strings = listOf(
|
||||
"ExposeItem(title=",
|
||||
", icon="
|
||||
)
|
||||
)
|
||||
@@ -1,10 +0,0 @@
|
||||
package app.revanced.patches.tiktok.misc.settings.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object SettingsOnViewCreatedFingerprint : MethodFingerprint(
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.definingClass.endsWith("/SettingNewVersionFragment;") &&
|
||||
methodDef.name == "onViewCreated"
|
||||
}
|
||||
)
|
||||
@@ -6,24 +6,20 @@ import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
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.replaceInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultError
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.tiktok.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.tiktok.misc.settings.annotations.SettingsCompatibility
|
||||
import app.revanced.patches.tiktok.misc.settings.fingerprints.AboutPageFingerprint
|
||||
import app.revanced.patches.tiktok.misc.settings.fingerprints.AdPersonalizationActivityOnCreateFingerprint
|
||||
import app.revanced.patches.tiktok.misc.settings.fingerprints.SettingsOnViewCreatedFingerprint
|
||||
import app.revanced.patches.tiktok.misc.settings.fingerprints.*
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
|
||||
@Patch
|
||||
@DependsOn([IntegrationsPatch::class])
|
||||
@@ -33,65 +29,46 @@ import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
||||
@Version("0.0.1")
|
||||
class SettingsPatch : BytecodePatch(
|
||||
listOf(
|
||||
AboutPageFingerprint,
|
||||
AdPersonalizationActivityOnCreateFingerprint,
|
||||
SettingsOnViewCreatedFingerprint,
|
||||
AddSettingsEntryFingerprint,
|
||||
SettingsEntryFingerprint,
|
||||
SettingsEntryInfoFingerprint,
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
SettingsOnViewCreatedFingerprint.result?.mutableMethod?.apply {
|
||||
val instructions = implementation!!.instructions
|
||||
// Find the class name of classes which construct a settings entry
|
||||
val settingsButtonClass = SettingsEntryFingerprint.result?.classDef?.type?.toClassName()
|
||||
?: return SettingsEntryFingerprint.toErrorResult()
|
||||
val settingsButtonInfoClass = SettingsEntryInfoFingerprint.result?.classDef?.type?.toClassName()
|
||||
?: return SettingsEntryInfoFingerprint.toErrorResult()
|
||||
|
||||
// Find the indices that need to be patched.
|
||||
val copyrightPolicyLabelId = AboutPageFingerprint.result?.let {
|
||||
val startIndex = it.scanResult.patternScanResult!!.startIndex
|
||||
it.mutableMethod.getInstruction<WideLiteralInstruction>(startIndex).wideLiteral
|
||||
} ?: return AboutPageFingerprint.toErrorResult()
|
||||
|
||||
val copyrightIndex = instructions.indexOfFirst {
|
||||
(it as? ReferenceInstruction)?.reference.toString() == "copyright_policy"
|
||||
} - 6
|
||||
|
||||
|
||||
// fixme: instead use Method.indexOfFirstConstantInstructionValue()
|
||||
val copyrightPolicyIndex = instructions.indexOfFirst {
|
||||
(it as? WideLiteralInstruction)?.wideLiteral == copyrightPolicyLabelId
|
||||
} + 2
|
||||
|
||||
// Replace an existing settings entry with ReVanced settings entry.
|
||||
arrayOf(
|
||||
copyrightIndex,
|
||||
copyrightPolicyIndex
|
||||
).forEach { index ->
|
||||
val instruction = getInstruction(index)
|
||||
if (instruction.opcode != Opcode.MOVE_RESULT_OBJECT)
|
||||
return PatchResultError("Hardcoded offset changed.")
|
||||
|
||||
val settingsEntryStringRegister = (instruction as OneRegisterInstruction).registerA
|
||||
|
||||
// Replace the settings entry string with a custom one.
|
||||
replaceInstruction(
|
||||
index,
|
||||
"""
|
||||
const-string v$settingsEntryStringRegister, "ReVanced Settings"
|
||||
"""
|
||||
// Create a settings entry for 'revanced settings' and add it to settings fragment
|
||||
AddSettingsEntryFingerprint.result?.apply {
|
||||
scanResult.patternScanResult?.startIndex?.let {
|
||||
val settingsEntries = mutableMethod.getInstruction(it + 3)
|
||||
val addEntry = mutableMethod.getInstruction<BuilderInstruction35c>(it + 5)
|
||||
val register1 = addEntry.registerC
|
||||
val register2 = addEntry.registerD
|
||||
// Add the settings entry created to the settings fragment
|
||||
mutableMethod.addInstructions(
|
||||
it + 6,
|
||||
listOf(
|
||||
settingsEntries,
|
||||
addEntry
|
||||
)
|
||||
)
|
||||
|
||||
// Replace the OnClickListener class with a custom one.
|
||||
val onClickListener = getInstruction<ReferenceInstruction>(index + 4).reference.toString()
|
||||
|
||||
context.findClass(onClickListener)?.mutableClass?.methods?.first {
|
||||
it.name == "onClick"
|
||||
}?.addInstructions(
|
||||
0,
|
||||
// These instructions call a method that create a settings entry use reflection base on the class name of classes that construct settings entry
|
||||
mutableMethod.addInstructions(
|
||||
it + 6,
|
||||
"""
|
||||
invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->startSettingsActivity()V
|
||||
return-void
|
||||
const-string v$register1, "$settingsButtonClass"
|
||||
const-string v$register2, "$settingsButtonInfoClass"
|
||||
invoke-static {v$register1, v$register2}, $CREATE_SETTINGS_ENTRY_METHOD_DESCRIPTOR
|
||||
move-result-object v$register2
|
||||
"""
|
||||
) ?: return PatchResultError("Could not find the onClick method.")
|
||||
)
|
||||
}
|
||||
|
||||
} ?: return SettingsOnViewCreatedFingerprint.toErrorResult()
|
||||
} ?: return AddSettingsEntryFingerprint.toErrorResult()
|
||||
|
||||
// Initialize the settings menu once the replaced setting entry is clicked.
|
||||
AdPersonalizationActivityOnCreateFingerprint.result?.mutableMethod?.apply {
|
||||
@@ -99,20 +76,28 @@ class SettingsPatch : BytecodePatch(
|
||||
it.opcode == Opcode.INVOKE_SUPER
|
||||
} + 1
|
||||
|
||||
val thisRegister = getInstruction<FiveRegisterInstruction>(initializeSettingsIndex - 1).registerC
|
||||
val thisRegister = getInstruction<Instruction35c>(initializeSettingsIndex - 1).registerC
|
||||
val usableRegister = implementation!!.registerCount - parameters.size - 2
|
||||
|
||||
addInstructions(
|
||||
addInstructionsWithLabels(
|
||||
initializeSettingsIndex,
|
||||
"""
|
||||
invoke-static {v$thisRegister}, $INITIALIZE_SETTINGS_METHOD_DESCRIPTOR
|
||||
move-result v$usableRegister
|
||||
if-eqz v$usableRegister, :notrevanced
|
||||
return-void
|
||||
"""
|
||||
""",
|
||||
ExternalLabel("notrevanced", getInstruction(initializeSettingsIndex))
|
||||
)
|
||||
} ?: return AdPersonalizationActivityOnCreateFingerprint.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private fun String.toClassName(): String {
|
||||
return substring(1, this.length - 1).replace("/", ".")
|
||||
}
|
||||
|
||||
private companion object {
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/tiktok/settingsmenu/SettingsMenu;"
|
||||
@@ -120,6 +105,11 @@ class SettingsPatch : BytecodePatch(
|
||||
private const val INITIALIZE_SETTINGS_METHOD_DESCRIPTOR =
|
||||
"$INTEGRATIONS_CLASS_DESCRIPTOR->initializeSettings(" +
|
||||
"Lcom/bytedance/ies/ugc/aweme/commercialize/compliance/personalization/AdPersonalizationActivity;" +
|
||||
")V"
|
||||
")Z"
|
||||
private const val CREATE_SETTINGS_ENTRY_METHOD_DESCRIPTOR =
|
||||
"$INTEGRATIONS_CLASS_DESCRIPTOR->createSettingsEntry(" +
|
||||
"Ljava/lang/String;" +
|
||||
"Ljava/lang/String;" +
|
||||
")Ljava/lang/Object;"
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,6 @@ package app.revanced.patches.trakt.annotations
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility([Package("tv.trakt.trakt")])
|
||||
@Compatibility([Package("tv.trakt.trakt", arrayOf("1.1.1"))])
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
internal annotation class UnlockProCompatibility
|
||||
internal annotation class UnlockProCompatibility
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
package app.revanced.patches.twitch.misc.settings.resource.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patches.shared.settings.preference.impl.ArrayResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||
import app.revanced.patches.shared.settings.resource.patch.AbstractSettingsResourcePatch
|
||||
import app.revanced.patches.twitch.misc.settings.annotations.SettingsCompatibility
|
||||
|
||||
@Name("Settings resource patch")
|
||||
@SettingsCompatibility
|
||||
@Version("0.0.1")
|
||||
class SettingsResourcePatch : AbstractSettingsResourcePatch(
|
||||
"revanced_prefs",
|
||||
"twitch/settings"
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
package app.revanced.patches.twitter.layout.hideviews.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.twitter.android", arrayOf("9.69.1-release.0", "9.71.0-release.0")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
internal annotation class HideViewsCompatibility
|
||||
@@ -1,15 +0,0 @@
|
||||
package app.revanced.patches.twitter.layout.hideviews.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
object InlineActionTypesFingerprint : MethodFingerprint(
|
||||
returnType = "Ljava/util/List",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||
strings = listOf(
|
||||
"getCurrentMemoizing()",
|
||||
"android_animated_reply_icon_enabled",
|
||||
"reply_voting_android_position_before_favorite_enabled"
|
||||
)
|
||||
)
|
||||
@@ -1,22 +0,0 @@
|
||||
package app.revanced.patches.twitter.layout.hideviews.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
object TweetStatsContainerConstructorFingerprint : MethodFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
parameters = listOf("L"),
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.CONST,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.CONST_4,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.INVOKE_VIRTUAL
|
||||
)
|
||||
)
|
||||
@@ -1,22 +0,0 @@
|
||||
package app.revanced.patches.twitter.layout.hideviews.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
object TweetStatsContainerWrapperConstructorFingerprint : MethodFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
parameters = listOf("L"),
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IPUT_OBJECT
|
||||
)
|
||||
)
|
||||
@@ -1,26 +0,0 @@
|
||||
package app.revanced.patches.twitter.layout.hideviews.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
object TweetStatsViewDelegateBinderFingerprint : MethodFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
opcodes = listOf(
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.CONST_16,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.CONST_16,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.RETURN_OBJECT
|
||||
)
|
||||
)
|
||||
@@ -1,114 +0,0 @@
|
||||
package app.revanced.patches.twitter.layout.hideviews.patch
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.twitter.layout.hideviews.fingerprints.InlineActionTypesFingerprint
|
||||
import app.revanced.patches.twitter.layout.hideviews.fingerprints.TweetStatsContainerConstructorFingerprint
|
||||
import app.revanced.patches.twitter.layout.hideviews.fingerprints.TweetStatsContainerWrapperConstructorFingerprint
|
||||
import app.revanced.patches.twitter.layout.hideviews.fingerprints.TweetStatsViewDelegateBinderFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
class HideViewsBytecodePatch : BytecodePatch(
|
||||
listOf(
|
||||
InlineActionTypesFingerprint,
|
||||
TweetStatsContainerWrapperConstructorFingerprint,
|
||||
TweetStatsContainerConstructorFingerprint,
|
||||
TweetStatsViewDelegateBinderFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
removeViewsFromTimeline(context)
|
||||
removeTweetStatViewInitializer(context)
|
||||
removeTweetStatViewWrapperInitializer(context)
|
||||
removeViewDelegateBinderSubscription()
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private fun removeViewsFromTimeline(context: BytecodeContext) {
|
||||
val addViewsToActionBarMethodFingerprint = object : MethodFingerprint(
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.IF_EQZ,
|
||||
)
|
||||
) {}
|
||||
transformMethodAtPattern(
|
||||
context,
|
||||
InlineActionTypesFingerprint,
|
||||
addViewsToActionBarMethodFingerprint
|
||||
) { patternScanResult, method ->
|
||||
method.removeInstruction(patternScanResult.endIndex - 1)
|
||||
}
|
||||
}
|
||||
|
||||
private fun removeTweetStatViewInitializer(context: BytecodeContext) {
|
||||
val returnFingerprint = object : MethodFingerprint(
|
||||
opcodes = listOf(Opcode.RETURN_VOID)
|
||||
) {}
|
||||
transformMethodAtPattern(
|
||||
context,
|
||||
TweetStatsContainerConstructorFingerprint,
|
||||
returnFingerprint
|
||||
) { patternScanResult, method ->
|
||||
method.removeInstructions(patternScanResult.endIndex - 3, 3)
|
||||
}
|
||||
}
|
||||
|
||||
private fun removeTweetStatViewWrapperInitializer(context: BytecodeContext) {
|
||||
val wrapperReturnFingerprint = object : MethodFingerprint(
|
||||
opcodes = listOf(
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.RETURN_VOID,
|
||||
)
|
||||
) {}
|
||||
transformMethodAtPattern(
|
||||
context,
|
||||
TweetStatsContainerWrapperConstructorFingerprint,
|
||||
wrapperReturnFingerprint
|
||||
) { patternScanResult, method ->
|
||||
method.removeInstructions(patternScanResult.startIndex - 4, 4)
|
||||
}
|
||||
}
|
||||
|
||||
private fun removeViewDelegateBinderSubscription() {
|
||||
transformMethod(TweetStatsViewDelegateBinderFingerprint) { result, method ->
|
||||
method.removeInstructions(result.scanResult.patternScanResult!!.startIndex - 4, 10)
|
||||
}
|
||||
}
|
||||
|
||||
private fun transformMethodAtPattern(
|
||||
context: BytecodeContext, methodFingerprint: MethodFingerprint,
|
||||
patternFingerprint: MethodFingerprint, transformer: TransformerAtPattern
|
||||
) {
|
||||
transformMethod(methodFingerprint) { result, method ->
|
||||
val patternResult = patternFingerprint.also {
|
||||
it.resolve(context, method, result.classDef)
|
||||
}.result!!
|
||||
transformer(patternResult.scanResult.patternScanResult!!, method)
|
||||
}
|
||||
}
|
||||
|
||||
private fun transformMethod(methodFingerprint: MethodFingerprint, transformer: Transformer) {
|
||||
val result = methodFingerprint.result!!
|
||||
val method = result.mutableMethod
|
||||
transformer(result, method)
|
||||
}
|
||||
}
|
||||
|
||||
private typealias Transformer = (MethodFingerprintResult, MutableMethod) -> Unit
|
||||
|
||||
private typealias TransformerAtPattern = (MethodFingerprintResult.MethodFingerprintScanResult.PatternScanResult, MutableMethod) -> Unit
|
||||
@@ -1,34 +0,0 @@
|
||||
package app.revanced.patches.twitter.layout.hideviews.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.*
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.twitter.layout.hideviews.annotations.HideViewsCompatibility
|
||||
import org.w3c.dom.Element
|
||||
|
||||
@Patch
|
||||
@DependsOn([HideViewsBytecodePatch::class])
|
||||
@Name("Hide views stats")
|
||||
@Description("Hides the view stats under tweets.")
|
||||
@HideViewsCompatibility
|
||||
@Version("0.0.1")
|
||||
class HideViewsResourcePatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
arrayOf(
|
||||
"res/layout/condensed_tweet_stats.xml",
|
||||
"res/layout/focal_tweet_stats.xml"
|
||||
).forEach { file ->
|
||||
context.xmlEditor[file].use { editor ->
|
||||
val tags = editor.file.getElementsByTagName("com.twitter.ui.tweet.TweetStatView")
|
||||
List(tags.length) { tags.item(it) as Element }
|
||||
.filter { it.getAttribute("android:id").contains("views_stat") }
|
||||
.forEach { it.parentNode.removeChild(it) }
|
||||
}
|
||||
}
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package app.revanced.patches.youtube.interaction.copyvideourl.resource.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
@@ -16,9 +14,7 @@ import app.revanced.util.resources.ResourceUtils
|
||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||
import app.revanced.util.resources.ResourceUtils.mergeStrings
|
||||
|
||||
@Name("Copy video url resource")
|
||||
@DependsOn([BottomControlsResourcePatch::class, SettingsPatch::class])
|
||||
@Version("0.0.1")
|
||||
class CopyVideoUrlResourcePatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package app.revanced.patches.youtube.interaction.downloads.resource.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
@@ -14,9 +12,7 @@ import app.revanced.util.resources.ResourceUtils
|
||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||
import app.revanced.util.resources.ResourceUtils.mergeStrings
|
||||
|
||||
@Name("External downloads resource patch")
|
||||
@DependsOn([BottomControlsResourcePatch::class, SettingsPatch::class])
|
||||
@Version("0.0.1")
|
||||
class ExternalDownloadsResourcePatch : ResourcePatch {
|
||||
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
|
||||
@@ -12,7 +12,6 @@ import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.util.resources.ResourceUtils
|
||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||
|
||||
@Name("Swipe controls resource patch")
|
||||
@DependsOn([SettingsPatch::class])
|
||||
@Version("0.0.1")
|
||||
class SwipeControlsResourcePatch : ResourcePatch {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package app.revanced.patches.youtube.layout.hide.albumcards.resource.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
@@ -10,13 +8,9 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.hide.albumcards.annotations.AlbumCardsCompatibility
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
|
||||
@Name("Hide album cards resource patch")
|
||||
@AlbumCardsCompatibility
|
||||
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||
@Version("0.0.1")
|
||||
class AlbumCardsResourcePatch : ResourcePatch {
|
||||
companion object {
|
||||
internal var albumCardId: Long = -1
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package app.revanced.patches.youtube.layout.hide.breakingnews.resource.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
@@ -12,9 +10,7 @@ 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.bytecode.patch.SettingsPatch
|
||||
|
||||
@Name("Breaking news shelf resource patch")
|
||||
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||
@Version("0.0.1")
|
||||
class BreakingNewsResourcePatch : ResourcePatch {
|
||||
companion object {
|
||||
internal var horizontalCardListId: Long = -1
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package app.revanced.patches.youtube.layout.hide.crowdfundingbox.resource.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
@@ -10,13 +8,9 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.hide.crowdfundingbox.annotations.CrowdfundingBoxCompatibility
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
|
||||
@Name("Crowdfunding box resource patch")
|
||||
@CrowdfundingBoxCompatibility
|
||||
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||
@Version("0.0.1")
|
||||
class CrowdfundingBoxResourcePatch : ResourcePatch {
|
||||
companion object {
|
||||
internal var crowdfundingBoxId: Long = -1
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package app.revanced.patches.youtube.layout.hide.endscreencards.resource.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
@@ -10,13 +8,9 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.hide.endscreencards.annotations.HideEndscreenCardsCompatibility
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
|
||||
@Name("Hide endscreen cards resource patch")
|
||||
@HideEndscreenCardsCompatibility
|
||||
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||
@Version("0.0.1")
|
||||
class HideEndscreenCardsResourcePatch : ResourcePatch {
|
||||
internal companion object {
|
||||
var layoutCircle: Long = -1
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package app.revanced.patches.youtube.layout.hide.loadmorebutton.resource.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
@@ -9,12 +8,9 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.hide.loadmorebutton.annotations.HideLoadMoreButtonCompatibility
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
|
||||
@Name("Hide load more button resource patch")
|
||||
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||
@HideLoadMoreButtonCompatibility
|
||||
class HideLoadMoreButtonResourcePatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package app.revanced.patches.youtube.layout.hide.personalinformation.resource.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
@@ -10,13 +8,9 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.hide.personalinformation.annotations.HideEmailAddressCompatibility
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
|
||||
@Name("Hide email address resource patch")
|
||||
@HideEmailAddressCompatibility
|
||||
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||
@Version("0.0.1")
|
||||
class HideEmailAddressResourcePatch : ResourcePatch {
|
||||
companion object {
|
||||
internal var accountSwitcherAccessibilityLabelId: Long = -1
|
||||
|
||||
@@ -8,13 +8,9 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.hide.player.overlay.annotations.HidePlayerOverlayPatchCompatibility
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import jdk.jfr.Name
|
||||
|
||||
@Name("Hide player overlay resource patch")
|
||||
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||
@HidePlayerOverlayPatchCompatibility
|
||||
class HidePlayerOverlayResourcePatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
|
||||
@@ -39,7 +39,7 @@ import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
PlayerTypeHookPatch::class,
|
||||
]
|
||||
)
|
||||
@Name("Return youtube dislike")
|
||||
@Name("Return YouTube Dislike")
|
||||
@Description("Shows the dislike count of videos using the Return YouTube Dislike API.")
|
||||
@ReturnYouTubeDislikeCompatibility
|
||||
@Version("0.0.1")
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package app.revanced.patches.youtube.layout.returnyoutubedislike.resource.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
@@ -11,15 +8,10 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.Preference
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.ReturnYouTubeDislikeCompatibility
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.util.resources.ResourceUtils.mergeStrings
|
||||
|
||||
@DependsOn([SettingsPatch::class])
|
||||
@Name("Return youtube dislike resource patch")
|
||||
@Description("Adds the preferences for Return YouTube Dislike.")
|
||||
@ReturnYouTubeDislikeCompatibility
|
||||
@Version("0.0.1")
|
||||
class ReturnYouTubeDislikeResourcePatch : ResourcePatch {
|
||||
companion object {
|
||||
internal var oldUIDislikeId: Long = -1
|
||||
|
||||
@@ -6,7 +6,7 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.layout.seekbar.resource.SeekbarColorResourcePatch
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
object CreateDarkThemeSeekbarFingerprint : MethodFingerprint(
|
||||
object PlayerSeekbarColorFingerprint : MethodFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
customFingerprint = { method, _ ->
|
||||
method.containsConstantInstructionValue(SeekbarColorResourcePatch.inlineTimeBarColorizedBarPlayedColorDarkId)
|
||||
@@ -0,0 +1,11 @@
|
||||
package app.revanced.patches.youtube.layout.seekbar.bytecode.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.layout.seekbar.resource.SeekbarColorResourcePatch
|
||||
import app.revanced.util.patch.LiteralValueFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
object ShortsSeekbarColorFingerprint : LiteralValueFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
literal = SeekbarColorResourcePatch.reelTimeBarPlayedColorId,
|
||||
)
|
||||
@@ -14,8 +14,9 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.youtube.layout.seekbar.annotations.SeekbarColorCompatibility
|
||||
import app.revanced.patches.youtube.layout.seekbar.bytecode.fingerprints.CreateDarkThemeSeekbarFingerprint
|
||||
import app.revanced.patches.youtube.layout.seekbar.bytecode.fingerprints.PlayerSeekbarColorFingerprint
|
||||
import app.revanced.patches.youtube.layout.seekbar.bytecode.fingerprints.SetSeekbarClickedColorFingerprint
|
||||
import app.revanced.patches.youtube.layout.seekbar.bytecode.fingerprints.ShortsSeekbarColorFingerprint
|
||||
import app.revanced.patches.youtube.layout.seekbar.resource.SeekbarColorResourcePatch
|
||||
import app.revanced.patches.youtube.layout.theme.bytecode.patch.LithoColorHookPatch
|
||||
import app.revanced.patches.youtube.layout.theme.bytecode.patch.LithoColorHookPatch.Companion.lithoColorOverrideHook
|
||||
@@ -28,30 +29,29 @@ import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
@SeekbarColorCompatibility
|
||||
@Version("0.0.1")
|
||||
class SeekbarColorBytecodePatch : BytecodePatch(
|
||||
listOf(CreateDarkThemeSeekbarFingerprint, SetSeekbarClickedColorFingerprint)
|
||||
listOf(PlayerSeekbarColorFingerprint, ShortsSeekbarColorFingerprint, SetSeekbarClickedColorFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
CreateDarkThemeSeekbarFingerprint.result?.mutableMethod?.apply {
|
||||
var registerIndex = indexOfFirstConstantInstructionValue(SeekbarColorResourcePatch.inlineTimeBarColorizedBarPlayedColorDarkId) + 2
|
||||
var colorRegister = (getInstruction(registerIndex) as OneRegisterInstruction).registerA
|
||||
fun MutableMethod.addColorChangeInstructions(resourceId: Long) {
|
||||
var registerIndex = indexOfFirstConstantInstructionValue(resourceId) + 2
|
||||
var colorRegister = getInstruction<OneRegisterInstruction>(registerIndex).registerA
|
||||
addInstructions(
|
||||
registerIndex + 1,
|
||||
"""
|
||||
invoke-static { v$colorRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getVideoPlayerSeekbarColor(I)I
|
||||
move-result v$colorRegister
|
||||
"""
|
||||
invoke-static { v$colorRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getVideoPlayerSeekbarColor(I)I
|
||||
move-result v$colorRegister
|
||||
"""
|
||||
)
|
||||
|
||||
registerIndex = indexOfFirstConstantInstructionValue(SeekbarColorResourcePatch.inlineTimeBarPlayedNotHighlightedColorId) + 2
|
||||
colorRegister = (getInstruction(registerIndex) as OneRegisterInstruction).registerA
|
||||
addInstructions(
|
||||
registerIndex + 1,
|
||||
"""
|
||||
invoke-static { v$colorRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getVideoPlayerSeekbarColor(I)I
|
||||
move-result v$colorRegister
|
||||
"""
|
||||
)
|
||||
} ?: return CreateDarkThemeSeekbarFingerprint.toErrorResult()
|
||||
}
|
||||
|
||||
PlayerSeekbarColorFingerprint.result?.mutableMethod?.apply {
|
||||
addColorChangeInstructions(SeekbarColorResourcePatch.inlineTimeBarColorizedBarPlayedColorDarkId)
|
||||
addColorChangeInstructions(SeekbarColorResourcePatch.inlineTimeBarPlayedNotHighlightedColorId)
|
||||
} ?: return PlayerSeekbarColorFingerprint.toErrorResult()
|
||||
|
||||
ShortsSeekbarColorFingerprint.result?.mutableMethod?.apply {
|
||||
addColorChangeInstructions(SeekbarColorResourcePatch.reelTimeBarPlayedColorId)
|
||||
} ?: return ShortsSeekbarColorFingerprint.toErrorResult()
|
||||
|
||||
SetSeekbarClickedColorFingerprint.result?.let { result ->
|
||||
result.mutableMethod.let {
|
||||
@@ -62,7 +62,7 @@ class SeekbarColorBytecodePatch : BytecodePatch(
|
||||
.getMethod() as MutableMethod
|
||||
|
||||
method.apply {
|
||||
val colorRegister = (method.getInstruction(0) as TwoRegisterInstruction).registerA
|
||||
val colorRegister = getInstruction<TwoRegisterInstruction>(0).registerA
|
||||
addInstructions(
|
||||
0,
|
||||
"""
|
||||
|
||||
@@ -9,17 +9,20 @@ import org.w3c.dom.Element
|
||||
|
||||
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||
class SeekbarColorResourcePatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
// Edit theme colors via bytecode.
|
||||
// For that the resource id is used in a bytecode patch to change the color.
|
||||
|
||||
val seekbarErrorMessage = "Could not find seekbar resource"
|
||||
inlineTimeBarColorizedBarPlayedColorDarkId = ResourceMappingPatch.resourceMappings
|
||||
.find { it.name == "inline_time_bar_colorized_bar_played_color_dark" }?.id
|
||||
?: return PatchResultError(seekbarErrorMessage)
|
||||
inlineTimeBarPlayedNotHighlightedColorId = ResourceMappingPatch.resourceMappings
|
||||
.find { it.name == "inline_time_bar_played_not_highlighted_color" }?.id
|
||||
?: return PatchResultError(seekbarErrorMessage)
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
fun findColorResource(resourceName: String): Long {
|
||||
return ResourceMappingPatch.resourceMappings
|
||||
.find { it.type == "color" && it.name == resourceName }?.id
|
||||
?: throw PatchResultError("Could not find color resource: $resourceName")
|
||||
}
|
||||
|
||||
reelTimeBarPlayedColorId =
|
||||
findColorResource("reel_time_bar_played_color")
|
||||
inlineTimeBarColorizedBarPlayedColorDarkId =
|
||||
findColorResource("inline_time_bar_colorized_bar_played_color_dark")
|
||||
inlineTimeBarPlayedNotHighlightedColorId =
|
||||
findColorResource("inline_time_bar_played_not_highlighted_color")
|
||||
|
||||
// Edit the resume playback drawable and replace the progress bar with a custom drawable
|
||||
context.xmlEditor["res/drawable/resume_playback_progressbar_drawable.xml"].use { editor ->
|
||||
@@ -39,6 +42,7 @@ class SeekbarColorResourcePatch : ResourcePatch {
|
||||
}
|
||||
|
||||
companion object {
|
||||
internal var reelTimeBarPlayedColorId = -1L
|
||||
internal var inlineTimeBarColorizedBarPlayedColorDarkId = -1L
|
||||
internal var inlineTimeBarPlayedNotHighlightedColorId = -1L
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package app.revanced.patches.youtube.layout.sponsorblock.resource.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
@@ -16,9 +14,7 @@ import app.revanced.util.resources.ResourceUtils.copyResources
|
||||
import app.revanced.util.resources.ResourceUtils.copyXmlNode
|
||||
import app.revanced.util.resources.ResourceUtils.mergeStrings
|
||||
|
||||
@Name("SponsorBlock resource patch")
|
||||
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||
@Version("0.0.1")
|
||||
class SponsorBlockResourcePatch : ResourcePatch {
|
||||
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
|
||||
@@ -42,7 +42,7 @@ class SpoofAppVersionPatch : BytecodePatch(
|
||||
StringResource("revanced_spoof_app_version_user_dialog_message",
|
||||
"App version will be spoofed to an older version of YouTube."
|
||||
+ "\\n\\nThis will change the appearance and features of the app, but unknown side effects may occur."
|
||||
+ "\\n\\nIf later turned off, the old UI may remain until you log out or clear the app data.")
|
||||
+ "\\n\\nIf later turned off, the old UI may remain until the app data is cleared.")
|
||||
),
|
||||
ListPreference(
|
||||
"revanced_spoof_app_version_target",
|
||||
@@ -54,7 +54,7 @@ class SpoofAppVersionPatch : BytecodePatch(
|
||||
"revanced_spoof_app_version_target_entries",
|
||||
listOf(
|
||||
StringResource("revanced_spoof_app_version_target_entry_1", "17.30.35 - Restore old UI layout"),
|
||||
StringResource("revanced_spoof_app_version_target_entry_2", "17.01.35 - Enable sorting videos by oldest"),
|
||||
StringResource("revanced_spoof_app_version_target_entry_2", "17.01.35 - Restore old watch history"),
|
||||
StringResource("revanced_spoof_app_version_target_entry_3", "16.08.35 - Restore explore tab"),
|
||||
StringResource("revanced_spoof_app_version_target_entry_4", "16.01.35 - Restore old Shorts player"),
|
||||
)
|
||||
|
||||
@@ -9,6 +9,7 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.InputType
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.shared.settings.preference.impl.TextPreference
|
||||
import app.revanced.patches.youtube.layout.seekbar.resource.SeekbarPreferencesPatch
|
||||
import app.revanced.patches.youtube.layout.theme.bytecode.patch.ThemeBytecodePatch.Companion.darkThemeBackgroundColor
|
||||
@@ -20,10 +21,16 @@ import org.w3c.dom.Element
|
||||
class ThemeResourcePatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
SeekbarPreferencesPatch.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_seekbar_custom_color",
|
||||
StringResource("revanced_seekbar_custom_color_title", "Enable custom seekbar color"),
|
||||
StringResource("revanced_seekbar_custom_color_summary_on", "Custom seekbar color is shown"),
|
||||
StringResource("revanced_seekbar_custom_color_summary_off", "Original seekbar color is shown")
|
||||
),
|
||||
TextPreference(
|
||||
"revanced_seekbar_color",
|
||||
StringResource("revanced_seekbar_color_title", "Seekbar color"),
|
||||
StringResource("revanced_seekbar_color_summary", "The color of the seekbar"),
|
||||
"revanced_seekbar_custom_color_value",
|
||||
StringResource("revanced_seekbar_custom_color_value_title", "Custom seekbar color"),
|
||||
StringResource("revanced_seekbar_custom_color_value_summary", "The color of the seekbar"),
|
||||
InputType.TEXT_CAP_CHARACTERS
|
||||
)
|
||||
)
|
||||
@@ -38,8 +45,8 @@ class ThemeResourcePatch : ResourcePatch {
|
||||
|
||||
node.textContent = when (node.getAttribute("name")) {
|
||||
"yt_black0", "yt_black1", "yt_black1_opacity95", "yt_black1_opacity98", "yt_black2", "yt_black3",
|
||||
"yt_black4", "yt_status_bar_background_dark", "material_grey_850" -> darkThemeBackgroundColor
|
||||
?: continue
|
||||
"yt_black4", "yt_status_bar_background_dark", "material_grey_850"
|
||||
-> darkThemeBackgroundColor ?: continue
|
||||
|
||||
"yt_white1", "yt_white1_opacity95", "yt_white1_opacity98",
|
||||
"yt_white2", "yt_white3", "yt_white4",
|
||||
@@ -51,36 +58,43 @@ class ThemeResourcePatch : ResourcePatch {
|
||||
}
|
||||
|
||||
// Add a dynamic background color to the colors.xml file.
|
||||
addResourceColor(context, "res/values/colors.xml",
|
||||
SPLASH_BACKGROUND_COLOR, lightThemeBackgroundColor!!)
|
||||
addResourceColor(context, "res/values-night/colors.xml",
|
||||
SPLASH_BACKGROUND_COLOR, darkThemeBackgroundColor!!)
|
||||
lightThemeBackgroundColor?.let {
|
||||
addColorResource(context, "res/values/colors.xml", SPLASH_BACKGROUND_COLOR, it)
|
||||
}
|
||||
|
||||
// Edit splash screen files and change the background color.
|
||||
val splashScreenResourceFiles = listOf(
|
||||
"res/drawable/quantum_launchscreen_youtube.xml",
|
||||
"res/drawable-sw600dp/quantum_launchscreen_youtube.xml")
|
||||
darkThemeBackgroundColor?.let {
|
||||
addColorResource(context, "res/values-night/colors.xml", SPLASH_BACKGROUND_COLOR, it)
|
||||
}
|
||||
|
||||
splashScreenResourceFiles.forEach editSplashScreen@ { resourceFile ->
|
||||
context.xmlEditor[resourceFile].use {
|
||||
val layerList = it.file.getElementsByTagName("layer-list").item(0) as Element
|
||||
// Edit splash screen files and change the background color,
|
||||
// if the background colors are set.
|
||||
if (darkThemeBackgroundColor != null && lightThemeBackgroundColor != null) {
|
||||
val splashScreenResourceFiles = listOf(
|
||||
"res/drawable/quantum_launchscreen_youtube.xml",
|
||||
"res/drawable-sw600dp/quantum_launchscreen_youtube.xml")
|
||||
|
||||
val childNodes = layerList.childNodes
|
||||
for (i in 0 until childNodes.length) {
|
||||
val node = childNodes.item(i)
|
||||
if (node is Element && node.hasAttribute("android:drawable")) {
|
||||
node.setAttribute("android:drawable", "@color/$SPLASH_BACKGROUND_COLOR")
|
||||
return@editSplashScreen
|
||||
splashScreenResourceFiles.forEach editSplashScreen@ { resourceFile ->
|
||||
context.xmlEditor[resourceFile].use {
|
||||
val layerList = it.file.getElementsByTagName("layer-list").item(0) as Element
|
||||
|
||||
val childNodes = layerList.childNodes
|
||||
for (i in 0 until childNodes.length) {
|
||||
val node = childNodes.item(i)
|
||||
if (node is Element && node.hasAttribute("android:drawable")) {
|
||||
node.setAttribute("android:drawable", "@color/$SPLASH_BACKGROUND_COLOR")
|
||||
return@editSplashScreen
|
||||
}
|
||||
}
|
||||
return PatchResultError("Failed to modify launch screen")
|
||||
}
|
||||
return PatchResultError("Failed to modify launch screen")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private fun addResourceColor(
|
||||
private fun addColorResource(
|
||||
context: ResourceContext,
|
||||
resourceFile: String,
|
||||
colorName: String,
|
||||
|
||||
@@ -11,7 +11,7 @@ import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
@DependsOn([ResourceMappingPatch::class])
|
||||
class BottomSheetHookResourcePatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
bottomSheetMargins = ResourceMappingPatch.resourceMappings.find { it.name == "bottomSheetMargins" }?.id
|
||||
bottomSheetMargins = ResourceMappingPatch.resourceMappings.find { it.name == "bottom_sheet_margins" }?.id
|
||||
?: return PatchResultError("Could not find resource")
|
||||
|
||||
return PatchResultSuccess()
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.misc.fix.playback.patch.SpoofSignatureVerificationResourcePatch
|
||||
import app.revanced.util.patch.LiteralValueFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.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.
|
||||
literal = SpoofSignatureVerificationResourcePatch.scrubbedPreviewThumbnailResourceId
|
||||
)
|
||||
@@ -0,0 +1,23 @@
|
||||
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
/**
|
||||
* Resolves using the class found in [StoryboardThumbnailParentFingerprint].
|
||||
*/
|
||||
object StoryboardThumbnailFingerprint : MethodFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
returnType = "Z",
|
||||
parameters = listOf(),
|
||||
opcodes = listOf(
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_GTZ,
|
||||
Opcode.GOTO,
|
||||
Opcode.CONST_4,
|
||||
Opcode.RETURN,
|
||||
Opcode.RETURN, // Last instruction of method.
|
||||
),
|
||||
)
|
||||
@@ -0,0 +1,17 @@
|
||||
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
/**
|
||||
* Here lies code that creates the seekbar thumbnails.
|
||||
*
|
||||
* An additional change here might force the thumbnails to be created,
|
||||
* or possibly a change somewhere else (maybe involving YouTube 18.23.35 class `hte`)
|
||||
*/
|
||||
object StoryboardThumbnailParentFingerprint : MethodFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
returnType = "Landroid/graphics/Bitmap;",
|
||||
strings = listOf("Storyboard regionDecoder.decodeRegion exception - "),
|
||||
)
|
||||
@@ -1,6 +1,5 @@
|
||||
package app.revanced.patches.youtube.misc.fix.playback.fingerprints
|
||||
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
|
||||
@@ -7,47 +7,35 @@ import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.data.toMethodWalker
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.ProtobufParameterBuilderFingerprint
|
||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.*
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
|
||||
@Name("Spoof signature verification")
|
||||
@Description("Spoofs a patched client to prevent playback issues.")
|
||||
@DependsOn([
|
||||
SpoofSignatureVerificationResourcePatch::class,
|
||||
IntegrationsPatch::class,
|
||||
SettingsPatch::class,
|
||||
PlayerTypeHookPatch::class,
|
||||
PlayerTypeHookPatch::class
|
||||
])
|
||||
@Version("0.0.1")
|
||||
class SpoofSignatureVerificationPatch : BytecodePatch(
|
||||
listOf(
|
||||
ProtobufParameterBuilderFingerprint,
|
||||
StoryboardThumbnailParentFingerprint,
|
||||
ScrubbedPreviewLayoutFingerprint,
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_spoof_signature_verification",
|
||||
StringResource("revanced_spoof_signature_verification_title", "Spoof app signature"),
|
||||
StringResource("revanced_spoof_signature_verification_summary_on",
|
||||
"App signature spoofed\\n\\n"
|
||||
+ "Side effects include:\\n"
|
||||
+ "• Ambient mode may not work\\n"
|
||||
+ "• Seekbar thumbnails are hidden\\n"
|
||||
+ "• Downloading videos may not work"),
|
||||
StringResource("revanced_spoof_signature_verification_summary_off", "App signature not spoofed"),
|
||||
StringResource("revanced_spoof_signature_verification_user_dialog_message",
|
||||
"Turning off this setting may cause playback issues.")
|
||||
)
|
||||
)
|
||||
|
||||
// hook parameter
|
||||
ProtobufParameterBuilderFingerprint.result?.let {
|
||||
@@ -68,6 +56,53 @@ class SpoofSignatureVerificationPatch : BytecodePatch(
|
||||
}
|
||||
} ?: return ProtobufParameterBuilderFingerprint.toErrorResult()
|
||||
|
||||
|
||||
// When signature spoofing is enabled, the seekbar when tapped does not show
|
||||
// the video time, chapter names, or the video thumbnail.
|
||||
// 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 ?: return StoryboardThumbnailParentFingerprint.toErrorResult()
|
||||
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
|
||||
"""
|
||||
)
|
||||
} ?: return StoryboardThumbnailFingerprint.toErrorResult()
|
||||
|
||||
|
||||
// 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(
|
||||
implementation!!.instructions.lastIndex,
|
||||
"""
|
||||
iget-object v0, p0, $imageViewFieldName # copy imageview field to a register
|
||||
invoke-static {v0}, $INTEGRATIONS_CLASS_DESCRIPTOR->seekbarImageViewCreated(Landroid/widget/ImageView;)V
|
||||
"""
|
||||
)
|
||||
}
|
||||
} ?: return ScrubbedPreviewLayoutFingerprint.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package app.revanced.patches.youtube.misc.fix.playback.patch
|
||||
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.*
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
|
||||
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||
class SpoofSignatureVerificationResourcePatch : ResourcePatch {
|
||||
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_spoof_signature_verification",
|
||||
StringResource("revanced_spoof_signature_verification_title", "Spoof app signature"),
|
||||
StringResource("revanced_spoof_signature_verification_summary_on",
|
||||
"App signature spoofed\\n\\n"
|
||||
+ "Side effects include:\\n"
|
||||
+ "• Ambient mode may not work\\n"
|
||||
+ "• Seekbar thumbnails are hidden\\n"
|
||||
+ "• Downloading videos may not work"),
|
||||
StringResource("revanced_spoof_signature_verification_summary_off", "App signature not spoofed"),
|
||||
StringResource("revanced_spoof_signature_verification_user_dialog_message",
|
||||
"Turning off this setting may cause playback issues.")
|
||||
)
|
||||
)
|
||||
|
||||
scrubbedPreviewThumbnailResourceId = ResourceMappingPatch.resourceMappings.single {
|
||||
it.type == "id" && it.name == "thumbnail"
|
||||
}.id
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
companion object {
|
||||
var scrubbedPreviewThumbnailResourceId: Long = -1
|
||||
}
|
||||
}
|
||||
@@ -176,7 +176,7 @@ class LithoFilterPatch : BytecodePatch(
|
||||
"""
|
||||
new-instance v1, $classDescriptor
|
||||
invoke-direct {v1}, $classDescriptor-><init>()V
|
||||
const/4 v2, ${filterCount++}
|
||||
const/16 v2, ${filterCount++}
|
||||
aput-object v1, v0, v2
|
||||
"""
|
||||
)
|
||||
@@ -187,7 +187,7 @@ class LithoFilterPatch : BytecodePatch(
|
||||
}
|
||||
|
||||
override fun close() = LithoFilterFingerprint.result!!
|
||||
.mutableMethod.replaceInstruction(0, "const/4 v0, $filterCount")
|
||||
.mutableMethod.replaceInstruction(0, "const/16 v0, $filterCount")
|
||||
|
||||
companion object {
|
||||
private val MethodFingerprint.patternScanResult
|
||||
@@ -208,4 +208,4 @@ class LithoFilterPatch : BytecodePatch(
|
||||
|
||||
private var filterCount = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package app.revanced.patches.youtube.misc.microg.patch.resource
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
@@ -10,7 +7,6 @@ import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.shared.settings.preference.impl.Preference
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||
import app.revanced.patches.youtube.misc.microg.shared.Constants.PACKAGE_NAME
|
||||
import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_APP_NAME
|
||||
import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_PACKAGE_NAME
|
||||
@@ -22,11 +18,7 @@ import app.revanced.util.microg.Constants.MICROG_VENDOR
|
||||
import app.revanced.util.microg.MicroGManifestHelper
|
||||
import app.revanced.util.microg.MicroGResourceHelper
|
||||
|
||||
@Name("Vanced MicroG resource patch")
|
||||
@DependsOn([SettingsResourcePatch::class])
|
||||
@Description("Resource patch to allow YouTube ReVanced to run without root and under a different package name.")
|
||||
@MicroGPatchCompatibility
|
||||
@Version("0.0.1")
|
||||
class MicroGResourcePatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
SettingsPatch.addPreference(
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package app.revanced.patches.youtube.misc.playercontrols.resource.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.DomFileEditor
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
@@ -10,14 +7,9 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
import app.revanced.patches.youtube.misc.playercontrols.annotation.PlayerControlsCompatibility
|
||||
import java.io.Closeable
|
||||
|
||||
@Name("Bottom controls resource patch")
|
||||
@Description("Manages the resources for the bottom controls of the YouTube player.")
|
||||
@PlayerControlsCompatibility
|
||||
@DependsOn([ResourceMappingPatch::class])
|
||||
@Version("0.0.1")
|
||||
class BottomControlsResourcePatch : ResourcePatch, Closeable {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
resourceContext = context
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package app.revanced.patches.youtube.misc.settings.resource.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.DomFileEditor
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
@@ -19,10 +16,7 @@ import app.revanced.util.resources.ResourceUtils.mergeStrings
|
||||
import org.w3c.dom.Element
|
||||
import org.w3c.dom.Node
|
||||
|
||||
@Name("Settings resource patch")
|
||||
@DependsOn([ResourceMappingPatch::class])
|
||||
@Description("Applies mandatory patches to implement ReVanced settings into the application.")
|
||||
@Version("0.0.1")
|
||||
class SettingsResourcePatch : AbstractSettingsResourcePatch(
|
||||
"revanced_prefs",
|
||||
"settings"
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
import org.jf.dexlib2.iface.reference.FieldReference
|
||||
|
||||
@Patch
|
||||
@Name("Hdr auto brightness")
|
||||
@Name("HDR auto brightness")
|
||||
@Description("Makes the brightness of HDR videos follow the system default.")
|
||||
@HDRBrightnessCompatibility
|
||||
@Version("0.0.2")
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package app.revanced.patches.youtube.video.information.fingerprints
|
||||
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object VideoTimeFingerprint : MethodFingerprint(
|
||||
strings = listOf("MedialibPlayerTimeInfo{currentPositionMillis=")
|
||||
)
|
||||
@@ -10,7 +10,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
@@ -44,7 +43,6 @@ class VideoInformationPatch : BytecodePatch(
|
||||
PlayerInitFingerprint,
|
||||
CreateVideoPlayerSeekbarFingerprint,
|
||||
PlayerControllerSetTimeReferenceFingerprint,
|
||||
VideoTimeFingerprint,
|
||||
OnPlaybackSpeedItemClickFingerprint,
|
||||
)
|
||||
) {
|
||||
@@ -118,18 +116,10 @@ class VideoInformationPatch : BytecodePatch(
|
||||
.getMethod() as MutableMethod
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the high precision video time method
|
||||
*/
|
||||
highPrecisionTimeMethod =
|
||||
(object : MethodFingerprint("V", null, listOf("J", "J", "J", "J", "I", "L"), null) {}).also {
|
||||
it.resolve(context, VideoTimeFingerprint.result!!.classDef)
|
||||
}.result!!.mutableMethod
|
||||
|
||||
/*
|
||||
* Hook the methods which set the time
|
||||
*/
|
||||
highPrecisionTimeHook(INTEGRATIONS_CLASS_DESCRIPTOR, "setVideoTimeHighPrecision")
|
||||
videoTimeHook(INTEGRATIONS_CLASS_DESCRIPTOR, "setVideoTime")
|
||||
|
||||
|
||||
/*
|
||||
@@ -164,9 +154,6 @@ class VideoInformationPatch : BytecodePatch(
|
||||
private lateinit var timeMethod: MutableMethod
|
||||
private var timeInitInsertIndex = 2
|
||||
|
||||
private lateinit var highPrecisionTimeMethod: MutableMethod
|
||||
private var highPrecisionInsertIndex = 0
|
||||
|
||||
private fun MutableMethod.insert(insertIndex: Int, register: String, descriptor: String) =
|
||||
addInstruction(insertIndex, "invoke-static { $register }, $descriptor")
|
||||
|
||||
@@ -202,20 +189,6 @@ class VideoInformationPatch : BytecodePatch(
|
||||
"$targetMethodClass->$targetMethodName(J)V"
|
||||
)
|
||||
|
||||
/**
|
||||
* Hook the high precision video time.
|
||||
* The hooks is called extremely often (10 to 15 times a seconds), so use with caution.
|
||||
* Note: the hook is usually called _off_ the main thread
|
||||
*
|
||||
* @param targetMethodClass The descriptor for the static method to invoke when the player controller is created.
|
||||
* @param targetMethodName The name of the static method to invoke when the player controller is created.
|
||||
*/
|
||||
internal fun highPrecisionTimeHook(targetMethodClass: String, targetMethodName: String) =
|
||||
highPrecisionTimeMethod.insertTimeHook(
|
||||
highPrecisionInsertIndex++,
|
||||
"$targetMethodClass->$targetMethodName(J)V"
|
||||
)
|
||||
|
||||
private fun getReference(instructions: List<BuilderInstruction>, offset: Int, opcode: Opcode) =
|
||||
(instructions[instructions.indexOfFirst { it.opcode == opcode } + offset] as ReferenceInstruction)
|
||||
.reference.toString()
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
package app.revanced.patches.youtube.video.speed
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.video.speed.custom.patch.CustomVideoSpeedPatch
|
||||
import app.revanced.patches.youtube.video.speed.remember.patch.RememberPlaybackSpeedPatch
|
||||
|
||||
@Patch
|
||||
@Name("Video speed")
|
||||
@Description("Adds custom video speeds and ability to remember the playback speed you chose in the video playback speed flyout.")
|
||||
@DependsOn([CustomVideoSpeedPatch::class, RememberPlaybackSpeedPatch::class])
|
||||
@VideoSpeedCompatibility
|
||||
@Version("0.0.1")
|
||||
class VideoSpeed : BytecodePatch() {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
return PatchResultSuccess() // All patches this patch depends on succeed.
|
||||
}
|
||||
}
|
||||
package app.revanced.patches.youtube.video.speed
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.video.speed.custom.patch.CustomPlaybackSpeedPatch
|
||||
import app.revanced.patches.youtube.video.speed.remember.patch.RememberPlaybackSpeedPatch
|
||||
|
||||
@Patch
|
||||
@Name("Playback speed")
|
||||
@Description("Adds custom playback speeds and ability to remember the playback speed you chose in the video playback speed flyout.")
|
||||
@DependsOn([CustomPlaybackSpeedPatch::class, RememberPlaybackSpeedPatch::class])
|
||||
@PlaybackSpeedCompatibility
|
||||
@Version("0.0.1")
|
||||
class PlaybackSpeed : BytecodePatch() {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
return PatchResultSuccess() // All patches this patch depends on succeed.
|
||||
}
|
||||
}
|
||||
@@ -5,4 +5,4 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility([Package("com.google.android.youtube", arrayOf("18.20.39", "18.23.35"))])
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
internal annotation class VideoSpeedCompatibility
|
||||
internal annotation class PlaybackSpeedCompatibility
|
||||
@@ -2,7 +2,7 @@ package app.revanced.patches.youtube.video.speed.custom.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object GetOldVideoSpeedsFingerprint : MethodFingerprint(
|
||||
object GetOldPlaybackSpeedsFingerprint : MethodFingerprint(
|
||||
parameters = listOf("[L", "I"),
|
||||
strings = listOf("menu_item_playback_speed")
|
||||
)
|
||||
@@ -2,6 +2,6 @@ package app.revanced.patches.youtube.video.speed.custom.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object ShowOldVideoSpeedMenuFingerprint : MethodFingerprint(
|
||||
object ShowOldPlaybackSpeedMenuFingerprint : MethodFingerprint(
|
||||
strings = listOf("PLAYBACK_RATE_MENU_BOTTOM_SHEET_FRAGMENT")
|
||||
)
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.revanced.patches.youtube.video.speed.custom.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object ShowOldPlaybackSpeedMenuIntegrationsFingerprint : MethodFingerprint(
|
||||
customFingerprint = { method, _ -> method.name == "showOldPlaybackSpeedMenu" }
|
||||
)
|
||||
@@ -1,7 +0,0 @@
|
||||
package app.revanced.patches.youtube.video.speed.custom.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object ShowOldVideoSpeedMenuIntegrationsFingerprint : MethodFingerprint(
|
||||
customFingerprint = { method, _ -> method.name == "showOldVideoSpeedMenu" }
|
||||
)
|
||||
@@ -31,16 +31,16 @@ import org.jf.dexlib2.iface.reference.FieldReference
|
||||
import org.jf.dexlib2.iface.reference.MethodReference
|
||||
import org.jf.dexlib2.immutable.ImmutableField
|
||||
|
||||
@Name("Custom video speed")
|
||||
@Description("Adds custom video speed options.")
|
||||
@Name("Custom playback speed")
|
||||
@Description("Adds custom playback speed options.")
|
||||
@DependsOn([IntegrationsPatch::class, LithoFilterPatch::class, SettingsPatch::class, BottomSheetHookPatch::class])
|
||||
@Version("0.0.1")
|
||||
class CustomVideoSpeedPatch : BytecodePatch(
|
||||
class CustomPlaybackSpeedPatch : BytecodePatch(
|
||||
listOf(
|
||||
SpeedArrayGeneratorFingerprint,
|
||||
SpeedLimiterFingerprint,
|
||||
GetOldVideoSpeedsFingerprint,
|
||||
ShowOldVideoSpeedMenuIntegrationsFingerprint
|
||||
GetOldPlaybackSpeedsFingerprint,
|
||||
ShowOldPlaybackSpeedMenuIntegrationsFingerprint
|
||||
)
|
||||
) {
|
||||
|
||||
@@ -81,12 +81,12 @@ class CustomVideoSpeedPatch : BytecodePatch(
|
||||
|
||||
val arrayLengthConstDestination = (arrayLengthConst as OneRegisterInstruction).registerA
|
||||
|
||||
val videoSpeedsArrayType = "$INTEGRATIONS_CLASS_DESCRIPTOR->customVideoSpeeds:[F"
|
||||
val playbackSpeedsArrayType = "$INTEGRATIONS_CLASS_DESCRIPTOR->customPlaybackSpeeds:[F"
|
||||
|
||||
arrayGenMethod.addInstructions(
|
||||
arrayLengthConstIndex + 1,
|
||||
"""
|
||||
sget-object v$arrayLengthConstDestination, $videoSpeedsArrayType
|
||||
sget-object v$arrayLengthConstDestination, $playbackSpeedsArrayType
|
||||
array-length v$arrayLengthConstDestination, v$arrayLengthConstDestination
|
||||
"""
|
||||
)
|
||||
@@ -102,7 +102,7 @@ class CustomVideoSpeedPatch : BytecodePatch(
|
||||
|
||||
arrayGenMethod.replaceInstruction(
|
||||
originalArrayFetchIndex,
|
||||
"sget-object v$originalArrayFetchDestination, $videoSpeedsArrayType"
|
||||
"sget-object v$originalArrayFetchDestination, $playbackSpeedsArrayType"
|
||||
)
|
||||
|
||||
val limiterMethod = SpeedLimiterFingerprint.result?.mutableMethod!!
|
||||
@@ -121,24 +121,24 @@ class CustomVideoSpeedPatch : BytecodePatch(
|
||||
// edit: alternatively this might work by overriding with fixed values such as 0.1x and 10x
|
||||
limiterMethod.replaceInstruction(
|
||||
limiterMinConstIndex,
|
||||
"sget v$limiterMinConstDestination, $INTEGRATIONS_CLASS_DESCRIPTOR->minVideoSpeed:F"
|
||||
"sget v$limiterMinConstDestination, $INTEGRATIONS_CLASS_DESCRIPTOR->minPlaybackSpeed:F"
|
||||
)
|
||||
limiterMethod.replaceInstruction(
|
||||
limiterMaxConstIndex,
|
||||
"sget v$limiterMaxConstDestination, $INTEGRATIONS_CLASS_DESCRIPTOR->maxVideoSpeed:F"
|
||||
"sget v$limiterMaxConstDestination, $INTEGRATIONS_CLASS_DESCRIPTOR->maxPlaybackSpeed:F"
|
||||
)
|
||||
|
||||
// region Force old video quality menu.
|
||||
// This is necessary, because there is no known way of adding custom video speeds to the new menu.
|
||||
// This is necessary, because there is no known way of adding custom playback speeds to the new menu.
|
||||
|
||||
BottomSheetHookPatch.addHook(INTEGRATIONS_CLASS_DESCRIPTOR)
|
||||
|
||||
// Required to check if the video speed menu is currently shown.
|
||||
// Required to check if the playback speed menu is currently shown.
|
||||
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||
|
||||
GetOldVideoSpeedsFingerprint.result?.let { result ->
|
||||
GetOldPlaybackSpeedsFingerprint.result?.let { result ->
|
||||
// Add a static INSTANCE field to the class.
|
||||
// This is later used to call "showOldVideoSpeedMenu" on the instance.
|
||||
// This is later used to call "showOldPlaybackSpeedMenu" on the instance.
|
||||
val instanceField = ImmutableField(
|
||||
result.classDef.type,
|
||||
"INSTANCE",
|
||||
@@ -154,15 +154,15 @@ class CustomVideoSpeedPatch : BytecodePatch(
|
||||
// In order to prevent a conflict with another patch, add the instruction at index 1.
|
||||
result.mutableMethod.addInstruction(1, "sput-object p0, $instanceField")
|
||||
|
||||
// Get the "showOldVideoSpeedMenu" method.
|
||||
// Get the "showOldPlaybackSpeedMenu" method.
|
||||
// This is later called on the field INSTANCE.
|
||||
val showOldVideoSpeedMenuMethod = ShowOldVideoSpeedMenuFingerprint.also {
|
||||
val showOldPlaybackSpeedMenuMethod = ShowOldPlaybackSpeedMenuFingerprint.also {
|
||||
if (!it.resolve(context, result.classDef))
|
||||
throw ShowOldVideoSpeedMenuFingerprint.toErrorResult()
|
||||
throw ShowOldPlaybackSpeedMenuFingerprint.toErrorResult()
|
||||
}.result!!.method.toString()
|
||||
|
||||
// Insert the call to the "showOldVideoSpeedMenu" method on the field INSTANCE.
|
||||
ShowOldVideoSpeedMenuIntegrationsFingerprint.result?.mutableMethod?.apply {
|
||||
// Insert the call to the "showOldPlaybackSpeedMenu" method on the field INSTANCE.
|
||||
ShowOldPlaybackSpeedMenuIntegrationsFingerprint.result?.mutableMethod?.apply {
|
||||
addInstructionsWithLabels(
|
||||
implementation!!.instructions.lastIndex,
|
||||
"""
|
||||
@@ -170,11 +170,11 @@ class CustomVideoSpeedPatch : BytecodePatch(
|
||||
if-nez v0, :not_null
|
||||
return-void
|
||||
:not_null
|
||||
invoke-virtual { v0 }, $showOldVideoSpeedMenuMethod
|
||||
invoke-virtual { v0 }, $showOldPlaybackSpeedMenuMethod
|
||||
"""
|
||||
)
|
||||
} ?: return ShowOldVideoSpeedMenuIntegrationsFingerprint.toErrorResult()
|
||||
} ?: return GetOldVideoSpeedsFingerprint.toErrorResult()
|
||||
} ?: return ShowOldPlaybackSpeedMenuIntegrationsFingerprint.toErrorResult()
|
||||
} ?: return GetOldPlaybackSpeedsFingerprint.toErrorResult()
|
||||
|
||||
// endregion
|
||||
|
||||
@@ -183,10 +183,10 @@ class CustomVideoSpeedPatch : BytecodePatch(
|
||||
|
||||
private companion object {
|
||||
private const val FILTER_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/patches/components/VideoSpeedMenuFilterPatch;"
|
||||
"Lapp/revanced/integrations/patches/components/PlaybackSpeedMenuFilterPatch;"
|
||||
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/patches/playback/speed/CustomVideoSpeedPatch;"
|
||||
"Lapp/revanced/integrations/patches/playback/speed/CustomPlaybackSpeedPatch;"
|
||||
|
||||
}
|
||||
}
|
||||
@@ -19,13 +19,13 @@ import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.video.information.patch.VideoInformationPatch
|
||||
import app.revanced.patches.youtube.video.speed.custom.patch.CustomVideoSpeedPatch
|
||||
import app.revanced.patches.youtube.video.speed.custom.patch.CustomPlaybackSpeedPatch
|
||||
import app.revanced.patches.youtube.video.speed.remember.fingerprint.InitializePlaybackSpeedValuesFingerprint
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
|
||||
@Name("Remember playback speed")
|
||||
@Description("Adds the ability to remember the playback speed you chose in the video playback speed flyout.")
|
||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class, VideoInformationPatch::class, CustomVideoSpeedPatch::class])
|
||||
@Description("Adds the ability to remember the playback speed you chose in the playback speed flyout.")
|
||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class, VideoInformationPatch::class, CustomPlaybackSpeedPatch::class])
|
||||
@Version("0.0.1")
|
||||
class RememberPlaybackSpeedPatch : BytecodePatch(
|
||||
listOf(
|
||||
|
||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 9.6 KiB |