chore: lint code

This commit is contained in:
inotia00 2024-10-03 21:17:11 +09:00
parent a766abdf3f
commit ffcc9e5db8
165 changed files with 265 additions and 230 deletions

View File

@ -6,5 +6,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object AccountSwitcherAccessibilityLabelFingerprint : LiteralValueFingerprint(
returnType = "V",
parameters = listOf("L", "Ljava/lang/Object;"),
literalSupplier = { AccountSwitcherAccessibility }
literalSupplier = { AccountSwitcherAccessibility },
)

View File

@ -5,5 +5,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object MenuEntryFingerprint : LiteralValueFingerprint(
returnType = "V",
literalSupplier = { MenuEntry }
literalSupplier = { MenuEntry },
)

View File

@ -20,5 +20,5 @@ internal object NamesInactiveAccountThumbnailSizeFingerprint : LiteralValueFinge
Opcode.MOVE_RESULT_OBJECT,
Opcode.IF_EQZ
),
literalSupplier = { NamesInactiveAccountThumbnailSize }
literalSupplier = { NamesInactiveAccountThumbnailSize },
)

View File

@ -5,5 +5,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object TermsOfServiceFingerprint : LiteralValueFingerprint(
returnType = "Landroid/view/View;",
literalSupplier = { TosFooter }
literalSupplier = { TosFooter },
)

View File

@ -17,5 +17,5 @@ internal object ActionBarComponentFingerprint : LiteralValueFingerprint(
Opcode.SGET_OBJECT,
Opcode.SGET_OBJECT
),
literalSupplier = { 99180 }
literalSupplier = { 99180 },
)

View File

@ -8,5 +8,5 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal object LikeDislikeContainerFingerprint : LiteralValueFingerprint(
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
literalSupplier = { LikeDislikeContainer }
literalSupplier = { LikeDislikeContainer },
)

View File

@ -17,5 +17,5 @@ internal object AccountMenuFooterFingerprint : LiteralValueFingerprint(
Opcode.INVOKE_VIRTUAL,
Opcode.IGET_OBJECT
),
literalSupplier = { PrivacyTosFooter }
literalSupplier = { PrivacyTosFooter },
)

View File

@ -9,5 +9,5 @@ internal object FloatingLayoutFingerprint : LiteralValueFingerprint(
returnType = "Landroid/view/View;",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = emptyList(),
literalSupplier = { FloatingLayout }
literalSupplier = { FloatingLayout },
)

View File

@ -6,5 +6,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object InterstitialsContainerFingerprint : LiteralValueFingerprint(
returnType = "V",
strings = listOf("overlay_controller_param"),
literalSupplier = { InterstitialsContainer }
literalSupplier = { InterstitialsContainer },
)

View File

@ -15,6 +15,6 @@ internal object DialogSolidFingerprint : LiteralValueFingerprint(
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_STATIC
),
literalSupplier = { DialogSolid }
literalSupplier = { DialogSolid },
)

View File

@ -5,6 +5,6 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object EndButtonsContainerFingerprint : LiteralValueFingerprint(
returnType = "V",
literalSupplier = { EndButtonsContainer }
literalSupplier = { EndButtonsContainer },
)

View File

@ -5,5 +5,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object SleepTimerFingerprint : LiteralValueFingerprint(
returnType = "Z",
parameters = emptyList(),
literalSupplier = { 45372767 }
literalSupplier = { 45372767 },
)

View File

@ -5,5 +5,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object TouchOutsideFingerprint : LiteralValueFingerprint(
returnType = "Landroid/view/View;",
literalSupplier = { TouchOutside }
literalSupplier = { TouchOutside },
)

View File

@ -4,5 +4,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
object TrimSilenceConfigFingerprint : LiteralValueFingerprint(
returnType = "Z",
literalSupplier = { 45619123 }
literalSupplier = { 45619123 },
)

View File

@ -8,6 +8,6 @@ import com.android.tools.smali.dexlib2.AccessFlags
object TrimSilenceSwitchFingerprint : LiteralValueFingerprint(
returnType = "Landroid/view/View;",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
literalSupplier = { TrimSilenceSwitch }
literalSupplier = { TrimSilenceSwitch },
)

View File

