Skip to content

Commit

Permalink
fix(YouTube - Toolbar components): Turning on the `Hide voice search …
Browse files Browse the repository at this point in the history
…button` setting makes the margin of the searchbar 0
  • Loading branch information
inotia00 authored and anddea committed Jul 29, 2024
1 parent f4dc6d3 commit ca02dba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import app.revanced.patches.youtube.general.toolbar.fingerprints.YouActionBarFin
import app.revanced.patches.youtube.utils.castbutton.CastButtonPatch
import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE
import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL_CLASS_DESCRIPTOR
import app.revanced.patches.youtube.utils.integrations.Constants.PATCH_STATUS_CLASS_DESCRIPTOR
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.ActionBarRingoBackground
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.VoiceSearch
Expand All @@ -48,6 +49,7 @@ import app.revanced.util.literalInstructionBooleanHook
import app.revanced.util.literalInstructionHook
import app.revanced.util.patch.BaseBytecodePatch
import app.revanced.util.resultOrThrow
import app.revanced.util.updatePatchStatus
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
Expand Down Expand Up @@ -306,12 +308,14 @@ object ToolBarComponentsPatch : BaseBytecodePatch(

// region patch for hide voice search button

if (SettingsPatch.upward1923) {
if (SettingsPatch.upward1928) {
ImageSearchButtonConfigFingerprint.literalInstructionBooleanHook(
45617544,
"$GENERAL_CLASS_DESCRIPTOR->hideImageSearchButton(Z)Z"
)

context.updatePatchStatus(PATCH_STATUS_CLASS_DESCRIPTOR, "ImageSearchButton")

settingArray += "SETTINGS: HIDE_IMAGE_SEARCH_BUTTON"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ object SettingsPatch : BaseResourcePatch(
internal var upward1912 = false
internal var upward1923 = false
internal var upward1925 = false
internal var upward1928 = false

override fun execute(context: ResourceContext) {

Expand Down Expand Up @@ -297,6 +298,7 @@ object SettingsPatch : BaseResourcePatch(
upward1912 = 241302000 <= playServicesVersion
upward1923 = 242402000 <= playServicesVersion
upward1925 = 242599000 <= playServicesVersion
upward1928 = 242905000 <= playServicesVersion

break
}
Expand Down

0 comments on commit ca02dba

Please sign in to comment.