Compare commits

...

11 Commits

Author SHA1 Message Date
semantic-release-bot
e2b2b7424b chore(release): 3.2.0-dev.7 [skip ci]
# [3.2.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v3.2.0-dev.6...v3.2.0-dev.7) (2023-12-24)

### Features

* **YouTube - Hide ads:** Hide fullscreen ads ([b12a14c](b12a14c4d0))
* **YouTube - Hide layout components:** Hide search result recommendations ([4408209](44082095ba))
2023-12-24 17:40:36 +00:00
oSumAtrIX
b12a14c4d0 feat(YouTube - Hide ads): Hide fullscreen ads 2023-12-24 18:38:34 +01:00
oSumAtrIX
44082095ba feat(YouTube - Hide layout components): Hide search result recommendations 2023-12-24 18:07:01 +01:00
semantic-release-bot
987e4e7e91 chore(release): 3.2.0-dev.6 [skip ci]
# [3.2.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v3.2.0-dev.5...v3.2.0-dev.6) (2023-12-24)

### Bug Fixes

* **Spoof SIM country:** Validate patch option value correctly ([4fd77b1](4fd77b130a))
2023-12-24 12:41:57 +00:00
oSumAtrIX
4fd77b130a fix(Spoof SIM country): Validate patch option value correctly 2023-12-24 13:39:59 +01:00
semantic-release-bot
47aa56a06e chore(release): 3.2.0-dev.5 [skip ci]
# [3.2.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v3.2.0-dev.4...v3.2.0-dev.5) (2023-12-23)

### Bug Fixes

