fix(YouTube/Hide suggested video overlay): click sound is continuously played when minimized after the video ends

This commit is contained in:
inotia00 2023-11-07 21:20:01 +09:00
parent ebcadd5c6f
commit 988e8e3ea7
2 changed files with 2 additions and 15 deletions

View File

@ -12,7 +12,6 @@ import app.revanced.patches.youtube.player.suggestedvideooverlay.fingerprints.Co
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.CoreContainer
import app.revanced.patches.youtube.utils.settings.SettingsPatch
import app.revanced.patches.youtube.utils.videoid.general.VideoIdPatch
import app.revanced.util.bytecode.getWideLiteralIndex
import app.revanced.util.integrations.Constants.PLAYER
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
@ -23,8 +22,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
description = "Hide the suggested video overlay to play next.",
dependencies = [
SettingsPatch::class,
SharedResourceIdPatch::class,
VideoIdPatch::class
SharedResourceIdPatch::class
],
compatiblePackages = [
CompatiblePackage(
@ -73,13 +71,6 @@ object SuggestedVideoOverlayPatch : BytecodePatch(
}
} ?: throw CoreConatinerBuilderFingerprint.exception
VideoIdPatch.videoEndMethod.apply {
addInstruction(
implementation!!.instructions.size - 1,
"invoke-static {},$PLAYER->hideSuggestedVideoOverlay()V"
)
}
/**
* Add settings
*/
@ -94,7 +85,4 @@ object SuggestedVideoOverlayPatch : BytecodePatch(
SettingsPatch.updatePatchStatus("Hide suggested video overlay")
}
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
"$PLAYER->hideSuggestedVideoOverlay(Landroid/view/ViewGroup;)V"
}

View File

@ -67,7 +67,7 @@ object VideoIdPatch : BytecodePatch(
)
it.mutableClass.methods.add(seekHelperMethod)
videoEndMethod = context.toMethodWalker(it.method)
val videoEndMethod = context.toMethodWalker(it.method)
.nextMethod(it.scanResult.patternScanResult!!.startIndex + 1, true)
.getMethod() as MutableMethod
@ -145,7 +145,6 @@ object VideoIdPatch : BytecodePatch(
private lateinit var insertMethod: MutableMethod
private lateinit var playerInitMethod: MutableMethod
private lateinit var timeMethod: MutableMethod
internal lateinit var videoEndMethod: MutableMethod
/**
* Adds an invoke-static instruction, called with the new id when the video changes