Skip to content

Commit ca02dba

Browse files
inotia00anddea
authored andcommitted
fix(YouTube - Toolbar components): Turning on the Hide voice search button setting makes the margin of the searchbar 0
1 parent f4dc6d3 commit ca02dba

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/main/kotlin/app/revanced/patches/youtube/general/toolbar/ToolBarComponentsPatch.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import app.revanced.patches.youtube.general.toolbar.fingerprints.YouActionBarFin
2727
import app.revanced.patches.youtube.utils.castbutton.CastButtonPatch
2828
import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE
2929
import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL_CLASS_DESCRIPTOR
30+
import app.revanced.patches.youtube.utils.integrations.Constants.PATCH_STATUS_CLASS_DESCRIPTOR
3031
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
3132
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ActionBarRingoBackground
3233
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.VoiceSearch
@@ -48,6 +49,7 @@ import app.revanced.util.literalInstructionBooleanHook
4849
import app.revanced.util.literalInstructionHook
4950
import app.revanced.util.patch.BaseBytecodePatch
5051
import app.revanced.util.resultOrThrow
52+
import app.revanced.util.updatePatchStatus
5153
import com.android.tools.smali.dexlib2.Opcode
5254
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
5355
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@@ -306,12 +308,14 @@ object ToolBarComponentsPatch : BaseBytecodePatch(
306308

307309
// region patch for hide voice search button
308310

309-
if (SettingsPatch.upward1923) {
311+
if (SettingsPatch.upward1928) {
310312
ImageSearchButtonConfigFingerprint.literalInstructionBooleanHook(
311313
45617544,
312314
"$GENERAL_CLASS_DESCRIPTOR->hideImageSearchButton(Z)Z"
313315
)
314316

317+
context.updatePatchStatus(PATCH_STATUS_CLASS_DESCRIPTOR, "ImageSearchButton")
318+
315319
settingArray += "SETTINGS: HIDE_IMAGE_SEARCH_BUTTON"
316320
}
317321

src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ object SettingsPatch : BaseResourcePatch(
9595
internal var upward1912 = false
9696
internal var upward1923 = false
9797
internal var upward1925 = false
98+
internal var upward1928 = false
9899

99100
override fun execute(context: ResourceContext) {
100101

@@ -297,6 +298,7 @@ object SettingsPatch : BaseResourcePatch(
297298
upward1912 = 241302000 <= playServicesVersion
298299
upward1923 = 242402000 <= playServicesVersion
299300
upward1925 = 242599000 <= playServicesVersion
301+
upward1928 = 242905000 <= playServicesVersion
300302

301303
break
302304
}

0 commit comments

Comments
 (0)