mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-05 17:14:35 +02:00
chore: Lint code
This commit is contained in:
parent
dc0a5973ad
commit
a353a48aa3
@ -179,7 +179,8 @@ val sponsorBlockPatch = resourcePatch(
|
|||||||
val tags = document.getElementsByTagName(PREFERENCE_SCREEN_TAG_NAME)
|
val tags = document.getElementsByTagName(PREFERENCE_SCREEN_TAG_NAME)
|
||||||
List(tags.length) { tags.item(it) as Element }
|
List(tags.length) { tags.item(it) as Element }
|
||||||
.filter {
|
.filter {
|
||||||
it.getAttribute("android:key").contains("revanced_preference_screen_$category")
|
it.getAttribute("android:key")
|
||||||
|
.contains("revanced_preference_screen_$category")
|
||||||
}
|
}
|
||||||
.forEach {
|
.forEach {
|
||||||
it.adoptChild(SWITCH_PREFERENCE_TAG_NAME) {
|
it.adoptChild(SWITCH_PREFERENCE_TAG_NAME) {
|
||||||
@ -210,7 +211,8 @@ val sponsorBlockPatch = resourcePatch(
|
|||||||
val tags = document.getElementsByTagName(PREFERENCE_SCREEN_TAG_NAME)
|
val tags = document.getElementsByTagName(PREFERENCE_SCREEN_TAG_NAME)
|
||||||
List(tags.length) { tags.item(it) as Element }
|
List(tags.length) { tags.item(it) as Element }
|
||||||
.filter {
|
.filter {
|
||||||
it.getAttribute("android:key").contains("revanced_preference_screen_$category")
|
it.getAttribute("android:key")
|
||||||
|
.contains("revanced_preference_screen_$category")
|
||||||
}
|
}
|
||||||
.forEach {
|
.forEach {
|
||||||
it.adoptChild("Preference") {
|
it.adoptChild("Preference") {
|
||||||
|
@ -114,7 +114,8 @@ val adsPatch = bytecodePatch(
|
|||||||
// AdElementConverter is conveniently responsible for inserting all feed ads.
|
// AdElementConverter is conveniently responsible for inserting all feed ads.
|
||||||
// By removing the appending instruction no ad posts gets appended to the feed.
|
// By removing the appending instruction no ad posts gets appended to the feed.
|
||||||
newAdPostFingerprint.methodOrThrow().apply {
|
newAdPostFingerprint.methodOrThrow().apply {
|
||||||
val stringIndex = indexOfFirstStringInstructionOrThrow("android_feed_freeform_render_variant")
|
val stringIndex =
|
||||||
|
indexOfFirstStringInstructionOrThrow("android_feed_freeform_render_variant")
|
||||||
val targetIndex = indexOfFirstInstructionOrThrow(stringIndex) {
|
val targetIndex = indexOfFirstInstructionOrThrow(stringIndex) {
|
||||||
opcode == Opcode.INVOKE_VIRTUAL
|
opcode == Opcode.INVOKE_VIRTUAL
|
||||||
&& getReference<MethodReference>()?.toString() == "Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z"
|
&& getReference<MethodReference>()?.toString() == "Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z"
|
||||||
|
@ -24,7 +24,9 @@ val recommendedCommunitiesPatch = bytecodePatch(
|
|||||||
dependsOn(settingsPatch)
|
dependsOn(settingsPatch)
|
||||||
|
|
||||||
execute {
|
execute {
|
||||||
communityRecommendationSectionFingerprint.methodOrThrow(communityRecommendationSectionParentFingerprint).apply {
|
communityRecommendationSectionFingerprint.methodOrThrow(
|
||||||
|
communityRecommendationSectionParentFingerprint
|
||||||
|
).apply {
|
||||||
addInstructionsWithLabels(
|
addInstructionsWithLabels(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
|
@ -39,28 +39,30 @@ val navigationButtonsPatch = bytecodePatch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bottomNavScreenFingerprint.resolvable()) {
|
if (bottomNavScreenFingerprint.resolvable()) {
|
||||||
val bottomNavScreenMutableClass = with (bottomNavScreenFingerprint.methodOrThrow()) {
|
val bottomNavScreenMutableClass = with(bottomNavScreenFingerprint.methodOrThrow()) {
|
||||||
val startIndex = indexOfGetDimensionPixelSizeInstruction(this)
|
val startIndex = indexOfGetDimensionPixelSizeInstruction(this)
|
||||||
val targetIndex = indexOfFirstInstructionOrThrow(startIndex, Opcode.NEW_INSTANCE)
|
val targetIndex = indexOfFirstInstructionOrThrow(startIndex, Opcode.NEW_INSTANCE)
|
||||||
val targetReference = getInstruction<ReferenceInstruction>(targetIndex).reference.toString()
|
val targetReference =
|
||||||
|
getInstruction<ReferenceInstruction>(targetIndex).reference.toString()
|
||||||
|
|
||||||
classBy { it.type == targetReference }
|
classBy { it.type == targetReference }
|
||||||
?.mutableClass
|
?.mutableClass
|
||||||
?: throw ClassNotFoundException("Failed to find class $targetReference")
|
?: throw ClassNotFoundException("Failed to find class $targetReference")
|
||||||
}
|
}
|
||||||
|
|
||||||
bottomNavScreenOnGlobalLayoutFingerprint.second.matchOrNull(bottomNavScreenMutableClass)?.let {
|
bottomNavScreenOnGlobalLayoutFingerprint.second.matchOrNull(bottomNavScreenMutableClass)
|
||||||
it.method.apply {
|
?.let {
|
||||||
val startIndex = it.patternMatch!!.startIndex
|
it.method.apply {
|
||||||
val targetRegister =
|
val startIndex = it.patternMatch!!.startIndex
|
||||||
getInstruction<FiveRegisterInstruction>(startIndex).registerC
|
val targetRegister =
|
||||||
|
getInstruction<FiveRegisterInstruction>(startIndex).registerC
|
||||||
|
|
||||||
addInstruction(
|
addInstruction(
|
||||||
startIndex + 1,
|
startIndex + 1,
|
||||||
"invoke-static {v$targetRegister}, $EXTENSION_CLASS_DESCRIPTOR->hideNavigationButtons(Landroid/view/ViewGroup;)V"
|
"invoke-static {v$targetRegister}, $EXTENSION_CLASS_DESCRIPTOR->hideNavigationButtons(Landroid/view/ViewGroup;)V"
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// Legacy method.
|
// Legacy method.
|
||||||
bottomNavScreenHandlerFingerprint.methodOrThrow().apply {
|
bottomNavScreenHandlerFingerprint.methodOrThrow().apply {
|
||||||
|
@ -31,15 +31,18 @@ val recentlyVisitedShelfPatch = bytecodePatch(
|
|||||||
|
|
||||||
execute {
|
execute {
|
||||||
|
|
||||||
val recentlyVisitedReference = with (communityDrawerPresenterConstructorFingerprint.methodOrThrow()) {
|
val recentlyVisitedReference =
|
||||||
val recentlyVisitedFieldIndex = indexOfHeaderItemInstruction(this)
|
with(communityDrawerPresenterConstructorFingerprint.methodOrThrow()) {
|
||||||
val recentlyVisitedObjectIndex =
|
val recentlyVisitedFieldIndex = indexOfHeaderItemInstruction(this)
|
||||||
indexOfFirstInstructionOrThrow(recentlyVisitedFieldIndex, Opcode.IPUT_OBJECT)
|
val recentlyVisitedObjectIndex =
|
||||||
|
indexOfFirstInstructionOrThrow(recentlyVisitedFieldIndex, Opcode.IPUT_OBJECT)
|
||||||
|
|
||||||
getInstruction<ReferenceInstruction>(recentlyVisitedObjectIndex).reference.toString()
|
getInstruction<ReferenceInstruction>(recentlyVisitedObjectIndex).reference.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
communityDrawerPresenterFingerprint.methodOrThrow(communityDrawerPresenterConstructorFingerprint).apply {
|
communityDrawerPresenterFingerprint.methodOrThrow(
|
||||||
|
communityDrawerPresenterConstructorFingerprint
|
||||||
|
).apply {
|
||||||
val recentlyVisitedObjectIndex =
|
val recentlyVisitedObjectIndex =
|
||||||
indexOfFirstInstructionOrThrow {
|
indexOfFirstInstructionOrThrow {
|
||||||
(this as? ReferenceInstruction)?.reference?.toString() == recentlyVisitedReference
|
(this as? ReferenceInstruction)?.reference?.toString() == recentlyVisitedReference
|
||||||
|
@ -19,7 +19,8 @@ internal val customReportsFingerprint = legacyFingerprint(
|
|||||||
|
|
||||||
fun indexOfScreenNavigatorInstruction(method: Method) =
|
fun indexOfScreenNavigatorInstruction(method: Method) =
|
||||||
method.indexOfFirstInstruction {
|
method.indexOfFirstInstruction {
|
||||||
(this as? ReferenceInstruction)?.reference?.toString()?.contains("Landroid/app/Activity;Landroid/net/Uri;") == true
|
(this as? ReferenceInstruction)?.reference?.toString()
|
||||||
|
?.contains("Landroid/app/Activity;Landroid/net/Uri;") == true
|
||||||
}
|
}
|
||||||
|
|
||||||
internal val screenNavigatorFingerprint = legacyFingerprint(
|
internal val screenNavigatorFingerprint = legacyFingerprint(
|
||||||
|
@ -9,7 +9,6 @@ import app.revanced.patches.reddit.utils.extension.Constants.PATCHES_PATH
|
|||||||
import app.revanced.patches.reddit.utils.patch.PatchList.OPEN_LINKS_EXTERNALLY
|
import app.revanced.patches.reddit.utils.patch.PatchList.OPEN_LINKS_EXTERNALLY
|
||||||
import app.revanced.patches.reddit.utils.settings.settingsPatch
|
import app.revanced.patches.reddit.utils.settings.settingsPatch
|
||||||
import app.revanced.patches.reddit.utils.settings.updatePatchStatus
|
import app.revanced.patches.reddit.utils.settings.updatePatchStatus
|
||||||
import app.revanced.util.fingerprint.methodOrThrow
|
|
||||||
import app.revanced.util.indexOfFirstStringInstructionOrThrow
|
import app.revanced.util.indexOfFirstStringInstructionOrThrow
|
||||||
|
|
||||||
private const val EXTENSION_METHOD_DESCRIPTOR =
|
private const val EXTENSION_METHOD_DESCRIPTOR =
|
||||||
|
@ -12,10 +12,10 @@ val screenNavigatorMethodResolverPatch = bytecodePatch(
|
|||||||
) {
|
) {
|
||||||
execute {
|
execute {
|
||||||
screenNavigatorMethod =
|
screenNavigatorMethod =
|
||||||
// ~ Reddit 2024.25.3
|
// ~ Reddit 2024.25.3
|
||||||
screenNavigatorFingerprint.second.methodOrNull
|
screenNavigatorFingerprint.second.methodOrNull
|
||||||
// Reddit 2024.26.1 ~
|
// Reddit 2024.26.1 ~
|
||||||
?: with (customReportsFingerprint.methodOrThrow()) {
|
?: with(customReportsFingerprint.methodOrThrow()) {
|
||||||
getWalkerMethod(indexOfScreenNavigatorInstruction(this))
|
getWalkerMethod(indexOfScreenNavigatorInstruction(this))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,9 @@ private val settingsBytecodePatch = bytecodePatch(
|
|||||||
&& (this as? BuilderInstruction21c)?.reference.toString().startsWith("202")
|
&& (this as? BuilderInstruction21c)?.reference.toString().startsWith("202")
|
||||||
}
|
}
|
||||||
|
|
||||||
val versionNumber = getInstruction<BuilderInstruction21c>(versionIndex).reference.toString().replace(".", "").toInt()
|
val versionNumber =
|
||||||
|
getInstruction<BuilderInstruction21c>(versionIndex).reference.toString()
|
||||||
|
.replace(".", "").toInt()
|
||||||
|
|
||||||
is_2024_18_or_greater = 2024180 <= versionNumber
|
is_2024_18_or_greater = 2024180 <= versionNumber
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ fun baseSpoofStreamingDataPatch(
|
|||||||
// region Replace the streaming data.
|
// region Replace the streaming data.
|
||||||
|
|
||||||
val approxDurationMsFieldName = formatStreamModelConstructorFingerprint.matchOrThrow().let {
|
val approxDurationMsFieldName = formatStreamModelConstructorFingerprint.matchOrThrow().let {
|
||||||
with (it.method) {
|
with(it.method) {
|
||||||
val approxDurationMsFieldIndex = it.patternMatch!!.startIndex
|
val approxDurationMsFieldIndex = it.patternMatch!!.startIndex
|
||||||
(getInstruction<ReferenceInstruction>(approxDurationMsFieldIndex).reference as FieldReference).name
|
(getInstruction<ReferenceInstruction>(approxDurationMsFieldIndex).reference as FieldReference).name
|
||||||
}
|
}
|
||||||
|
@ -80,8 +80,10 @@ val shortsActionButtonsPatch = resourcePatch(
|
|||||||
val fromPath = res.resolve(fromFile).toPath()
|
val fromPath = res.resolve(fromFile).toPath()
|
||||||
val toFile = "$drawableDirectory/$toFileName.webp"
|
val toFile = "$drawableDirectory/$toFileName.webp"
|
||||||
val toPath = res.resolve(toFile).toPath()
|
val toPath = res.resolve(toFile).toPath()
|
||||||
val inputStreamForLegacy = inputStreamFromBundledResourceOrThrow(sourceResourceDirectory, fromFile)
|
val inputStreamForLegacy =
|
||||||
val inputStreamForNew = inputStreamFromBundledResourceOrThrow(sourceResourceDirectory, fromFile)
|
inputStreamFromBundledResourceOrThrow(sourceResourceDirectory, fromFile)
|
||||||
|
val inputStreamForNew =
|
||||||
|
inputStreamFromBundledResourceOrThrow(sourceResourceDirectory, fromFile)
|
||||||
|
|
||||||
Files.copy(inputStreamForLegacy, fromPath, StandardCopyOption.REPLACE_EXISTING)
|
Files.copy(inputStreamForLegacy, fromPath, StandardCopyOption.REPLACE_EXISTING)
|
||||||
|
|
||||||
|
@ -178,7 +178,8 @@ val customBrandingIconPatch = resourcePatch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
document("res/values/styles.xml").use { document ->
|
document("res/values/styles.xml").use { document ->
|
||||||
val resourcesNode = document.getElementsByTagName("resources").item(0) as Element
|
val resourcesNode =
|
||||||
|
document.getElementsByTagName("resources").item(0) as Element
|
||||||
val childNodes = resourcesNode.childNodes
|
val childNodes = resourcesNode.childNodes
|
||||||
|
|
||||||
for (i in 0 until childNodes.length) {
|
for (i in 0 until childNodes.length) {
|
||||||
@ -205,7 +206,8 @@ val customBrandingIconPatch = resourcePatch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val styleMap = mutableMapOf<String, String>()
|
val styleMap = mutableMapOf<String, String>()
|
||||||
styleMap["Base.Theme.YouTube.Launcher"] = "@style/Theme.AppCompat.DayNight.NoActionBar"
|
styleMap["Base.Theme.YouTube.Launcher"] =
|
||||||
|
"@style/Theme.AppCompat.DayNight.NoActionBar"
|
||||||
|
|
||||||
if (is_19_32_or_greater) {
|
if (is_19_32_or_greater) {
|
||||||
styleMap["Theme.YouTube.Home"] = "@style/Base.V27.Theme.YouTube.Home"
|
styleMap["Theme.YouTube.Home"] = "@style/Base.V27.Theme.YouTube.Home"
|
||||||
@ -213,7 +215,8 @@ val customBrandingIconPatch = resourcePatch(
|
|||||||
|
|
||||||
styleMap.forEach { (nodeAttributeName, nodeAttributeParent) ->
|
styleMap.forEach { (nodeAttributeName, nodeAttributeParent) ->
|
||||||
document("res/values-v31/styles.xml").use { document ->
|
document("res/values-v31/styles.xml").use { document ->
|
||||||
val resourcesNode = document.getElementsByTagName("resources").item(0) as Element
|
val resourcesNode =
|
||||||
|
document.getElementsByTagName("resources").item(0) as Element
|
||||||
|
|
||||||
val style = document.createElement("style")
|
val style = document.createElement("style")
|
||||||
style.setAttribute("name", nodeAttributeName)
|
style.setAttribute("name", nodeAttributeName)
|
||||||
@ -223,7 +226,10 @@ val customBrandingIconPatch = resourcePatch(
|
|||||||
primaryItem.setAttribute("name", "android:windowSplashScreenAnimatedIcon")
|
primaryItem.setAttribute("name", "android:windowSplashScreenAnimatedIcon")
|
||||||
primaryItem.textContent = "@drawable/avd_anim"
|
primaryItem.textContent = "@drawable/avd_anim"
|
||||||
val secondaryItem = document.createElement("item")
|
val secondaryItem = document.createElement("item")
|
||||||
secondaryItem.setAttribute("name", "android:windowSplashScreenAnimationDuration")
|
secondaryItem.setAttribute(
|
||||||
|
"name",
|
||||||
|
"android:windowSplashScreenAnimationDuration"
|
||||||
|
)
|
||||||
secondaryItem.textContent = if (appIcon.startsWith("revancify"))
|
secondaryItem.textContent = if (appIcon.startsWith("revancify"))
|
||||||
"1500"
|
"1500"
|
||||||
else
|
else
|
||||||
|
@ -67,6 +67,7 @@ val sharedThemePatch = resourcePatch(
|
|||||||
1 -> when (nodeAttributeName) {
|
1 -> when (nodeAttributeName) {
|
||||||
"Base.Theme.YouTube.Launcher",
|
"Base.Theme.YouTube.Launcher",
|
||||||
"Base.Theme.YouTube.Launcher.Cairo" -> SPLASH_SCREEN_COLOR_ATTRIBUTE
|
"Base.Theme.YouTube.Launcher.Cairo" -> SPLASH_SCREEN_COLOR_ATTRIBUTE
|
||||||
|
|
||||||
else -> "null"
|
else -> "null"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +116,8 @@ val sharedThemePatch = resourcePatch(
|
|||||||
return@editSplashScreen
|
return@editSplashScreen
|
||||||
}
|
}
|
||||||
document("res/$drawable/$fileName.xml").use { document ->
|
document("res/$drawable/$fileName.xml").use { document ->
|
||||||
val layerList = document.getElementsByTagName("layer-list").item(0) as Element
|
val layerList =
|
||||||
|
document.getElementsByTagName("layer-list").item(0) as Element
|
||||||
|
|
||||||
val childNodes = layerList.childNodes
|
val childNodes = layerList.childNodes
|
||||||
for (i in 0 until childNodes.length) {
|
for (i in 0 until childNodes.length) {
|
||||||
|
@ -169,7 +169,8 @@ val playerButtonsPatch = bytecodePatch(
|
|||||||
|
|
||||||
if (is_19_34_or_greater) {
|
if (is_19_34_or_greater) {
|
||||||
layoutConstructorFingerprint.methodOrThrow().apply {
|
layoutConstructorFingerprint.methodOrThrow().apply {
|
||||||
val resourceIndex = indexOfFirstLiteralInstructionOrThrow(playerControlPreviousButtonTouchArea)
|
val resourceIndex =
|
||||||
|
indexOfFirstLiteralInstructionOrThrow(playerControlPreviousButtonTouchArea)
|
||||||
|
|
||||||
val insertIndex = indexOfFirstInstructionOrThrow(resourceIndex) {
|
val insertIndex = indexOfFirstInstructionOrThrow(resourceIndex) {
|
||||||
opcode == Opcode.INVOKE_STATIC &&
|
opcode == Opcode.INVOKE_STATIC &&
|
||||||
|
@ -16,8 +16,8 @@ import app.revanced.patches.youtube.utils.playertype.playerTypeHookPatch
|
|||||||
import app.revanced.patches.youtube.utils.playservice.is_18_49_or_greater
|
import app.revanced.patches.youtube.utils.playservice.is_18_49_or_greater
|
||||||
import app.revanced.patches.youtube.utils.playservice.is_19_02_or_greater
|
import app.revanced.patches.youtube.utils.playservice.is_19_02_or_greater
|
||||||
import app.revanced.patches.youtube.utils.playservice.versionCheckPatch
|
import app.revanced.patches.youtube.utils.playservice.versionCheckPatch
|
||||||
import app.revanced.patches.youtube.utils.recyclerview.recyclerViewTreeObserverPatch
|
|
||||||
import app.revanced.patches.youtube.utils.recyclerview.recyclerViewTreeObserverHook
|
import app.revanced.patches.youtube.utils.recyclerview.recyclerViewTreeObserverHook
|
||||||
|
import app.revanced.patches.youtube.utils.recyclerview.recyclerViewTreeObserverPatch
|
||||||
import app.revanced.patches.youtube.utils.resourceid.sharedResourceIdPatch
|
import app.revanced.patches.youtube.utils.resourceid.sharedResourceIdPatch
|
||||||
import app.revanced.patches.youtube.utils.rollingNumberTextViewAnimationUpdateFingerprint
|
import app.revanced.patches.youtube.utils.rollingNumberTextViewAnimationUpdateFingerprint
|
||||||
import app.revanced.patches.youtube.utils.rollingNumberTextViewFingerprint
|
import app.revanced.patches.youtube.utils.rollingNumberTextViewFingerprint
|
||||||
|
@ -37,8 +37,8 @@ import app.revanced.patches.youtube.utils.playservice.is_19_25_or_greater
|
|||||||
import app.revanced.patches.youtube.utils.playservice.is_19_28_or_greater
|
import app.revanced.patches.youtube.utils.playservice.is_19_28_or_greater
|
||||||
import app.revanced.patches.youtube.utils.playservice.is_19_34_or_greater
|
import app.revanced.patches.youtube.utils.playservice.is_19_34_or_greater
|
||||||
import app.revanced.patches.youtube.utils.playservice.versionCheckPatch
|
import app.revanced.patches.youtube.utils.playservice.versionCheckPatch
|
||||||
import app.revanced.patches.youtube.utils.recyclerview.recyclerViewTreeObserverPatch
|
|
||||||
import app.revanced.patches.youtube.utils.recyclerview.recyclerViewTreeObserverHook
|
import app.revanced.patches.youtube.utils.recyclerview.recyclerViewTreeObserverHook
|
||||||
|
import app.revanced.patches.youtube.utils.recyclerview.recyclerViewTreeObserverPatch
|
||||||
import app.revanced.patches.youtube.utils.resourceid.bottomBarContainer
|
import app.revanced.patches.youtube.utils.resourceid.bottomBarContainer
|
||||||
import app.revanced.patches.youtube.utils.resourceid.metaPanel
|
import app.revanced.patches.youtube.utils.resourceid.metaPanel
|
||||||
import app.revanced.patches.youtube.utils.resourceid.reelDynRemix
|
import app.revanced.patches.youtube.utils.resourceid.reelDynRemix
|
||||||
|
@ -165,10 +165,22 @@ val swipeControlsPatch = bytecodePatch(
|
|||||||
reference.parameterTypes.size == 0
|
reference.parameterTypes.size == 0
|
||||||
}
|
}
|
||||||
if (getInstruction(targetIndex - 1).opcode != Opcode.IGET_OBJECT) {
|
if (getInstruction(targetIndex - 1).opcode != Opcode.IGET_OBJECT) {
|
||||||
throw PatchException("Previous Opcode pattern does not match: ${getInstruction(targetIndex - 1).opcode}")
|
throw PatchException(
|
||||||
|
"Previous Opcode pattern does not match: ${
|
||||||
|
getInstruction(
|
||||||
|
targetIndex - 1
|
||||||
|
).opcode
|
||||||
|
}"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
if (getInstruction(targetIndex + 1).opcode != Opcode.IF_EQZ) {
|
if (getInstruction(targetIndex + 1).opcode != Opcode.IF_EQZ) {
|
||||||
throw PatchException("Next Opcode pattern does not match: ${getInstruction(targetIndex + 1).opcode}")
|
throw PatchException(
|
||||||
|
"Next Opcode pattern does not match: ${
|
||||||
|
getInstruction(
|
||||||
|
targetIndex + 1
|
||||||
|
).opcode
|
||||||
|
}"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
val fieldReference = getInstruction<ReferenceInstruction>(targetIndex - 1).reference
|
val fieldReference = getInstruction<ReferenceInstruction>(targetIndex - 1).reference
|
||||||
val fieldInstruction = getInstruction<TwoRegisterInstruction>(targetIndex - 1)
|
val fieldInstruction = getInstruction<TwoRegisterInstruction>(targetIndex - 1)
|
||||||
|
@ -67,7 +67,12 @@ internal val layoutConstructorFingerprint = legacyFingerprint(
|
|||||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
parameters = emptyList(),
|
parameters = emptyList(),
|
||||||
strings = listOf("1.0x"),
|
strings = listOf("1.0x"),
|
||||||
literals = listOf(autoNavToggle, autoNavPreviewStub, playerControlPreviousButtonTouchArea, playerControlNextButtonTouchArea),
|
literals = listOf(
|
||||||
|
autoNavToggle,
|
||||||
|
autoNavPreviewStub,
|
||||||
|
playerControlPreviousButtonTouchArea,
|
||||||
|
playerControlNextButtonTouchArea
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
internal val playbackRateBottomSheetBuilderFingerprint = legacyFingerprint(
|
internal val playbackRateBottomSheetBuilderFingerprint = legacyFingerprint(
|
||||||
|
@ -5,7 +5,6 @@ import app.revanced.patches.youtube.misc.backgroundplayback.backgroundPlaybackPa
|
|||||||
import app.revanced.patches.youtube.utils.playservice.is_19_04_or_greater
|
import app.revanced.patches.youtube.utils.playservice.is_19_04_or_greater
|
||||||
import app.revanced.patches.youtube.utils.playservice.versionCheckPatch
|
import app.revanced.patches.youtube.utils.playservice.versionCheckPatch
|
||||||
import app.revanced.util.fingerprint.injectLiteralInstructionBooleanCall
|
import app.revanced.util.fingerprint.injectLiteralInstructionBooleanCall
|
||||||
import app.revanced.util.fingerprint.resolvable
|
|
||||||
|
|
||||||
val cairoSettingsPatch = bytecodePatch(
|
val cairoSettingsPatch = bytecodePatch(
|
||||||
description = "cairoSettingsPatch"
|
description = "cairoSettingsPatch"
|
||||||
|
@ -45,7 +45,8 @@ val playbackSpeedWhilePlayingPatch = bytecodePatch(
|
|||||||
playbackSpeedInFeedsFingerprint.methodOrThrow().apply {
|
playbackSpeedInFeedsFingerprint.methodOrThrow().apply {
|
||||||
val freeRegister = implementation!!.registerCount - parameters.size - 2
|
val freeRegister = implementation!!.registerCount - parameters.size - 2
|
||||||
val playbackSpeedIndex = indexOfGetPlaybackSpeedInstruction(this)
|
val playbackSpeedIndex = indexOfGetPlaybackSpeedInstruction(this)
|
||||||
val playbackSpeedRegister = getInstruction<TwoRegisterInstruction>(playbackSpeedIndex).registerA
|
val playbackSpeedRegister =
|
||||||
|
getInstruction<TwoRegisterInstruction>(playbackSpeedIndex).registerA
|
||||||
val jumpIndex = indexOfFirstInstructionOrThrow(playbackSpeedIndex, Opcode.RETURN_VOID)
|
val jumpIndex = indexOfFirstInstructionOrThrow(playbackSpeedIndex, Opcode.RETURN_VOID)
|
||||||
|
|
||||||
addInstructionsWithLabels(
|
addInstructionsWithLabels(
|
||||||
|
@ -19,8 +19,8 @@ import app.revanced.patches.youtube.utils.flyoutmenu.flyoutMenuHookPatch
|
|||||||
import app.revanced.patches.youtube.utils.patch.PatchList.VIDEO_PLAYBACK
|
import app.revanced.patches.youtube.utils.patch.PatchList.VIDEO_PLAYBACK
|
||||||
import app.revanced.patches.youtube.utils.playertype.playerTypeHookPatch
|
import app.revanced.patches.youtube.utils.playertype.playerTypeHookPatch
|
||||||
import app.revanced.patches.youtube.utils.qualityMenuViewInflateFingerprint
|
import app.revanced.patches.youtube.utils.qualityMenuViewInflateFingerprint
|
||||||
import app.revanced.patches.youtube.utils.recyclerview.recyclerViewTreeObserverPatch
|
|
||||||
import app.revanced.patches.youtube.utils.recyclerview.recyclerViewTreeObserverHook
|
import app.revanced.patches.youtube.utils.recyclerview.recyclerViewTreeObserverHook
|
||||||
|
import app.revanced.patches.youtube.utils.recyclerview.recyclerViewTreeObserverPatch
|
||||||
import app.revanced.patches.youtube.utils.resourceid.sharedResourceIdPatch
|
import app.revanced.patches.youtube.utils.resourceid.sharedResourceIdPatch
|
||||||
import app.revanced.patches.youtube.utils.settings.ResourceUtils.addPreference
|
import app.revanced.patches.youtube.utils.settings.ResourceUtils.addPreference
|
||||||
import app.revanced.patches.youtube.utils.settings.settingsPatch
|
import app.revanced.patches.youtube.utils.settings.settingsPatch
|
||||||
|
@ -123,7 +123,8 @@ fun ResourcePatchContext.copyAdaptiveIcon(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (adaptiveIconMonoChromeFileName != null &&
|
if (adaptiveIconMonoChromeFileName != null &&
|
||||||
adaptiveIconMonoChromeFileName != getAdaptiveIconMonoChromeResourceFile()) {
|
adaptiveIconMonoChromeFileName != getAdaptiveIconMonoChromeResourceFile()
|
||||||
|
) {
|
||||||
val drawableDirectory = get("res").resolve("drawable")
|
val drawableDirectory = get("res").resolve("drawable")
|
||||||
Files.copy(
|
Files.copy(
|
||||||
drawableDirectory
|
drawableDirectory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user