build(Needs bump): Bump dependencies (#2946)
Co-authored-by: Ushie <ushiekane@gmail.com> Co-authored-by: aAbed <aabedhkhan@gmail.com> Co-authored-by: CnC-Robert <CnC.Rob3rt@gmail.com>
This commit is contained in:
co-authored by
Ushie
aAbed
CnC-Robert
parent
fe3a6fd4a4
commit
8c8dff9078
+22
-27
@@ -1,7 +1,5 @@
|
||||
package app.revanced.patches.twitter.misc.hook.json.patch
|
||||
package app.revanced.patches.twitter.misc.hook.json
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
|
||||
@@ -9,19 +7,32 @@ 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.PatchException
|
||||
import app.revanced.patcher.patch.annotations.RequiresIntegrations
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.twitter.misc.hook.json.fingerprints.JsonHookPatchFingerprint
|
||||
import app.revanced.patches.twitter.misc.hook.json.fingerprints.JsonInputStreamFingerprint
|
||||
import app.revanced.patches.twitter.misc.hook.json.fingerprints.LoganSquareFingerprint
|
||||
import java.io.Closeable
|
||||
import java.io.InvalidClassException
|
||||
|
||||
@Name("Json hook")
|
||||
@Description("Hooks the stream which reads JSON responses.")
|
||||
@RequiresIntegrations
|
||||
class JsonHookPatch : BytecodePatch(
|
||||
listOf(LoganSquareFingerprint)
|
||||
@Patch(
|
||||
description = "Hooks the stream which reads JSON responses.",
|
||||
requiresIntegrations = true
|
||||
)
|
||||
object JsonHookPatch : BytecodePatch(
|
||||
setOf(LoganSquareFingerprint)
|
||||
), Closeable {
|
||||
private const val JSON_HOOK_CLASS_NAMESPACE = "app/revanced/twitter/patches/hook/json"
|
||||
private const val JSON_HOOK_PATCH_CLASS_DESCRIPTOR = "L$JSON_HOOK_CLASS_NAMESPACE/JsonHookPatch;"
|
||||
private const val BASE_PATCH_CLASS_NAME = "BaseJsonHook"
|
||||
private const val JSON_HOOK_CLASS_DESCRIPTOR = "L$JSON_HOOK_CLASS_NAMESPACE/$BASE_PATCH_CLASS_NAME;"
|
||||
|
||||
/**
|
||||
* The [JsonHookPatchHook] of the [JsonHookPatch].
|
||||
*
|
||||
* @see JsonHookPatchHook
|
||||
*/
|
||||
internal lateinit var hooks: JsonHookPatchHook
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
JsonHookPatchFingerprint.also {
|
||||
// Make sure the integrations are present.
|
||||
@@ -65,7 +76,8 @@ class JsonHookPatch : BytecodePatch(
|
||||
* @param descriptor The class descriptor of the hook.
|
||||
* @throws ClassNotFoundException If the class could not be found.
|
||||
*/
|
||||
internal class Hook(context: BytecodeContext, internal val descriptor: String) {
|
||||
internal class
|
||||
Hook(context: BytecodeContext, internal val descriptor: String) {
|
||||
internal var added = false
|
||||
|
||||
init {
|
||||
@@ -127,21 +139,4 @@ class JsonHookPatch : BytecodePatch(
|
||||
|
||||
override fun close() = hooks.close()
|
||||
|
||||
internal companion object {
|
||||
private const val JSON_HOOK_CLASS_NAMESPACE = "app/revanced/twitter/patches/hook/json"
|
||||
|
||||
private const val JSON_HOOK_PATCH_CLASS_DESCRIPTOR = "L$JSON_HOOK_CLASS_NAMESPACE/JsonHookPatch;"
|
||||
|
||||
private const val BASE_PATCH_CLASS_NAME = "BaseJsonHook"
|
||||
|
||||
private const val JSON_HOOK_CLASS_DESCRIPTOR = "L$JSON_HOOK_CLASS_NAMESPACE/$BASE_PATCH_CLASS_NAME;"
|
||||
|
||||
/**
|
||||
* The [JsonHookPatchHook] of the [JsonHookPatch].
|
||||
*
|
||||
* @see JsonHookPatchHook
|
||||
*/
|
||||
internal lateinit var hooks: JsonHookPatchHook
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package app.revanced.patches.twitter.misc.hook.patch
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patches.twitter.misc.hook.json.patch.JsonHookPatch
|
||||
import app.revanced.patches.twitter.misc.hook.json.JsonHookPatch
|
||||
|
||||
abstract class BaseHookPatchPatch(private val hookClassDescriptor: String) : BytecodePatch() {
|
||||
override fun execute(context: BytecodeContext) =
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.revanced.patches.twitter.misc.hook.patch.ads
|
||||
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.twitter.misc.hook.json.JsonHookPatch
|
||||
import app.revanced.patches.twitter.misc.hook.patch.BaseHookPatchPatch
|
||||
|
||||
@Patch(
|
||||
name = "Hide ads",
|
||||
description = "Hides ads.",
|
||||
dependencies = [JsonHookPatch::class],
|
||||
compatiblePackages = [CompatiblePackage("com.twitter.android")]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object HideAdsPatch : BaseHookPatchPatch("Lapp/revanced/twitter/patches/hook/patch/ads/AdsHook;")
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
package app.revanced.patches.twitter.misc.hook.patch.ads.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility([Package("com.twitter.android")])
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
internal annotation class HideAdsCompatibility
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
package app.revanced.patches.twitter.misc.hook.patch.ads.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.twitter.misc.hook.json.patch.JsonHookPatch
|
||||
import app.revanced.patches.twitter.misc.hook.patch.BaseHookPatchPatch
|
||||
import app.revanced.patches.twitter.misc.hook.patch.ads.annotations.HideAdsCompatibility
|
||||
|
||||
@Patch
|
||||
@Name("Hide ads")
|
||||
@DependsOn([JsonHookPatch::class])
|
||||
@Description("Hides ads.")
|
||||
@HideAdsCompatibility
|
||||
class HideAdsPatch : BaseHookPatchPatch("Lapp/revanced/twitter/patches/hook/patch/ads/AdsHook;")
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package app.revanced.patches.twitter.misc.hook.patch.recommendation
|
||||
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.twitter.misc.hook.json.JsonHookPatch
|
||||
import app.revanced.patches.twitter.misc.hook.patch.BaseHookPatchPatch
|
||||
|
||||
@Patch(
|
||||
name = "Hide recommended users",
|
||||
dependencies = [JsonHookPatch::class],
|
||||
compatiblePackages = [CompatiblePackage("com.twitter.android")]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object HideRecommendedUsersPatch : BaseHookPatchPatch(
|
||||
"Lapp/revanced/twitter/patches/hook/patch/recommendation/RecommendedUsersHook;"
|
||||
)
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
package app.revanced.patches.twitter.misc.hook.patch.recommendation.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility([Package("com.twitter.android")])
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
internal annotation class HideRecommendedUsersCompatibility
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package app.revanced.patches.twitter.misc.hook.patch.recommendation.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.twitter.misc.hook.json.patch.JsonHookPatch
|
||||
import app.revanced.patches.twitter.misc.hook.patch.BaseHookPatchPatch
|
||||
import app.revanced.patches.twitter.misc.hook.patch.recommendation.annotations.HideRecommendedUsersCompatibility
|
||||
|
||||
@Patch
|
||||
@Name("Hide recommended users")
|
||||
@DependsOn([JsonHookPatch::class])
|
||||
@Description("Hides recommended users.")
|
||||
@HideRecommendedUsersCompatibility
|
||||
class HideRecommendedUsersPatch : BaseHookPatchPatch(
|
||||
"Lapp/revanced/twitter/patches/hook/patch/recommendation/RecommendedUsersHook;"
|
||||
)
|
||||
Reference in New Issue
Block a user