mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-08 02:13:55 +01:00
Compare commits
6 Commits
v5.41.1-de
...
v5.42.0-de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
725d5dc974 | ||
|
|
76b0364c5b | ||
|
|
1cbff799ad | ||
|
|
080a226614 | ||
|
|
2b71bd80c2 | ||
|
|
5cb46c4e91 |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,3 +1,24 @@
|
||||
# [5.42.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.42.0-dev.2...v5.42.0-dev.3) (2025-09-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Hide end screen cards:** Hide new type of end screen card ([#6027](https://github.com/ReVanced/revanced-patches/issues/6027)) ([76b0364](https://github.com/ReVanced/revanced-patches/commit/76b0364c5b5562c6a0d178d2bbe5b220f48aaca9))
|
||||
|
||||
# [5.42.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.42.0-dev.1...v5.42.0-dev.2) (2025-09-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Instagram - Hide navigation buttons:** Resolve app startup crash ([080a226](https://github.com/ReVanced/revanced-patches/commit/080a2266146798be71789c939deef2f289697523))
|
||||
|
||||
# [5.42.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.41.1-dev.2...v5.42.0-dev.1) (2025-09-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Viber:** Add `Hide navigation buttons` patch ([#5991](https://github.com/ReVanced/revanced-patches/issues/5991)) ([5cb46c4](https://github.com/ReVanced/revanced-patches/commit/5cb46c4e9180ebc16eddb983dad73d137d8ec047))
|
||||
|
||||
## [5.41.1-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.41.1-dev.1...v5.41.1-dev.2) (2025-09-27)
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package app.revanced.extension.youtube.patches;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import app.revanced.extension.shared.Utils;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class HideEndScreenCardsPatch {
|
||||
|
||||
/**
|
||||
* Injection point.
|
||||
*/
|
||||
public static void hideEndScreenCardView(View view) {
|
||||
Utils.hideViewUnderCondition(Settings.HIDE_ENDSCREEN_CARDS, view);
|
||||
}
|
||||
|
||||
/**
|
||||
* Injection point.
|
||||
*/
|
||||
public static boolean hideEndScreenCards() {
|
||||
return Settings.HIDE_ENDSCREEN_CARDS.get();
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package app.revanced.extension.youtube.patches;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class HideEndscreenCardsPatch {
|
||||
//Used by app.revanced.patches.youtube.layout.hideendscreencards.bytecode.patch.HideEndscreenCardsPatch
|
||||
public static void hideEndscreen(View view) {
|
||||
if (!Settings.HIDE_ENDSCREEN_CARDS.get()) return;
|
||||
view.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
@@ -3,4 +3,4 @@ org.gradle.jvmargs = -Xms512M -Xmx2048M
|
||||
org.gradle.parallel = true
|
||||
android.useAndroidX = true
|
||||
kotlin.code.style = official
|
||||
version = 5.41.1-dev.2
|
||||
version = 5.42.0-dev.3
|
||||
|
||||
@@ -1306,6 +1306,10 @@ public final class app/revanced/patches/viber/ads/HideAdsPatchKt {
|
||||
public static final fun getHideAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/viber/misc/navbar/HideNavigationButtonsKt {
|
||||
public static final fun getHideNavigationButtonsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/vsco/misc/pro/UnlockProPatchKt {
|
||||
public static final fun getUnlockProPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -1407,8 +1411,8 @@ public final class app/revanced/patches/youtube/layout/formfactor/ChangeFormFact
|
||||
public static final fun getChangeFormFactorPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatchKt {
|
||||
public static final fun getHideEndscreenCardsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
public final class app/revanced/patches/youtube/layout/hide/endscreencards/HideEndScreenCardsPatchKt {
|
||||
public static final fun getHideEndScreenCardsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/youtube/layout/hide/endscreensuggestion/HideEndScreenSuggestedVideoPatchKt {
|
||||
|
||||
@@ -3,6 +3,7 @@ package app.revanced.patches.instagram.hide.navigation
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.booleanOption
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patches.instagram.misc.extension.sharedExtensionPatch
|
||||
import app.revanced.util.addInstructionsAtControlFlowLabel
|
||||
import app.revanced.util.findFreeRegister
|
||||
import app.revanced.util.getReference
|
||||
@@ -24,6 +25,8 @@ val hideNavigationButtonsPatch = bytecodePatch(
|
||||
) {
|
||||
compatibleWith("com.instagram.android")
|
||||
|
||||
dependsOn(sharedExtensionPatch)
|
||||
|
||||
val hideReels by booleanOption(
|
||||
key = "hideReels",
|
||||
default = true,
|
||||
@@ -69,20 +72,22 @@ val hideNavigationButtonsPatch = bytecodePatch(
|
||||
const-string v$freeRegister2, "$enumNameField"
|
||||
invoke-static { v$buttonsListRegister, v$freeRegister, v$freeRegister2 }, $EXTENSION_CLASS_DESCRIPTOR->removeNavigationButtonByName(Ljava/util/List;Ljava/lang/String;Ljava/lang/String;)Ljava/util/List;
|
||||
move-result-object v$buttonsListRegister
|
||||
"""
|
||||
"""
|
||||
}
|
||||
|
||||
if (hideReels!!)
|
||||
if (hideReels!!) {
|
||||
addInstructionsAtControlFlowLabel(
|
||||
returnIndex,
|
||||
instructionsRemoveButtonByName("fragment_clips")
|
||||
)
|
||||
}
|
||||
|
||||
if (hideCreate!!)
|
||||
if (hideCreate!!) {
|
||||
addInstructionsAtControlFlowLabel(
|
||||
returnIndex,
|
||||
instructionsRemoveButtonByName("fragment_share")
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package app.revanced.patches.viber.misc.navbar
|
||||
import app.revanced.patcher.fingerprint
|
||||
import app.revanced.patcher.patch.BytecodePatchContext
|
||||
|
||||
internal val tabIdClassFingerprint = fingerprint {
|
||||
strings("shouldShowTabId")
|
||||
}
|
||||
|
||||
context(BytecodePatchContext)
|
||||
internal val shouldShowTabIdMethodFingerprint get() = fingerprint {
|
||||
parameters("I", "I")
|
||||
returns("Z")
|
||||
custom { methodDef, classDef ->
|
||||
classDef == tabIdClassFingerprint.classDef
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package app.revanced.patches.viber.misc.navbar
|
||||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.patch.booleanOption
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import java.util.logging.Logger
|
||||
import kotlin.collections.joinToString
|
||||
|
||||
|
||||
private const val instructionsFooter = """
|
||||
# If we reach this, it means that this tab has been disabled by user
|
||||
const/4 v0, 0
|
||||
return v0 # return false as "This tab is not enabled"
|
||||
|
||||
# Proceed with default execution
|
||||
:continue
|
||||
nop
|
||||
"""
|
||||
|
||||
@Suppress("unused")
|
||||
val hideNavigationButtonsPatch = bytecodePatch(
|
||||
name = "Hide navigation buttons",
|
||||
description = "Permanently hides navigation bar buttons, such as Explore and Marketplace.",
|
||||
use = false
|
||||
) {
|
||||
compatibleWith("com.viber.voip")
|
||||
|
||||
val hideOptions = AllowedNavigationItems.entries.associateWith {
|
||||
booleanOption(
|
||||
key = it.key,
|
||||
default = it.defaultHideOption,
|
||||
title = it.title,
|
||||
description = it.description,
|
||||
)
|
||||
}
|
||||
|
||||
execute {
|
||||
// Items that won't be forcefully hidden.
|
||||
val allowedItems = hideOptions.filter { (option, enabled) -> enabled.value != true }
|
||||
|
||||
if (allowedItems.size == AllowedNavigationItems.entries.size) {
|
||||
return@execute Logger.getLogger(this::class.java.name).warning(
|
||||
"No hide navigation buttons options are enabled. No changes made."
|
||||
)
|
||||
}
|
||||
|
||||
val injectionInstructions = allowedItems
|
||||
.map { it.key.buildAllowInstruction() }
|
||||
.joinToString("\n") + instructionsFooter
|
||||
|
||||
shouldShowTabIdMethodFingerprint
|
||||
.method
|
||||
.addInstructionsWithLabels(0, injectionInstructions)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigation items taken from source code.
|
||||
* They appear in code like new NavigationItem(0, R.string.bottom_tab_chats, R.drawable.ic_tab_chats).
|
||||
*/
|
||||
private enum class AllowedNavigationItems(
|
||||
val defaultHideOption: Boolean,
|
||||
private val itemName: String,
|
||||
private vararg val ids: Int
|
||||
) {
|
||||
CHATS(false, "Chats", 0),
|
||||
CALLS(false, "Calls", 1, 7),
|
||||
EXPLORE(true, "Explore", 2),
|
||||
MORE(false, "More", 3),
|
||||
PAY(true, "Pay", 5),
|
||||
CAMERA(true, "Camera", 6),
|
||||
MARKETPLACE(true, "Marketplace", 8);
|
||||
|
||||
val key = "hide$itemName"
|
||||
val title = "Hide $itemName"
|
||||
val description = "Permanently hides the $itemName button."
|
||||
|
||||
fun buildAllowInstruction(): String =
|
||||
ids.joinToString("\n") { id ->
|
||||
"""
|
||||
const/4 v0, $id # If tabId == $id ($itemName), don't hide it
|
||||
if-eq p1, v0, :continue
|
||||
"""
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,13 @@
|
||||
package app.revanced.patches.youtube.layout.hide.endscreencards
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
import app.revanced.util.containsLiteralInstruction
|
||||
import app.revanced.util.getReference
|
||||
import app.revanced.util.indexOfFirstInstruction
|
||||
import app.revanced.util.literal
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
||||
|
||||
internal val layoutCircleFingerprint = fingerprint {
|
||||
returns("Landroid/view/View;")
|
||||
@@ -38,3 +43,19 @@ internal val layoutVideoFingerprint = fingerprint {
|
||||
)
|
||||
literal { layoutVideo }
|
||||
}
|
||||
|
||||
internal val showEndscreenCardsFingerprint = fingerprint {
|
||||
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
|
||||
returns("V")
|
||||
parameters("L")
|
||||
custom { method, classDef ->
|
||||
classDef.methods.count() == 5
|
||||
&& method.containsLiteralInstruction(0)
|
||||
&& method.containsLiteralInstruction(5)
|
||||
&& method.containsLiteralInstruction(8)
|
||||
&& method.indexOfFirstInstruction {
|
||||
val reference = getReference<FieldReference>()
|
||||
reference?.type == "Lcom/google/android/libraries/youtube/innertube/model/player/PlayerResponseModel;"
|
||||
} >= 0
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.revanced.patches.youtube.layout.hide.endscreencards
|
||||
|
||||
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.resourcePatch
|
||||
@@ -11,6 +12,8 @@ import app.revanced.patches.shared.misc.mapping.resourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.mapping.resourceMappings
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
|
||||
import app.revanced.patches.youtube.misc.playservice.is_19_43_or_greater
|
||||
import app.revanced.patches.youtube.misc.playservice.versionCheckPatch
|
||||
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
|
||||
import app.revanced.patches.youtube.misc.settings.settingsPatch
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
@@ -22,7 +25,7 @@ internal var layoutIcon = -1L
|
||||
internal var layoutVideo = -1L
|
||||
private set
|
||||
|
||||
private val hideEndscreenCardsResourcePatch = resourcePatch {
|
||||
private val hideEndScreenCardsResourcePatch = resourcePatch {
|
||||
dependsOn(
|
||||
settingsPatch,
|
||||
resourceMappingPatch,
|
||||
@@ -30,7 +33,7 @@ private val hideEndscreenCardsResourcePatch = resourcePatch {
|
||||
)
|
||||
|
||||
execute {
|
||||
addResources("youtube", "layout.hide.endscreencards.hideEndscreenCardsResourcePatch")
|
||||
addResources("youtube", "layout.hide.endscreencards.hideEndScreenCardsResourcePatch")
|
||||
|
||||
PreferenceScreen.PLAYER.addPreferences(
|
||||
SwitchPreference("revanced_hide_endscreen_cards"),
|
||||
@@ -45,16 +48,17 @@ private val hideEndscreenCardsResourcePatch = resourcePatch {
|
||||
}
|
||||
|
||||
private const val EXTENSION_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/extension/youtube/patches/HideEndscreenCardsPatch;"
|
||||
"Lapp/revanced/extension/youtube/patches/HideEndScreenCardsPatch;"
|
||||
|
||||
@Suppress("unused")
|
||||
val hideEndscreenCardsPatch = bytecodePatch(
|
||||
val hideEndScreenCardsPatch = bytecodePatch(
|
||||
name = "Hide end screen cards",
|
||||
description = "Adds an option to hide suggested video cards at the end of videos.",
|
||||
) {
|
||||
dependsOn(
|
||||
sharedExtensionPatch,
|
||||
hideEndscreenCardsResourcePatch,
|
||||
hideEndScreenCardsResourcePatch,
|
||||
versionCheckPatch
|
||||
)
|
||||
|
||||
compatibleWith(
|
||||
@@ -78,9 +82,24 @@ val hideEndscreenCardsPatch = bytecodePatch(
|
||||
|
||||
addInstruction(
|
||||
insertIndex,
|
||||
"invoke-static { v$viewRegister }, $EXTENSION_CLASS_DESCRIPTOR->hideEndscreen(Landroid/view/View;)V",
|
||||
"invoke-static { v$viewRegister }, " +
|
||||
"$EXTENSION_CLASS_DESCRIPTOR->hideEndScreenCardView(Landroid/view/View;)V",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (is_19_43_or_greater) {
|
||||
showEndscreenCardsFingerprint.method.addInstructionsWithLabels(
|
||||
0,
|
||||
"""
|
||||
invoke-static {}, $EXTENSION_CLASS_DESCRIPTOR->hideEndScreenCards()Z
|
||||
move-result v0
|
||||
if-eqz v0, :show
|
||||
return-void
|
||||
:show
|
||||
nop
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -859,7 +859,7 @@ To show the Audio track menu, change \'Spoof video streams\' to iPadOS"</string>
|
||||
<string name="revanced_hide_player_previous_next_buttons_summary_on">Previous & Next buttons are hidden</string>
|
||||
<string name="revanced_hide_player_previous_next_buttons_summary_off">Previous & Next buttons are shown</string>
|
||||
</patch>
|
||||
<patch id="layout.hide.endscreencards.hideEndscreenCardsResourcePatch">
|
||||
<patch id="layout.hide.endscreencards.hideEndScreenCardsResourcePatch">
|
||||
<string name="revanced_hide_endscreen_cards_title">Hide end screen cards</string>
|
||||
<string name="revanced_hide_endscreen_cards_summary_on">End screen cards are hidden</string>
|
||||
<string name="revanced_hide_endscreen_cards_summary_off">End screen cards are shown</string>
|
||||
|
||||
Reference in New Issue
Block a user