mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-07 18:03:55 +01:00
Compare commits
6 Commits
v5.0.0
...
v5.0.1-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0cb993d6ea | ||
|
|
3793b2103c | ||
|
|
658370f035 | ||
|
|
3059aca69d | ||
|
|
2094a23ccc | ||
|
|
53b6b1ff41 |
20
CHANGELOG.md
20
CHANGELOG.md
@@ -1,3 +1,23 @@
|
||||
## [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)
|
||||
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@ org.gradle.jvmargs = -Xms512M -Xmx2048M
|
||||
org.gradle.parallel = true
|
||||
android.useAndroidX = true
|
||||
kotlin.code.style = official
|
||||
version = 5.0.0
|
||||
version = 5.0.1-dev.2
|
||||
|
||||
@@ -10,6 +10,6 @@ val disablePiracyDetectionPatch = bytecodePatch(
|
||||
execute {
|
||||
// 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.
|
||||
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
|
||||
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.instructions
|
||||
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 {
|
||||
accessFlags(AccessFlags.PRIVATE, AccessFlags.FINAL)
|
||||
@@ -16,12 +18,9 @@ internal val piracyDetectionFingerprint = fingerprint {
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
)
|
||||
custom { method, _ ->
|
||||
method.implementation?.instructions?.any {
|
||||
if (it.opcode != Opcode.NEW_INSTANCE) return@any false
|
||||
|
||||
val reference = (it as ReferenceInstruction).reference
|
||||
|
||||
reference.toString() == "Lcom/github/javiersantos/piracychecker/PiracyChecker;"
|
||||
} == true
|
||||
method.implementation ?: return@custom false
|
||||
method.instructions.any {
|
||||
it.getReference<Reference>()?.toString() == "Lcom/github/javiersantos/piracychecker/PiracyChecker;"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ fun sharedExtensionPatch(
|
||||
extendWith("extensions/shared.rve")
|
||||
|
||||
execute {
|
||||
if (classBy { EXTENSION_CLASS_DESCRIPTOR in it.type } == null) {
|
||||
if (classes.none { EXTENSION_CLASS_DESCRIPTOR == it.type }) {
|
||||
throw PatchException(
|
||||
"Shared extension has not been merged yet. This patch can not succeed without merging it.",
|
||||
)
|
||||
@@ -35,7 +35,7 @@ fun sharedExtensionPatch(
|
||||
*/
|
||||
fun getCurrentJarFilePath(): String {
|
||||
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) {
|
||||
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.patch.bytecodePatch
|
||||
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.twitch.misc.settings.settingsPatch
|
||||
import app.revanced.util.findMutableMethodOf
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@@ -47,18 +47,22 @@ val jsonHookPatch = bytecodePatch(
|
||||
dependsOn(sharedExtensionPatch)
|
||||
|
||||
execute {
|
||||
val jsonFactoryClassDef = jsonHookPatchFingerprint.apply {
|
||||
jsonHookPatchFingerprint.apply {
|
||||
// Make sure the extension is present.
|
||||
val jsonHookPatch = classBy { classDef -> classDef.type == JSON_HOOK_PATCH_CLASS_DESCRIPTOR }
|
||||
?: throw PatchException("Could not find the extension.")
|
||||
|
||||
matchOrNull(jsonHookPatch.immutableClass)
|
||||
?: throw PatchException("Unexpected extension.")
|
||||
}.originalClassDef // Conveniently find the type to hook a method in, via a named field.
|
||||
.fields
|
||||
.firstOrNull { it.name == "JSON_FACTORY" }
|
||||
?.type
|
||||
.let { type -> classes.find { it.type == type } } ?: throw PatchException("Could not find required class.")
|
||||
}
|
||||
|
||||
val jsonFactoryClassDef =
|
||||
loganSquareFingerprint.originalClassDef // Conveniently find the type to hook a method in, via a named field.
|
||||
.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.
|
||||
jsonInputStreamFingerprint.match(jsonFactoryClassDef).method.addInstructions(
|
||||
|
||||
Reference in New Issue
Block a user