mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-07 01:51:27 +01:00
fix(Instagram - Hide navigation buttons): Resolve app startup crash
This commit is contained in:
@@ -3,6 +3,7 @@ package app.revanced.patches.instagram.hide.navigation
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.booleanOption
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patches.instagram.misc.extension.sharedExtensionPatch
|
||||
import app.revanced.util.addInstructionsAtControlFlowLabel
|
||||
import app.revanced.util.findFreeRegister
|
||||
import app.revanced.util.getReference
|
||||
@@ -24,6 +25,8 @@ val hideNavigationButtonsPatch = bytecodePatch(
|
||||
) {
|
||||
compatibleWith("com.instagram.android")
|
||||
|
||||
dependsOn(sharedExtensionPatch)
|
||||
|
||||
val hideReels by booleanOption(
|
||||
key = "hideReels",
|
||||
default = true,
|
||||
@@ -69,20 +72,22 @@ val hideNavigationButtonsPatch = bytecodePatch(
|
||||
const-string v$freeRegister2, "$enumNameField"
|
||||
invoke-static { v$buttonsListRegister, v$freeRegister, v$freeRegister2 }, $EXTENSION_CLASS_DESCRIPTOR->removeNavigationButtonByName(Ljava/util/List;Ljava/lang/String;Ljava/lang/String;)Ljava/util/List;
|
||||
move-result-object v$buttonsListRegister
|
||||
"""
|
||||
"""
|
||||
}
|
||||
|
||||
if (hideReels!!)
|
||||
if (hideReels!!) {
|
||||
addInstructionsAtControlFlowLabel(
|
||||
returnIndex,
|
||||
instructionsRemoveButtonByName("fragment_clips")
|
||||
)
|
||||
}
|
||||
|
||||
if (hideCreate!!)
|
||||
if (hideCreate!!) {
|
||||
addInstructionsAtControlFlowLabel(
|
||||
returnIndex,
|
||||
instructionsRemoveButtonByName("fragment_share")
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user