@ -12,6 +12,6 @@ internal object ChipCloudFingerprint : LiteralValueFingerprint(
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT
),
literalSupplier = { ChipCloud }
literalSupplier = { ChipCloud },
)

View File

@ -10,6 +10,6 @@ internal object FloatingButtonParentFingerprint : LiteralValueFingerprint(
accessFlags = AccessFlags.PROTECTED or AccessFlags.FINAL,
parameters = listOf("L"),
opcodes = listOf(Opcode.INVOKE_DIRECT),
literalSupplier = { 259982244 }
literalSupplier = { 259982244 },
)

View File

@ -8,5 +8,5 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal object PlayerOverlayChipFingerprint : LiteralValueFingerprint(
returnType = "L",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
literalSupplier = { PlayerOverlayChip }
literalSupplier = { PlayerOverlayChip },
)

View File

@ -4,5 +4,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object SoundSearchFingerprint : LiteralValueFingerprint(
parameters = emptyList(),
literalSupplier = { 45625491 }
literalSupplier = { 45625491 },
)

View File

@ -8,5 +8,5 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal object TasteBuilderConstructorFingerprint : LiteralValueFingerprint(
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
literalSupplier = { MusicTasteBuilderShelf }
literalSupplier = { MusicTasteBuilderShelf },
)

View File

@ -9,5 +9,5 @@ internal object TooltipContentViewFingerprint : LiteralValueFingerprint(
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("L"),
literalSupplier = { ToolTipContentView }
literalSupplier = { ToolTipContentView },
)

View File

@ -9,6 +9,6 @@ internal object TopBarMenuItemImageViewFingerprint : LiteralValueFingerprint(
returnType = "Landroid/view/View;",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = emptyList(),
literalSupplier = { TopBarMenuItemImageView }
literalSupplier = { TopBarMenuItemImageView },
)

View File

@ -15,6 +15,6 @@ internal object TabletIdentifierFingerprint : LiteralValueFingerprint(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT
),
literalSupplier = { IsTablet }
literalSupplier = { IsTablet },
)

View File

@ -9,5 +9,5 @@ internal object BrowseIdFingerprint : LiteralValueFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("L"),
strings = listOf("FEmusic_offline"),
literalSupplier = { 45358178 }
literalSupplier = { 45358178 },
)

View File

@ -12,6 +12,6 @@ internal object DesignBottomSheetDialogFingerprint : LiteralValueFingerprint(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT
),
literalSupplier = { DesignBottomSheetDialog }
literalSupplier = { DesignBottomSheetDialog },
)

View File

@ -8,5 +8,5 @@ internal object BackgroundPlaybackManagerFingerprint : LiteralValueFingerprint(
returnType = "Z",
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
parameters = listOf("L"),
literalSupplier = { 64657230 }
literalSupplier = { 64657230 },
)

View File

@ -8,5 +8,5 @@ internal object PodCastConfigFingerprint : LiteralValueFingerprint(
returnType = "Z",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = emptyList(),
literalSupplier = { 45388403 }
literalSupplier = { 45388403 },
)

View File

@ -9,5 +9,5 @@ internal object BottomSheetRecyclerViewFingerprint : LiteralValueFingerprint(
returnType = "Lj${'$'}/util/Optional;",
accessFlags = AccessFlags.PROTECTED or AccessFlags.FINAL,
parameters = emptyList(),
literalSupplier = { BottomSheetRecyclerView }
literalSupplier = { BottomSheetRecyclerView },
)

View File

@ -10,6 +10,6 @@ internal object TabLayoutFingerprint : LiteralValueFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = emptyList(),
strings = listOf("FEmusic_radio_builder"),
literalSupplier = { ColorGrey }
literalSupplier = { ColorGrey },
)

View File

@ -19,6 +19,6 @@ internal object TabLayoutTextFingerprint : LiteralValueFingerprint(
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT
),
literalSupplier = { Text1 }
literalSupplier = { Text1 },
)

View File

