feat(Instagram - Hides navigation buttons): Add more buttons to hide (#6390)
This commit is contained in:
parent
16bd96e2bb
commit
6bb6281149
1 changed files with 59 additions and 1 deletions
|
|
@ -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")
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue