feat(Instagram - Hides navigation buttons): Add more buttons to hide (#6390)

This commit is contained in:
PainfulPaladins 2025-12-27 19:50:08 +02:00 committed by GitHub
parent 16bd96e2bb
commit 6bb6281149
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,6 +28,13 @@ val hideNavigationButtonsPatch = bytecodePatch(
dependsOn(sharedExtensionPatch) dependsOn(sharedExtensionPatch)
val hideHome by booleanOption(
key = "hideHome",
default = false,
title = "Hide Home",
description = "Permanently hides the Home button. App starts at next available tab." // On the "homecoming" / current instagram layout.
)
val hideReels by booleanOption( val hideReels by booleanOption(
key = "hideReels", key = "hideReels",
default = true, default = true,
@ -35,6 +42,27 @@ val hideNavigationButtonsPatch = bytecodePatch(
description = "Permanently hides the Reels button." description = "Permanently hides the Reels button."
) )
val hideDirect by booleanOption(
key = "hideDirect",
default = false,
title = "Hide Direct",
description = "Permanently hides the Direct button."
)
val hideSearch by booleanOption(
key = "hideSearch",
default = false,
title = "Hide Search",
description = "Permanently hides the Search button."
)
val hideProfile by booleanOption(
key = "hideProfile",
default = false,
title = "Hide Profile",
description = "Permanently hides the Profile button."
)
val hideCreate by booleanOption( val hideCreate by booleanOption(
key = "hideCreate", key = "hideCreate",
default = true, default = true,
@ -42,8 +70,10 @@ val hideNavigationButtonsPatch = bytecodePatch(
description = "Permanently hides the Create button." description = "Permanently hides the Create button."
) )
execute { execute {
if (!hideReels!! && !hideCreate!!) { if (!hideHome!! &&!hideReels!! && !hideDirect!! && !hideSearch!! && !hideProfile && !hideCreate!!) {
return@execute Logger.getLogger(this::class.java.name).warning( return@execute Logger.getLogger(this::class.java.name).warning(
"No hide navigation buttons options are enabled. No changes made." "No hide navigation buttons options are enabled. No changes made."
) )
@ -76,6 +106,13 @@ val hideNavigationButtonsPatch = bytecodePatch(
""" """
} }
if (hideHome!!) {
addInstructionsAtControlFlowLabel(
returnIndex,
instructionsRemoveButtonByName("fragment_feed")
)
}
if (hideReels!!) { if (hideReels!!) {
addInstructionsAtControlFlowLabel( addInstructionsAtControlFlowLabel(
returnIndex, returnIndex,
@ -83,12 +120,33 @@ val hideNavigationButtonsPatch = bytecodePatch(
) )
} }
if (hideDirect!!) {
addInstructionsAtControlFlowLabel(
returnIndex,
instructionsRemoveButtonByName("fragment_direct_tab")
)
}
if (hideSearch!!) {
addInstructionsAtControlFlowLabel(
returnIndex,
instructionsRemoveButtonByName("fragment_search")
)
}
if (hideCreate!!) { if (hideCreate!!) {
addInstructionsAtControlFlowLabel( addInstructionsAtControlFlowLabel(
returnIndex, returnIndex,
instructionsRemoveButtonByName("fragment_share") instructionsRemoveButtonByName("fragment_share")
) )
} }
if (hideProfile!!) {
addInstructionsAtControlFlowLabel(
returnIndex,
instructionsRemoveButtonByName("fragment_profile")
)
}
} }
} }
} }