forked from ReVanced/revanced-patches
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
11 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 9 additions & 15 deletions
24
src/main/kotlin/app/revanced/patches/messenger/inbox/subtabs/patch/HideInboxSubtabsPatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |