Compare commits

...

13 Commits

Author SHA1 Message Date
semantic-release-bot
5228fd4b58 chore: Release v5.47.0-dev.11 [skip ci]
# [5.47.0-dev.11](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.10...v5.47.0-dev.11) (2025-12-08)

### Features

* **Disney+:** Add `Skip ads` patch ([#6343](https://github.com/ReVanced/revanced-patches/issues/6343)) ([6bd7dca](6bd7dca75b))
2025-12-08 13:51:15 +00:00
g9q
6bd7dca75b feat(Disney+): Add Skip ads patch (#6343)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2025-12-08 14:45:41 +01:00
semantic-release-bot
22ed7bfbb3 chore: Release v5.47.0-dev.10 [skip ci]
# [5.47.0-dev.10](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.9...v5.47.0-dev.10) (2025-12-08)

### Features

* **YouTube - Hide Shorts components:** Add "Hide auto-dubbed label" and "Hide live preview" options ([#6334](https://github.com/ReVanced/revanced-patches/issues/6334)) ([a7c220a](a7c220a4ae))
2025-12-08 12:57:23 +00:00
ILoveOpenSourceApplications
a7c220a4ae feat(YouTube - Hide Shorts components): Add "Hide auto-dubbed label" and "Hide live preview" options (#6334) 2025-12-08 13:51:57 +01:00
semantic-release-bot
d8ca4ee931 chore: Release v5.47.0-dev.9 [skip ci]
# [5.47.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.8...v5.47.0-dev.9) (2025-12-08)

### Features

* **YouTube - Hide layout components:** Add "Hide cell divider", "Hide featured links", and "Hide featured videos" options ([#6335](https://github.com/ReVanced/revanced-patches/issues/6335)) ([a5d197b](a5d197b977))
2025-12-08 12:06:03 +00:00
ILoveOpenSourceApplications
a5d197b977 feat(YouTube - Hide layout components): Add "Hide cell divider", "Hide featured links", and "Hide featured videos" options (#6335)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2025-12-08 13:02:22 +01:00
semantic-release-bot
a0ec4c07f7 chore: Release v5.47.0-dev.8 [skip ci]
# [5.47.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.7...v5.47.0-dev.8) (2025-12-08)

### Features

* **Instagram:** Add `Disable Reels scrolling` patch ([#6317](https://github.com/ReVanced/revanced-patches/issues/6317)) ([0928dcd](0928dcd00d))
* **ProtonVPN:** Add `Remove delay` patch ([#6326](https://github.com/ReVanced/revanced-patches/issues/6326)) ([bbd8932](bbd8932b2e))
2025-12-08 11:36:43 +00:00
Alexey Gorbachev
0928dcd00d feat(Instagram): Add Disable Reels scrolling patch (#6317)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2025-12-08 12:31:54 +01:00
Sylvain Finot
bbd8932b2e feat(ProtonVPN): Add Remove delay patch (#6326)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2025-12-08 12:30:47 +01:00
semantic-release-bot
300b12f948 chore: Release v5.47.0-dev.7 [skip ci]
# [5.47.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.6...v5.47.0-dev.7) (2025-12-03)

### Features

* **Spoof SIM provider:** Spoof additional TelephonyManager methods ([#6293](https://github.com/ReVanced/revanced-patches/issues/6293)) ([ac583d4](ac583d40d0))
2025-12-03 15:05:05 +00:00
rospino74
ac583d40d0 feat(Spoof SIM provider): Spoof additional TelephonyManager methods (#6293) 2025-12-03 16:01:08 +01:00
semantic-release-bot
c400188c38 chore: Release v5.47.0-dev.6 [skip ci]
# [5.47.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.5...v5.47.0-dev.6) (2025-11-24)

### Features

* **Letterboxd:** Add `Hide ads` patch ([#6309](https://github.com/ReVanced/revanced-patches/issues/6309)) ([0af0ee9](0af0ee92c4))
2025-11-24 12:01:20 +00:00
Swakshan
0af0ee92c4 feat(Letterboxd): Add Hide ads patch (#6309)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2025-11-24 12:56:55 +01:00
21 changed files with 504 additions and 125 deletions

View File

@@ -1,3 +1,46 @@
# [5.47.0-dev.11](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.10...v5.47.0-dev.11) (2025-12-08)
### Features
* **Disney+:** Add `Skip ads` patch ([#6343](https://github.com/ReVanced/revanced-patches/issues/6343)) ([6bd7dca](https://github.com/ReVanced/revanced-patches/commit/6bd7dca75bd2ea335a596aa93a8b767d39be5f83))
# [5.47.0-dev.10](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.9...v5.47.0-dev.10) (2025-12-08)
### Features
* **YouTube - Hide Shorts components:** Add "Hide auto-dubbed label" and "Hide live preview" options ([#6334](https://github.com/ReVanced/revanced-patches/issues/6334)) ([a7c220a](https://github.com/ReVanced/revanced-patches/commit/a7c220a4aea93ea7ae7005b5760443d7571c4228))
# [5.47.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.8...v5.47.0-dev.9) (2025-12-08)
### Features
* **YouTube - Hide layout components:** Add "Hide cell divider", "Hide featured links", and "Hide featured videos" options ([#6335](https://github.com/ReVanced/revanced-patches/issues/6335)) ([a5d197b](https://github.com/ReVanced/revanced-patches/commit/a5d197b9775b98d7a37bfdee9e5f726d5e04d8cf))
# [5.47.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.7...v5.47.0-dev.8) (2025-12-08)
### Features
* **Instagram:** Add `Disable Reels scrolling` patch ([#6317](https://github.com/ReVanced/revanced-patches/issues/6317)) ([0928dcd](https://github.com/ReVanced/revanced-patches/commit/0928dcd00dc2a9c1eef9a23c1e26ff5dc9ee670a))
* **ProtonVPN:** Add `Remove delay` patch ([#6326](https://github.com/ReVanced/revanced-patches/issues/6326)) ([bbd8932](https://github.com/ReVanced/revanced-patches/commit/bbd8932b2e740aff96ba047332e541bff3e09436))
# [5.47.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.6...v5.47.0-dev.7) (2025-12-03)
### Features
* **Spoof SIM provider:** Spoof additional TelephonyManager methods ([#6293](https://github.com/ReVanced/revanced-patches/issues/6293)) ([ac583d4](https://github.com/ReVanced/revanced-patches/commit/ac583d40d0f4c0e6544e3661ff3e82a25912f2b0))
# [5.47.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.5...v5.47.0-dev.6) (2025-11-24)
### Features
* **Letterboxd:** Add `Hide ads` patch ([#6309](https://github.com/ReVanced/revanced-patches/issues/6309)) ([0af0ee9](https://github.com/ReVanced/revanced-patches/commit/0af0ee92c48bb2ffc332197e05439e20c5c05d83))
# [5.47.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.4...v5.47.0-dev.5) (2025-11-13)

View File

@@ -58,6 +58,23 @@ public abstract class Setting<T> {
};
}
/**
* Availability based on a single parent setting being disabled.
*/
public static Availability parentNot(BooleanSetting parent) {
return new Availability() {
@Override
public boolean isAvailable() {
return !parent.get();
}
@Override
public List<Setting<?>> getParentSettings() {
return Collections.singletonList(parent);
}
};
}
/**
* Availability based on all parents being enabled.
*/

View File

@@ -44,10 +44,14 @@ final class DescriptionComponentsFilter extends Filter {
"video_attributes_section"
);
final StringFilterGroup featuredSection = new StringFilterGroup(
Settings.HIDE_FEATURED_SECTION,
// "media_lockup", "structured_description_video_lockup"
"compact_infocard"
final StringFilterGroup featuredLinksSection = new StringFilterGroup(
Settings.HIDE_FEATURED_LINKS_SECTION,
"media_lockup"
);
final StringFilterGroup featuredVideosSection = new StringFilterGroup(
Settings.HIDE_FEATURED_VIDEOS_SECTION,
"structured_description_video_lockup"
);
final StringFilterGroup podcastSection = new StringFilterGroup(
@@ -76,7 +80,7 @@ final class DescriptionComponentsFilter extends Filter {
);
subscribeButton = new StringFilterGroup(
Settings.HIDE_DESCRIPTION_SUBSCRIBE_BUTTON,
Settings.HIDE_SUBSCRIBE_BUTTON,
"subscribe_button"
);
@@ -110,7 +114,8 @@ final class DescriptionComponentsFilter extends Filter {
aiGeneratedVideoSummarySection,
askSection,
attributesSection,
featuredSection,
featuredLinksSection,
featuredVideosSection,
horizontalShelf,
howThisWasMadeSection,
hypePoints,

View File

@@ -63,12 +63,18 @@ public final class LayoutComponentsFilter extends Filter {
// Identifiers.
final var cellDivider = new StringFilterGroup(
Settings.HIDE_CELL_DIVIDER,
"cell_divider"
);
final var chipsShelf = new StringFilterGroup(
Settings.HIDE_CHIPS_SHELF,
"chips_shelf"
);
addIdentifierCallbacks(
cellDivider,
chipsShelf
);

View File

@@ -44,9 +44,10 @@ public final class ShortsFilter extends Filter {
private final StringFilterGroup useTemplateButton;
private final ByteArrayFilterGroup useTemplateButtonBuffer;
private final StringFilterGroup autoDubbedLabel;
private final StringFilterGroup subscribeButton;
private final StringFilterGroup joinButton;
private final StringFilterGroup paidPromotionButton;
private final StringFilterGroup paidPromotionLabel;
private final StringFilterGroup shelfHeader;
private final StringFilterGroup suggestedAction;
@@ -161,6 +162,18 @@ public final class ShortsFilter extends Filter {
"participation_bar.e"
);
StringFilterGroup livePreview = new StringFilterGroup(
Settings.HIDE_SHORTS_LIVE_PREVIEW,
// Live Shorts preview that can popup while scrolling through Shorts player.
// Can be removed if a way to disable live Shorts is found.
"live_preview_page_vm.e"
);
autoDubbedLabel = new StringFilterGroup(
Settings.HIDE_SHORTS_AUTO_DUBBED_LABEL,
"badge."
);
joinButton = new StringFilterGroup(
Settings.HIDE_SHORTS_JOIN_BUTTON,
"sponsor_button"
@@ -171,9 +184,10 @@ public final class ShortsFilter extends Filter {
"subscribe_button"
);
paidPromotionButton = new StringFilterGroup(
paidPromotionLabel = new StringFilterGroup(
Settings.HIDE_PAID_PROMOTION_LABEL,
"reel_player_disclosure.e"
"reel_player_disclosure.e",
"shorts_disclosures.e"
);
shortsActionBar = new StringFilterGroup(
@@ -219,10 +233,10 @@ public final class ShortsFilter extends Filter {
);
addPathCallbacks(
shortsCompactFeedVideo, joinButton, subscribeButton, paidPromotionButton,
shortsCompactFeedVideo, joinButton, subscribeButton, paidPromotionLabel, autoDubbedLabel,
shortsActionBar, suggestedAction, pausedOverlayButtons, channelBar, previewComment,
fullVideoLinkLabel, videoTitle, useSoundButton, reelSoundMetadata, soundButton, infoPanel,
stickers, likeFountain, likeButton, dislikeButton
stickers, likeFountain, likeButton, dislikeButton, livePreview
);
//
@@ -250,6 +264,12 @@ public final class ShortsFilter extends Filter {
// Suggested actions.
//
suggestedActionsBuffer.addAll(
new ByteArrayFilterGroup(
Settings.HIDE_SHORTS_PREVIEW_COMMENT,
// Preview comment that can popup while a Short is playing.
// Uses no bundled icons, and instead the users profile photo is shown.
"shorts-comments-panel"
),
new ByteArrayFilterGroup(
Settings.HIDE_SHORTS_SHOP_BUTTON,
"yt_outline_bag_"
@@ -322,7 +342,8 @@ public final class ShortsFilter extends Filter {
boolean isFiltered(String identifier, String path, byte[] buffer,
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
if (contentType == FilterContentType.PATH) {
if (matchedGroup == subscribeButton || matchedGroup == joinButton || matchedGroup == paidPromotionButton) {
if (matchedGroup == subscribeButton || matchedGroup == joinButton
|| matchedGroup == paidPromotionLabel || matchedGroup == autoDubbedLabel) {
// Selectively filter to avoid false positive filtering of other subscribe/join buttons.
return path.startsWith(REEL_CHANNEL_BAR_PATH) || path.startsWith(REEL_METAPANEL_PATH);
}

View File

@@ -3,6 +3,7 @@ package app.revanced.extension.youtube.settings;
import static java.lang.Boolean.FALSE;
import static java.lang.Boolean.TRUE;
import static app.revanced.extension.shared.settings.Setting.parent;
import static app.revanced.extension.shared.settings.Setting.parentNot;
import static app.revanced.extension.shared.settings.Setting.parentsAll;
import static app.revanced.extension.shared.settings.Setting.parentsAny;
import static app.revanced.extension.youtube.patches.ChangeFormFactorPatch.FormFactor;
@@ -92,6 +93,7 @@ public class Settings extends BaseSettings {
// Feed
public static final BooleanSetting HIDE_ALBUM_CARDS = new BooleanSetting("revanced_hide_album_cards", FALSE, true);
public static final BooleanSetting HIDE_ARTIST_CARDS = new BooleanSetting("revanced_hide_artist_cards", FALSE);
public static final BooleanSetting HIDE_CELL_DIVIDER = new BooleanSetting("revanced_hide_cell_divider", TRUE);
public static final BooleanSetting HIDE_CHIPS_SHELF = new BooleanSetting("revanced_hide_chips_shelf", TRUE);
public static final BooleanSetting HIDE_COMMUNITY_POSTS = new BooleanSetting("revanced_hide_community_posts", FALSE);
public static final BooleanSetting HIDE_COMPACT_BANNER = new BooleanSetting("revanced_hide_compact_banner", TRUE);
@@ -210,13 +212,14 @@ public class Settings extends BaseSettings {
public static final BooleanSetting HIDE_ASK_SECTION = new BooleanSetting("revanced_hide_ask_section", FALSE);
public static final BooleanSetting HIDE_ATTRIBUTES_SECTION = new BooleanSetting("revanced_hide_attributes_section", FALSE);
public static final BooleanSetting HIDE_CHAPTERS_SECTION = new BooleanSetting("revanced_hide_chapters_section", TRUE);
public static final BooleanSetting HIDE_FEATURED_SECTION = new BooleanSetting("revanced_hide_featured_section", TRUE);
public static final BooleanSetting HIDE_HOW_THIS_WAS_MADE_SECTION = new BooleanSetting("revanced_hide_how_this_was_made_section", FALSE);
public static final BooleanSetting HIDE_HYPE_POINTS = new BooleanSetting("revanced_hide_hype_points", FALSE);
public static final BooleanSetting HIDE_INFO_CARDS_SECTION = new BooleanSetting("revanced_hide_info_cards_section", TRUE);
public static final BooleanSetting HIDE_FEATURED_LINKS_SECTION = new BooleanSetting("revanced_hide_featured_links_section", FALSE, parentNot(HIDE_INFO_CARDS_SECTION));
public static final BooleanSetting HIDE_FEATURED_VIDEOS_SECTION = new BooleanSetting("revanced_hide_featured_videos_section", FALSE, parentNot(HIDE_INFO_CARDS_SECTION));
public static final BooleanSetting HIDE_SUBSCRIBE_BUTTON = new BooleanSetting("revanced_hide_subscribe_button", FALSE, parentNot(HIDE_INFO_CARDS_SECTION));
public static final BooleanSetting HIDE_KEY_CONCEPTS_SECTION = new BooleanSetting("revanced_hide_key_concepts_section", FALSE);
public static final BooleanSetting HIDE_PODCAST_SECTION = new BooleanSetting("revanced_hide_podcast_section", TRUE);
public static final BooleanSetting HIDE_DESCRIPTION_SUBSCRIBE_BUTTON = new BooleanSetting("revanced_hide_description_subscribe_button", TRUE);
public static final BooleanSetting HIDE_TRANSCRIPT_SECTION = new BooleanSetting("revanced_hide_transcript_section", TRUE);
// Action buttons
@@ -292,6 +295,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting DISABLE_RESUMING_SHORTS_PLAYER = new BooleanSetting("revanced_disable_resuming_shorts_player", FALSE);
public static final BooleanSetting DISABLE_SHORTS_BACKGROUND_PLAYBACK = new BooleanSetting("revanced_shorts_disable_background_playback", FALSE);
public static final EnumSetting<ShortsPlayerType> SHORTS_PLAYER_TYPE = new EnumSetting<>("revanced_shorts_player_type", ShortsPlayerType.SHORTS_PLAYER);
public static final BooleanSetting HIDE_SHORTS_AUTO_DUBBED_LABEL = new BooleanSetting("revanced_hide_shorts_auto_dubbed_label", FALSE);
public static final BooleanSetting HIDE_SHORTS_CHANNEL_BAR = new BooleanSetting("revanced_hide_shorts_channel_bar", FALSE);
public static final BooleanSetting HIDE_SHORTS_COMMENTS_BUTTON = new BooleanSetting("revanced_hide_shorts_comments_button", FALSE);
public static final BooleanSetting HIDE_SHORTS_DISLIKE_BUTTON = new BooleanSetting("revanced_hide_shorts_dislike_button", FALSE);
@@ -306,6 +310,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting HIDE_SHORTS_JOIN_BUTTON = new BooleanSetting("revanced_hide_shorts_join_button", TRUE);
public static final BooleanSetting HIDE_SHORTS_LIKE_BUTTON = new BooleanSetting("revanced_hide_shorts_like_button", FALSE);
public static final BooleanSetting HIDE_SHORTS_LIKE_FOUNTAIN = new BooleanSetting("revanced_hide_shorts_like_fountain", TRUE);
public static final BooleanSetting HIDE_SHORTS_LIVE_PREVIEW = new BooleanSetting("revanced_hide_shorts_live_preview", FALSE);
public static final BooleanSetting HIDE_SHORTS_LOCATION_LABEL = new BooleanSetting("revanced_hide_shorts_location_label", FALSE);
public static final BooleanSetting HIDE_SHORTS_NAVIGATION_BAR = new BooleanSetting("revanced_hide_shorts_navigation_bar", FALSE, true);
public static final BooleanSetting HIDE_SHORTS_PAUSED_OVERLAY_BUTTONS = new BooleanSetting("revanced_hide_shorts_paused_overlay_buttons", FALSE);

View File

@@ -3,4 +3,4 @@ org.gradle.jvmargs = -Xms512M -Xmx2048M
org.gradle.parallel = true
android.useAndroidX = true
kotlin.code.style = official
version = 5.47.0-dev.5
version = 5.47.0-dev.11

View File

@@ -1,3 +1,7 @@
public final class DisableReelsScrollingPatchKt {
public static final fun getDisableReelsScrollingPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/all/misc/activity/exportall/ExportAllActivitiesPatchKt {
public static final fun getExportAllActivitiesPatch ()Lapp/revanced/patcher/patch/ResourcePatch;
}
@@ -56,6 +60,10 @@ public final class app/revanced/patches/all/misc/connectivity/telephony/sim/spoo
public static final fun getSpoofSimCountryPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/all/misc/connectivity/telephony/sim/spoof/SpoofSimProviderPatchKt {
public static final fun getSpoofSimProviderPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/all/misc/connectivity/wifi/spoof/SpoofWifiPatchKt {
public static final fun getSpoofWifiPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
@@ -180,6 +188,10 @@ public final class app/revanced/patches/crunchyroll/ads/HideAdsPatchKt {
public static final fun getHideAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/disneyplus/ads/SkipAdsPatchKt {
public static final fun getSkipAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/duolingo/ad/DisableAdsPatchKt {
public static final fun getDisableAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
@@ -328,6 +340,10 @@ public final class app/revanced/patches/irplus/ad/RemoveAdsPatchKt {
public static final fun getRemoveAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/letterboxd/ads/HideAdsPatchKt {
public static final fun getHideAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/lightroom/misc/login/DisableMandatoryLoginPatchKt {
public static final fun getDisableMandatoryLoginPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
@@ -613,6 +629,10 @@ public final class app/revanced/patches/protonmail/signature/RemoveSentFromSigna
public static final fun getRemoveSentFromSignaturePatch ()Lapp/revanced/patcher/patch/ResourcePatch;
}
public final class app/revanced/patches/protonvpn/delay/RemoveDelayPatchKt {
public static final fun getRemoveDelayPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/rar/misc/annoyances/purchasereminder/HidePurchaseReminderPatchKt {
public static final fun getHidePurchaseReminderPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}

View File

@@ -1,105 +1,9 @@
package app.revanced.patches.all.misc.connectivity.telephony.sim.spoof
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patcher.patch.stringOption
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.all.misc.transformation.transformInstructionsPatch
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.reference.MethodReference
import com.android.tools.smali.dexlib2.immutable.reference.ImmutableMethodReference
import com.android.tools.smali.dexlib2.util.MethodUtil
import java.util.*
@Deprecated("Patch was renamed", ReplaceWith("spoofSimProviderPatch"))
@Suppress("unused")
val spoofSimCountryPatch = bytecodePatch(
name = "Spoof SIM country",
description = "Spoofs country information returned by the SIM card provider.",
use = false,
) {
val countries = Locale.getISOCountries().associateBy { Locale("", it).displayCountry }
fun isoCountryPatchOption(
key: String,
title: String,
) = stringOption(
key,
null,
countries,
title,
"ISO-3166-1 alpha-2 country code equivalent for the SIM provider's country code.",
false,
validator = { it: String? -> it == null || it.uppercase() in countries.values },
)
val networkCountryIso by isoCountryPatchOption(
"networkCountryIso",
"Network ISO country code",
)
val simCountryIso by isoCountryPatchOption(
"simCountryIso",
"SIM ISO country code",
)
dependsOn(
transformInstructionsPatch(
filterMap = { _, _, instruction, instructionIndex ->
if (instruction !is ReferenceInstruction) return@transformInstructionsPatch null
val reference = instruction.reference as? MethodReference ?: return@transformInstructionsPatch null
val match = MethodCall.entries.firstOrNull { search ->
MethodUtil.methodSignaturesMatch(reference, search.reference)
} ?: return@transformInstructionsPatch null
val iso = when (match) {
MethodCall.NetworkCountryIso -> networkCountryIso
MethodCall.SimCountryIso -> simCountryIso
}?.lowercase()
iso?.let { instructionIndex to it }
},
transform = { mutableMethod, entry: Pair<Int, String> ->
transformMethodCall(entry, mutableMethod)
},
),
)
}
private fun transformMethodCall(
entry: Pair<Int, String>,
mutableMethod: MutableMethod,
) {
val (instructionIndex, methodCallValue) = entry
val register = mutableMethod.getInstruction<OneRegisterInstruction>(instructionIndex + 1).registerA
mutableMethod.replaceInstruction(
instructionIndex + 1,
"const-string v$register, \"$methodCallValue\"",
)
}
private enum class MethodCall(
val reference: MethodReference,
) {
NetworkCountryIso(
ImmutableMethodReference(
"Landroid/telephony/TelephonyManager;",
"getNetworkCountryIso",
emptyList(),
"Ljava/lang/String;",
),
),
SimCountryIso(
ImmutableMethodReference(
"Landroid/telephony/TelephonyManager;",
"getSimCountryIso",
emptyList(),
"Ljava/lang/String;",
),
),
val spoofSimCountryPatch = bytecodePatch {
dependsOn(spoofSimProviderPatch)
}

View File

@@ -0,0 +1,169 @@
package app.revanced.patches.all.misc.connectivity.telephony.sim.spoof
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patcher.patch.intOption
import app.revanced.patcher.patch.stringOption
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.all.misc.transformation.transformInstructionsPatch
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.reference.MethodReference
import com.android.tools.smali.dexlib2.immutable.reference.ImmutableMethodReference
import com.android.tools.smali.dexlib2.util.MethodUtil
import java.util.Locale
@Suppress("unused")
val spoofSimProviderPatch = bytecodePatch(
name = "Spoof SIM provider",
description = "Spoofs information about the SIM card provider.",
use = false,
) {
val countries = Locale.getISOCountries().associateBy { Locale("", it).displayCountry }
fun isoCountryPatchOption(
key: String,
title: String,
) = stringOption(
key,
null,
countries,
title,
"ISO-3166-1 alpha-2 country code equivalent for the SIM provider's country code.",
false,
validator = { it: String? -> it == null || it.uppercase() in countries.values },
)
fun isMccMncValid(it: Int?): Boolean = it == null || (it >= 10000 && it <= 999999)
val networkCountryIso by isoCountryPatchOption(
"networkCountryIso",
"Network ISO country code",
)
val networkOperator by intOption(
key = "networkOperator",
title = "MCC+MNC network operator code",
description = "The 5 or 6 digits MCC+MNC (Mobile Country Code + Mobile Network Code) of the network operator.",
validator = { isMccMncValid(it) }
)
val networkOperatorName by stringOption(
key = "networkOperatorName",
title = "Network operator name",
description = "The full name of the network operator.",
)
val simCountryIso by isoCountryPatchOption(
"simCountryIso",
"SIM ISO country code",
)
val simOperator by intOption(
key = "simOperator",
title = "MCC+MNC SIM operator code",
description = "The 5 or 6 digits MCC+MNC (Mobile Country Code + Mobile Network Code) of the SIM operator.",
validator = { isMccMncValid(it) }
)
val simOperatorName by stringOption(
key = "simOperatorName",
title = "SIM operator name",
description = "The full name of the SIM operator.",
)
dependsOn(
transformInstructionsPatch(
filterMap = { _, _, instruction, instructionIndex ->
if (instruction !is ReferenceInstruction) return@transformInstructionsPatch null
val reference = instruction.reference as? MethodReference ?: return@transformInstructionsPatch null
val match = MethodCall.entries.firstOrNull { search ->
MethodUtil.methodSignaturesMatch(reference, search.reference)
} ?: return@transformInstructionsPatch null
val replacement = when (match) {
MethodCall.NetworkCountryIso -> networkCountryIso?.lowercase()
MethodCall.NetworkOperator -> networkOperator?.toString()
MethodCall.NetworkOperatorName -> networkOperatorName
MethodCall.SimCountryIso -> simCountryIso?.lowercase()
MethodCall.SimOperator -> simOperator?.toString()
MethodCall.SimOperatorName -> simOperatorName
}
replacement?.let { instructionIndex to it }
},
transform = ::transformMethodCall,
),
)
}
private fun transformMethodCall(
mutableMethod: MutableMethod,
entry: Pair<Int, String>,
) {
val (instructionIndex, methodCallValue) = entry
// Get the register which would have contained the return value
val register = mutableMethod.getInstruction<OneRegisterInstruction>(instructionIndex + 1).registerA
// Replace the move-result instruction with our fake value
mutableMethod.replaceInstruction(
instructionIndex + 1,
"const-string v$register, \"$methodCallValue\"",
)
}
private enum class MethodCall(
val reference: MethodReference,
) {
NetworkCountryIso(
ImmutableMethodReference(
"Landroid/telephony/TelephonyManager;",
"getNetworkCountryIso",
emptyList(),
"Ljava/lang/String;",
),
),
NetworkOperator(
ImmutableMethodReference(
"Landroid/telephony/TelephonyManager;",
"getNetworkOperator",
emptyList(),
"Ljava/lang/String;",
),
),
NetworkOperatorName(
ImmutableMethodReference(
"Landroid/telephony/TelephonyManager;",
"getNetworkOperatorName",
emptyList(),
"Ljava/lang/String;",
),
),
SimCountryIso(
ImmutableMethodReference(
"Landroid/telephony/TelephonyManager;",
"getSimCountryIso",
emptyList(),
"Ljava/lang/String;",
),
),
SimOperator(
ImmutableMethodReference(
"Landroid/telephony/TelephonyManager;",
"getSimOperator",
emptyList(),
"Ljava/lang/String;",
),
),
SimOperatorName(
ImmutableMethodReference(
"Landroid/telephony/TelephonyManager;",
"getSimOperatorName",
emptyList(),
"Ljava/lang/String;",
),
),
}

View File

@@ -0,0 +1,19 @@
package app.revanced.patches.disneyplus.ads
import app.revanced.patcher.fingerprint
internal val insertionGetPointsFingerprint = fingerprint {
returns("Ljava/util/List")
custom { method, _ ->
method.name == "getPoints" &&
method.definingClass == "Lcom/dss/sdk/internal/media/Insertion;"
}
}
internal val insertionGetRangesFingerprint = fingerprint {
returns("Ljava/util/List")
custom { method, _ ->
method.name == "getRanges" &&
method.definingClass == "Lcom/dss/sdk/internal/media/Insertion;"
}
}

View File

@@ -0,0 +1,25 @@
package app.revanced.patches.disneyplus.ads
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.bytecodePatch
@Suppress("unused")
val skipAdsPatch = bytecodePatch(
name = "Skip ads",
description = "Automatically skips ads.",
) {
compatibleWith("com.disney.disneyplus")
execute {
arrayOf(insertionGetPointsFingerprint, insertionGetRangesFingerprint).forEach {
it.method.addInstructions(
0,
"""
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
return-object v0
""",
)
}
}
}

View File

@@ -0,0 +1,34 @@
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.instagram.reels.clipsSwipeRefreshLayoutOnInterceptTouchEventFingerprint
import app.revanced.patches.instagram.reels.clipsViewPagerImplGetViewAtIndexFingerprint
import app.revanced.util.returnEarly
@Suppress("unused")
val disableReelsScrollingPatch = bytecodePatch(
name = "Disable Reels scrolling",
description = "Disables the endless scrolling behavior in Instagram Reels, preventing swiping to the next Reel. " +
"Note: On a clean install, the 'Tip' animation may appear but will stop on its own after a few seconds.",
use = true
) {
compatibleWith("com.instagram.android")
execute {
val viewPagerField = clipsViewPagerImplGetViewAtIndexFingerprint.classDef.fields.first {
it.type == "Landroidx/viewpager2/widget/ViewPager2;"
}
// Disable user input on the ViewPager2 to prevent scrolling.
clipsViewPagerImplGetViewAtIndexFingerprint.method.addInstructions(
0,
"""
iget-object v0, p0, $viewPagerField
const/4 v1, 0x0
invoke-virtual { v0, v1 }, Landroidx/viewpager2/widget/ViewPager2;->setUserInputEnabled(Z)V
"""
)
// Return false in onInterceptTouchEvent to disable pull-to-refresh.
clipsSwipeRefreshLayoutOnInterceptTouchEventFingerprint.method.returnEarly(false)
}
}

View File

@@ -0,0 +1,13 @@
package app.revanced.patches.instagram.reels
import app.revanced.patcher.fingerprint
internal val clipsViewPagerImplGetViewAtIndexFingerprint = fingerprint {
strings("ClipsViewPagerImpl_getViewAtIndex")
}
internal val clipsSwipeRefreshLayoutOnInterceptTouchEventFingerprint = fingerprint {
parameters("Landroid/view/MotionEvent;")
custom { _, classDef -> classDef.type == "Linstagram/features/clips/viewer/ui/ClipsSwipeRefreshLayout;" }
}

View File

@@ -0,0 +1,29 @@
package app.revanced.patches.letterboxd.ads
import app.revanced.patcher.fingerprint
internal const val admobHelperClassName = "Lcom/letterboxd/letterboxd/helpers/AdmobHelper;"
internal val admobHelperSetShowAdsFingerprint = fingerprint {
custom { method, classDef ->
method.name == "setShowAds" && classDef.type == admobHelperClassName
}
}
internal val admobHelperShouldShowAdsFingerprint = fingerprint {
custom { method, classDef ->
method.name == "shouldShowAds" && classDef.type == admobHelperClassName
}
}
internal val filmFragmentShowAdsFingerprint = fingerprint {
custom { method, classDef ->
method.name == "showAds" && classDef.type.endsWith("/FilmFragment;")
}
}
internal val memberExtensionShowAdsFingerprint = fingerprint {
custom { method, classDef ->
method.name == "showAds" && classDef.type.endsWith("/AMemberExtensionKt;")
}
}

View File

@@ -0,0 +1,20 @@
package app.revanced.patches.letterboxd.ads
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.util.returnEarly
@Suppress("unused")
val hideAdsPatch = bytecodePatch(
name = "Hide ads",
) {
compatibleWith("com.letterboxd.letterboxd")
execute {
admobHelperSetShowAdsFingerprint.method.addInstruction(0, "const p1, 0x0")
listOf(admobHelperShouldShowAdsFingerprint, filmFragmentShowAdsFingerprint, memberExtensionShowAdsFingerprint).forEach {
it.method.returnEarly(false)
}
}
}

View File

@@ -0,0 +1,16 @@
package app.revanced.patches.protonvpn.delay
import app.revanced.patcher.fingerprint
internal val longDelayFingerprint = fingerprint {
custom { method, _ ->
method.name == "getChangeServerLongDelayInSeconds"
}
}
internal val shortDelayFingerprint = fingerprint {
custom { method, _ ->
method.name == "getChangeServerShortDelayInSeconds"
}
}

View File

@@ -0,0 +1,17 @@
package app.revanced.patches.protonvpn.delay
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.util.returnEarly
@Suppress("unused")
val removeDelayPatch = bytecodePatch(
name = "Remove delay",
description = "Removes the delay when changing servers.",
) {
compatibleWith("ch.protonvpn.android")
execute {
longDelayFingerprint.method.returnEarly(0)
shortDelayFingerprint.method.returnEarly(0)
}
}

View File

@@ -145,13 +145,14 @@ val hideLayoutComponentsPatch = bytecodePatch(
SwitchPreference("revanced_hide_ask_section"),
SwitchPreference("revanced_hide_attributes_section"),
SwitchPreference("revanced_hide_chapters_section"),
SwitchPreference("revanced_hide_featured_section"),
SwitchPreference("revanced_hide_featured_links_section"),
SwitchPreference("revanced_hide_featured_videos_section"),
SwitchPreference("revanced_hide_info_cards_section"),
SwitchPreference("revanced_hide_how_this_was_made_section"),
SwitchPreference("revanced_hide_hype_points"),
SwitchPreference("revanced_hide_key_concepts_section"),
SwitchPreference("revanced_hide_podcast_section"),
SwitchPreference("revanced_hide_description_subscribe_button"),
SwitchPreference("revanced_hide_subscribe_button"),
SwitchPreference("revanced_hide_transcript_section"),
),
),
@@ -223,10 +224,11 @@ val hideLayoutComponentsPatch = bytecodePatch(
),
SwitchPreference("revanced_hide_album_cards"),
SwitchPreference("revanced_hide_artist_cards"),
SwitchPreference("revanced_hide_cell_divider"),
SwitchPreference("revanced_hide_chips_shelf"),
SwitchPreference("revanced_hide_community_posts"),
SwitchPreference("revanced_hide_compact_banner"),
SwitchPreference("revanced_hide_crowdfunding_box"),
SwitchPreference("revanced_hide_chips_shelf"),
SwitchPreference("revanced_hide_expandable_card"),
SwitchPreference("revanced_hide_floating_microphone_button"),
SwitchPreference(
@@ -242,9 +244,9 @@ val hideLayoutComponentsPatch = bytecodePatch(
SwitchPreference("revanced_hide_show_more_button"),
SwitchPreference("revanced_hide_surveys"),
SwitchPreference("revanced_hide_ticket_shelf"),
SwitchPreference("revanced_hide_upload_time"),
SwitchPreference("revanced_hide_video_recommendation_labels"),
SwitchPreference("revanced_hide_view_count"),
SwitchPreference("revanced_hide_upload_time"),
SwitchPreference("revanced_hide_doodles"),
)

View File

@@ -101,6 +101,7 @@ private val hideShortsComponentsResourcePatch = resourcePatch {
SwitchPreference("revanced_hide_shorts_effect_button"),
SwitchPreference("revanced_hide_shorts_green_screen_button"),
SwitchPreference("revanced_hide_shorts_hashtag_button"),
SwitchPreference("revanced_hide_shorts_live_preview"),
SwitchPreference("revanced_hide_shorts_new_posts_button"),
SwitchPreference("revanced_hide_shorts_shop_button"),
SwitchPreference("revanced_hide_shorts_tagged_products"),
@@ -109,6 +110,7 @@ private val hideShortsComponentsResourcePatch = resourcePatch {
SwitchPreference("revanced_hide_shorts_stickers"),
// Bottom of the screen.
SwitchPreference("revanced_hide_shorts_auto_dubbed_label"),
SwitchPreference("revanced_hide_shorts_location_label"),
SwitchPreference("revanced_hide_shorts_channel_bar"),
SwitchPreference("revanced_hide_shorts_info_panel"),

View File

@@ -223,6 +223,9 @@ However, enabling this will also log some user data such as your IP address."</s
<string name="revanced_hide_artist_cards_title">Hide artist cards</string>
<string name="revanced_hide_artist_cards_summary_on">Artist cards are hidden</string>
<string name="revanced_hide_artist_cards_summary_off">Artist cards are shown</string>
<string name="revanced_hide_cell_divider_title">Hide cell divider</string>
<string name="revanced_hide_cell_divider_summary_on">Cell divider (Visual space) is hidden</string>
<string name="revanced_hide_cell_divider_summary_off">Cell divider (Visual space) is shown</string>
<string name="revanced_hide_chips_shelf_title">Hide chips shelf</string>
<string name="revanced_hide_chips_shelf_summary_on">Chips shelf is hidden</string>
<string name="revanced_hide_chips_shelf_summary_off">Chips shelf is shown</string>
@@ -346,18 +349,21 @@ If a Doodle is currently showing in your region and this hide setting is on, the
<string name="revanced_hide_podcast_section_title">Hide \'Explore the podcast\'</string>
<string name="revanced_hide_podcast_section_summary_on">Explore the podcast section is hidden</string>
<string name="revanced_hide_podcast_section_summary_off">Explore the podcast section is shown</string>
<string name="revanced_hide_featured_section_title">Hide Featured content</string>
<string name="revanced_hide_featured_section_summary_on">Featured content section is hidden</string>
<string name="revanced_hide_featured_section_summary_off">Featured content section is shown</string>
<string name="revanced_hide_featured_links_section_title">Hide Featured links</string>
<string name="revanced_hide_featured_links_section_summary_on">Featured links section is hidden</string>
<string name="revanced_hide_featured_links_section_summary_off">Featured links section is shown</string>
<string name="revanced_hide_featured_videos_section_title">Hide Featured videos</string>
<string name="revanced_hide_featured_videos_section_summary_on">Featured videos section is hidden</string>
<string name="revanced_hide_featured_videos_section_summary_off">Featured videos section is shown</string>
<string name="revanced_hide_info_cards_section_title">Hide Info cards</string>
<string name="revanced_hide_info_cards_section_summary_on">Info cards section is hidden</string>
<string name="revanced_hide_info_cards_section_summary_off">Info cards section is shown</string>
<string name="revanced_hide_key_concepts_section_title">Hide \'Key concepts\'</string>
<string name="revanced_hide_key_concepts_section_summary_on">Key concepts section is hidden</string>
<string name="revanced_hide_key_concepts_section_summary_off">Key concepts section is shown</string>
<string name="revanced_hide_description_subscribe_button_title">Hide Subscribe button</string>
<string name="revanced_hide_description_subscribe_button_summary_on">Subscribe button is hidden</string>
<string name="revanced_hide_description_subscribe_button_summary_off">Subscribe button is shown</string>
<string name="revanced_hide_subscribe_button_title">Hide Subscribe button</string>
<string name="revanced_hide_subscribe_button_summary_on">Subscribe button is hidden</string>
<string name="revanced_hide_subscribe_button_summary_off">Subscribe button is shown</string>
<string name="revanced_hide_transcript_section_title">Hide Transcript</string>
<string name="revanced_hide_transcript_section_summary_on">Transcript section is hidden</string>
<string name="revanced_hide_transcript_section_summary_off">Transcript section is shown</string>
@@ -887,6 +893,9 @@ To show the Audio track menu, change \'Spoof video streams\' to \'Android No SDK
<string name="revanced_hide_shorts_history_title">Hide Shorts in watch history</string>
<string name="revanced_hide_shorts_history_summary_on">Hidden in watch history</string>
<string name="revanced_hide_shorts_history_summary_off">Shown in watch history</string>
<string name="revanced_hide_shorts_auto_dubbed_label_title">Hide auto-dubbed label</string>
<string name="revanced_hide_shorts_auto_dubbed_label_summary_on">Auto-dubbed label is hidden</string>
<string name="revanced_hide_shorts_auto_dubbed_label_summary_off">Auto-dubbed label is shown</string>
<string name="revanced_hide_shorts_super_thanks_button_title">Hide Buy Super Thanks button</string>
<string name="revanced_hide_shorts_super_thanks_button_summary_on">Buy Super Thanks button is hidden</string>
<string name="revanced_hide_shorts_super_thanks_button_summary_off">Buy Super Thanks button is shown</string>
@@ -903,6 +912,9 @@ To show the Audio track menu, change \'Spoof video streams\' to \'Android No SDK
<string name="revanced_hide_shorts_join_button_title">Hide Join button</string>
<string name="revanced_hide_shorts_join_button_summary_on">Join button is hidden</string>
<string name="revanced_hide_shorts_join_button_summary_off">Join button is shown</string>
<string name="revanced_hide_shorts_live_preview_title">Hide live preview</string>
<string name="revanced_hide_shorts_live_preview_summary_on">Live preview is hidden</string>
<string name="revanced_hide_shorts_live_preview_summary_off">Live preview is shown</string>
<string name="revanced_hide_shorts_location_label_title">Hide location label</string>
<string name="revanced_hide_shorts_location_label_summary_on">Location label is hidden</string>
<string name="revanced_hide_shorts_location_label_summary_off">Location label is shown</string>