Compare commits

..

12 Commits

Author SHA1 Message Date
semantic-release-bot
59647d7cb2 chore(release): 2.165.0-dev.4 [skip ci]
# [2.165.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.3...v2.165.0-dev.4) (2023-02-24)

### Features

* **youtube/disable-player-popup-panels:** use better patch description ([aaaca32](aaaca326e7))
2023-02-24 23:04:24 +00:00
oSumAtrIX
aaaca326e7 feat(youtube/disable-player-popup-panels): use better patch description
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-25 00:02:13 +01:00
semantic-release-bot
f3ab06beea chore(release): 2.165.0-dev.3 [skip ci]
# [2.165.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.2...v2.165.0-dev.3) (2023-02-24)

### Bug Fixes

* **instagram/hide-timeline-ads:** fix compatibility with newer versions ([#1672](https://github.com/revanced/revanced-patches/issues/1672)) ([bc43d9c](bc43d9c76f))
2023-02-24 22:52:17 +00:00
falafelp
bc43d9c76f fix(instagram/hide-timeline-ads): fix compatibility with newer versions (#1672)
Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
2023-02-24 23:50:34 +01:00
semantic-release-bot
3bb9e3c504 chore(release): 2.165.0-dev.2 [skip ci]
# [2.165.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.1...v2.165.0-dev.2) (2023-02-24)

### Bug Fixes

* **youtube/general-ads:** remove duplicate preference ([5ff2565](5ff256509a))
2023-02-24 12:49:37 +00:00
oSumAtrIX
5ff256509a fix(youtube/general-ads): remove duplicate preference 2023-02-24 13:47:12 +01:00
semantic-release-bot
dd16fbf0b2 chore(release): 2.165.0-dev.1 [skip ci]
# [2.165.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.164.0...v2.165.0-dev.1) (2023-02-24)

### Features

* **youtube/general-ads:** hide image shelf from search results ([e584da9](e584da9cbf))
2023-02-24 03:15:53 +00:00
oSumAtrIX
e584da9cbf feat(youtube/general-ads): hide image shelf from search results
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-24 04:14:09 +01:00
semantic-release-bot
40a2b078a4 chore(release): 2.164.0 [skip ci]
# [2.164.0](https://github.com/revanced/revanced-patches/compare/v2.163.0...v2.164.0) (2023-02-24)

### Features

* **photomath:** `unlock-plus` patch ([#1633](https://github.com/revanced/revanced-patches/issues/1633)) ([8158388](81583886b6))
* **youtube/general-ads:** hide quick actions in fullscreen ([1148648](1148648465))
* **youtube/general-ads:** hide related videos in quick action ([2a80ab1](2a80ab17cb))
* **youtube/return-youtube-dislike:** support for shorts ([#1596](https://github.com/revanced/revanced-patches/issues/1596)) ([c36a12b](c36a12bd42))
* **youtube:** remove patch `open-links-directly` ([725ff39](725ff39997))
2023-02-24 02:49:26 +00:00
oSumAtrIX
6e6e386ac8 chore: merge branch dev to main (#1659) 2023-02-24 03:47:29 +01:00
semantic-release-bot
249fac1a32 chore(release): 2.164.0-dev.3 [skip ci]
# [2.164.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.164.0-dev.2...v2.164.0-dev.3) (2023-02-24)

### Features

* **youtube/return-youtube-dislike:** support for shorts ([#1596](https://github.com/revanced/revanced-patches/issues/1596)) ([c36a12b](c36a12bd42))
2023-02-24 02:00:55 +00:00
LisoUseInAIKyrios
c36a12bd42 feat(youtube/return-youtube-dislike): support for shorts (#1596)
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-24 02:59:07 +01:00
13 changed files with 207 additions and 62 deletions

View File

@@ -1,3 +1,49 @@
# [2.165.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.3...v2.165.0-dev.4) (2023-02-24)
### Features
* **youtube/disable-player-popup-panels:** use better patch description ([eda4ed3](https://github.com/revanced/revanced-patches/commit/eda4ed3a3e83b5a0e97740547494708f4e6536c2))
# [2.165.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.2...v2.165.0-dev.3) (2023-02-24)
### Bug Fixes
* **instagram/hide-timeline-ads:** fix compatibility with newer versions ([#1672](https://github.com/revanced/revanced-patches/issues/1672)) ([9a295a9](https://github.com/revanced/revanced-patches/commit/9a295a9aa1ca40e2afde22ea199805e8fbe93832))
# [2.165.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.1...v2.165.0-dev.2) (2023-02-24)
### Bug Fixes
* **youtube/general-ads:** remove duplicate preference ([cd7a728](https://github.com/revanced/revanced-patches/commit/cd7a728f52cd29c76a24b37c07c0e4d4c5485b07))
# [2.165.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.164.0...v2.165.0-dev.1) (2023-02-24)
### Features
* **youtube/general-ads:** hide image shelf from search results ([e29230f](https://github.com/revanced/revanced-patches/commit/e29230f44930a9928c3f97222fe05b5493ef1710))
# [2.164.0](https://github.com/revanced/revanced-patches/compare/v2.163.0...v2.164.0) (2023-02-24)
### Features
* **photomath:** `unlock-plus` patch ([#1633](https://github.com/revanced/revanced-patches/issues/1633)) ([a673514](https://github.com/revanced/revanced-patches/commit/a673514f848e583513924a6a9b8cfbb56153cc3a))
* **youtube/general-ads:** hide quick actions in fullscreen ([fff9670](https://github.com/revanced/revanced-patches/commit/fff9670a81108b8343d0b7913953fc6c2bb4a6f0))
* **youtube/general-ads:** hide related videos in quick action ([d23c31a](https://github.com/revanced/revanced-patches/commit/d23c31a9ec39189e08474044ac5ca06d974add76))
* **youtube/return-youtube-dislike:** support for shorts ([#1596](https://github.com/revanced/revanced-patches/issues/1596)) ([967c1cb](https://github.com/revanced/revanced-patches/commit/967c1cbd4b340a382a355f13d236d2881bafddbf))
* **youtube:** remove patch `open-links-directly` ([79291a0](https://github.com/revanced/revanced-patches/commit/79291a0d34bd9514cbef5d97c21c59dfbffad287))
# [2.164.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.164.0-dev.2...v2.164.0-dev.3) (2023-02-24)
### Features
* **youtube/return-youtube-dislike:** support for shorts ([#1596](https://github.com/revanced/revanced-patches/issues/1596)) ([967c1cb](https://github.com/revanced/revanced-patches/commit/967c1cbd4b340a382a355f13d236d2881bafddbf))
# [2.164.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.164.0-dev.1...v2.164.0-dev.2) (2023-02-23)

View File

@@ -19,7 +19,7 @@ The official Patch bundle provided by ReVanced and the community.
| `debugging` | Adds debugging options. | all |
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 18.03.36 |
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 18.03.36 |
| `disable-fullscreen-panels-auto-popup` | Disables fullscreen panels from appearing automatically when going fullscreen (playlist or live chat). | 18.03.36 |
| `disable-player-popup-panels` | Disables panels from appearing automatically when going into fullscreen (playlist or live chat). | 18.03.36 |
| `disable-shorts-on-startup` | Disables playing YouTube Shorts when launching YouTube. | 18.03.36 |
| `disable-zoom-haptics` | Disables haptics when zooming. | all |
| `downloads` | Enables downloading music and videos from YouTube. | 18.03.36 |

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.164.0-dev.2
version = 2.165.0-dev.4

File diff suppressed because one or more lines are too long

View File

@@ -21,6 +21,5 @@ object ShowAdFingerprint : MethodFingerprint(
Opcode.CONST_4,
Opcode.GOTO,
Opcode.CONST_4,
Opcode.RETURN,
),
)

View File

@@ -214,12 +214,12 @@ class GeneralAdsResourcePatch : ResourcePatch {
StringResource("revanced_hide_related_videos_summary_off", "Related videos are shown")
),
SwitchPreference(
"revanced_hide_channel_bar",
StringResource("revanced_hide_channel_bar_title", "Hide channel bar"),
false,
StringResource("revanced_hide_channel_bar_summary_on", "Channel bar is hidden"),
StringResource("revanced_hide_channel_bar_summary_off", "Channel bar is shown")
),
"revanced_hide_image_shelf",
StringResource("revanced_hide_image_shelf", "Hide image shelf in search results"),
true,
StringResource("revanced_hide_image_shelf_summary_on", "Image shelf is hidden"),
StringResource("revanced_hide_image_shelf_summary_off", "Image shelf is shown")
)
)
PreferenceScreen.ADS.addPreferences(

View File

@@ -1,4 +1,4 @@
package app.revanced.patches.youtube.layout.panels.fullscreen.popup.annotations
package app.revanced.patches.youtube.layout.panels.popup.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package

View File

@@ -1,4 +1,4 @@
package app.revanced.patches.youtube.layout.panels.fullscreen.popup.fingerprints
package app.revanced.patches.youtube.layout.panels.popup.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod

View File

@@ -1,4 +1,4 @@
package app.revanced.patches.youtube.layout.panels.fullscreen.popup.patch
package app.revanced.patches.youtube.layout.panels.popup.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
@@ -13,18 +13,18 @@ import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.layout.panels.fullscreen.popup.annotations.PlayerPopupPanelsCompatibility
import app.revanced.patches.youtube.layout.panels.fullscreen.popup.fingerprints.EngagementPanelControllerFingerprint
import app.revanced.patches.youtube.layout.panels.popup.annotations.PlayerPopupPanelsCompatibility
import app.revanced.patches.youtube.layout.panels.popup.fingerprints.EngagementPanelControllerFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
@Patch
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
@Name("disable-fullscreen-panels-auto-popup")
@Description("Disables fullscreen panels from appearing automatically when going fullscreen (playlist or live chat).")
@Name("disable-player-popup-panels")
@Description("Disables panels from appearing automatically when going into fullscreen (playlist or live chat).")
@PlayerPopupPanelsCompatibility
@Version("0.0.1")
class FullscreenPanelsPatch : BytecodePatch(
class PlayerPopupPanelsPatch : BytecodePatch(
listOf(
EngagementPanelControllerFingerprint
)

View File

@@ -0,0 +1,25 @@
package app.revanced.patches.youtube.layout.returnyoutubedislike.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 ShortsTextComponentParentFingerprint : MethodFingerprint(
returnType = "V",
access = AccessFlags.PROTECTED or AccessFlags.FINAL,
parameters = listOf("L", "L"),
opcodes = listOf(
Opcode.IF_EQZ,
Opcode.CONST_4,
Opcode.IF_EQ,
Opcode.CONST_4,
Opcode.IF_EQ,
Opcode.RETURN_VOID,
Opcode.IGET_OBJECT,
Opcode.CHECK_CAST,
Opcode.IGET_BOOLEAN,
Opcode.IF_EQZ,
Opcode.INVOKE_STATIC
)
)

View File

@@ -5,8 +5,10 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.data.toMethodWalker
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.instruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
@@ -15,12 +17,15 @@ import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.ReturnYouTubeDislikeCompatibility
import app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints.*
import app.revanced.patches.youtube.layout.returnyoutubedislike.resource.patch.ReturnYouTubeDislikeResourcePatch
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Patch
@DependsOn(
@@ -38,55 +43,103 @@ import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch
class ReturnYouTubeDislikePatch : BytecodePatch(
listOf(
TextComponentSpecParentFingerprint,
ShortsTextComponentParentFingerprint,
LikeFingerprint,
DislikeFingerprint,
RemoveLikeFingerprint,
)
) {
override fun execute(context: BytecodeContext): PatchResult {
// region Inject newVideoLoaded event handler
VideoIdPatch.injectCall("$INTEGRATIONS_PATCH_CLASS_DESCRIPTOR->newVideoLoaded(Ljava/lang/String;)V")
// endregion
// region Hook interaction
listOf(
LikeFingerprint.toPatch(Vote.LIKE),
DislikeFingerprint.toPatch(Vote.DISLIKE),
RemoveLikeFingerprint.toPatch(Vote.REMOVE_LIKE)
).forEach { (fingerprint, vote) ->
with(fingerprint.result ?: return PatchResultError("Failed to find ${fingerprint.name} method.")) {
mutableMethod.addInstructions(
fingerprint.result?.mutableMethod?.apply {
addInstructions(
0,
"""
const/4 v0, ${vote.value}
invoke-static {v0}, Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;->sendVote(I)V
invoke-static {v0}, $INTEGRATIONS_PATCH_CLASS_DESCRIPTOR->sendVote(I)V
"""
)
}
} ?: return PatchResultError("Failed to find ${fingerprint.name} method.")
}
VideoIdPatch.injectCall("Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;->newVideoLoaded(Ljava/lang/String;)V")
// endregion
with(TextComponentFingerprint
.apply { resolve(context, TextComponentSpecParentFingerprint.result!!.classDef) }
.result ?: return TextComponentFingerprint.toErrorResult()
) {
val createComponentMethod = mutableMethod
// region Hook components
val conversionContextParam = 5
val textRefParam = createComponentMethod.parameters.size - 2
// insert index must be 0, otherwise UI does not updated correctly in some situations
// such as switching from full screen or when using previous/next overlay buttons.
val insertIndex = 0
TextComponentFingerprint.also { it.resolve(context, TextComponentSpecParentFingerprint.result!!.classDef) }
.result?.let {
with(it.mutableMethod) {
val createComponentMethod = this
val conversionContextParam = 5
val textRefParam = createComponentMethod.parameters.size - 2
// Insert index must be 0, otherwise UI does not updated correctly in some situations
// such as switching from full screen or when using previous/next overlay buttons.
val insertIndex = 0
createComponentMethod.addInstructions(
insertIndex,
"""
move-object/from16 v7, p$conversionContextParam
move-object/from16 v8, p$textRefParam
invoke-static {v7, v8}, $INTEGRATIONS_PATCH_CLASS_DESCRIPTOR->onComponentCreated(Ljava/lang/Object;Ljava/util/concurrent/atomic/AtomicReference;)V
"""
)
}
} ?: return TextComponentFingerprint.toErrorResult()
ShortsTextComponentParentFingerprint.result?.let {
context
.toMethodWalker(it.method)
.nextMethod(it.scanResult.patternScanResult!!.endIndex, true)
.getMethod().let { method ->
with(method as MutableMethod) {
// After walking, verify the found method is what's expected.
if (returnType != ("Ljava/lang/CharSequence;") || parameterTypes.size != 1)
return PatchResultError("Method signature did not match: $this $parameterTypes")
val insertIndex = implementation!!.instructions.size - 1
val spannedParameterRegister = (instruction(insertIndex) as OneRegisterInstruction).registerA
val parameter = (instruction(insertIndex - 2) as BuilderInstruction35c).reference
if (!parameter.toString().endsWith("Landroid/text/Spanned;"))
return PatchResultError("Method signature parameter did not match: $parameter")
addInstructions(
insertIndex,
"""
invoke-static {v$spannedParameterRegister}, $INTEGRATIONS_PATCH_CLASS_DESCRIPTOR->onShortsComponentCreated(Landroid/text/Spanned;)Landroid/text/Spanned;
move-result-object v$spannedParameterRegister
"""
)
}
}
} ?: return ShortsTextComponentParentFingerprint.toErrorResult()
// endregion
createComponentMethod.addInstructions(
insertIndex,
"""
move-object/from16 v7, p$conversionContextParam
move-object/from16 v8, p$textRefParam
invoke-static {v7, v8}, Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;->onComponentCreated(Ljava/lang/Object;Ljava/util/concurrent/atomic/AtomicReference;)V
"""
)
}
return PatchResultSuccess()
}
private fun MethodFingerprint.toPatch(voteKind: Vote) = VotePatch(this, voteKind)
private companion object {
const val INTEGRATIONS_PATCH_CLASS_DESCRIPTOR =
"Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;"
private fun MethodFingerprint.toPatch(voteKind: Vote) = VotePatch(this, voteKind)
}
private data class VotePatch(val fingerprint: MethodFingerprint, val voteKind: Vote)

View File

@@ -1,16 +1,31 @@
package app.revanced.patches.youtube.misc.video.videoid.fingerprint
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@FuzzyPatternScanMethod(2)
object VideoIdFingerprint : MethodFingerprint(
"V",
AccessFlags.DECLARED_SYNCHRONIZED or AccessFlags.FINAL or AccessFlags.PUBLIC,
listOf("L"),
listOf(Opcode.INVOKE_INTERFACE),
customFingerprint = {
it.definingClass.endsWith("PlaybackLifecycleMonitor;")
}
returnType = "V",
access = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("L"),
opcodes = listOf(
Opcode.IF_EQZ,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT_OBJECT,
Opcode.IF_EQZ,
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT_OBJECT
),
null,
{ it.definingClass.endsWith("SubtitlesOverlayPresenter;") }
)

View File

@@ -1,5 +1,6 @@
package app.revanced.patches.youtube.misc.video.videoid.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
@@ -22,17 +23,18 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Version("0.0.1")
@DependsOn([IntegrationsPatch::class])
class VideoIdPatch : BytecodePatch(
listOf(
VideoIdFingerprint
)
listOf(VideoIdFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
with(VideoIdFingerprint.result!!) {
insertMethod = mutableMethod
insertIndex = scanResult.patternScanResult!!.endIndex + 2
VideoIdFingerprint.result?.let {
val videoIdRegisterInstructionIndex = it.scanResult.patternScanResult!!.endIndex
videoIdRegister = (insertMethod.instruction(insertIndex - 1) as OneRegisterInstruction).registerA
}
with(it.mutableMethod) {
insertMethod = this
videoIdRegister = (instruction(videoIdRegisterInstructionIndex) as OneRegisterInstruction).registerA
insertIndex = videoIdRegisterInstructionIndex + 1
}
} ?: return VideoIdFingerprint.toErrorResult()
return PatchResultSuccess()
}
@@ -49,10 +51,15 @@ class VideoIdPatch : BytecodePatch(
*/
fun injectCall(
methodDescriptor: String
) = insertMethod.addInstructions(
insertIndex, // move-result-object offset
"invoke-static {v$videoIdRegister}, $methodDescriptor"
)
) {
insertMethod.addInstructions(
// TODO: The order has been proven to not be required, so remove the logic for keeping order.
// Keep injection calls in the order they're added:
// Increment index. So if additional injection calls are added, those calls run after this injection call.
insertIndex++,
"invoke-static {v$videoIdRegister}, $methodDescriptor"
)
}
}
}