mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 21:27:43 +02:00
cleanup
This commit is contained in:
@ -3,7 +3,7 @@ package app.revanced.patches.youtube.misc.playeroverlay.fingerprint
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object PlayerOverlaysOnFinishInflateFingerprint : MethodFingerprint(
|
||||
null, null, null, null, null, { methodDef ->
|
||||
methodDef.definingClass.endsWith("YouTubePlayerOverlaysLayout;") && methodDef.name == "onFinishInflate"
|
||||
customFingerprint = {
|
||||
it.definingClass.endsWith("YouTubePlayerOverlaysLayout;") && it.name == "onFinishInflate"
|
||||
}
|
||||
)
|
||||
|
@ -10,6 +10,7 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patches.youtube.misc.playeroverlay.fingerprint.PlayerOverlaysOnFinishInflateFingerprint
|
||||
import app.revanced.shared.annotation.YouTubeCompatibility
|
||||
import app.revanced.shared.extensions.toErrorResult
|
||||
import app.revanced.shared.util.integrations.Constants.UTILS_PATH
|
||||
|
||||
@Name("player-overlays-hook")
|
||||
@ -23,11 +24,13 @@ class PlayerOverlaysHookPatch : BytecodePatch(
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
// hook YouTubePlayerOverlaysLayout.onFinishInflate()
|
||||
val method = PlayerOverlaysOnFinishInflateFingerprint.result!!.mutableMethod
|
||||
method.addInstruction(
|
||||
method.implementation!!.instructions.size - 2,
|
||||
"invoke-static { p0 }, $UTILS_PATH/PlayerOverlaysHookPatch;->YouTubePlayerOverlaysLayout_onFinishInflateHook(Ljava/lang/Object;)V"
|
||||
)
|
||||
PlayerOverlaysOnFinishInflateFingerprint.result?.mutableMethod?.let {
|
||||
it.addInstruction(
|
||||
it.implementation!!.instructions.size - 2,
|
||||
"invoke-static { p0 }, $UTILS_PATH/PlayerOverlaysHookPatch;->YouTubePlayerOverlaysLayout_onFinishInflateHook(Ljava/lang/Object;)V"
|
||||
)
|
||||
} ?: return PlayerOverlaysOnFinishInflateFingerprint.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user