Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed May 18, 2024
1 parent 9e357b6 commit 08b0107
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
4 changes: 2 additions & 2 deletions api/revanced-patches.api
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ public final class app/revanced/patches/messenger/inbox/ads/patch/HideInboxAdsPa
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}

public final class app/revanced/patches/messenger/inbox/subtabs/patch/HideChannelSubTab : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/messenger/inbox/subtabs/patch/HideChannelSubTab;
public final class app/revanced/patches/messenger/inbox/subtabs/patch/HideInboxSubtabsPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/messenger/inbox/subtabs/patch/HideInboxSubtabsPatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
package app.revanced.patches.messenger.inbox.subtabs.patch

import app.revanced.util.exception
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.messenger.inbox.subtabs.fingerprints.InboxSubTabsItemSupplierFingerprint
import app.revanced.util.exception

@Patch(
name = "Hide inbox subtabs",
compatiblePackages = [CompatiblePackage("com.facebook.orca")]
compatiblePackages = [CompatiblePackage("com.facebook.orca")],
)
@Suppress("unused")
object HideChannelSubTab : BytecodePatch(
setOf(InboxSubTabsItemSupplierFingerprint)
object HideInboxSubtabsPatch : BytecodePatch(
setOf(InboxSubTabsItemSupplierFingerprint),
) {
override fun execute(context: BytecodeContext) {
InboxSubTabsItemSupplierFingerprint.result?.mutableMethod?.apply {
this.replaceInstruction(2,
"""
# Set InboxSubtabsItemSupplierImplementation boolean attribute to false.
const/4 v0, 0x0
""".trimIndent()
)
} ?: throw InboxSubTabsItemSupplierFingerprint.exception
}
}
// Set InboxSubtabsItemSupplierImplementation boolean attribute to false.
override fun execute(context: BytecodeContext) = InboxSubTabsItemSupplierFingerprint.result?.mutableMethod
?.replaceInstruction(2, "const/4 v0, 0x0")
?: throw InboxSubTabsItemSupplierFingerprint.exception
}

0 comments on commit 08b0107

Please sign in to comment.