mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-08 10:34:33 +02:00
chore: lint code
This commit is contained in:
parent
3f7803c5b8
commit
b593fa302f
@ -2,34 +2,34 @@ package app.revanced.patches.music.flyoutpanel.component
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.music.flyoutpanel.component.fingerprints.EndButtonsContainerFingerprint
|
||||
import app.revanced.patches.music.flyoutpanel.component.fingerprints.SleepTimerFingerprint
|
||||
import app.revanced.patches.music.flyoutpanel.utils.EnumUtils.getEnumIndex
|
||||
import app.revanced.patches.music.utils.fingerprints.MenuItemFingerprint
|
||||
import app.revanced.patches.music.utils.flyoutbutton.FlyoutButtonContainerPatch
|
||||
import app.revanced.patches.music.flyoutpanel.shared.FlyoutPanelMenuItemPatch
|
||||
import app.revanced.patches.music.utils.integrations.Constants.COMPONENTS_PATH
|
||||
import app.revanced.patches.music.utils.integrations.Constants.FLYOUT
|
||||
import app.revanced.patches.music.utils.litho.LithoFilterPatch
|
||||
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch
|
||||
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.EndButtonsContainer
|
||||
import app.revanced.patches.music.utils.settings.CategoryType
|
||||
import app.revanced.patches.music.utils.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.util.getTargetIndex
|
||||
import app.revanced.util.getWideLiteralInstructionIndex
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.Instruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Hide flyout panel",
|
||||
description = "Adds options to hide flyout panel components.",
|
||||
dependencies = [
|
||||
FlyoutButtonContainerPatch::class,
|
||||
FlyoutPanelMenuItemPatch::class,
|
||||
LithoFilterPatch::class,
|
||||
SettingsPatch::class
|
||||
SettingsPatch::class,
|
||||
SharedResourceIdPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
@ -52,37 +52,29 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
@Suppress("unused")
|
||||
object FlyoutPanelPatch : BytecodePatch(
|
||||
setOf(
|
||||
MenuItemFingerprint,
|
||||
EndButtonsContainerFingerprint,
|
||||
SleepTimerFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
MenuItemFingerprint.result?.let {
|
||||
FlyoutPanelMenuItemPatch.hideComponents()
|
||||
|
||||
EndButtonsContainerFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val freeIndex = implementation!!.instructions.indexOfFirst { instruction ->
|
||||
instruction.opcode == Opcode.OR_INT_LIT16
|
||||
}
|
||||
val freeRegister = getInstruction<TwoRegisterInstruction>(freeIndex).registerA
|
||||
val startIndex = getWideLiteralInstructionIndex(EndButtonsContainer)
|
||||
val targetIndex = getTargetIndex(startIndex, Opcode.MOVE_RESULT_OBJECT)
|
||||
val targetRegister = getInstruction<OneRegisterInstruction>(targetIndex).registerA
|
||||
|
||||
val enumIndex = getEnumIndex()
|
||||
val enumRegister = getInstruction<OneRegisterInstruction>(enumIndex).registerA
|
||||
|
||||
val jumpInstruction =
|
||||
getInstruction<Instruction>(implementation!!.instructions.size - 1)
|
||||
|
||||
addInstructionsWithLabels(
|
||||
enumIndex + 1, """
|
||||
invoke-static {v$enumRegister}, $FLYOUT->hideFlyoutPanels(Ljava/lang/Enum;)Z
|
||||
move-result v$freeRegister
|
||||
if-nez v$freeRegister, :hide
|
||||
""", ExternalLabel("hide", jumpInstruction)
|
||||
addInstruction(
|
||||
targetIndex + 1,
|
||||
"invoke-static {v$targetRegister}, $FLYOUT->hideLikeDislikeContainer(Landroid/view/View;)V"
|
||||
)
|
||||
}
|
||||
} ?: throw MenuItemFingerprint.exception
|
||||
} ?: throw EndButtonsContainerFingerprint.exception
|
||||
|
||||
/**
|
||||
* Forces sleep timer menu to be enabled.
|
||||
* This method may be deperated in the future.
|
||||
* This method may be desperate in the future.
|
||||
*/
|
||||
SleepTimerFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
@ -166,13 +158,11 @@ object FlyoutPanelPatch : BytecodePatch(
|
||||
"revanced_hide_flyout_panel_like_dislike",
|
||||
"false"
|
||||
)
|
||||
if (!SettingsPatch.upward0636) {
|
||||
SettingsPatch.addMusicPreferenceWithoutSummary(
|
||||
CategoryType.FLYOUT,
|
||||
"revanced_hide_flyout_panel_play_next",
|
||||
"false"
|
||||
)
|
||||
}
|
||||
SettingsPatch.addMusicPreferenceWithoutSummary(
|
||||
CategoryType.FLYOUT,
|
||||
"revanced_hide_flyout_panel_quality",
|
||||
@ -203,7 +193,6 @@ object FlyoutPanelPatch : BytecodePatch(
|
||||
"revanced_hide_flyout_panel_save_to_library",
|
||||
"false"
|
||||
)
|
||||
if (!SettingsPatch.upward0636) {
|
||||
SettingsPatch.addMusicPreferenceWithoutSummary(
|
||||
CategoryType.FLYOUT,
|
||||
"revanced_hide_flyout_panel_save_to_playlist",
|
||||
@ -214,7 +203,6 @@ object FlyoutPanelPatch : BytecodePatch(
|
||||
"revanced_hide_flyout_panel_share",
|
||||
"false"
|
||||
)
|
||||
}
|
||||
SettingsPatch.addMusicPreferenceWithoutSummary(
|
||||
CategoryType.FLYOUT,
|
||||
"revanced_hide_flyout_panel_shuffle_play",
|
||||
|
@ -0,0 +1,10 @@
|
||||
package app.revanced.patches.music.flyoutpanel.component.fingerprints
|
||||
|
||||
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.EndButtonsContainer
|
||||
import app.revanced.util.fingerprint.LiteralValueFingerprint
|
||||
|
||||
object EndButtonsContainerFingerprint : LiteralValueFingerprint(
|
||||
returnType = "V",
|
||||
literalSupplier = { EndButtonsContainer }
|
||||
)
|
||||
|
@ -1,24 +1,19 @@
|
||||
package app.revanced.patches.music.flyoutpanel.replace
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.music.flyoutpanel.utils.EnumUtils.getEnumIndex
|
||||
import app.revanced.patches.music.utils.fingerprints.MenuItemFingerprint
|
||||
import app.revanced.patches.music.utils.integrations.Constants.FLYOUT
|
||||
import app.revanced.patches.music.flyoutpanel.shared.FlyoutPanelMenuItemPatch
|
||||
import app.revanced.patches.music.utils.settings.CategoryType
|
||||
import app.revanced.patches.music.utils.settings.SettingsPatch
|
||||
import app.revanced.patches.music.video.information.VideoInformationPatch
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Replace dismiss queue",
|
||||
description = "Adds an option to replace \"Dismiss queue\" with \"Watch on YouTube\" in the flyout menu.",
|
||||
dependencies = [
|
||||
FlyoutPanelMenuItemPatch::class,
|
||||
SettingsPatch::class,
|
||||
VideoInformationPatch::class
|
||||
],
|
||||
@ -41,36 +36,15 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object ReplaceDismissQueuePatch : BytecodePatch(
|
||||
setOf(MenuItemFingerprint)
|
||||
) {
|
||||
object ReplaceDismissQueuePatch : BytecodePatch(emptySet()) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
MenuItemFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val enumIndex = getEnumIndex()
|
||||
val enumRegister = getInstruction<OneRegisterInstruction>(enumIndex).registerA
|
||||
|
||||
val textViewIndex = it.scanResult.patternScanResult!!.startIndex
|
||||
val imageViewIndex = it.scanResult.patternScanResult!!.endIndex
|
||||
|
||||
val textViewRegister =
|
||||
getInstruction<OneRegisterInstruction>(textViewIndex).registerA
|
||||
val imageViewRegister =
|
||||
getInstruction<OneRegisterInstruction>(imageViewIndex).registerA
|
||||
|
||||
addInstruction(
|
||||
enumIndex + 1,
|
||||
"invoke-static {v$enumRegister, v$textViewRegister, v$imageViewRegister}, $FLYOUT->replaceDismissQueue(Ljava/lang/Enum;Landroid/widget/TextView;Landroid/widget/ImageView;)V"
|
||||
)
|
||||
}
|
||||
} ?: throw MenuItemFingerprint.exception
|
||||
FlyoutPanelMenuItemPatch.replaceComponents()
|
||||
|
||||
SettingsPatch.addMusicPreference(
|
||||
CategoryType.FLYOUT,
|
||||
"revanced_replace_flyout_panel_dismiss_queue",
|
||||
"false"
|
||||
)
|
||||
|
||||
SettingsPatch.addMusicPreference(
|
||||
CategoryType.FLYOUT,
|
||||
"revanced_replace_flyout_panel_dismiss_queue_continue_watch",
|
||||
|
@ -0,0 +1,83 @@
|
||||
package app.revanced.patches.music.flyoutpanel.shared
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.music.flyoutpanel.shared.fingerprints.MenuItemFingerprint
|
||||
import app.revanced.patches.music.utils.integrations.Constants.FLYOUT
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.util.getTargetIndex
|
||||
import app.revanced.util.indexOfFirstInstruction
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
object FlyoutPanelMenuItemPatch : BytecodePatch(
|
||||
setOf(MenuItemFingerprint)
|
||||
) {
|
||||
private lateinit var menuItemMethod: MutableMethod
|
||||
private var freeRegister by Delegates.notNull<Int>()
|
||||
private var textViewRegister by Delegates.notNull<Int>()
|
||||
private var imageViewRegister by Delegates.notNull<Int>()
|
||||
private var instructionAdded = false
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
MenuItemFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val freeIndex = getTargetIndex(Opcode.OR_INT_LIT16)
|
||||
val textViewIndex = it.scanResult.patternScanResult!!.startIndex
|
||||
val imageViewIndex = it.scanResult.patternScanResult!!.endIndex
|
||||
|
||||
freeRegister =
|
||||
getInstruction<TwoRegisterInstruction>(freeIndex).registerA
|
||||
textViewRegister =
|
||||
getInstruction<OneRegisterInstruction>(textViewIndex).registerA
|
||||
imageViewRegister =
|
||||
getInstruction<OneRegisterInstruction>(imageViewIndex).registerA
|
||||
|
||||
menuItemMethod = this
|
||||
}
|
||||
} ?: throw MenuItemFingerprint.exception
|
||||
}
|
||||
|
||||
private fun MutableMethod.getEnumIndex() = indexOfFirstInstruction {
|
||||
opcode == Opcode.INVOKE_STATIC
|
||||
&& (this as? ReferenceInstruction)?.reference.toString().contains("(I)L")
|
||||
} + 1
|
||||
|
||||
internal fun hideComponents() {
|
||||
menuItemMethod.apply {
|
||||
val enumIndex = getEnumIndex()
|
||||
val enumRegister = getInstruction<OneRegisterInstruction>(enumIndex).registerA
|
||||
|
||||
addInstructionsWithLabels(
|
||||
enumIndex + 1, """
|
||||
invoke-static {v$enumRegister}, $FLYOUT->hideComponents(Ljava/lang/Enum;)Z
|
||||
move-result v$freeRegister
|
||||
if-nez v$freeRegister, :hide
|
||||
""", ExternalLabel("hide", getInstruction(implementation!!.instructions.size - 1))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
internal fun replaceComponents() {
|
||||
if (!instructionAdded) {
|
||||
menuItemMethod.apply {
|
||||
val enumIndex = getEnumIndex()
|
||||
val enumRegister = getInstruction<OneRegisterInstruction>(enumIndex).registerA
|
||||
|
||||
addInstruction(
|
||||
enumIndex + 1,
|
||||
"invoke-static {v$enumRegister, v$textViewRegister, v$imageViewRegister}, $FLYOUT->replaceComponents(Ljava/lang/Enum;Landroid/widget/TextView;Landroid/widget/ImageView;)V"
|
||||
)
|
||||
}
|
||||
instructionAdded = true
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package app.revanced.patches.music.utils.fingerprints
|
||||
package app.revanced.patches.music.flyoutpanel.shared.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
@ -1,28 +0,0 @@
|
||||
package app.revanced.patches.music.flyoutpanel.utils
|
||||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
|
||||
internal object EnumUtils {
|
||||
|
||||
fun MutableMethod.getEnumIndex(): Int {
|
||||
var targetIndex = 0
|
||||
for ((index, instruction) in implementation!!.instructions.withIndex()) {
|
||||
if (instruction.opcode != Opcode.INVOKE_STATIC) continue
|
||||
|
||||
val targetParameter = getInstruction<ReferenceInstruction>(index).reference
|
||||
|
||||
if (!targetParameter.toString().contains("(I)")) continue
|
||||
|
||||
targetIndex = index + 1
|
||||
break
|
||||
}
|
||||
if (targetIndex == 0)
|
||||
throw PatchException("Target reference not found!")
|
||||
|
||||
return targetIndex
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
package app.revanced.patches.music.utils.flyoutbutton
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.music.utils.flyoutbutton.fingerprints.FlyoutPanelLikeButtonFingerprint
|
||||
import app.revanced.patches.music.utils.integrations.Constants.FLYOUT
|
||||
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch
|
||||
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.MusicMenuLikeButtons
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.util.getWideLiteralInstructionIndex
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
dependencies = [
|
||||
SharedResourceIdPatch::class
|
||||
]
|
||||
)
|
||||
object FlyoutButtonContainerPatch : BytecodePatch(
|
||||
setOf(FlyoutPanelLikeButtonFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
|
||||
FlyoutPanelLikeButtonFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val targetIndex = getWideLiteralInstructionIndex(MusicMenuLikeButtons)
|
||||
|
||||
var insertIndex = -1
|
||||
|
||||
for (index in targetIndex until targetIndex + 5) {
|
||||
if (getInstruction(index).opcode != Opcode.MOVE_RESULT_OBJECT) continue
|
||||
|
||||
val register = getInstruction<OneRegisterInstruction>(index).registerA
|
||||
insertIndex = index
|
||||
|
||||
addInstruction(
|
||||
index + 1,
|
||||
"invoke-static {v$register}, $FLYOUT->setFlyoutButtonContainer(Landroid/view/View;)V"
|
||||
)
|
||||
break
|
||||
}
|
||||
if (insertIndex == -1)
|
||||
throw PatchException("Couldn't find target Index")
|
||||
}
|
||||
} ?: throw FlyoutPanelLikeButtonFingerprint.exception
|
||||
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
package app.revanced.patches.music.utils.flyoutbutton.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.MusicMenuLikeButtons
|
||||
import app.revanced.util.fingerprint.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
object FlyoutPanelLikeButtonFingerprint : LiteralValueFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.SYNTHETIC,
|
||||
parameters = listOf("L", "Ljava/lang/Object;"),
|
||||
literalSupplier = { MusicMenuLikeButtons }
|
||||
)
|
||||
|
@ -22,6 +22,7 @@ object SharedResourceIdPatch : ResourcePatch() {
|
||||
var ColorGrey: Long = -1
|
||||
var DesignBottomSheetDialog: Long = -1
|
||||
var DialogSolid: Long = -1
|
||||
var EndButtonsContainer: Long = -1
|
||||
var FloatingLayout: Long = -1
|
||||
var HistoryMenuItem: Long = -1
|
||||
var InlineTimeBarAdBreakMarkerColor: Long = -1
|
||||
@ -30,7 +31,6 @@ object SharedResourceIdPatch : ResourcePatch() {
|
||||
var MenuEntry: Long = -1
|
||||
var MiniPlayerMdxPlaying: Long = -1
|
||||
var MiniPlayerPlayPauseReplayButton: Long = -1
|
||||
var MusicMenuLikeButtons: Long = -1
|
||||
var MusicNotifierShelf: Long = -1
|
||||
var MusicTasteBuilderShelf: Long = -1
|
||||
var NamesInactiveAccountThumbnailSize: Long = -1
|
||||
@ -59,6 +59,7 @@ object SharedResourceIdPatch : ResourcePatch() {
|
||||
ColorGrey = find(COLOR, "ytm_color_grey_12")
|
||||
DesignBottomSheetDialog = find(LAYOUT, "design_bottom_sheet_dialog")
|
||||
DialogSolid = find(STYLE, "Theme.YouTubeMusic.Dialog.Solid")
|
||||
EndButtonsContainer = find(ID, "end_buttons_container")
|
||||
FloatingLayout = find(ID, "floating_layout")
|
||||
HistoryMenuItem = find(ID, "history_menu_item")
|
||||
InlineTimeBarAdBreakMarkerColor = find(COLOR, "inline_time_bar_ad_break_marker_color")
|
||||
@ -67,7 +68,6 @@ object SharedResourceIdPatch : ResourcePatch() {
|
||||
MenuEntry = find(LAYOUT, "menu_entry")
|
||||
MiniPlayerMdxPlaying = find(STRING, "mini_player_mdx_playing")
|
||||
MiniPlayerPlayPauseReplayButton = find(ID, "mini_player_play_pause_replay_button")
|
||||
MusicMenuLikeButtons = find(LAYOUT, "music_menu_like_buttons")
|
||||
MusicNotifierShelf = find(LAYOUT, "music_notifier_shelf")
|
||||
MusicTasteBuilderShelf = find(LAYOUT, "music_tastebuilder_shelf")
|
||||
NamesInactiveAccountThumbnailSize = find(DIMEN, "names_inactive_account_thumbnail_size")
|
||||
|
@ -91,19 +91,13 @@ fun Method.getWideLiteralInstructionIndex(literal: Long) = implementation?.let {
|
||||
}
|
||||
} ?: -1
|
||||
|
||||
fun Method.getEmptyStringInstructionIndex() = implementation?.let {
|
||||
it.instructions.indexOfFirst { instruction ->
|
||||
instruction.opcode == Opcode.CONST_STRING
|
||||
&& (instruction as? BuilderInstruction21c)?.reference.toString().isEmpty()
|
||||
}
|
||||
} ?: -1
|
||||
fun MutableMethod.getEmptyStringInstructionIndex()
|
||||
= getStringInstructionIndex("")
|
||||
|
||||
fun Method.getStringInstructionIndex(value: String) = implementation?.let {
|
||||
it.instructions.indexOfFirst { instruction ->
|
||||
instruction.opcode == Opcode.CONST_STRING
|
||||
&& (instruction as? BuilderInstruction21c)?.reference.toString() == value
|
||||
}
|
||||
} ?: -1
|
||||
fun MutableMethod.getStringInstructionIndex(value: String) = indexOfFirstInstruction {
|
||||
opcode == Opcode.CONST_STRING
|
||||
&& (this as? BuilderInstruction21c)?.reference.toString() == value
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the method contains a literal with the given value.
|
||||
|
Loading…
x
Reference in New Issue
Block a user