@ -747,7 +747,8 @@ object PlayerComponentsPatch : BaseBytecodePatch(
getReference<MethodReference>()?.returnType == "Ljava/lang/String;"
}
val enumRegister = getInstruction<FiveRegisterInstruction>(enumIndex).registerD
val enumClass = (getInstruction<ReferenceInstruction>(enumIndex).reference as MethodReference).parameterTypes.first()
val enumClass =
(getInstruction<ReferenceInstruction>(enumIndex).reference as MethodReference).parameterTypes.first()
addInstruction(
enumIndex,
@ -758,8 +759,10 @@ object PlayerComponentsPatch : BaseBytecodePatch(
// region set static field
val shuffleClassIndex = indexOfFirstInstructionReversedOrThrow(accessibilityIndex, Opcode.CHECK_CAST)
val shuffleClass = getInstruction<ReferenceInstruction>(shuffleClassIndex).reference.toString()
val shuffleClassIndex =
indexOfFirstInstructionReversedOrThrow(accessibilityIndex, Opcode.CHECK_CAST)
val shuffleClass =
getInstruction<ReferenceInstruction>(shuffleClassIndex).reference.toString()
val shuffleMutableClass = context.findClass { classDef ->
classDef.type == shuffleClass
}!!.mutableClass

View File

@ -8,5 +8,5 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal object AudioVideoSwitchToggleFingerprint : LiteralValueFingerprint(
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
literalSupplier = { AudioVideoSwitchToggle }
literalSupplier = { AudioVideoSwitchToggle },
)

View File

@ -11,5 +11,5 @@ internal object MiniPlayerDefaultTextFingerprint : LiteralValueFingerprint(
Opcode.SGET_OBJECT,
Opcode.IF_NE
),
literalSupplier = { MiniPlayerDefaultText }
literalSupplier = { MiniPlayerDefaultText },
)

View File

@ -9,5 +9,5 @@ internal object MiniPlayerParentFingerprint : LiteralValueFingerprint(
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = emptyList(),
literalSupplier = { MiniPlayerMdxPlaying }
literalSupplier = { MiniPlayerMdxPlaying },
)

View File

@ -5,5 +5,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object OldEngagementPanelFingerprint : LiteralValueFingerprint(
returnType = "Z",
parameters = emptyList(),
literalSupplier = { 45427672 }
literalSupplier = { 45427672 },
)

View File

@ -8,5 +8,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object OldPlayerBackgroundFingerprint : LiteralValueFingerprint(
returnType = "Z",
parameters = emptyList(),
literalSupplier = { 45415319 }
literalSupplier = { 45415319 },
)

View File

@ -8,5 +8,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object OldPlayerLayoutFingerprint : LiteralValueFingerprint(
returnType = "Z",
parameters = emptyList(),
literalSupplier = { 45399578 }
literalSupplier = { 45399578 },
)

View File

@ -15,5 +15,5 @@ internal object RemixGenericButtonFingerprint : LiteralValueFingerprint(
Opcode.MOVE_RESULT,
Opcode.FLOAT_TO_INT
),
literalSupplier = { RemixGenericButtonSize }
literalSupplier = { RemixGenericButtonSize },
)

View File

@ -16,9 +16,9 @@ internal object ShuffleOnClickFingerprint : MethodFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("Landroid/view/View;"),
customFingerprint = { methodDef, _ ->
methodDef.containsWideLiteralInstructionValue(45468) &&
methodDef.name == "onClick" &&
indexOfAccessibilityInstruction(methodDef) >= 0
methodDef.containsWideLiteralInstructionValue(45468) &&
methodDef.name == "onClick" &&
indexOfAccessibilityInstruction(methodDef) >= 0
}
) {
fun indexOfAccessibilityInstruction(methodDef: Method) =

View File

@ -5,5 +5,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object SwipeToCloseFingerprint : LiteralValueFingerprint(
returnType = "Z",
parameters = emptyList(),
literalSupplier = { 45398432 }
literalSupplier = { 45398432 },
)

View File

@ -10,5 +10,5 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal object HeaderSwitchConfigFingerprint : LiteralValueFingerprint(
returnType = "Z",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
literalSupplier = { 45617851 }
literalSupplier = { 45617851 },
)

View File

@ -6,8 +6,8 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
internal object PlaybackRateBottomSheetClassFingerprint : LiteralValueFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = emptyList(),
literalSupplier = { VarispeedUnavailableTitle }
literalSupplier = { VarispeedUnavailableTitle },
)

View File

