From cd93917148e2f7695effb15183f53b84ddb9800a Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sat, 20 May 2023 04:32:38 +0200 Subject: [PATCH] fix(twitter): correctly resolve to integrations methods --- .../twitter/patches/hook/json/JsonHookPatch.kt | 4 +++- .../twitter/patches/hook/patch/dummy/DummyHook.kt | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/app/revanced/twitter/patches/hook/patch/dummy/DummyHook.kt diff --git a/app/src/main/java/app/revanced/twitter/patches/hook/json/JsonHookPatch.kt b/app/src/main/java/app/revanced/twitter/patches/hook/json/JsonHookPatch.kt index 9817b6aa..d8c47d71 100644 --- a/app/src/main/java/app/revanced/twitter/patches/hook/json/JsonHookPatch.kt +++ b/app/src/main/java/app/revanced/twitter/patches/hook/json/JsonHookPatch.kt @@ -1,5 +1,6 @@ package app.revanced.twitter.patches.hook.json +import app.revanced.twitter.patches.hook.patch.dummy.DummyHook import app.revanced.twitter.utils.json.JsonUtils.parseJson import app.revanced.twitter.utils.stream.StreamUtils import org.json.JSONException @@ -7,8 +8,9 @@ import java.io.IOException import java.io.InputStream object JsonHookPatch { + // Additional hooks added by corresponding patch. private val hooks = buildList { - // Modified by corresponding patch. + add(DummyHook) } @JvmStatic diff --git a/app/src/main/java/app/revanced/twitter/patches/hook/patch/dummy/DummyHook.kt b/app/src/main/java/app/revanced/twitter/patches/hook/patch/dummy/DummyHook.kt new file mode 100644 index 00000000..56a7a08e --- /dev/null +++ b/app/src/main/java/app/revanced/twitter/patches/hook/patch/dummy/DummyHook.kt @@ -0,0 +1,14 @@ +package app.revanced.twitter.patches.hook.patch.dummy + +import app.revanced.twitter.patches.hook.json.BaseJsonHook +import app.revanced.twitter.patches.hook.json.JsonHookPatch +import org.json.JSONObject + +/** + * Dummy hook to reserve a register in [JsonHookPatch.hooks] list. + */ +object DummyHook : BaseJsonHook() { + override fun apply(json: JSONObject) { + // Do nothing. + } +} \ No newline at end of file