mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-25 03:31:03 +00:00
Compare commits
8 Commits
v5.0.0
...
v5.0.1-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef37b78b45 | ||
|
|
d881d8bc44 | ||
|
|
0cb993d6ea | ||
|
|
3793b2103c | ||
|
|
658370f035 | ||
|
|
3059aca69d | ||
|
|
2094a23ccc | ||
|
|
53b6b1ff41 |
27
CHANGELOG.md
27
CHANGELOG.md
@@ -1,3 +1,30 @@
|
|||||||
|
## [5.0.1-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.0.1-dev.2...v5.0.1-dev.3) (2024-11-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **YouTube - Playback speed:** Remember playback speed when using non 1.0x default speed ([05b9f87](https://github.com/ReVanced/revanced-patches/commit/05b9f8709895dae67e8cc12e8b7bdb87ff401997)), closes [#3810](https://github.com/ReVanced/revanced-patches/issues/3810)
|
||||||
|
|
||||||
|
## [5.0.1-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.0.1-dev.1...v5.0.1-dev.2) (2024-11-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Twitter:** Fix patches by matching fingerprint using correct class ([6ae0d12](https://github.com/ReVanced/revanced-patches/commit/6ae0d124e1f27faecd20e4008951b08353572d98))
|
||||||
|
|
||||||
|
## [5.0.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.0.0...v5.0.1-dev.1) (2024-11-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Sync:** Fix patches by not throwing unnecessarily ([2ee1316](https://github.com/ReVanced/revanced-patches/commit/2ee13160d51dba3c5806594b2387f806e5946b9a))
|
||||||
|
* **Tiktok - Settings:** Fix the patch by depending on the correct settings patch ([0c75929](https://github.com/ReVanced/revanced-patches/commit/0c75929a83729841197b482d28f7f7f5f9cec332))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* Check for extension without a class proxy ([a6a74e2](https://github.com/ReVanced/revanced-patches/commit/a6a74e289db1fe04db230d1e864cb9e752f9a01d))
|
||||||
|
|
||||||
# [5.0.0](https://github.com/ReVanced/revanced-patches/compare/v4.17.0...v5.0.0) (2024-11-10)
|
# [5.0.0](https://github.com/ReVanced/revanced-patches/compare/v4.17.0...v5.0.0) (2024-11-10)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ org.gradle.jvmargs = -Xms512M -Xmx2048M
|
|||||||
org.gradle.parallel = true
|
org.gradle.parallel = true
|
||||||
android.useAndroidX = true
|
android.useAndroidX = true
|
||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 5.0.0
|
version = 5.0.1-dev.3
|
||||||
|
|||||||
@@ -10,6 +10,6 @@ val disablePiracyDetectionPatch = bytecodePatch(
|
|||||||
execute {
|
execute {
|
||||||
// Do not throw an error if the fingerprint is not resolved.
|
// Do not throw an error if the fingerprint is not resolved.
|
||||||
// This is fine because new versions of the target app do not need this patch.
|
// This is fine because new versions of the target app do not need this patch.
|
||||||
piracyDetectionFingerprint.method.addInstruction(0, "return-void")
|
piracyDetectionFingerprint.methodOrNull?.addInstruction(0, "return-void")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
package app.revanced.patches.reddit.customclients.sync.detection.piracy
|
package app.revanced.patches.reddit.customclients.sync.detection.piracy
|
||||||
|
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.instructions
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
|
||||||
import com.android.tools.smali.dexlib2.AccessFlags
|
|
||||||
import app.revanced.patcher.fingerprint
|
import app.revanced.patcher.fingerprint
|
||||||
|
import app.revanced.util.getReference
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
import com.android.tools.smali.dexlib2.iface.reference.Reference
|
||||||
|
|
||||||
internal val piracyDetectionFingerprint = fingerprint {
|
internal val piracyDetectionFingerprint = fingerprint {
|
||||||
accessFlags(AccessFlags.PRIVATE, AccessFlags.FINAL)
|
accessFlags(AccessFlags.PRIVATE, AccessFlags.FINAL)
|
||||||
@@ -16,12 +18,9 @@ internal val piracyDetectionFingerprint = fingerprint {
|
|||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
)
|
)
|
||||||
custom { method, _ ->
|
custom { method, _ ->
|
||||||
method.implementation?.instructions?.any {
|
method.implementation ?: return@custom false
|
||||||
if (it.opcode != Opcode.NEW_INSTANCE) return@any false
|
method.instructions.any {
|
||||||
|
it.getReference<Reference>()?.toString() == "Lcom/github/javiersantos/piracychecker/PiracyChecker;"
|
||||||
val reference = (it as ReferenceInstruction).reference
|
}
|
||||||
|
|
||||||
reference.toString() == "Lcom/github/javiersantos/piracychecker/PiracyChecker;"
|
|
||||||
} == true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ fun sharedExtensionPatch(
|
|||||||
extendWith("extensions/shared.rve")
|
extendWith("extensions/shared.rve")
|
||||||
|
|
||||||
execute {
|
execute {
|
||||||
if (classBy { EXTENSION_CLASS_DESCRIPTOR in it.type } == null) {
|
if (classes.none { EXTENSION_CLASS_DESCRIPTOR == it.type }) {
|
||||||
throw PatchException(
|
throw PatchException(
|
||||||
"Shared extension has not been merged yet. This patch can not succeed without merging it.",
|
"Shared extension has not been merged yet. This patch can not succeed without merging it.",
|
||||||
)
|
)
|
||||||
@@ -35,7 +35,7 @@ fun sharedExtensionPatch(
|
|||||||
*/
|
*/
|
||||||
fun getCurrentJarFilePath(): String {
|
fun getCurrentJarFilePath(): String {
|
||||||
val className = object {}::class.java.enclosingClass.name.replace('.', '/') + ".class"
|
val className = object {}::class.java.enclosingClass.name.replace('.', '/') + ".class"
|
||||||
val classUrl = object {}::class.java.classLoader.getResource(className)
|
val classUrl = object {}::class.java.classLoader?.getResource(className)
|
||||||
if (classUrl != null) {
|
if (classUrl != null) {
|
||||||
val urlString = classUrl.toString()
|
val urlString = classUrl.toString()
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
|||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.patch.bytecodePatch
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
import app.revanced.patches.tiktok.misc.extension.sharedExtensionPatch
|
import app.revanced.patches.tiktok.misc.extension.sharedExtensionPatch
|
||||||
|
import app.revanced.patches.tiktok.misc.settings.settingsPatch
|
||||||
import app.revanced.patches.tiktok.misc.settings.settingsStatusLoadFingerprint
|
import app.revanced.patches.tiktok.misc.settings.settingsStatusLoadFingerprint
|
||||||
import app.revanced.patches.twitch.misc.settings.settingsPatch
|
|
||||||
import app.revanced.util.findMutableMethodOf
|
import app.revanced.util.findMutableMethodOf
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
|||||||
@@ -47,18 +47,22 @@ val jsonHookPatch = bytecodePatch(
|
|||||||
dependsOn(sharedExtensionPatch)
|
dependsOn(sharedExtensionPatch)
|
||||||
|
|
||||||
execute {
|
execute {
|
||||||
val jsonFactoryClassDef = jsonHookPatchFingerprint.apply {
|
jsonHookPatchFingerprint.apply {
|
||||||
// Make sure the extension is present.
|
// Make sure the extension is present.
|
||||||
val jsonHookPatch = classBy { classDef -> classDef.type == JSON_HOOK_PATCH_CLASS_DESCRIPTOR }
|
val jsonHookPatch = classBy { classDef -> classDef.type == JSON_HOOK_PATCH_CLASS_DESCRIPTOR }
|
||||||
?: throw PatchException("Could not find the extension.")
|
?: throw PatchException("Could not find the extension.")
|
||||||
|
|
||||||
matchOrNull(jsonHookPatch.immutableClass)
|
matchOrNull(jsonHookPatch.immutableClass)
|
||||||
?: throw PatchException("Unexpected extension.")
|
?: throw PatchException("Unexpected extension.")
|
||||||
}.originalClassDef // Conveniently find the type to hook a method in, via a named field.
|
}
|
||||||
.fields
|
|
||||||
.firstOrNull { it.name == "JSON_FACTORY" }
|
val jsonFactoryClassDef =
|
||||||
?.type
|
loganSquareFingerprint.originalClassDef // Conveniently find the type to hook a method in, via a named field.
|
||||||
.let { type -> classes.find { it.type == type } } ?: throw PatchException("Could not find required class.")
|
.fields
|
||||||
|
.firstOrNull { it.name == "JSON_FACTORY" }
|
||||||
|
?.type
|
||||||
|
.let { type -> classes.find { it.type == type } }
|
||||||
|
?: throw PatchException("Could not find required class.")
|
||||||
|
|
||||||
// Hook the methods first parameter.
|
// Hook the methods first parameter.
|
||||||
jsonInputStreamFingerprint.match(jsonFactoryClassDef).method.addInstructions(
|
jsonInputStreamFingerprint.match(jsonFactoryClassDef).method.addInstructions(
|
||||||
|
|||||||
@@ -302,8 +302,14 @@ private fun getReference(instructions: List<BuilderInstruction>, offset: Int, op
|
|||||||
/**
|
/**
|
||||||
* Hook the video speed selected by the user.
|
* Hook the video speed selected by the user.
|
||||||
*/
|
*/
|
||||||
fun userSelectedPlaybackSpeedHook(targetMethodClass: String, targetMethodName: String) =
|
fun userSelectedPlaybackSpeedHook(targetMethodClass: String, targetMethodName: String) {
|
||||||
|
legacySpeedSelectionInsertMethod.addInstruction(
|
||||||
|
legacySpeedSelectionInsertIndex++,
|
||||||
|
"invoke-static { v$legacySpeedSelectionValueRegister }, $targetMethodClass->$targetMethodName(F)V"
|
||||||
|
)
|
||||||
|
|
||||||
speedSelectionInsertMethod.addInstruction(
|
speedSelectionInsertMethod.addInstruction(
|
||||||
speedSelectionInsertIndex++,
|
speedSelectionInsertIndex++,
|
||||||
"invoke-static {v$speedSelectionValueRegister}, $targetMethodClass->$targetMethodName(F)V",
|
"invoke-static { v$speedSelectionValueRegister }, $targetMethodClass->$targetMethodName(F)V",
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user