@ -7,5 +7,5 @@ import com.android.tools.smali.dexlib2.Opcode
internal object TextComponentFingerprint : LiteralValueFingerprint(
returnType = "V",
opcodes = listOf(Opcode.CONST_HIGH16),
literalSupplier = { ButtonIconPaddingMedium }
literalSupplier = { ButtonIconPaddingMedium },
)

View File

@ -5,5 +5,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object SeekBarConstructorFingerprint : LiteralValueFingerprint(
returnType = "V",
literalSupplier = { InlineTimeBarAdBreakMarkerColor }
literalSupplier = { InlineTimeBarAdBreakMarkerColor },
)

View File

@ -11,5 +11,5 @@ internal object VideoQualityListFingerprint : LiteralValueFingerprint(
Opcode.INVOKE_INTERFACE,
Opcode.RETURN_VOID
),
literalSupplier = { QualityAuto }
literalSupplier = { QualityAuto },
)

View File

@ -19,5 +19,5 @@ internal object MusicAdsFingerprint : LiteralValueFingerprint(
Opcode.IPUT_WIDE,
Opcode.CONST_4,
),
literalSupplier = { 4 }
literalSupplier = { 4 },
)

View File

@ -4,5 +4,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object SettingsMenuFingerprint : LiteralValueFingerprint(
returnType = "Landroid/view/View;",
literalSupplier = { 16908351 }
literalSupplier = { 16908351 },
)

View File

@ -6,5 +6,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object InterstitialsContainerFingerprint : LiteralValueFingerprint(
returnType = "V",
strings = listOf("overlay_controller_param"),
literalSupplier = { InterstitialsContainer }
literalSupplier = { InterstitialsContainer },
)

View File

@ -14,5 +14,5 @@ internal object BreakingNewsFingerprint : LiteralValueFingerprint(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT
),
literalSupplier = { HorizontalCardList }
literalSupplier = { HorizontalCardList },
)

View File

@ -9,5 +9,5 @@ internal object CaptionsButtonFingerprint : LiteralValueFingerprint(
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = emptyList(),
literalSupplier = { CaptionToggleContainer }
literalSupplier = { CaptionToggleContainer },
)

View File

@ -9,5 +9,5 @@ internal object CaptionsButtonSyntheticFingerprint : LiteralValueFingerprint(
returnType = "Landroid/view/View;",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.BRIDGE or AccessFlags.SYNTHETIC,
parameters = listOf("Landroid/content/Context;"),
literalSupplier = { CaptionToggleContainer }
literalSupplier = { CaptionToggleContainer },
)

View File

@ -11,5 +11,5 @@ internal object ChannelListSubMenuFingerprint : LiteralValueFingerprint(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT
),
literalSupplier = { ChannelListSubMenu }
literalSupplier = { ChannelListSubMenu },
)

View File

@ -6,8 +6,8 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
internal object ChannelListSubMenuTabletFingerprint : LiteralValueFingerprint(
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = emptyList(),
returnType = "V",
literalSupplier = { DrawerResults }
literalSupplier = { DrawerResults },
)

View File

@ -15,5 +15,5 @@ internal object FilterBarHeightFingerprint : LiteralValueFingerprint(
Opcode.MOVE_RESULT,
Opcode.IPUT
),
literalSupplier = { FilterBarHeight }
literalSupplier = { FilterBarHeight },
)

View File

@ -16,5 +16,5 @@ internal object LatestVideosButtonFingerprint : LiteralValueFingerprint(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT
),
literalSupplier = { Bar }
literalSupplier = { Bar },
)

View File

@ -14,5 +14,5 @@ internal object RelatedChipCloudFingerprint : LiteralValueFingerprint(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT
),
literalSupplier = { RelatedChipCloudMargin }
literalSupplier = { RelatedChipCloudMargin },
)

View File

@ -16,5 +16,5 @@ internal object SearchResultsChipBarFingerprint : LiteralValueFingerprint(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT
),
literalSupplier = { BarContainerHeight }
literalSupplier = { BarContainerHeight },
)

View File

@ -11,5 +11,5 @@ internal object ShowMoreButtonFingerprint : LiteralValueFingerprint(
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT
),
literalSupplier = { ExpandButtonDown }
literalSupplier = { ExpandButtonDown },
)

View File

