Compare commits

...

4 Commits

Author SHA1 Message Date
semantic-release-bot
658370f035 chore: Release v5.0.1-dev.1 [skip ci]
## [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 ([3059aca](3059aca69d))
* **Tiktok - Settings:** Fix the patch by depending on the correct settings patch ([2094a23](2094a23ccc))

### Performance Improvements

* Check for extension without a class proxy ([53b6b1f](53b6b1ff41))
2024-11-11 01:40:33 +00:00
oSumAtrIX
3059aca69d fix(Sync): Fix patches by not throwing unnecessarily 2024-11-11 02:37:44 +01:00
oSumAtrIX
2094a23ccc fix(Tiktok - Settings): Fix the patch by depending on the correct settings patch 2024-11-11 02:33:12 +01:00
oSumAtrIX
53b6b1ff41 perf: Check for extension without a class proxy 2024-11-11 02:25:17 +01:00
6 changed files with 27 additions and 15 deletions

View File

@@ -1,3 +1,16 @@
## [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)

View File

@@ -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.1

View File

@@ -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")
} }
} }

View File

@@ -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
} }
} }

View File

@@ -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()

View File

@@ -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