chore: lint code

This commit is contained in:
inotia00
2023-12-03 15:07:30 +09:00
parent 5247cf9c81
commit 5101c5db4a
3 changed files with 8 additions and 9 deletions

View File

@ -21,7 +21,7 @@ import app.revanced.util.integrations.Constants.MUSIC_COMPONENTS_PATH
) )
@Suppress("unused") @Suppress("unused")
object MusicAdsPatch : AbstractAdsPatch( object MusicAdsPatch : AbstractAdsPatch(
"$MUSIC_ADS_PATH/HideMusicAdsPatch;->hideMusicAds()Z" "$MUSIC_ADS_PATH/MusicAdsPatch;->hideMusicAds()Z"
) { ) {
override fun execute(context: BytecodeContext) { override fun execute(context: BytecodeContext) {
super.execute(context) super.execute(context)

View File

@ -41,7 +41,7 @@ import app.revanced.util.integrations.Constants.ADS_PATH
) )
@Suppress("unused") @Suppress("unused")
object VideoAdsPatch : AbstractAdsPatch( object VideoAdsPatch : AbstractAdsPatch(
"$ADS_PATH/HideVideoAdsPatch;->hideVideoAds()Z" "$ADS_PATH/VideoAdsPatch;->hideVideoAds()Z"
) { ) {
override fun execute(context: BytecodeContext) { override fun execute(context: BytecodeContext) {
super.execute(context) super.execute(context)

View File

@ -17,14 +17,13 @@ object VideoIdWithoutShortsPatch : BytecodePatch(
override fun execute(context: BytecodeContext) { override fun execute(context: BytecodeContext) {
VideoIdWithoutShortsFingerprint.result?.let { VideoIdWithoutShortsFingerprint.result?.let {
insertMethod = it.mutableMethod it.mutableMethod.apply {
insertMethod = this
insertIndex = insertMethod.implementation!!.instructions.indexOfFirst { instruction -> insertIndex = implementation!!.instructions.indexOfFirst { instruction ->
instruction.opcode == Opcode.INVOKE_INTERFACE instruction.opcode == Opcode.INVOKE_INTERFACE
}
insertRegister = getInstruction<OneRegisterInstruction>(insertIndex + 1).registerA
} }
insertRegister =
insertMethod.getInstruction<OneRegisterInstruction>(insertIndex + 1).registerA
} ?: throw VideoIdWithoutShortsFingerprint.exception } ?: throw VideoIdWithoutShortsFingerprint.exception
injectCall("$VIDEO_PATH/VideoInformation;->setVideoId(Ljava/lang/String;)V") injectCall("$VIDEO_PATH/VideoInformation;->setVideoId(Ljava/lang/String;)V")