@ -7,9 +7,9 @@ import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
internal object ContextualMenuItemBuilderFingerprint : LiteralValueFingerprint(
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.SYNTHETIC,
parameters = listOf("L", "L"),
returnType = "V",
opcodes = listOf(
Opcode.CHECK_CAST,
Opcode.INVOKE_VIRTUAL,
@ -17,5 +17,5 @@ internal object ContextualMenuItemBuilderFingerprint : LiteralValueFingerprint(
Opcode.MOVE_RESULT,
Opcode.ADD_INT_2ADDR
),
literalSupplier = { PosterArtWidthDefault }
literalSupplier = { PosterArtWidthDefault },
)

View File

@ -4,5 +4,5 @@ import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.Compa
import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object AccountListParentFingerprint : LiteralValueFingerprint(
literalSupplier = { CompactListItem }
literalSupplier = { CompactListItem },
)

View File

@ -11,5 +11,5 @@ internal object AccountMenuParentFingerprint : LiteralValueFingerprint(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT
),
literalSupplier = { CompactLink }
literalSupplier = { CompactLink },
)

View File

@ -6,5 +6,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object AccountSwitcherAccessibilityLabelFingerprint : LiteralValueFingerprint(
returnType = "V",
parameters = listOf("L", "Ljava/lang/Object;"),
literalSupplier = { AccountSwitcherAccessibility }
literalSupplier = { AccountSwitcherAccessibility },
)

View File

@ -15,5 +15,5 @@ internal object FloatingMicrophoneFingerprint : LiteralValueFingerprint(
Opcode.IF_EQZ,
Opcode.RETURN_VOID
),
literalSupplier = { Fab }
literalSupplier = { Fab },
)

View File

@ -9,5 +9,5 @@ internal object PiPNotificationFingerprint : LiteralValueFingerprint(
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("L"),
literalSupplier = { EditSettingsAction }
literalSupplier = { EditSettingsAction },
)

View File

@ -4,5 +4,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object TooltipContentFullscreenFingerprint : LiteralValueFingerprint(
returnType = "V",
literalSupplier = { 45384061 }
literalSupplier = { 45384061 },
)

View File

@ -9,5 +9,5 @@ internal object TooltipContentViewFingerprint : LiteralValueFingerprint(
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("L"),
literalSupplier = { ToolTipContentView }
literalSupplier = { ToolTipContentView },
)

View File

@ -6,7 +6,7 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
internal object AccessibilityOfflineButtonSyncFingerprint : LiteralValueFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
returnType = "V",
literalSupplier = { AccessibilityOfflineButtonSync }
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
literalSupplier = { AccessibilityOfflineButtonSync },
)

View File

@ -3,5 +3,5 @@ package app.revanced.patches.youtube.general.loadingscreen.fingerprints
import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object GradientLoadingScreenPrimaryFingerprint : LiteralValueFingerprint(
literalSupplier = { 45412406 }
literalSupplier = { 45412406 },
)

View File

@ -3,5 +3,5 @@ package app.revanced.patches.youtube.general.loadingscreen.fingerprints
import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object GradientLoadingScreenSecondaryFingerprint : LiteralValueFingerprint(
literalSupplier = { 45418917 }
literalSupplier = { 45418917 },
)

View File

@ -7,8 +7,8 @@ import com.android.tools.smali.dexlib2.AccessFlags
@Suppress("SpellCheckingInspection")
internal object MiniplayerDimensionsCalculatorParentFingerprint : LiteralValueFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("L"),
literalSupplier = { FloatyBarTopMargin }
literalSupplier = { FloatyBarTopMargin },
)

View File

@ -10,8 +10,8 @@ import com.android.tools.smali.dexlib2.AccessFlags
*/
@Suppress("SpellCheckingInspection")
internal object MiniplayerModernCloseButtonFingerprint : LiteralValueFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
returnType = "Landroid/widget/ImageView;",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = emptyList(),
literalSupplier = { ModernMiniPlayerClose }
literalSupplier = { ModernMiniPlayerClose },
)

View File

@ -8,5 +8,5 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal object MiniplayerModernDragAndDropFingerprint : LiteralValueFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
parameters = listOf("L"),
literalSupplier = { 45628752 }
literalSupplier = { 45628752 },
)

View File

