refactor(settings): remove 'layout' label in string resource and code

This commit is contained in:
inotia00
2023-04-02 14:49:32 +09:00
parent 359e6e4dae
commit f690160996
67 changed files with 264 additions and 250 deletions

View File

@ -16,7 +16,7 @@ import app.revanced.patches.shared.annotation.YouTubeCompatibility
import app.revanced.patches.shared.fingerprints.LayoutConstructorFingerprint
import app.revanced.patches.shared.patch.mapping.ResourceMappingPatch
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
import app.revanced.util.integrations.Constants.FULLSCREEN_LAYOUT
import app.revanced.util.integrations.Constants.FULLSCREEN
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.builder.instruction.BuilderInstruction21c
import org.jf.dexlib2.iface.instruction.Instruction
@ -68,7 +68,7 @@ class HideAutoplayPreviewPatch : BytecodePatch(
method.addInstructions(
insertIndex, """
invoke-static {}, $FULLSCREEN_LAYOUT->hideAutoPlayPreview()Z
invoke-static {}, $FULLSCREEN->hideAutoPlayPreview()Z
move-result v$dummyRegister
if-nez v$dummyRegister, :hidden
""", listOf(ExternalLabel("hidden", jumpInstruction))
@ -81,7 +81,7 @@ class HideAutoplayPreviewPatch : BytecodePatch(
*/
SettingsPatch.addPreference(
arrayOf(
"PREFERENCE: FULLSCREEN_LAYOUT_SETTINGS",
"PREFERENCE: FULLSCREEN_SETTINGS",
"SETTINGS: HIDE_AUTOPLAY_PREVIEW"
)
)

View File

@ -17,7 +17,7 @@ import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.annotation.YouTubeCompatibility
import app.revanced.patches.shared.patch.mapping.ResourceMappingPatch
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
import app.revanced.util.integrations.Constants.FULLSCREEN_LAYOUT
import app.revanced.util.integrations.Constants.FULLSCREEN
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.formats.Instruction31i
@ -59,7 +59,7 @@ class HideEndScreenOverlayPatch : BytecodePatch() {
val dummyRegister = (instructions.elementAt(index) as Instruction31i).registerA
mutableMethod.addInstructions(
insertIndex, """
invoke-static {}, $FULLSCREEN_LAYOUT->hideEndScreenOverlay()Z
invoke-static {}, $FULLSCREEN->hideEndScreenOverlay()Z
move-result v$dummyRegister
if-eqz v$dummyRegister, :on
return-void
@ -85,7 +85,7 @@ class HideEndScreenOverlayPatch : BytecodePatch() {
*/
SettingsPatch.addPreference(
arrayOf(
"PREFERENCE: FULLSCREEN_LAYOUT_SETTINGS",
"PREFERENCE: FULLSCREEN_SETTINGS",
"SETTINGS: HIDE_ENDSCREEN_OVERLAY"
)
)

View File

@ -16,7 +16,7 @@ import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility
import app.revanced.patches.youtube.layout.fullscreen.flimstripoverlay.fingerprints.ScrubbingLabelFingerprint
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
import app.revanced.util.integrations.Constants.FULLSCREEN_LAYOUT
import app.revanced.util.integrations.Constants.FULLSCREEN
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
@ -45,7 +45,7 @@ class HideFilmstripOverlayPatch : BytecodePatch(
it.addInstructions(
index + 1, """
invoke-static {}, $FULLSCREEN_LAYOUT->hideFilmstripOverlay()Z
invoke-static {}, $FULLSCREEN->hideFilmstripOverlay()Z
move-result v$dummyRegister
if-eqz v$dummyRegister, :show
const/4 v$primaryRegister, 0x0
@ -61,7 +61,7 @@ class HideFilmstripOverlayPatch : BytecodePatch(
*/
SettingsPatch.addPreference(
arrayOf(
"PREFERENCE: FULLSCREEN_LAYOUT_SETTINGS",
"PREFERENCE: FULLSCREEN_SETTINGS",
"SETTINGS: HIDE_FILMSTRIP_OVERLAY"
)
)

View File

@ -43,7 +43,7 @@ class HideFullscreenButtonContainerBytecodePatch : BytecodePatch() {
val mutableMethod = context.proxy(classDef).mutableClass.findMutableMethodOf(method)
val viewRegister = (invokeInstruction as Instruction21c).registerA
mutableMethod.implementation!!.injectHideCall(insertIndex, viewRegister, "layout/FullscreenLayoutPatch", "hideFullscreenButtonContainer")
mutableMethod.implementation!!.injectHideCall(insertIndex, viewRegister, "layout/FullscreenPatch", "hideFullscreenButtonContainer")
patchSuccessArray[0] = true
}

View File

@ -33,7 +33,7 @@ class HideFullscreenButtonContainerPatch : ResourcePatch {
*/
SettingsPatch.addPreference(
arrayOf(
"PREFERENCE: FULLSCREEN_LAYOUT_SETTINGS",
"PREFERENCE: FULLSCREEN_SETTINGS",
"SETTINGS: HIDE_FULLSCREEN_BUTTON_CONTAINER"
)
)

View File

@ -19,7 +19,7 @@ import app.revanced.patches.shared.fingerprints.LayoutConstructorFingerprint
import app.revanced.patches.youtube.layout.fullscreen.fullscreenbuttoncontainer.bytecode.patch.HideFullscreenButtonContainerBytecodePatch
import app.revanced.patches.youtube.layout.fullscreen.fullscreenpanels.fingerprints.FullscreenViewAdderFingerprint
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
import app.revanced.util.integrations.Constants.FULLSCREEN_LAYOUT
import app.revanced.util.integrations.Constants.FULLSCREEN
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.builder.instruction.BuilderInstruction21c
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
@ -53,7 +53,7 @@ class HideFullscreenPanelsPatch : BytecodePatch(
addInstructions(
endIndex - 3, """
invoke-static {}, $FULLSCREEN_LAYOUT->hideFullscreenPanels()I
invoke-static {}, $FULLSCREEN->hideFullscreenPanels()I
move-result v$register
"""
)
@ -76,7 +76,7 @@ class HideFullscreenPanelsPatch : BytecodePatch(
method.addInstructions(
invokeIndex, """
invoke-static {}, $FULLSCREEN_LAYOUT->showFullscreenTitle()Z
invoke-static {}, $FULLSCREEN->showFullscreenTitle()Z
move-result v$dummyRegister
if-eqz v$dummyRegister, :hidden
""", listOf(ExternalLabel("hidden", method.instruction(invokeIndex + 1)))
@ -88,7 +88,7 @@ class HideFullscreenPanelsPatch : BytecodePatch(
*/
SettingsPatch.addPreference(
arrayOf(
"PREFERENCE: FULLSCREEN_LAYOUT_SETTINGS",
"PREFERENCE: FULLSCREEN_SETTINGS",
"SETTINGS: HIDE_FULLSCREEN_PANELS"
)
)

View File

@ -18,7 +18,7 @@ import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.annotation.YouTubeCompatibility
import app.revanced.patches.youtube.layout.fullscreen.hapticfeedback.fingerprints.*
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
import app.revanced.util.integrations.Constants.FULLSCREEN_LAYOUT
import app.revanced.util.integrations.Constants.FULLSCREEN
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Patch
@ -56,7 +56,7 @@ class HapticFeedBackPatch : BytecodePatch(
*/
SettingsPatch.addPreference(
arrayOf(
"PREFERENCE: FULLSCREEN_LAYOUT_SETTINGS",
"PREFERENCE: FULLSCREEN_SETTINGS",
"SETTINGS: DISABLE_HAPTIC_FEEDBACK"
)
)
@ -79,7 +79,7 @@ class HapticFeedBackPatch : BytecodePatch(
addInstructions(
insertIndex, """
invoke-static {}, $FULLSCREEN_LAYOUT->$targetMethodName()Z
invoke-static {}, $FULLSCREEN->$targetMethodName()Z
move-result v$dummyRegister
if-eqz v$dummyRegister, :vibrate
const-wide/16 v$targetRegister, 0x0
@ -91,7 +91,7 @@ class HapticFeedBackPatch : BytecodePatch(
addInstructions(
startIndex, """
invoke-static {}, $FULLSCREEN_LAYOUT->$targetMethodName()Z
invoke-static {}, $FULLSCREEN->$targetMethodName()Z
move-result v$dummyRegister
if-eqz v$dummyRegister, :vibrate
return-void
@ -103,7 +103,7 @@ class HapticFeedBackPatch : BytecodePatch(
fun MethodFingerprintResult.voidHaptics(targetMethodName: String) {
mutableMethod.addInstructions(
0, """
invoke-static {}, $FULLSCREEN_LAYOUT->$targetMethodName()Z
invoke-static {}, $FULLSCREEN->$targetMethodName()Z
move-result v0
if-eqz v0, :vibrate
return-void