mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-07 09:53:55 +01:00
Compare commits
34 Commits
v2.196.0-d
...
v2.196.1-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7236dee006 | ||
|
|
f9b7c31ba9 | ||
|
|
14017311f0 | ||
|
|
79c2f04383 | ||
|
|
1468edfbc8 | ||
|
|
8ec276aac9 | ||
|
|
4a7d723290 | ||
|
|
0f242a6aaa | ||
|
|
2fb76f779b | ||
|
|
278f204463 | ||
|
|
943235f770 | ||
|
|
3e224e6379 | ||
|
|
58e923f5f8 | ||
|
|
b1047dcdb9 | ||
|
|
8acc23cb9b | ||
|
|
afd2766b0d | ||
|
|
b09b59493b | ||
|
|
0496a814d3 | ||
|
|
e2ef688824 | ||
|
|
7832787c7f | ||
|
|
e671258572 | ||
|
|
01e8938227 | ||
|
|
e73e1a2898 | ||
|
|
82949a098c | ||
|
|
fd83834788 | ||
|
|
4874853cda | ||
|
|
0756f81547 | ||
|
|
47f96563a9 | ||
|
|
2e9be4ea8f | ||
|
|
d76d96c1aa | ||
|
|
d5e226b449 | ||
|
|
340dc59f74 | ||
|
|
a75014b390 | ||
|
|
3740494f1b |
136
CHANGELOG.md
136
CHANGELOG.md
@@ -1,3 +1,139 @@
|
||||
## [2.196.1-dev.5](https://github.com/ReVanced/revanced-patches/compare/v2.196.1-dev.4...v2.196.1-dev.5) (2023-11-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Remove screenshot restriction:** Improve reliability ([#2938](https://github.com/ReVanced/revanced-patches/issues/2938)) ([6b7cb7b](https://github.com/ReVanced/revanced-patches/commit/6b7cb7bd38348dbe4a56385356df6ed97e81c319))
|
||||
|
||||
## [2.196.1-dev.4](https://github.com/ReVanced/revanced-patches/compare/v2.196.1-dev.3...v2.196.1-dev.4) (2023-11-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - SponsorBlock:** Rename "Preview/Recap" category to "Preview/Recap/Hook" ([#3245](https://github.com/ReVanced/revanced-patches/issues/3245)) ([2cd2453](https://github.com/ReVanced/revanced-patches/commit/2cd2453658622f369b6449d5c8c33326384c2679))
|
||||
|
||||
## [2.196.1-dev.3](https://github.com/ReVanced/revanced-patches/compare/v2.196.1-dev.2...v2.196.1-dev.3) (2023-11-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Nyx Music Plaer - Unlock pro:** Constrain to last working version ([96d24a3](https://github.com/ReVanced/revanced-patches/commit/96d24a3e2ef6bd323aa44a05aaf122683898e90a))
|
||||
|
||||
## [2.196.1-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.196.1-dev.1...v2.196.1-dev.2) (2023-11-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube:** Rename `Restore old seekbar thumbnails` and `Restore old quality menu` ([#3235](https://github.com/ReVanced/revanced-patches/issues/3235)) ([7e3ffc8](https://github.com/ReVanced/revanced-patches/commit/7e3ffc88631da47a032cb29a4a30fd8f5679542d))
|
||||
|
||||
## [2.196.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.196.0...v2.196.1-dev.1) (2023-11-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Theme:** Use consistent patch option descriptions ([#3231](https://github.com/ReVanced/revanced-patches/issues/3231)) ([c84a940](https://github.com/ReVanced/revanced-patches/commit/c84a94075ecba11e826f0b311283ef530563fe93))
|
||||
|
||||
# [2.196.0](https://github.com/ReVanced/revanced-patches/compare/v2.195.0...v2.196.0) (2023-11-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Announcements:** Do not end descriptions with punctuation ([17e414d](https://github.com/ReVanced/revanced-patches/commit/17e414d32b41b66441382d123aa4c16c2547f2c9))
|
||||
* **YouTube - Custom branding:** Set default values for patch options ([2ba31f1](https://github.com/ReVanced/revanced-patches/commit/2ba31f13012284f4ae9d556cbaa01dc128f193df))
|
||||
* **YouTube - Player flyout menu:** Restore functionality ([#3163](https://github.com/ReVanced/revanced-patches/issues/3163)) ([b5e63c1](https://github.com/ReVanced/revanced-patches/commit/b5e63c11ab21a89e912dd41e307631f479e0ba96))
|
||||
* **YouTube - ReturnYouTubeDislike:** Fix RYD prefetching home feed Shorts ([#3195](https://github.com/ReVanced/revanced-patches/issues/3195)) ([f3726fe](https://github.com/ReVanced/revanced-patches/commit/f3726fefb9a80cccbf12f3ec455d1720b385782e))
|
||||
* **YouTube - Theme:** Fix patch error ([e6fe646](https://github.com/ReVanced/revanced-patches/commit/e6fe646a7f2ade5f24c0142ad44032ccaf2cc9d0))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Digitales Amt:** Bump compatibility to `3.0.2` ([#3217](https://github.com/ReVanced/revanced-patches/issues/3217)) ([79a1571](https://github.com/ReVanced/revanced-patches/commit/79a1571dd674d0cdaae7d00da74b59376ef1550b))
|
||||
* **ID Austria:** Constrain compatibility to last working version ([#3196](https://github.com/ReVanced/revanced-patches/issues/3196)) ([79a2416](https://github.com/ReVanced/revanced-patches/commit/79a24164193460acf1b7bac43abdfa2604b02679))
|
||||
* **Sony Headphones Connect - Remove notification badge:** Constrain to last working version ([4a7d189](https://github.com/ReVanced/revanced-patches/commit/4a7d18962d85382f358de774d5b2bcc3ab7f4a1a))
|
||||
* **YouTube - Announcements:** Clarify announcements origin ([03bb7d3](https://github.com/ReVanced/revanced-patches/commit/03bb7d3cff419c5214cf5bc0e5298e612b678d98))
|
||||
* **YouTube - Announcements:** Clarify announcements origin in patch description ([#3175](https://github.com/ReVanced/revanced-patches/issues/3175)) ([0a04500](https://github.com/ReVanced/revanced-patches/commit/0a0450075a6af913de0c8b414103e491e5ff8e72))
|
||||
* **YouTube - Client spoof:** Update current video id ([9937b8f](https://github.com/ReVanced/revanced-patches/commit/9937b8fc7e7df6c850073da6faeeb70f82977cd1))
|
||||
* **YouTube - Disable precise seeking gesture:** Use better patch name ([88cce59](https://github.com/ReVanced/revanced-patches/commit/88cce592adde46bc2811596772c03d275352be4b))
|
||||
* **YouTube - Hide layout components:** Hide video quality menu footer ([0f9e6e7](https://github.com/ReVanced/revanced-patches/commit/0f9e6e751fe4822c92afd7176e6be67d1afe566f))
|
||||
* **YouTube - Theme:** Add set of light and dark themes to chose from ([cf6006c](https://github.com/ReVanced/revanced-patches/commit/cf6006cc83909b60acaad374ddaac5de902eb604))
|
||||
* **YouTube - Theme:** Improve patch option descriptions ([5d3008a](https://github.com/ReVanced/revanced-patches/commit/5d3008a5afa8961a04ce09782574a4c19343951b))
|
||||
* **YouTube:** Add `Disable fullscreen ambient mode` patch ([2a5514a](https://github.com/ReVanced/revanced-patches/commit/2a5514a6b3df076d5bc2cdc4459df30bca18f396))
|
||||
* **YouTube:** Add `Disable suggested video end screen` patch ([09f1684](https://github.com/ReVanced/revanced-patches/commit/09f168406c36fb71e12c6c1875a765a86ec2b4f9))
|
||||
* **YouTube:** Add `Enable old seekbar thumbnails` patch ([e97e0e6](https://github.com/ReVanced/revanced-patches/commit/e97e0e6631f64e12b8d45d8cacbc059d5fc72e0c))
|
||||
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "fix(YouTube - Minimized playback): Fix pip incorrectly showing for Short playback (#3170)" ([4179b16](https://github.com/ReVanced/revanced-patches/commit/4179b166bbdfbe98cc368f4a7ad17419e1b469a9)), closes [#3170](https://github.com/ReVanced/revanced-patches/issues/3170)
|
||||
|
||||
# [2.196.0-dev.14](https://github.com/ReVanced/revanced-patches/compare/v2.196.0-dev.13...v2.196.0-dev.14) (2023-11-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Digitales Amt:** Bump compatibility to `3.0.2` ([#3217](https://github.com/ReVanced/revanced-patches/issues/3217)) ([79a1571](https://github.com/ReVanced/revanced-patches/commit/79a1571dd674d0cdaae7d00da74b59376ef1550b))
|
||||
* **Sony Headphones Connect - Remove notification badge:** Constrain to last working version ([4a7d189](https://github.com/ReVanced/revanced-patches/commit/4a7d18962d85382f358de774d5b2bcc3ab7f4a1a))
|
||||
|
||||
# [2.196.0-dev.14](https://github.com/ReVanced/revanced-patches/compare/v2.196.0-dev.13...v2.196.0-dev.14) (2023-11-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Digitales Amt:** Bump compatibility to `3.0.2` ([#3217](https://github.com/ReVanced/revanced-patches/issues/3217)) ([f21fa58](https://github.com/ReVanced/revanced-patches/commit/f21fa5894b767474b7cedcc2eba7b2a65554169a))
|
||||
|
||||
# [2.196.0-dev.13](https://github.com/ReVanced/revanced-patches/compare/v2.196.0-dev.12...v2.196.0-dev.13) (2023-11-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Player flyout menu:** Restore functionality ([#3163](https://github.com/ReVanced/revanced-patches/issues/3163)) ([b5e63c1](https://github.com/ReVanced/revanced-patches/commit/b5e63c11ab21a89e912dd41e307631f479e0ba96))
|
||||
|
||||
# [2.196.0-dev.12](https://github.com/ReVanced/revanced-patches/compare/v2.196.0-dev.11...v2.196.0-dev.12) (2023-11-03)
|
||||
|
||||
# [2.196.0-dev.11](https://github.com/ReVanced/revanced-patches/compare/v2.196.0-dev.10...v2.196.0-dev.11) (2023-10-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Custom branding:** Set default values for patch options ([2ba31f1](https://github.com/ReVanced/revanced-patches/commit/2ba31f13012284f4ae9d556cbaa01dc128f193df))
|
||||
|
||||
# [2.196.0-dev.10](https://github.com/ReVanced/revanced-patches/compare/v2.196.0-dev.9...v2.196.0-dev.10) (2023-10-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **YouTube - Client spoof:** Update current video id ([9937b8f](https://github.com/ReVanced/revanced-patches/commit/9937b8fc7e7df6c850073da6faeeb70f82977cd1))
|
||||
|
||||
# [2.196.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v2.196.0-dev.8...v2.196.0-dev.9) (2023-10-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **YouTube - Disable precise seeking gesture:** Use better patch name ([88cce59](https://github.com/ReVanced/revanced-patches/commit/88cce592adde46bc2811596772c03d275352be4b))
|
||||
* **YouTube:** Add `Enable old seekbar thumbnails` patch ([e97e0e6](https://github.com/ReVanced/revanced-patches/commit/e97e0e6631f64e12b8d45d8cacbc059d5fc72e0c))
|
||||
|
||||
# [2.196.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v2.196.0-dev.7...v2.196.0-dev.8) (2023-10-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **ID Austria:** Constrain compatibility to last working version ([#3196](https://github.com/ReVanced/revanced-patches/issues/3196)) ([79a2416](https://github.com/ReVanced/revanced-patches/commit/79a24164193460acf1b7bac43abdfa2604b02679))
|
||||
|
||||
# [2.196.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v2.196.0-dev.6...v2.196.0-dev.7) (2023-10-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **YouTube:** Add `Disable fullscreen ambient mode` patch ([2a5514a](https://github.com/ReVanced/revanced-patches/commit/2a5514a6b3df076d5bc2cdc4459df30bca18f396))
|
||||
* **YouTube:** Add `Disable suggested video end screen` patch ([09f1684](https://github.com/ReVanced/revanced-patches/commit/09f168406c36fb71e12c6c1875a765a86ec2b4f9))
|
||||
|
||||
# [2.196.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v2.196.0-dev.5...v2.196.0-dev.6) (2023-10-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - ReturnYouTubeDislike:** Fix RYD prefetching home feed Shorts ([#3195](https://github.com/ReVanced/revanced-patches/issues/3195)) ([f3726fe](https://github.com/ReVanced/revanced-patches/commit/f3726fefb9a80cccbf12f3ec455d1720b385782e))
|
||||
|
||||
# [2.196.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v2.196.0-dev.4...v2.196.0-dev.5) (2023-10-24)
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
org.gradle.parallel = true
|
||||
org.gradle.caching = true
|
||||
kotlin.code.style = official
|
||||
version = 2.196.0-dev.5
|
||||
version = 2.196.1-dev.5
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[versions]
|
||||
revanced-patcher = "18.0.0"
|
||||
revanced-patcher = "19.0.0"
|
||||
smali = "3.0.3"
|
||||
guava = "32.1.2-jre"
|
||||
gson = "2.10.1"
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,14 +1,19 @@
|
||||
package app.revanced.patches.all.screenshot.removerestriction
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.util.patch.AbstractTransformInstructionsPatch
|
||||
import app.revanced.util.patch.IMethodCall
|
||||
import app.revanced.util.patch.Instruction35cInfo
|
||||
import app.revanced.util.patch.filterMapInstruction35c
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.ClassDef
|
||||
import com.android.tools.smali.dexlib2.iface.Method
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.Instruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction22c
|
||||
import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
||||
|
||||
@Patch(
|
||||
name = "Remove screenshot restriction",
|
||||
@@ -22,6 +27,11 @@ object RemoveScreenshotRestrictionPatch : AbstractTransformInstructionsPatch<Ins
|
||||
"Lapp/revanced/all/screenshot/removerestriction/RemoveScreenshotRestrictionPatch"
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR = "$INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
super.execute(context)
|
||||
ModifyLayoutParamsFlags().execute(context)
|
||||
}
|
||||
|
||||
override fun filterMap(
|
||||
classDef: ClassDef,
|
||||
method: Method,
|
||||
@@ -46,6 +56,12 @@ object RemoveScreenshotRestrictionPatch : AbstractTransformInstructionsPatch<Ins
|
||||
override val methodParams: Array<String>,
|
||||
override val returnType: String
|
||||
): IMethodCall {
|
||||
AddFlags(
|
||||
"Landroid/view/Window;",
|
||||
"addFlags",
|
||||
arrayOf("I"),
|
||||
"V",
|
||||
),
|
||||
SetFlags(
|
||||
"Landroid/view/Window;",
|
||||
"setFlags",
|
||||
@@ -54,3 +70,37 @@ object RemoveScreenshotRestrictionPatch : AbstractTransformInstructionsPatch<Ins
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private class ModifyLayoutParamsFlags : AbstractTransformInstructionsPatch<Pair<Instruction22c, Int>>() {
|
||||
override fun filterMap(
|
||||
classDef: ClassDef,
|
||||
method: Method,
|
||||
instruction: Instruction,
|
||||
instructionIndex: Int
|
||||
): Pair<Instruction22c, Int>? {
|
||||
if (instruction.opcode != Opcode.IPUT) {
|
||||
return null
|
||||
}
|
||||
|
||||
val instruction22c = instruction as Instruction22c
|
||||
val fieldReference = instruction22c.reference as FieldReference
|
||||
|
||||
if (fieldReference.definingClass != "Landroid/view/WindowManager\$LayoutParams;"
|
||||
|| fieldReference.name != "flags"
|
||||
|| fieldReference.type != "I") {
|
||||
return null
|
||||
}
|
||||
|
||||
return Pair(instruction22c, instructionIndex)
|
||||
}
|
||||
|
||||
override fun transform(mutableMethod: MutableMethod, entry: Pair<Instruction22c, Int>) {
|
||||
val (instruction, index) = entry
|
||||
val register = instruction.registerA
|
||||
|
||||
mutableMethod.addInstructions(
|
||||
index,
|
||||
"and-int/lit16 v$register, v$register, -0x2001"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,26 @@
|
||||
package app.revanced.patches.idaustria.detection.root
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.idaustria.detection.root.fingerprints.RootDetectionFingerprint
|
||||
import app.revanced.patches.idaustria.detection.root.fingerprints.AttestationSupportedCheckFingerprint
|
||||
import app.revanced.patches.idaustria.detection.root.fingerprints.BootloaderCheckFingerprint
|
||||
import app.revanced.patches.idaustria.detection.root.fingerprints.RootCheckFingerprint
|
||||
import app.revanced.util.Utils.returnEarly
|
||||
|
||||
@Patch(
|
||||
name = "Remove root detection",
|
||||
description = "Removes the check for root permissions and unlocked bootloader.",
|
||||
compatiblePackages = [CompatiblePackage("at.gv.oe.app")]
|
||||
compatiblePackages = [CompatiblePackage("at.gv.oe.app", ["3.0.2"])]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object RootDetectionPatch : BytecodePatch(
|
||||
setOf(RootDetectionFingerprint)
|
||||
setOf(AttestationSupportedCheckFingerprint, BootloaderCheckFingerprint, RootCheckFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) =
|
||||
RootDetectionFingerprint.result!!.mutableMethod.addInstruction(0, "return-void")
|
||||
override fun execute(context: BytecodeContext) = listOf(
|
||||
AttestationSupportedCheckFingerprint,
|
||||
BootloaderCheckFingerprint,
|
||||
RootCheckFingerprint
|
||||
).returnEarly(true)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.idaustria.detection.root.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object AttestationSupportedCheckFingerprint : MethodFingerprint(
|
||||
"V",
|
||||
accessFlags = AccessFlags.PUBLIC.value,
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.name == "attestationSupportCheck" &&
|
||||
methodDef.definingClass.endsWith("/DeviceIntegrityCheck;")
|
||||
}
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.idaustria.detection.root.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object BootloaderCheckFingerprint : MethodFingerprint(
|
||||
"Z",
|
||||
accessFlags = AccessFlags.PUBLIC.value,
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.name == "bootloaderCheck" &&
|
||||
methodDef.definingClass.endsWith("/DeviceIntegrityCheck;")
|
||||
}
|
||||
)
|
||||
@@ -3,10 +3,11 @@ package app.revanced.patches.idaustria.detection.root.fingerprints
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object RootDetectionFingerprint : MethodFingerprint(
|
||||
object RootCheckFingerprint : MethodFingerprint(
|
||||
"V",
|
||||
accessFlags = AccessFlags.PUBLIC.value,
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.name == "rootCheck" &&
|
||||
methodDef.definingClass.endsWith("/DeviceIntegrityCheck;")
|
||||
}
|
||||
)
|
||||
@@ -10,7 +10,7 @@ import app.revanced.patches.idaustria.detection.signature.fingerprints.SpoofSign
|
||||
@Patch(
|
||||
name = "Spoof signature",
|
||||
description = "Spoofs the signature of the app.",
|
||||
compatiblePackages = [CompatiblePackage("at.gv.oe.app")]
|
||||
compatiblePackages = [CompatiblePackage("at.gv.oe.app", ["3.0.2"])]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object SpoofSignaturePatch : BytecodePatch(
|
||||
|
||||
@@ -10,7 +10,7 @@ import app.revanced.patches.nyx.misc.pro.fingerprints.CheckProFingerprint
|
||||
|
||||
@Patch(
|
||||
name = "Unlock pro",
|
||||
compatiblePackages = [CompatiblePackage("com.awedea.nyx")]
|
||||
compatiblePackages = [CompatiblePackage("com.awedea.nyx", ["2.2.7"])]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object UnlockProPatch : BytecodePatch(setOf(CheckProFingerprint)) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import app.revanced.patches.songpal.badge.fingerprints.ShowNotificationFingerpri
|
||||
@Patch(
|
||||
name = "Remove notification badge",
|
||||
description = "Removes the red notification badge from the activity tab.",
|
||||
compatiblePackages = [CompatiblePackage("com.sony.songpal.mdr")]
|
||||
compatiblePackages = [CompatiblePackage("com.sony.songpal.mdr", ["10.1.0"])]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object RemoveNotificationBadgePatch : BytecodePatch(setOf(ShowNotificationFingerprint)) {
|
||||
|
||||
@@ -15,8 +15,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Disable fine scrubbing gesture",
|
||||
description = "Disables gesture that shows the fine scrubbing overlay when swiping up on the seekbar.",
|
||||
name = "Disable precise seeking gesture",
|
||||
description = "Disables the gesture that is used to seek precisely when swiping up on the seekbar.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
@@ -30,20 +30,20 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||
]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object DisableFineScrubbingGesturePatch : BytecodePatch(
|
||||
object DisablePreciseSeekingGesturePatch : BytecodePatch(
|
||||
setOf(IsSwipingUpFingerprint)
|
||||
) {
|
||||
private const val INTEGRATIONS_METHOD_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/patches/DisableFineScrubbingGesturePatch;->" +
|
||||
"Lapp/revanced/integrations/patches/DisablePreciseSeekingGesturePatch;->" +
|
||||
"disableGesture(Landroid/view/VelocityTracker;Landroid/view/MotionEvent;)V"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_disable_fine_scrubbing_gesture",
|
||||
StringResource("revanced_disable_fine_scrubbing_gesture_title", "Disable fine scrubbing gesture"),
|
||||
StringResource("revanced_disable_fine_scrubbing_gesture_summary_on", "Gesture is disabled"),
|
||||
StringResource("revanced_disable_fine_scrubbing_gesture_summary_off", "Gesture is enabled"),
|
||||
"revanced_disable_precise_seeking_gesture",
|
||||
StringResource("revanced_disable_precise_seeking_gesture_title", "Disable precise seeking gesture"),
|
||||
StringResource("revanced_disable_precise_seeking_gesture_summary_on", "Gesture is disabled"),
|
||||
StringResource("revanced_disable_precise_seeking_gesture_summary_off", "Gesture is enabled"),
|
||||
)
|
||||
)
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.nio.file.Files
|
||||
@Suppress("unused")
|
||||
object CustomBrandingPatch : ResourcePatch() {
|
||||
private const val REVANCED_ICON = "ReVanced*Logo" // Can never be a valid path.
|
||||
private const val APP_NAME = "YouTube ReVanced"
|
||||
|
||||
private val iconResourceFileNames = arrayOf(
|
||||
"adaptiveproduct_youtube_background_color_108",
|
||||
@@ -39,8 +40,9 @@ object CustomBrandingPatch : ResourcePatch() {
|
||||
|
||||
private var appName by stringPatchOption(
|
||||
key = "appName",
|
||||
default = APP_NAME,
|
||||
values = mapOf(
|
||||
"YouTube ReVanced" to "YouTube ReVanced",
|
||||
"YouTube ReVanced" to APP_NAME,
|
||||
"YT" to "YT",
|
||||
"YouTube" to "YouTube",
|
||||
),
|
||||
@@ -50,6 +52,7 @@ object CustomBrandingPatch : ResourcePatch() {
|
||||
|
||||
private var icon by stringPatchOption(
|
||||
key = "iconPath",
|
||||
default = REVANCED_ICON,
|
||||
values = mapOf("ReVanced Logo" to REVANCED_ICON),
|
||||
title = "App icon",
|
||||
description = """
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package app.revanced.patches.youtube.layout.hide.fullscreenambientmode
|
||||
|
||||
import app.revanced.extensions.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.hide.fullscreenambientmode.fingerprints.InitializeAmbientModeFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
name = "Disable fullscreen ambient mode",
|
||||
description = "Disables the ambient mode when in fullscreen.",
|
||||
dependencies = [SettingsPatch::class, IntegrationsPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object DisableFullscreenAmbientModePatch : BytecodePatch(
|
||||
setOf(InitializeAmbientModeFingerprint)
|
||||
) {
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/patches/DisableFullscreenAmbientModePatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_disable_fullscreen_ambient_mode",
|
||||
StringResource(
|
||||
"revanced_disable_fullscreen_ambient_mode_title",
|
||||
"Disable ambient mode in fullscreen"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_disable_fullscreen_ambient_mode_summary_on",
|
||||
"Ambient mode disabled"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_disable_fullscreen_ambient_mode_summary_off",
|
||||
"Ambient mode enabled"
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
InitializeAmbientModeFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val moveIsEnabledIndex = it.scanResult.patternScanResult!!.endIndex
|
||||
|
||||
addInstruction(
|
||||
moveIsEnabledIndex,
|
||||
"invoke-static { }, " +
|
||||
"$INTEGRATIONS_CLASS_DESCRIPTOR->enableFullScreenAmbientMode()Z"
|
||||
)
|
||||
}
|
||||
} ?: throw InitializeAmbientModeFingerprint.exception
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.youtube.layout.hide.fullscreenambientmode.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.util.patch.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object InitializeAmbientModeFingerprint : LiteralValueFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.CONSTRUCTOR or AccessFlags.PUBLIC,
|
||||
opcodes = listOf(Opcode.MOVE_RESULT),
|
||||
literalSupplier = { 45389368 }
|
||||
)
|
||||
@@ -8,6 +8,7 @@ import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
@@ -15,6 +16,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
description = "Hides player flyout menu items.",
|
||||
dependencies = [
|
||||
LithoFilterPatch::class,
|
||||
PlayerTypeHookPatch::class,
|
||||
SettingsPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
@@ -43,18 +45,18 @@ object HidePlayerFlyoutMenuPatch : ResourcePatch() {
|
||||
KEY,
|
||||
StringResource("${KEY}_title", "Player flyout menu items"),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"${KEY}_quality",
|
||||
StringResource("${KEY}_quality_title", "Hide Quality menu"),
|
||||
StringResource("${KEY}_quality_on", "Quality menu item is hidden"),
|
||||
StringResource("${KEY}_quality_off", "Quality menu item is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"${KEY}_captions",
|
||||
StringResource("${KEY}_captions_title", "Hide Captions menu"),
|
||||
StringResource("${KEY}_captions_on", "Captions menu item is hidden"),
|
||||
StringResource("${KEY}_captions_off", "Captions menu item is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"${KEY}_additional_settings",
|
||||
StringResource("${KEY}_additional_settings_title", "Hide Additional settings menu"),
|
||||
StringResource("${KEY}_additional_settings_on", "Additional settings menu item is hidden"),
|
||||
StringResource("${KEY}_additional_settings_off", "Additional settings menu item is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"${KEY}_loop_video",
|
||||
StringResource("${KEY}_loop_video_title", "Hide Loop video menu"),
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package app.revanced.patches.youtube.layout.hide.suggestedvideoendscreen
|
||||
|
||||
import app.revanced.extensions.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.youtube.layout.hide.suggestedvideoendscreen.fingerprints.CreateEndScreenViewFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Disable suggested video end screen",
|
||||
description = "Disables the suggested video end screen at the end of a video.",
|
||||
dependencies = [IntegrationsPatch::class, DisableSuggestedVideoEndScreenResourcePatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object DisableSuggestedVideoEndScreenPatch : BytecodePatch(
|
||||
setOf(CreateEndScreenViewFingerprint)
|
||||
) {
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/patches/DisableSuggestedVideoEndScreenPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
CreateEndScreenViewFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val addOnClickEventListenerIndex = it.scanResult.patternScanResult!!.endIndex - 1
|
||||
val viewRegister = getInstruction<FiveRegisterInstruction>(addOnClickEventListenerIndex).registerC
|
||||
|
||||
addInstruction(
|
||||
addOnClickEventListenerIndex + 1,
|
||||
"invoke-static {v$viewRegister}, " +
|
||||
"$INTEGRATIONS_CLASS_DESCRIPTOR->closeEndScreen(Landroid/widget/ImageView;)V"
|
||||
)
|
||||
}
|
||||
} ?: throw CreateEndScreenViewFingerprint.exception
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package app.revanced.patches.youtube.layout.hide.suggestedvideoendscreen
|
||||
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
ResourceMappingPatch::class
|
||||
],
|
||||
)
|
||||
object DisableSuggestedVideoEndScreenResourcePatch : ResourcePatch() {
|
||||
internal var sizeAdjustableLiteAutoNavOverlay: Long = -1
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_disable_suggested_video_end_screen",
|
||||
StringResource(
|
||||
"revanced_disable_suggested_video_end_screen_title",
|
||||
"Disable suggested video end screen"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_disable_suggested_video_end_screen_summary_on",
|
||||
"Suggested videos will be disabled"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_disable_suggested_video_end_screen_summary_off",
|
||||
"Suggested videos will be shown"
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
sizeAdjustableLiteAutoNavOverlay = ResourceMappingPatch.resourceMappings.single {
|
||||
it.type == "layout" && it.name == "size_adjustable_lite_autonav_overlay"
|
||||
}.id
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.revanced.patches.youtube.layout.hide.suggestedvideoendscreen.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.layout.hide.suggestedvideoendscreen.DisableSuggestedVideoEndScreenResourcePatch
|
||||
import app.revanced.util.patch.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object CreateEndScreenViewFingerprint : LiteralValueFingerprint(
|
||||
returnType= "Landroid/view/View;",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf("Landroid/content/Context;"),
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.CONST
|
||||
),
|
||||
literalSupplier = { DisableSuggestedVideoEndScreenResourcePatch.sizeAdjustableLiteAutoNavOverlay }
|
||||
)
|
||||
@@ -58,7 +58,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
||||
VideoIdPatch.hookVideoId("$INTEGRATIONS_CLASS_DESCRIPTOR->newVideoLoaded(Ljava/lang/String;)V")
|
||||
|
||||
// Hook the player response video id, to start loading RYD sooner in the background.
|
||||
VideoIdPatch.hookPlayerResponseVideoId("$INTEGRATIONS_CLASS_DESCRIPTOR->preloadVideoId(Ljava/lang/String;)V")
|
||||
VideoIdPatch.hookPlayerResponseVideoId("$INTEGRATIONS_CLASS_DESCRIPTOR->preloadVideoId(Ljava/lang/String;Z)V")
|
||||
|
||||
// endregion
|
||||
|
||||
@@ -184,7 +184,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
|
||||
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||
|
||||
// Player response video id is needed to search for the video ids in Shorts litho components.
|
||||
VideoIdPatch.hookPlayerResponseVideoId("$FILTER_CLASS_DESCRIPTOR->newPlayerResponseVideoId(Ljava/lang/String;)V")
|
||||
VideoIdPatch.hookPlayerResponseVideoId("$FILTER_CLASS_DESCRIPTOR->newPlayerResponseVideoId(Ljava/lang/String;Z)V")
|
||||
|
||||
// endregion
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package app.revanced.patches.youtube.layout.seekbar
|
||||
|
||||
import app.revanced.extensions.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstructions
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.seekbar.fingerprints.FullscreenSeekbarThumbnailsFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
name = "Restore old seekbar thumbnails",
|
||||
description = "Restores the old seekbar thumbnails that appear above the seekbar instead of fullscreen thumbnails.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
"18.37.36",
|
||||
"18.38.44"
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object RestoreOldSeekbarThumbnailsPatch : BytecodePatch(
|
||||
setOf(FullscreenSeekbarThumbnailsFingerprint)
|
||||
) {
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/patches/RestoreOldSeekbarThumbnailsPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_restore_old_seekbar_thumbnails",
|
||||
StringResource(
|
||||
"revanced_restore_old_seekbar_thumbnails_title",
|
||||
"Restore old seekbar thumbnails"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_restore_old_seekbar_thumbnails_summary_on",
|
||||
"Seekbar thumbnails will appear above the seekbar"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_restore_old_seekbar_thumbnails_summary_off",
|
||||
"Seekbar thumbnails will appear in fullscreen"
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
FullscreenSeekbarThumbnailsFingerprint.result?.mutableMethod?.apply {
|
||||
val moveResultIndex = getInstructions().lastIndex - 1
|
||||
|
||||
addInstruction(
|
||||
moveResultIndex,
|
||||
"invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->useFullscreenSeekbarThumbnails()Z"
|
||||
)
|
||||
} ?: throw FullscreenSeekbarThumbnailsFingerprint.exception
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.revanced.patches.youtube.layout.seekbar.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.util.patch.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object FullscreenSeekbarThumbnailsFingerprint : LiteralValueFingerprint(
|
||||
returnType = "Z",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = emptyList(),
|
||||
literalSupplier = { 45398577 }
|
||||
)
|
||||
@@ -82,7 +82,7 @@ object ThemeBytecodePatch : BytecodePatch(
|
||||
"Light red" to "#FFFFD6D6"
|
||||
),
|
||||
title = "Light theme background color",
|
||||
description = "Can be a hex color or a color resource reference.",
|
||||
description = "Can be a hex color (#AARRGGBB) or a color resource reference.",
|
||||
)
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
|
||||
@@ -15,6 +15,7 @@ import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.*
|
||||
import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
||||
import app.revanced.patches.youtube.video.playerresponse.PlayerResponseMethodHookPatch
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@@ -24,6 +25,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
SettingsPatch::class,
|
||||
PlayerTypeHookPatch::class,
|
||||
PlayerResponseMethodHookPatch::class,
|
||||
VideoInformationPatch::class,
|
||||
]
|
||||
)
|
||||
object SpoofSignaturePatch : BytecodePatch(
|
||||
|
||||
@@ -114,7 +114,7 @@ object VideoInformationPatch : BytecodePatch(
|
||||
VideoIdPatch.hookVideoId(videoIdMethodDescriptor)
|
||||
VideoIdPatch.hookBackgroundPlayVideoId(videoIdMethodDescriptor)
|
||||
VideoIdPatch.hookPlayerResponseVideoId(
|
||||
"$INTEGRATIONS_CLASS_DESCRIPTOR->setPlayerResponseVideoId(Ljava/lang/String;)V")
|
||||
"$INTEGRATIONS_CLASS_DESCRIPTOR->setPlayerResponseVideoId(Ljava/lang/String;Z)V")
|
||||
|
||||
/*
|
||||
* Set the video time method
|
||||
|
||||
@@ -19,6 +19,7 @@ object PlayerResponseMethodHookPatch :
|
||||
Closeable,
|
||||
MutableSet<PlayerResponseMethodHookPatch.Hook> by mutableSetOf() {
|
||||
private const val VIDEO_ID_PARAMETER = 1
|
||||
private const val VIDEO_IS_OPENING_OR_PLAYING_PARAMETER = 11
|
||||
private const val PROTO_BUFFER_PARAMETER_PARAMETER = 3
|
||||
|
||||
private lateinit var playerResponseMethod: MutableMethod
|
||||
@@ -30,7 +31,7 @@ object PlayerResponseMethodHookPatch :
|
||||
|
||||
override fun close() {
|
||||
fun hookVideoId(hook: Hook) = playerResponseMethod.addInstruction(
|
||||
0, "invoke-static {p$VIDEO_ID_PARAMETER}, $hook"
|
||||
0, "invoke-static {p$VIDEO_ID_PARAMETER, p$VIDEO_IS_OPENING_OR_PLAYING_PARAMETER}, $hook"
|
||||
)
|
||||
|
||||
fun hookProtoBufferParameter(hook: Hook) = playerResponseMethod.addInstructions(
|
||||
|
||||
@@ -18,7 +18,7 @@ object PlayerParameterBuilderFingerprint : MethodFingerprint(
|
||||
"Ljava/lang/String;",
|
||||
"Ljava/lang/String;",
|
||||
"L",
|
||||
"Z",
|
||||
"Z", // Appears to indicate if the video id is being opened or is currently playing.
|
||||
"Z",
|
||||
"Z"
|
||||
)
|
||||
|
||||
@@ -103,6 +103,9 @@ object VideoIdPatch : BytecodePatch(
|
||||
* Hooks the video id of every video when loaded.
|
||||
* Supports all videos and functions in all situations.
|
||||
*
|
||||
* First parameter is the video id.
|
||||
* Second parameter is if the video is being opened or is currently playing.
|
||||
*
|
||||
* Hook is always called off the main thread.
|
||||
*
|
||||
* This hook is called as soon as the player response is parsed,
|
||||
@@ -117,7 +120,7 @@ object VideoIdPatch : BytecodePatch(
|
||||
*
|
||||
* Be aware, this can be called multiple times for the same video id.
|
||||
*
|
||||
* @param methodDescriptor which method to call. Params have to be `Ljava/lang/String;`
|
||||
* @param methodDescriptor which method to call. Params must be `Ljava/lang/String;Z`
|
||||
*/
|
||||
fun hookPlayerResponseVideoId(methodDescriptor: String) {
|
||||
PlayerResponseMethodHookPatch += PlayerResponseMethodHookPatch.Hook.VideoId(
|
||||
|
||||
@@ -13,11 +13,11 @@ import app.revanced.patches.youtube.video.videoqualitymenu.fingerprints.VideoQua
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Old video quality menu",
|
||||
description = "Shows the old video quality with the advanced video quality options instead of the new one.",
|
||||
name = "Restore old video quality menu",
|
||||
description = "Restores the old video quality with advanced video quality options.",
|
||||
dependencies = [
|
||||
IntegrationsPatch::class,
|
||||
OldVideoQualityMenuResourcePatch::class,
|
||||
RestoreOldVideoQualityMenuResourcePatch::class,
|
||||
LithoFilterPatch::class,
|
||||
RecyclerViewTreeHookPatch::class
|
||||
],
|
||||
@@ -36,14 +36,14 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object OldVideoQualityMenuPatch : BytecodePatch(
|
||||
object RestoreOldVideoQualityMenuPatch : BytecodePatch(
|
||||
setOf(VideoQualityMenuViewInflateFingerprint)
|
||||
) {
|
||||
private const val FILTER_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/patches/components/VideoQualityMenuFilterPatch;"
|
||||
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/patches/playback/quality/OldVideoQualityMenuPatch;"
|
||||
"Lapp/revanced/integrations/patches/playback/quality/RestoreOldVideoQualityMenuPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
// region Patch for the old type of the video quality menu.
|
||||
@@ -12,16 +12,16 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
@Patch(
|
||||
dependencies = [SettingsPatch::class, ResourceMappingPatch::class]
|
||||
)
|
||||
object OldVideoQualityMenuResourcePatch : ResourcePatch() {
|
||||
object RestoreOldVideoQualityMenuResourcePatch : ResourcePatch() {
|
||||
internal var videoQualityBottomSheetListFragmentTitle = -1L
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.PreferenceScreen.VIDEO.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_show_old_video_quality_menu",
|
||||
StringResource("revanced_show_old_video_quality_menu_title", "Show old video quality menu"),
|
||||
StringResource("revanced_show_old_video_quality_menu_summary_on", "Old video quality menu is shown"),
|
||||
StringResource("revanced_show_old_video_quality_menu_summary_off", "New video quality menu is hidden")
|
||||
"revanced_restore_old_video_quality_menu",
|
||||
StringResource("revanced_restore_old_video_quality_menu_title", "Restore old video quality menu"),
|
||||
StringResource("revanced_restore_old_video_quality_menu_summary_on", "Old video quality menu is shown"),
|
||||
StringResource("revanced_restore_old_video_quality_menu_summary_off", "Old video quality menu is not shown")
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package app.revanced.patches.youtube.video.videoqualitymenu.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.video.videoqualitymenu.OldVideoQualityMenuResourcePatch
|
||||
import app.revanced.patches.youtube.video.videoqualitymenu.RestoreOldVideoQualityMenuResourcePatch
|
||||
import app.revanced.util.patch.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
@@ -26,5 +26,5 @@ object VideoQualityMenuViewInflateFingerprint : LiteralValueFingerprint(
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST
|
||||
),
|
||||
literalSupplier = { OldVideoQualityMenuResourcePatch.videoQualityBottomSheetListFragmentTitle }
|
||||
literalSupplier = { RestoreOldVideoQualityMenuResourcePatch.videoQualityBottomSheetListFragmentTitle }
|
||||
)
|
||||
32
src/main/kotlin/app/revanced/util/Utils.kt
Normal file
32
src/main/kotlin/app/revanced/util/Utils.kt
Normal file
@@ -0,0 +1,32 @@
|
||||
package app.revanced.util
|
||||
|
||||
import app.revanced.extensions.exception
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
|
||||
object Utils {
|
||||
/**
|
||||
* Return the resolved methods of [MethodFingerprint]s early.
|
||||
*/
|
||||
fun List<MethodFingerprint>.returnEarly(bool: Boolean = false) {
|
||||
val const = if (bool) "0x1" else "0x0"
|
||||
this.forEach { fingerprint ->
|
||||
fingerprint.result?.let { result ->
|
||||
val stringInstructions = when (result.method.returnType.first()) {
|
||||
'L' -> """
|
||||
const/4 v0, $const
|
||||
return-object v0
|
||||
"""
|
||||
'V' -> "return-void"
|
||||
'I', 'Z' -> """
|
||||
const/4 v0, $const
|
||||
return v0
|
||||
"""
|
||||
else -> throw Exception("This case should never happen.")
|
||||
}
|
||||
|
||||
result.mutableMethod.addInstructions(0, stringInstructions)
|
||||
} ?: throw fingerprint.exception
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
package app.revanced.util.microg
|
||||
|
||||
import app.revanced.extensions.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.util.Utils.returnEarly
|
||||
import app.revanced.util.microg.Constants.ACTIONS
|
||||
import app.revanced.util.microg.Constants.AUTHORITIES
|
||||
import app.revanced.util.microg.Constants.MICROG_VENDOR
|
||||
@@ -213,31 +212,4 @@ internal object MicroGBytecodeHelper {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the resolved methods of a list of [MethodFingerprint] early.
|
||||
*/
|
||||
private fun List<MethodFingerprint>.returnEarly() {
|
||||
this.forEach { fingerprint ->
|
||||
fingerprint.result?.let { result ->
|
||||
val stringInstructions = when (result.method.returnType.first()) {
|
||||
'L' -> """
|
||||
const/4 v0, 0x0
|
||||
return-object v0
|
||||
"""
|
||||
|
||||
'V' -> "return-void"
|
||||
'I' -> """
|
||||
const/4 v0, 0x0
|
||||
return v0
|
||||
"""
|
||||
|
||||
else -> throw Exception("This case should never happen.")
|
||||
}
|
||||
result.mutableMethod.addInstructions(
|
||||
0, stringInstructions
|
||||
)
|
||||
} ?: throw fingerprint.exception
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ inline fun <reified E> fromMethodReference(methodReference: MethodReference)
|
||||
search.definedClassName == methodReference.definingClass
|
||||
&& search.methodName == methodReference.name
|
||||
&& methodReference.parameterTypes.toTypedArray().contentEquals(search.methodParams)
|
||||
&& search.returnType == methodReference.returnType
|
||||
}
|
||||
|
||||
inline fun <reified E> filterMapInstruction35c(
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<string name="sb_segments_intro_sum">An interval without actual content. Could be a pause, static frame, or repeating animation. Does not include transitions containing information</string>
|
||||
<string name="sb_segments_outro">Endcards/Credits</string>
|
||||
<string name="sb_segments_outro_sum">Credits or when the YouTube endcards appear. Not for conclusions with information</string>
|
||||
<string name="sb_segments_preview">Preview/Recap</string>
|
||||
<string name="sb_segments_preview">Preview/Recap/Hook</string>
|
||||
<string name="sb_segments_preview_sum">Collection of clips that show what is coming up or what happened in the video or in other videos of a series, where all information is repeated elsewhere</string>
|
||||
<string name="sb_segments_filler">Filler Tangent/Jokes</string>
|
||||
<string name="sb_segments_filler_sum">Tangential scenes added only for filler or humor that are not required to understand the main content of the video. Does not include segments providing context or background details</string>
|
||||
|
||||
Reference in New Issue
Block a user