@ -4,5 +4,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
@Suppress("SpellCheckingInspection")
internal object MiniplayerModernEnabledFingerprint : LiteralValueFingerprint(
literalSupplier = { 45622882 }
literalSupplier = { 45622882 },
)

View File

@ -10,8 +10,8 @@ import com.android.tools.smali.dexlib2.AccessFlags
*/
@Suppress("SpellCheckingInspection")
internal object MiniplayerModernExpandButtonFingerprint : LiteralValueFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
returnType = "Landroid/widget/ImageView;",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = emptyList(),
literalSupplier = { ModernMiniPlayerExpand }
literalSupplier = { ModernMiniPlayerExpand },
)

View File

@ -10,8 +10,8 @@ import com.android.tools.smali.dexlib2.AccessFlags
*/
@Suppress("SpellCheckingInspection")
internal object MiniplayerModernExpandCloseDrawablesFingerprint : LiteralValueFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("L"),
literalSupplier = { YtOutlinePictureInPictureWhite }
literalSupplier = { YtOutlinePictureInPictureWhite },
)

View File

@ -10,8 +10,8 @@ import com.android.tools.smali.dexlib2.AccessFlags
*/
@Suppress("SpellCheckingInspection")
internal object MiniplayerModernForwardButtonFingerprint : LiteralValueFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
returnType = "Landroid/widget/ImageView;",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = emptyList(),
literalSupplier = { ModernMiniPlayerForwardButton }
literalSupplier = { ModernMiniPlayerForwardButton },
)

View File

@ -10,8 +10,8 @@ import com.android.tools.smali.dexlib2.AccessFlags
*/
@Suppress("SpellCheckingInspection")
internal object MiniplayerModernOverlayViewFingerprint : LiteralValueFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = emptyList(),
literalSupplier = { ScrimOverlay }
literalSupplier = { ScrimOverlay },
)

View File

@ -10,8 +10,8 @@ import com.android.tools.smali.dexlib2.AccessFlags
*/
@Suppress("SpellCheckingInspection")
internal object MiniplayerModernRewindButtonFingerprint : LiteralValueFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
returnType = "Landroid/widget/ImageView;",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = emptyList(),
literalSupplier = { ModernMiniPlayerRewindButton }
literalSupplier = { ModernMiniPlayerRewindButton },
)

View File

@ -8,9 +8,9 @@ import app.revanced.patches.youtube.general.music.fingerprints.AppDeepLinkFinger
import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE
import app.revanced.patches.youtube.utils.gms.GmsCoreSupportResourcePatch.PackageNameYouTubeMusic
import app.revanced.patches.youtube.utils.integrations.Constants.GENERAL_PATH
import app.revanced.patches.youtube.utils.settings.ResourceUtils.addEntryValues
import app.revanced.patches.youtube.utils.settings.SettingsBytecodePatch
import app.revanced.patches.youtube.utils.settings.SettingsPatch
import app.revanced.util.addEntryValues
import app.revanced.util.findMethodOrThrow
import app.revanced.util.getReference
import app.revanced.util.indexOfFirstInstructionOrThrow

View File

@ -3,5 +3,5 @@ package app.revanced.patches.youtube.general.navigation.fingerprints
import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object TranslucentNavigationBarFingerprint : LiteralValueFingerprint(
literalSupplier = { 45630927 }
literalSupplier = { 45630927 },
)

View File

@ -4,5 +4,5 @@ import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.YtOut
import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object CreateButtonDrawableFingerprint : LiteralValueFingerprint(
literalSupplier = { YtOutlineVideoCamera }
literalSupplier = { YtOutlineVideoCamera },
)

View File

@ -7,5 +7,5 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal object DrawerContentViewConstructorFingerprint : LiteralValueFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
literalSupplier = { DrawerContentView }
literalSupplier = { DrawerContentView },
)

View File

@ -10,5 +10,5 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal object ImageSearchButtonConfigFingerprint : LiteralValueFingerprint(
returnType = "Z",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
literalSupplier = { 45617544 }
literalSupplier = { 45617544 },
)

View File

@ -6,5 +6,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
object SearchBarParentFingerprint : LiteralValueFingerprint(
returnType = "Landroid/view/View;",
strings = listOf("voz-target-id"),
literalSupplier = { VoiceSearch }
literalSupplier = { VoiceSearch },
)