* **YouTube - Alternative thumbnails:** Clarify DeArrow support is for thumbnails ([#2531](https://github.com/ReVanced/revanced-patches/issues/2531)) ([47f2de4](47f2de4bc8))
2023-12-23 07:49:58 +00:00
Ajay Ramachandran
47f2de4bc8 fix(YouTube - Alternative thumbnails): Clarify DeArrow support is for thumbnails (#2531) 2023-12-23 11:48:06 +04:00
oSumAtrIX
36b929c3b3 refactor(Spoof SIM country): Use existing function to register patch option 2023-12-22 03:30:27 +01:00
oSumAtrIX
7109d8e088 refactor(Spoof SIM country): Reduce code duplication 2023-12-22 03:20:55 +01:00
semantic-release-bot
c91df0f29c chore(release): 3.2.0-dev.4 [skip ci]
# [3.2.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v3.2.0-dev.3...v3.2.0-dev.4) (2023-12-21)

### Bug Fixes

* **Tiktok - Remember clear display:** Use correct name ([2c83b86](2c83b86297))
2023-12-21 14:34:43 +00:00
oSumAtrIX
2c83b86297 fix(Tiktok - Remember clear display): Use correct name 2023-12-21 15:32:18 +01:00
11 changed files with 100 additions and 47 deletions

View File

@@ -1,3 +1,32 @@
# [3.2.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v3.2.0-dev.6...v3.2.0-dev.7) (2023-12-24)
### Features
* **YouTube - Hide ads:** Hide fullscreen ads ([bdc9a12](https://github.com/ReVanced/revanced-patches/commit/bdc9a129eff3a5051b8b37665b3243a8b61cbbac))
* **YouTube - Hide layout components:** Hide search result recommendations ([55cc7f1](https://github.com/ReVanced/revanced-patches/commit/55cc7f1c7722f56af6d33ea2bd09a1b99d635209))
# [3.2.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v3.2.0-dev.5...v3.2.0-dev.6) (2023-12-24)
### Bug Fixes
* **Spoof SIM country:** Validate patch option value correctly ([8105463](https://github.com/ReVanced/revanced-patches/commit/81054637915a5399d15f546b2290b5d939e15732))
# [3.2.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v3.2.0-dev.4...v3.2.0-dev.5) (2023-12-23)
### Bug Fixes
* **YouTube - Alternative thumbnails:** Clarify DeArrow support is for thumbnails ([#2531](https://github.com/ReVanced/revanced-patches/issues/2531)) ([828abb0](https://github.com/ReVanced/revanced-patches/commit/828abb0558926cd6557c79abcf1a04bfe2c719e6))
# [3.2.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v3.2.0-dev.3...v3.2.0-dev.4) (2023-12-21)
### Bug Fixes
* **Tiktok - Remember clear display:** Use correct name ([d7e44cb](https://github.com/ReVanced/revanced-patches/commit/d7e44cb887396bba27ee81c70c006f0cc247c56d))
# [3.2.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v3.2.0-dev.2...v3.2.0-dev.3) (2023-12-21) # [3.2.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v3.2.0-dev.2...v3.2.0-dev.3) (2023-12-21)

View File

@@ -818,8 +818,8 @@ public final class app/revanced/patches/tiktok/feedfilter/FeedFilterPatch : app/
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
} }
public final class app/revanced/patches/tiktok/interaction/clearmode/RememberClearModePatch : app/revanced/patcher/patch/BytecodePatch { public final class app/revanced/patches/tiktok/interaction/cleardisplay/RememberClearDisplayPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/tiktok/interaction/clearmode/RememberClearModePatch; public static final field INSTANCE Lapp/revanced/patches/tiktok/interaction/cleardisplay/RememberClearDisplayPatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
} }

View File

@@ -1,4 +1,4 @@
org.gradle.parallel = true org.gradle.parallel = true
org.gradle.caching = true org.gradle.caching = true
kotlin.code.style = official kotlin.code.style = official
version = 3.2.0-dev.3 version = 3.2.0-dev.7

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,6 @@ package app.revanced.patches.all.telephony.sim.spoof
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.patch.options.PatchOption
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.all.misc.transformation.AbstractTransformInstructionsPatch import app.revanced.patches.all.misc.transformation.AbstractTransformInstructionsPatch
@@ -25,26 +24,29 @@ import java.util.*
) )
@Suppress("unused") @Suppress("unused")
object SpoofSimCountryPatch : AbstractTransformInstructionsPatch<Pair<Int, String>>() { object SpoofSimCountryPatch : AbstractTransformInstructionsPatch<Pair<Int, String>>() {
private val isoValidator: PatchOption<String>.(String?) -> Boolean = private val countries = Locale.getISOCountries().associateBy { Locale("", it).displayCountry }
{ it: String? -> it?.uppercase() in Locale.getISOCountries() || it == null }
private val networkCountryIso by stringPatchOption( private val networkCountryIso by isoCountryPatchOption(
"networkCountryIso", "networkCountryIso",
null,
null,
"Network ISO Country Code", "Network ISO Country Code",
"ISO-3166-1 alpha-2 country code equivalent of the MCC (Mobile Country Code) " +
"of the current registered operator or the cell nearby.",
validator = isoValidator
) )
private val simCountryIso by stringPatchOption( private val simCountryIso by isoCountryPatchOption(
"simCountryIso", "simCountryIso",
null,
null,
"Sim ISO Country Code", "Sim ISO Country Code",
)
private fun isoCountryPatchOption(
key: String,
title: String,
) = stringPatchOption(
key,
null,
countries,
title,
"ISO-3166-1 alpha-2 country code equivalent for the SIM provider's country code.", "ISO-3166-1 alpha-2 country code equivalent for the SIM provider's country code.",
validator = isoValidator false,
validator = { it: String? -> it == null || it.uppercase() in countries.values }
) )
override fun filterMap( override fun filterMap(

View File

@@ -1,4 +1,4 @@
package app.revanced.patches.tiktok.interaction.clearmode package app.revanced.patches.tiktok.interaction.cleardisplay
import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
@@ -8,31 +8,31 @@ import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.tiktok.interaction.clearmode.fingerprints.OnClearModeEventFingerprint import app.revanced.patches.tiktok.interaction.cleardisplay.fingerprints.OnClearDisplayEventFingerprint
import app.revanced.patches.tiktok.interaction.clearmode.fingerprints.OnRenderFirstFrameFingerprint import app.revanced.patches.tiktok.interaction.cleardisplay.fingerprints.OnRenderFirstFrameFingerprint
import app.revanced.util.exception import app.revanced.util.exception
import app.revanced.util.indexOfFirstInstruction import app.revanced.util.indexOfFirstInstruction
import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction22c import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction22c
@Patch( @Patch(
name = "Remember clear mode", name = "Remember clear display",
description = "Remembers the clear mode configurations in between videos.", description = "Remembers the clear display configurations in between videos.",
compatiblePackages = [ compatiblePackages = [
CompatiblePackage("com.ss.android.ugc.trill", ["32.5.3"]), CompatiblePackage("com.ss.android.ugc.trill", ["32.5.3"]),
CompatiblePackage("com.zhiliaoapp.musically", ["32.5.3"]) CompatiblePackage("com.zhiliaoapp.musically", ["32.5.3"])
] ]
) )
@Suppress("unused") @Suppress("unused")
object RememberClearModePatch : BytecodePatch( object RememberClearDisplayPatch : BytecodePatch(
setOf( setOf(
OnClearModeEventFingerprint, OnClearDisplayEventFingerprint,
OnRenderFirstFrameFingerprint OnRenderFirstFrameFingerprint
) )
) { ) {
override fun execute(context: BytecodeContext) { override fun execute(context: BytecodeContext) {
OnClearModeEventFingerprint.result?.mutableMethod?.let { OnClearDisplayEventFingerprint.result?.mutableMethod?.let {
// region Hook the "Clear mode" configuration save event to remember the state of clear mode. // region Hook the "Clear display" configuration save event to remember the state of clear display.
val isEnabledIndex = it.indexOfFirstInstruction { opcode == Opcode.IGET_BOOLEAN } + 1 val isEnabledIndex = it.indexOfFirstInstruction { opcode == Opcode.IGET_BOOLEAN } + 1
val isEnabledRegister = it.getInstruction<Instruction22c>(isEnabledIndex - 1).registerA val isEnabledRegister = it.getInstruction<Instruction22c>(isEnabledIndex - 1).registerA
@@ -40,40 +40,40 @@ object RememberClearModePatch : BytecodePatch(
it.addInstructions( it.addInstructions(
isEnabledIndex, isEnabledIndex,
"invoke-static { v$isEnabledRegister }, " + "invoke-static { v$isEnabledRegister }, " +
"Lapp/revanced/tiktok/clearmode/RememberClearModePatch;->rememberClearModeState(Z)V" "Lapp/revanced/tiktok/cleardisplay/RememberClearDisplayPatch;->rememberClearDisplayState(Z)V"
) )
// endregion // endregion
// region Override the "Clear mode" configuration load event to load the state of clear mode. // region Override the "Clear display" configuration load event to load the state of clear display.
val clearModeEventClass = it.parameters[0].type val clearDisplayEventClass = it.parameters[0].type
OnRenderFirstFrameFingerprint.result?.mutableMethod?.apply { OnRenderFirstFrameFingerprint.result?.mutableMethod?.apply {
addInstructionsWithLabels( addInstructionsWithLabels(
0, 0,
""" """
# Create a new clearModeEvent and post it to the EventBus (https://github.com/greenrobot/EventBus) # Create a new clearDisplayEvent and post it to the EventBus (https://github.com/greenrobot/EventBus)
# The state of clear mode. # The state of clear display.
invoke-static { }, Lapp/revanced/tiktok/clearmode/RememberClearModePatch;->getClearModeState()Z invoke-static { }, Lapp/revanced/tiktok/cleardisplay/RememberClearDisplayPatch;->getClearDisplayState()Z
move-result v3 move-result v3
if-eqz v3, :clear_mode_disabled if-eqz v3, :clear_display_disabled
# Clear mode type such as 0 = LONG_PRESS, 1 = SCREEN_RECORD etc. # Clear display type such as 0 = LONG_PRESS, 1 = SCREEN_RECORD etc.
const/4 v1, 0x0 const/4 v1, 0x0
# Name of the clear mode type which is equivalent to the clear mode type. # Name of the clear display type which is equivalent to the clear display type.
const-string v2, "long_press" const-string v2, "long_press"
new-instance v0, $clearModeEventClass new-instance v0, $clearDisplayEventClass
invoke-direct { v0, v1, v2, v3 }, $clearModeEventClass-><init>(ILjava/lang/String;Z)V invoke-direct { v0, v1, v2, v3 }, $clearDisplayEventClass-><init>(ILjava/lang/String;Z)V
invoke-virtual { v0 }, $clearModeEventClass->post()Lcom/ss/android/ugc/governance/eventbus/IEvent; invoke-virtual { v0 }, $clearDisplayEventClass->post()Lcom/ss/android/ugc/governance/eventbus/IEvent;
""", """,
ExternalLabel("clear_mode_disabled", getInstruction(0)) ExternalLabel("clear_display_disabled", getInstruction(0))
) )
} ?: throw OnRenderFirstFrameFingerprint.exception } ?: throw OnRenderFirstFrameFingerprint.exception
// endregion // endregion
} ?: throw OnClearModeEventFingerprint.exception } ?: throw OnClearDisplayEventFingerprint.exception
} }
} }

View File

@@ -1,9 +1,10 @@
package app.revanced.patches.tiktok.interaction.clearmode.fingerprints package app.revanced.patches.tiktok.interaction.cleardisplay.fingerprints
import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.fingerprint.MethodFingerprint
internal object OnClearModeEventFingerprint : MethodFingerprint( internal object OnClearDisplayEventFingerprint : MethodFingerprint(
customFingerprint = { methodDef, _ -> customFingerprint = { methodDef, _ ->
// Internally the feature is called "Clear mode".
methodDef.definingClass.endsWith("/ClearModePanelComponent;") && methodDef.name == "onClearModeEvent" methodDef.definingClass.endsWith("/ClearModePanelComponent;") && methodDef.name == "onClearModeEvent"
} }
) )

View File

@@ -1,4 +1,4 @@
package app.revanced.patches.tiktok.interaction.clearmode.fingerprints package app.revanced.patches.tiktok.interaction.cleardisplay.fingerprints
import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.fingerprint.MethodFingerprint

View File

@@ -31,6 +31,12 @@ object HideAdsResourcePatch : ResourcePatch() {
StringResource("revanced_hide_general_ads_summary_on", "General ads are hidden"), StringResource("revanced_hide_general_ads_summary_on", "General ads are hidden"),
StringResource("revanced_hide_general_ads_summary_off", "General ads are shown") StringResource("revanced_hide_general_ads_summary_off", "General ads are shown")
), ),
SwitchPreference(
"revanced_hide_fullscreen_ads",
StringResource("revanced_hide_fullscreen_ads_title", "Hide fullscreen ads"),
StringResource("revanced_hide_fullscreen_ads_summary_on", "Fullscreen ads are hidden"),
StringResource("revanced_hide_fullscreen_ads_summary_off", "Fullscreen ads are shown")
),
SwitchPreference( SwitchPreference(
"revanced_hide_buttoned_ads", "revanced_hide_buttoned_ads",
StringResource("revanced_hide_buttoned_ads_title", "Hide buttoned ad"), StringResource("revanced_hide_buttoned_ads_title", "Hide buttoned ad"),

View File

@@ -1,6 +1,5 @@
package app.revanced.patches.youtube.layout.hide.general package app.revanced.patches.youtube.layout.hide.general
import app.revanced.util.exception
import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
@@ -18,6 +17,7 @@ import app.revanced.patches.youtube.layout.hide.general.fingerprints.ShowWaterma
import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
import app.revanced.patches.youtube.misc.settings.SettingsPatch import app.revanced.patches.youtube.misc.settings.SettingsPatch
import app.revanced.patches.youtube.misc.settings.SettingsPatch.PreferenceScreen import app.revanced.patches.youtube.misc.settings.SettingsPatch.PreferenceScreen
import app.revanced.util.exception
import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
@@ -93,6 +93,21 @@ object HideLayoutComponentsPatch : BytecodePatch(
StringResource("revanced_hide_timed_reactions_summary_on", "Timed reactions are hidden"), StringResource("revanced_hide_timed_reactions_summary_on", "Timed reactions are hidden"),
StringResource("revanced_hide_timed_reactions_summary_off", "Timed reactions are shown") StringResource("revanced_hide_timed_reactions_summary_off", "Timed reactions are shown")
), ),
SwitchPreference(
"revanced_hide_search_result_recommendations",
StringResource(
"revanced_hide_search_result_recommendations_title",
"Hide search result recommendations (e.g People also watched)"
),
StringResource(
"revanced_hide_search_result_recommendations_summary_on",
"Recommendations are hidden"
),
StringResource(
"revanced_hide_search_result_recommendations_summary_off",
"Recommendations are shown"
)
),
SwitchPreference( SwitchPreference(
"revanced_hide_search_result_shelf_header", "revanced_hide_search_result_shelf_header",
StringResource( StringResource(

View File

@@ -119,9 +119,9 @@ object AlternativeThumbnailsPatch : BytecodePatch(
), ),
SwitchPreference( SwitchPreference(
"revanced_alt_thumbnail_dearrow", "revanced_alt_thumbnail_dearrow",
StringResource("revanced_alt_thumbnail_dearrow_title", "Enable DeArrow"), StringResource("revanced_alt_thumbnail_dearrow_title", "Enable DeArrow thumbnails"),
StringResource("revanced_alt_thumbnail_dearrow_summary_on", "Using DeArrow"), StringResource("revanced_alt_thumbnail_dearrow_summary_on", "Using DeArrow thumbnails"),
StringResource("revanced_alt_thumbnail_dearrow_summary_off", "Not using DeArrow") StringResource("revanced_alt_thumbnail_dearrow_summary_off", "Not using DeArrow thumbnails")
), ),
SwitchPreference( SwitchPreference(
"revanced_alt_thumbnail_dearrow_connection_toast", "revanced_alt_thumbnail_dearrow_connection_toast",