feat: Use an extension property to create new exception when failing to resolve a fingerprint

This commit adds the extension property to the public API
This commit is contained in:
oSumAtrIX
2023-08-25 00:05:30 +02:00
parent 31b5d506a5
commit a471605db7
91 changed files with 259 additions and 247 deletions
@@ -1,7 +1,7 @@
package app.revanced.patches.youtube.layout.buttons.autoplay.patch
import app.revanced.extensions.findIndexForIdResource
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -68,6 +68,6 @@ class HideAutoplayButtonPatch : BytecodePatch(
""",
ExternalLabel("hidden", jumpInstruction)
)
} ?: throw LayoutConstructorFingerprint.toErrorResult()
} ?: throw LayoutConstructorFingerprint.exception
}
}
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.buttons.navigation.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -101,7 +101,7 @@ class NavigationButtonsPatch : BytecodePatch(listOf(AddCreateButtonViewFingerpri
initializeButtonsResult.mutableClass
)
)
throw it.toErrorResult()
throw it.exception
}
.map { it.result!!.scanResult.patternScanResult!! }
@@ -150,7 +150,7 @@ class NavigationButtonsPatch : BytecodePatch(listOf(AddCreateButtonViewFingerpri
"""
)
}
} ?: throw AddCreateButtonViewFingerprint.toErrorResult()
} ?: throw AddCreateButtonViewFingerprint.exception
/*
* Resolve fingerprints
@@ -158,7 +158,7 @@ class NavigationButtonsPatch : BytecodePatch(listOf(AddCreateButtonViewFingerpri
InitializeButtonsFingerprint.result!!.let {
if (!PivotBarCreateButtonViewFingerprint.resolve(context, it.mutableMethod, it.mutableClass))
throw PivotBarCreateButtonViewFingerprint.toErrorResult()
throw PivotBarCreateButtonViewFingerprint.exception
}
PivotBarCreateButtonViewFingerprint.result!!.apply {
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.buttons.navigation.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
@@ -28,8 +28,8 @@ class ResolvePivotBarFingerprintsPatch : BytecodePatch(
context,
it.classDef
)
) throw InitializeButtonsFingerprint.toErrorResult()
} ?: throw PivotBarConstructorFingerprint.toErrorResult()
) throw InitializeButtonsFingerprint.exception
} ?: throw PivotBarConstructorFingerprint.exception
}
internal companion object {
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.buttons.player.hide.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -67,6 +67,6 @@ class HidePlayerButtonsPatch : BytecodePatch(
move-result v$hasPreviousParameterRegister
"""
)
} ?: throw PlayerControlsVisibilityModelFingerprint.toErrorResult()
} ?: throw PlayerControlsVisibilityModelFingerprint.exception
}
}
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.hide.albumcards.bytecode.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -41,6 +41,6 @@ class AlbumCardsPatch : BytecodePatch(
"hideAlbumCard(Landroid/view/View;)V"
)
}
} ?: throw AlbumCardsFingerprint.toErrorResult()
} ?: throw AlbumCardsFingerprint.exception
}
}
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.hide.breakingnews.bytecode.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -42,7 +42,7 @@ class BreakingNewsPatch : BytecodePatch(
)
}
} ?: throw BreakingNewsFingerprint.toErrorResult()
} ?: throw BreakingNewsFingerprint.exception
}
}
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.hide.crowdfundingbox.bytecode.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -33,7 +33,7 @@ class CrowdfundingBoxPatch : BytecodePatch(
addInstruction(insertIndex, "invoke-static {v$objectRegister}, $INTEGRATIONS_METHOD_DESCRIPTOR")
}
} ?: throw CrowdfundingBoxFingerprint.toErrorResult()
} ?: throw CrowdfundingBoxFingerprint.exception
}
private companion object {
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.hide.endscreencards.bytecode.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -32,7 +32,7 @@ class HideEndscreenCardsPatch : BytecodePatch(
) {
override fun execute(context: BytecodeContext) {
fun MethodFingerprint.injectHideCall() {
val layoutResult = result ?: throw toErrorResult()
val layoutResult = result ?: throw exception
layoutResult.mutableMethod.apply {
val insertIndex = layoutResult.scanResult.patternScanResult!!.endIndex + 1
val viewRegister = getInstruction<Instruction21c>(insertIndex - 1).registerA
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.hide.filterbar.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -76,6 +76,6 @@ class HideFilterBarPatch : BytecodePatch(
addInstructions(insertIndex, instructions(register))
}
} ?: throw toErrorResult()
} ?: throw exception
}
}
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.hide.floatingmicrophone.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -35,7 +35,7 @@ class HideFloatingMicrophoneButtonPatch : BytecodePatch(
"""
)
}
} ?: throw ShowFloatingMicrophoneButtonFingerprint.toErrorResult()
} ?: throw ShowFloatingMicrophoneButtonFingerprint.exception
}
private companion object {
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.hide.general.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -272,7 +272,7 @@ class HideLayoutComponentsPatch : BytecodePatch(
addInstruction(0, "move-object/from16 v$freeRegister, p3")
}
} ?: throw ConvertElementToFlatBufferFingerprint.toErrorResult()
} ?: throw ConvertElementToFlatBufferFingerprint.exception
// endregion
}
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.hide.loadmorebutton.bytecode.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -33,7 +33,7 @@ class HideLoadMoreButtonPatch : BytecodePatch(listOf(HideLoadMoreButtonFingerpri
"$INTEGRATIONS_CLASS_DESCRIPTOR->hideLoadMoreButton(Landroid/view/View;)V"
)
}
} ?: throw HideLoadMoreButtonFingerprint.toErrorResult()
} ?: throw HideLoadMoreButtonFingerprint.exception
}
private companion object {
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.hide.personalinformation.bytecode.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -41,6 +41,6 @@ class HideEmailAddressPatch : BytecodePatch(
"""
)
}
} ?: throw AccountSwitcherAccessibilityLabelFingerprint.toErrorResult()
} ?: throw AccountSwitcherAccessibilityLabelFingerprint.exception
}
}
@@ -1,7 +1,7 @@
package app.revanced.patches.youtube.layout.hide.player.overlay.bytecode.patch
import app.revanced.extensions.indexOfFirstConstantInstructionValue
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -35,7 +35,7 @@ class HidePlayerOverlayPatch : BytecodePatch(listOf(CreatePlayerOverviewFingerpr
"$INTEGRATIONS_CLASS_DESCRIPTOR->hidePlayerOverlay(Landroid/widget/ImageView;)V"
)
}
} ?: throw CreatePlayerOverviewFingerprint.toErrorResult()
} ?: throw CreatePlayerOverviewFingerprint.exception
}
private companion object {
@@ -2,7 +2,7 @@ package app.revanced.patches.youtube.layout.hide.shorts.bytecode.patch
import app.revanced.extensions.findIndexForIdResource
import app.revanced.extensions.injectHideViewCall
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -61,7 +61,7 @@ class HideShortsComponentsPatch : BytecodePatch(
"hideShortsShelf"
)
}
} ?: throw ReelConstructorFingerprint.toErrorResult()
} ?: throw ReelConstructorFingerprint.exception
// endregion
@@ -70,7 +70,7 @@ class HideShortsComponentsPatch : BytecodePatch(
// Some Shorts buttons are views, hide them by setting their visibility to GONE.
CreateShortsButtonsFingerprint.result?.let {
ShortsButtons.values().forEach { button -> button.injectHideCall(it.mutableMethod) }
} ?: throw CreateShortsButtonsFingerprint.toErrorResult()
} ?: throw CreateShortsButtonsFingerprint.exception
// endregion
@@ -79,7 +79,7 @@ class HideShortsComponentsPatch : BytecodePatch(
// Hook to get the pivotBar view.
SetPivotBarVisibilityParentFingerprint.result?.let {
if (!SetPivotBarVisibilityFingerprint.resolve(context, it.classDef))
throw SetPivotBarVisibilityFingerprint.toErrorResult()
throw SetPivotBarVisibilityFingerprint.exception
SetPivotBarVisibilityFingerprint.result!!.let { result ->
result.mutableMethod.apply {
@@ -92,17 +92,17 @@ class HideShortsComponentsPatch : BytecodePatch(
)
}
}
} ?: throw SetPivotBarVisibilityParentFingerprint.toErrorResult()
} ?: throw SetPivotBarVisibilityParentFingerprint.exception
// Hook to hide the navigation bar when Shorts are being played.
RenderBottomNavigationBarParentFingerprint.result?.let {
if (!RenderBottomNavigationBarFingerprint.resolve(context, it.classDef))
throw RenderBottomNavigationBarFingerprint.toErrorResult()
throw RenderBottomNavigationBarFingerprint.exception
RenderBottomNavigationBarFingerprint.result!!.mutableMethod.apply {
addInstruction(0, "invoke-static { }, $FILTER_CLASS_DESCRIPTOR->hideNavigationBar()V")
}
} ?: throw RenderBottomNavigationBarParentFingerprint.toErrorResult()
} ?: throw RenderBottomNavigationBarParentFingerprint.exception
// Required to prevent a black bar from appearing at the bottom of the screen.
BottomNavigationBarFingerprint.result?.let {
@@ -117,7 +117,7 @@ class HideShortsComponentsPatch : BytecodePatch(
"hideNavigationBar(Landroid/view/View;)Landroid/view/View;"
)
}
} ?: throw BottomNavigationBarFingerprint.toErrorResult()
} ?: throw BottomNavigationBarFingerprint.exception
// endregion
}
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.hide.time.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -47,6 +47,6 @@ class HideTimestampPatch : BytecodePatch(
nop
"""
)
} ?: throw TimeCounterFingerprint.toErrorResult()
} ?: throw TimeCounterFingerprint.exception
}
}
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.panels.popup.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -36,7 +36,7 @@ class PlayerPopupPanelsPatch : BytecodePatch(
)
val engagementPanelControllerMethod = EngagementPanelControllerFingerprint
.result?.mutableMethod ?: throw EngagementPanelControllerFingerprint.toErrorResult()
.result?.mutableMethod ?: throw EngagementPanelControllerFingerprint.exception
engagementPanelControllerMethod.addInstructionsWithLabels(
0,
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.returnyoutubedislike.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -89,7 +89,7 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
)
}.result?.also { result ->
if (!TextComponentAtomicReferenceFingerprint.resolve(context, result.method, result.classDef))
throw TextComponentAtomicReferenceFingerprint.toErrorResult()
throw TextComponentAtomicReferenceFingerprint.exception
}?.let { textComponentContextFingerprintResult ->
val conversionContextIndex = textComponentContextFingerprintResult
.scanResult.patternScanResult!!.startIndex
@@ -126,7 +126,7 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
"""
)
}
} ?: throw TextComponentContextFingerprint.toErrorResult()
} ?: throw TextComponentContextFingerprint.exception
// endregion
@@ -166,7 +166,7 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
"""
)
}
} ?: throw ShortsTextViewFingerprint.toErrorResult()
} ?: throw ShortsTextViewFingerprint.exception
// endregion
@@ -184,7 +184,7 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
"invoke-static {v$resourceIdentifierRegister, v$textViewRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->setOldUILayoutDislikes(ILandroid/widget/TextView;)V"
)
}
} ?: throw DislikesOldLayoutTextViewFingerprint.toErrorResult()
} ?: throw DislikesOldLayoutTextViewFingerprint.exception
// endregion
}
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.searchbar.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -38,7 +38,7 @@ class WideSearchbarPatch : BytecodePatch(
)
)
val result = CreateSearchSuggestionsFingerprint.result ?: throw CreateSearchSuggestionsFingerprint.toErrorResult()
val result = CreateSearchSuggestionsFingerprint.result ?: throw CreateSearchSuggestionsFingerprint.exception
// patch methods
mapOf(
@@ -60,7 +60,7 @@ class WideSearchbarPatch : BytecodePatch(
fun BytecodeContext.walkMutable(index: Int, fromFingerprint: MethodFingerprint) =
fromFingerprint.result?.let {
toMethodWalker(it.method).nextMethod(index, true).getMethod() as MutableMethod
} ?: throw fromFingerprint.toErrorResult()
} ?: throw fromFingerprint.exception
/**
@@ -1,7 +1,7 @@
package app.revanced.patches.youtube.layout.seekbar.bytecode.patch
import app.revanced.extensions.indexOfFirstConstantInstructionValue
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
@@ -42,11 +42,11 @@ class SeekbarColorBytecodePatch : BytecodePatch(
PlayerSeekbarColorFingerprint.result?.mutableMethod?.apply {
addColorChangeInstructions(SeekbarColorResourcePatch.inlineTimeBarColorizedBarPlayedColorDarkId)
addColorChangeInstructions(SeekbarColorResourcePatch.inlineTimeBarPlayedNotHighlightedColorId)
} ?: throw PlayerSeekbarColorFingerprint.toErrorResult()
} ?: throw PlayerSeekbarColorFingerprint.exception
ShortsSeekbarColorFingerprint.result?.mutableMethod?.apply {
addColorChangeInstructions(SeekbarColorResourcePatch.reelTimeBarPlayedColorId)
} ?: throw ShortsSeekbarColorFingerprint.toErrorResult()
} ?: throw ShortsSeekbarColorFingerprint.exception
SetSeekbarClickedColorFingerprint.result?.let { result ->
result.mutableMethod.let {
@@ -67,7 +67,7 @@ class SeekbarColorBytecodePatch : BytecodePatch(
)
}
}
} ?: throw SetSeekbarClickedColorFingerprint.toErrorResult()
} ?: throw SetSeekbarClickedColorFingerprint.exception
lithoColorOverrideHook(INTEGRATIONS_CLASS_DESCRIPTOR, "getLithoColor")
}
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -64,8 +64,8 @@ class SponsorBlockBytecodePatch : BytecodePatch(
override fun execute(context: BytecodeContext) {
LayoutConstructorFingerprint.result?.let {
if (!ControlsOverlayFingerprint.resolve(context, it.classDef))
throw ControlsOverlayFingerprint.toErrorResult()
} ?: throw LayoutConstructorFingerprint.toErrorResult()
throw ControlsOverlayFingerprint.exception
} ?: throw LayoutConstructorFingerprint.exception
/*
* Hook the video time methods
@@ -219,7 +219,7 @@ class SponsorBlockBytecodePatch : BytecodePatch(
"invoke-static {v$frameLayoutRegister}, $INTEGRATIONS_SPONSORBLOCK_VIEW_CONTROLLER_CLASS_DESCRIPTOR->initialize(Landroid/view/ViewGroup;)V"
)
}
} ?: throw ControlsOverlayFingerprint.toErrorResult()
} ?: throw ControlsOverlayFingerprint.exception
// get rectangle field name
RectangleFieldInvalidatorFingerprint.resolve(context, seekbarSignatureResult.classDef)
@@ -258,13 +258,13 @@ class SponsorBlockBytecodePatch : BytecodePatch(
// The vote and create segment buttons automatically change their visibility when appropriate,
// but if buttons are showing when the end of the video is reached then they will not automatically hide.
// Add a hook to forcefully hide when the end of the video is reached.
AutoRepeatParentFingerprint.result ?: throw AutoRepeatParentFingerprint.toErrorResult()
AutoRepeatParentFingerprint.result ?: throw AutoRepeatParentFingerprint.exception
AutoRepeatFingerprint.also {
it.resolve(context, AutoRepeatParentFingerprint.result!!.classDef)
}.result?.mutableMethod?.addInstruction(
0,
"invoke-static {}, $INTEGRATIONS_SPONSORBLOCK_VIEW_CONTROLLER_CLASS_DESCRIPTOR->endOfVideoReached()V"
) ?: throw AutoRepeatFingerprint.toErrorResult()
) ?: throw AutoRepeatFingerprint.exception
// TODO: isSBChannelWhitelisting implementation
}
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.spoofappversion.bytecode.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -77,7 +77,7 @@ class SpoofAppVersionPatch : BytecodePatch(
move-result-object v$buildOverrideNameRegister
"""
)
} ?: throw SpoofAppVersionFingerprint.toErrorResult()
} ?: throw SpoofAppVersionFingerprint.exception
}
private companion object {
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.tabletminiplayer.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -47,7 +47,7 @@ class TabletMiniPlayerPatch : BytecodePatch(
)
// First resolve the fingerprints via the parent fingerprint.
MiniPlayerDimensionsCalculatorParentFingerprint.result ?: throw MiniPlayerDimensionsCalculatorParentFingerprint.toErrorResult()
MiniPlayerDimensionsCalculatorParentFingerprint.result ?: throw MiniPlayerDimensionsCalculatorParentFingerprint.exception
val miniPlayerClass = MiniPlayerDimensionsCalculatorParentFingerprint.result!!.classDef
/*
@@ -89,7 +89,7 @@ class TabletMiniPlayerPatch : BytecodePatch(
}
return@let
} ?: throw MiniPlayerOverrideFingerprint.toErrorResult()
} ?: throw MiniPlayerOverrideFingerprint.exception
/*
* Size check return value override.
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.theme.bytecode.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -19,7 +19,7 @@ class LithoColorHookPatch : BytecodePatch(listOf(LithoThemeFingerprint)) {
insertionIndex = it.scanResult.patternScanResult!!.endIndex - 1
colorRegister = "p1"
insertionMethod = it.mutableMethod
} ?: throw LithoThemeFingerprint.toErrorResult()
} ?: throw LithoThemeFingerprint.exception
}
companion object {
private var insertionIndex : Int = -1
@@ -1,6 +1,6 @@
package app.revanced.patches.youtube.layout.thumbnails.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
@@ -73,23 +73,23 @@ class AlternativeThumbnailsPatch : BytecodePatch(
)
MessageDigestImageUrlParentFingerprint.result
?: throw MessageDigestImageUrlParentFingerprint.toErrorResult()
?: throw MessageDigestImageUrlParentFingerprint.exception
MessageDigestImageUrlFingerprint.resolve(context, MessageDigestImageUrlParentFingerprint.result!!.classDef)
MessageDigestImageUrlFingerprint.result?.apply {
loadImageUrlMethod = mutableMethod
} ?: throw MessageDigestImageUrlFingerprint.toErrorResult()
} ?: throw MessageDigestImageUrlFingerprint.exception
addImageUrlHook(INTEGRATIONS_CLASS_DESCRIPTOR, true)
CronetURLRequestCallbackOnResponseStartedFingerprint.result
?: throw CronetURLRequestCallbackOnResponseStartedFingerprint.toErrorResult()
?: throw CronetURLRequestCallbackOnResponseStartedFingerprint.exception
CronetURLRequestCallbackOnSucceededFingerprint.resolve(
context,
CronetURLRequestCallbackOnResponseStartedFingerprint.result!!.classDef
)
CronetURLRequestCallbackOnSucceededFingerprint.result?.apply {
loadImageSuccessCallbackMethod = mutableMethod
} ?: throw CronetURLRequestCallbackOnSucceededFingerprint.toErrorResult()
} ?: throw CronetURLRequestCallbackOnSucceededFingerprint.exception
addImageUrlSuccessCallbackHook(INTEGRATIONS_CLASS_DESCRIPTOR)
@@ -99,7 +99,7 @@ class AlternativeThumbnailsPatch : BytecodePatch(
)
CronetURLRequestCallbackOnFailureFingerprint.result?.apply {
loadImageErrorCallbackMethod = mutableMethod
} ?: throw CronetURLRequestCallbackOnFailureFingerprint.toErrorResult()
} ?: throw CronetURLRequestCallbackOnFailureFingerprint.exception
}
internal companion object {