View File

@ -6,5 +6,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
object SearchResultFingerprint : LiteralValueFingerprint(
returnType = "Landroid/view/View;",
strings = listOf("search_filter_chip_applied", "search_original_chip_query"),
literalSupplier = { VoiceSearch }
literalSupplier = { VoiceSearch },
)

View File

@ -13,5 +13,5 @@ internal object SetActionBarRingoFingerprint : LiteralValueFingerprint(
Opcode.IGET_OBJECT,
Opcode.INVOKE_STATIC
),
literalSupplier = { ActionBarRingo }
literalSupplier = { ActionBarRingo },
)

View File

@ -4,9 +4,9 @@ import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE
import app.revanced.patches.youtube.utils.settings.ResourceUtils.addEntryValues
import app.revanced.patches.youtube.utils.settings.SettingsPatch
import app.revanced.util.ResourceGroup
import app.revanced.util.addEntryValues
import app.revanced.util.copyResources
import app.revanced.util.patch.BaseResourcePatch
import java.nio.file.Files

View File

@ -1,6 +1,7 @@
package app.revanced.patches.youtube.layout.theme
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.shared.drawable.DrawableColorPatch
@ -10,28 +11,32 @@ import org.w3c.dom.Element
@Patch(dependencies = [DrawableColorPatch::class])
@Suppress("DEPRECATION")
object BaseThemePatch : ResourcePatch() {
private const val SPLASH_SCREEN_COLOR_NAME = "splashScreenColor"
private const val SPLASH_SCREEN_COLOR_ATTRIBUTE = "?attr/$SPLASH_SCREEN_COLOR_NAME"
override fun execute(context: ResourceContext) {
DrawableColorPatch.injectCall("$UTILS_PATH/DrawableColorPatch;->getColor(I)I")
// edit the resource files to change the splash screen color
val attrsPath = "res/values/attrs.xml"
val stylesPaths: List<String> = listOf(
"res/values/styles.xml", // Android 11 (and below)
"res/values-v31/styles.xml", // Android 12 (and above)
)
val attrsResourceFile = "res/values/attrs.xml"
val stylesResourceFiles =
listOf("values", "values-v31").map { valuesPath ->
"res/$valuesPath/styles.xml"
}.toTypedArray()
context.xmlEditor[attrsPath].use { editor ->
context.xmlEditor[attrsResourceFile].use { editor ->
val file = editor.file
(file.getElementsByTagName("resources").item(0) as Element).appendChild(
file.createElement("attr").apply {
setAttribute("format", "reference")
setAttribute("name", "splashScreenColor")
setAttribute("name", SPLASH_SCREEN_COLOR_NAME)
}
)
}
stylesPaths.forEachIndexed { pathIndex, stylesPath ->
stylesResourceFiles.forEachIndexed { pathIndex, stylesPath ->
context.xmlEditor[stylesPath].use { editor ->
val file = editor.file
@ -62,7 +67,7 @@ object BaseThemePatch : ResourcePatch() {
}
1 -> when (nodeAttributeName) {
"Base.Theme.YouTube.Launcher" -> "?attr/splashScreenColor"
"Base.Theme.YouTube.Launcher" -> SPLASH_SCREEN_COLOR_ATTRIBUTE
else -> "null"
}
@ -78,12 +83,27 @@ object BaseThemePatch : ResourcePatch() {
}
}
arrayOf("drawable", "drawable-sw600dp").forEach { quantumLaunchScreenPath ->
context.xmlEditor["res/$quantumLaunchScreenPath/quantum_launchscreen_youtube.xml"].use { editor ->
val resourcesNode = editor.file.getElementsByTagName("item").item(0) as Element
val splashScreenResourceFiles =
listOf("drawable", "drawable-sw600dp").map { quantumLaunchScreenPath ->
"res/$quantumLaunchScreenPath/quantum_launchscreen_youtube.xml"
}.toTypedArray()
if (resourcesNode.attributes.getNamedItem("android:drawable") != null)
resourcesNode.setAttribute("android:drawable", "?attr/splashScreenColor")
splashScreenResourceFiles.forEach editSplashScreen@{ resourceFile ->
context.xmlEditor[resourceFile].use { editor ->
val document = editor.file
val layerList = document.getElementsByTagName("layer-list").item(0) as Element
val childNodes = layerList.childNodes
for (i in 0 until childNodes.length) {
val node = childNodes.item(i)
if (node is Element && node.hasAttribute("android:drawable")) {
node.setAttribute("android:drawable", SPLASH_SCREEN_COLOR_ATTRIBUTE)
return@editSplashScreen
}
}
throw PatchException("Failed to modify launch screen")
}
}

View File

@ -44,9 +44,6 @@ object MaterialYouPatch : BaseResourcePatch(
context.copyXmlNode("youtube/materialyou/host", "values-v31/colors.xml", "resources")
/**
* Add settings
*/
context.updatePatchStatusTheme("MaterialYou")
isMonetPatchIncluded = true

View File

@ -10,5 +10,5 @@ internal object BackgroundPlaybackManagerFingerprint : LiteralValueFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
parameters = listOf("L"),
opcodes = listOf(Opcode.AND_INT_LIT16),
literalSupplier = { 64657230 }
literalSupplier = { 64657230 },
)

View File

@ -18,5 +18,5 @@ internal object BackgroundPlaybackSettingsFingerprint : LiteralValueFingerprint(
Opcode.IF_NEZ,
Opcode.GOTO
),
literalSupplier = { BackgroundCategory }
literalSupplier = { BackgroundCategory },
)

View File

@ -8,5 +8,5 @@ internal object KidsBackgroundPlaybackPolicyControllerFingerprint : LiteralValue
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("I", "L", "L"),
literalSupplier = { 5 }
literalSupplier = { 5 },
)

View File

@ -13,5 +13,5 @@ internal object PiPControllerFingerprint : LiteralValueFingerprint(
Opcode.IF_NEZ,
Opcode.INVOKE_DIRECT
),
literalSupplier = { 151635310 }
literalSupplier = { 151635310 },
)

View File

@ -9,5 +9,5 @@ internal object BottomSheetRecyclerViewFingerprint : LiteralValueFingerprint(
returnType = "Lj${'$'}/util/Optional;",
accessFlags = AccessFlags.PROTECTED or AccessFlags.FINAL,
parameters = emptyList(),
literalSupplier = { BottomSheetRecyclerView }
literalSupplier = { BottomSheetRecyclerView },
)

View File

@ -4,5 +4,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object AmbientModeInFullscreenFingerprint : LiteralValueFingerprint(
returnType = "V",
literalSupplier = { 45389368 }
literalSupplier = { 45389368 },
)

View File

@ -10,5 +10,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
*/
internal object LithoSubtitleButtonConfigFingerprint : LiteralValueFingerprint(
returnType = "Z",
literalSupplier = { 45421555 }
literalSupplier = { 45421555 },
)

View File

@ -5,5 +5,5 @@ import app.revanced.util.fingerprint.LiteralValueFingerprint
internal object MusicAppDeeplinkButtonParentFingerprint : LiteralValueFingerprint(
returnType = "V",
literalSupplier = { MusicAppDeeplinkButtonView }
literalSupplier = { MusicAppDeeplinkButtonView },
)

View File

@ -14,5 +14,5 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal object YouTubeControlsOverlaySubtitleButtonFingerprint : LiteralValueFingerprint(
returnType = "L",
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
literalSupplier = { YouTubeControlsOverlaySubtitleButton }
literalSupplier = { YouTubeControlsOverlaySubtitleButton },
)

View File

@ -5,7 +5,7 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal object ShortsLiveStreamEmojiPickerOnClickListenerFingerprint : LiteralValueFingerprint(
returnType = "V",
parameters = listOf("L"),
accessFlags = AccessFlags.PUBLIC.value,
literalSupplier = { 126326492 }
parameters = listOf("L"),
literalSupplier = { 126326492 },
)

View File

@ -9,5 +9,5 @@ internal object ShortsLiveStreamEmojiPickerOpacityFingerprint : LiteralValueFing
returnType = "Landroid/widget/ImageView;",
accessFlags = AccessFlags.PROTECTED or AccessFlags.FINAL,
parameters = emptyList(),
literalSupplier = { EmojiPickerIcon }
literalSupplier = { EmojiPickerIcon },
)

Some files were not shown because too many files have changed in this diff Show More