mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-06 17:44:36 +02:00
remove dead code
This commit is contained in:
parent
ee9e69e328
commit
3c16f3eb55
@ -1,18 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.layout.flyoutpanel.oldqualitylayout.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
object VideoQualitySettingsFingerprint : MethodFingerprint(
|
|
||||||
returnType = "V",
|
|
||||||
access = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
|
||||||
parameters = listOf("[L", "I", "Z"),
|
|
||||||
opcodes = listOf(
|
|
||||||
Opcode.IF_EQZ,
|
|
||||||
Opcode.IF_EQ,
|
|
||||||
Opcode.IF_EQ
|
|
||||||
),
|
|
||||||
strings = listOf("menu_item_video_quality")
|
|
||||||
)
|
|
@ -6,7 +6,6 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
|
||||||
import app.revanced.patcher.extensions.instruction
|
import app.revanced.patcher.extensions.instruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
@ -14,7 +13,7 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
|||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.shared.annotation.YouTubeCompatibility
|
import app.revanced.patches.shared.annotation.YouTubeCompatibility
|
||||||
import app.revanced.patches.youtube.layout.flyoutpanel.oldqualitylayout.fingerprints.*
|
import app.revanced.patches.youtube.layout.flyoutpanel.oldqualitylayout.fingerprints.QualityMenuViewInflateFingerprint
|
||||||
import app.revanced.patches.youtube.misc.resourceid.patch.SharedResourceIdPatch
|
import app.revanced.patches.youtube.misc.resourceid.patch.SharedResourceIdPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.videoid.legacy.patch.LegacyVideoIdPatch
|
import app.revanced.patches.youtube.misc.videoid.legacy.patch.LegacyVideoIdPatch
|
||||||
@ -35,8 +34,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
|||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class OldQualityLayoutPatch : BytecodePatch(
|
class OldQualityLayoutPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
QualityMenuViewInflateFingerprint,
|
QualityMenuViewInflateFingerprint
|
||||||
VideoQualitySettingsFingerprint
|
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
@ -52,19 +50,6 @@ class OldQualityLayoutPatch : BytecodePatch(
|
|||||||
}
|
}
|
||||||
} ?: return QualityMenuViewInflateFingerprint.toErrorResult()
|
} ?: return QualityMenuViewInflateFingerprint.toErrorResult()
|
||||||
|
|
||||||
VideoQualitySettingsFingerprint.result?.let {
|
|
||||||
with (it.mutableMethod) {
|
|
||||||
val insertIndex = it.scanResult.patternScanResult!!.startIndex + LegacyVideoIdPatch.qualityOffSet
|
|
||||||
val register = (this.implementation!!.instructions[insertIndex] as OneRegisterInstruction).registerA
|
|
||||||
addInstructions(
|
|
||||||
insertIndex, """
|
|
||||||
invoke-static { v$register }, $FLYOUT_PANEL->enableOldQualityLayout(I)I
|
|
||||||
move-result v$register
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} ?: return VideoQualitySettingsFingerprint.toErrorResult()
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add settings
|
* Add settings
|
||||||
*/
|
*/
|
||||||
|
@ -41,8 +41,6 @@ class LegacyVideoIdPatch : BytecodePatch(
|
|||||||
companion object {
|
companion object {
|
||||||
private var offset = 2
|
private var offset = 2
|
||||||
|
|
||||||
internal var qualityOffSet: Int = 0
|
|
||||||
|
|
||||||
private var insertIndex: Int = 0
|
private var insertIndex: Int = 0
|
||||||
private var videoIdRegister: Int = 0
|
private var videoIdRegister: Int = 0
|
||||||
private lateinit var insertMethod: MutableMethod
|
private lateinit var insertMethod: MutableMethod
|
||||||
|
@ -6,7 +6,6 @@ import app.revanced.patcher.annotation.Version
|
|||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
@ -52,7 +51,6 @@ class VideoQualityBytecodePatch : BytecodePatch(
|
|||||||
relayFieldReference = (it.implementation!!.instructions.elementAt(0) as ReferenceInstruction).reference as FieldReference
|
relayFieldReference = (it.implementation!!.instructions.elementAt(0) as ReferenceInstruction).reference as FieldReference
|
||||||
} ?: return VideoQualitySettingsFingerprint.toErrorResult()
|
} ?: return VideoQualitySettingsFingerprint.toErrorResult()
|
||||||
|
|
||||||
parentResult.mutableMethod.removeInstruction(parentResult.scanResult.patternScanResult!!.endIndex)
|
|
||||||
parentResult.mutableMethod.addInstructions(
|
parentResult.mutableMethod.addInstructions(
|
||||||
0, """
|
0, """
|
||||||
iget-object v0, p0, ${parentResult.classDef.type}->${relayFieldReference.name}:${relayFieldReference.type}
|
iget-object v0, p0, ${parentResult.classDef.type}->${relayFieldReference.name}:${relayFieldReference.type}
|
||||||
@ -62,8 +60,6 @@ class VideoQualityBytecodePatch : BytecodePatch(
|
|||||||
move-result p2
|
move-result p2
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
LegacyVideoIdPatch.qualityOffSet = 4
|
|
||||||
} ?: return VideoQualitySettingsParentFingerprint.toErrorResult()
|
} ?: return VideoQualitySettingsParentFingerprint.toErrorResult()
|
||||||
|
|
||||||
LegacyVideoIdPatch.injectCall("$INTEGRATIONS_VIDEO_QUALITY_CLASS_DESCRIPTOR->newVideoStarted(Ljava/lang/String;)V")
|
LegacyVideoIdPatch.injectCall("$INTEGRATIONS_VIDEO_QUALITY_CLASS_DESCRIPTOR->newVideoStarted(Ljava/lang/String;)V")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user