Compare commits

...

16 Commits

Author SHA1 Message Date
semantic-release-bot
618f6746cc chore(release): 2.165.0-dev.7 [skip ci]
# [2.165.0-dev.7](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.6...v2.165.0-dev.7) (2023-02-26)

### Features

* **youtube/hide-autoplay-button:** do not disable autoplay button when hidden ([766172b](766172b8ff))
* **youtube:** `hide-floating-microphone-button` patch ([b379911](b379911b8b))
2023-02-26 22:17:18 +00:00
oSumAtrIX
24cb30f520 refactor(youtube/hide-timestamp): use better descriptions
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-26 23:10:36 +01:00
oSumAtrIX
b379911b8b feat(youtube): hide-floating-microphone-button patch
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-26 23:05:43 +01:00
oSumAtrIX
766172b8ff feat(youtube/hide-autoplay-button): do not disable autoplay button when hidden
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-26 22:38:09 +01:00
semantic-release-bot
e21ce083e7 chore(release): 2.165.0-dev.6 [skip ci]
# [2.165.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.5...v2.165.0-dev.6) (2023-02-26)

### Bug Fixes

* **backdrops/pro-unlock:** constrain to most recent working app version ([#1677](https://github.com/revanced/revanced-patches/issues/1677)) ([cbd733c](cbd733c226))
2023-02-26 14:20:39 +00:00
KAZI MMT
cbd733c226 fix(backdrops/pro-unlock): constrain to most recent working app version (#1677) 2023-02-26 15:18:54 +01:00
semantic-release-bot
a7e53adaa1 chore(release): 2.165.0-dev.5 [skip ci]
# [2.165.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.4...v2.165.0-dev.5) (2023-02-24)

### Features

* **youtube/general-ads:** do not hide components in library tab ([9d62835](9d62835db4))
2023-02-24 23:13:27 +00:00
oSumAtrIX
9d62835db4 feat(youtube/general-ads): do not hide components in library tab
This reverts commit 5a62eb1a28.

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-25 00:11:32 +01:00
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
17 changed files with 232 additions and 95 deletions

View File

@@ -1,3 +1,53 @@
# [2.165.0-dev.7](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.6...v2.165.0-dev.7) (2023-02-26)
### Features
* **youtube/hide-autoplay-button:** do not disable autoplay button when hidden ([7bc6a5b](https://github.com/revanced/revanced-patches/commit/7bc6a5ba2505e368e7590fe429b682ae435dba83))
* **youtube:** `hide-floating-microphone-button` patch ([c684bed](https://github.com/revanced/revanced-patches/commit/c684bed5054beb5361fed5fe404cf68033927a27))
# [2.165.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.5...v2.165.0-dev.6) (2023-02-26)
### Bug Fixes
* **backdrops/pro-unlock:** constrain to most recent working app version ([#1677](https://github.com/revanced/revanced-patches/issues/1677)) ([331fe04](https://github.com/revanced/revanced-patches/commit/331fe04f142e3f1f7f6066271261a55d0bee33c4))
# [2.165.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.165.0-dev.4...v2.165.0-dev.5) (2023-02-24)
### Features
* **youtube/general-ads:** do not hide components in library tab ([a8b597a](https://github.com/revanced/revanced-patches/commit/a8b597a1ba2fa6f6e37d3792e85296c1f07da630))
# [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) # [2.164.0](https://github.com/revanced/revanced-patches/compare/v2.163.0...v2.164.0) (2023-02-24)

View File

@@ -19,7 +19,7 @@ The official Patch bundle provided by ReVanced and the community.
| `debugging` | Adds debugging options. | all | | `debugging` | Adds debugging options. | all |
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 18.03.36 | | `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` | 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-shorts-on-startup` | Disables playing YouTube Shorts when launching YouTube. | 18.03.36 |
| `disable-zoom-haptics` | Disables haptics when zooming. | all | | `disable-zoom-haptics` | Disables haptics when zooming. | all |
| `downloads` | Enables downloading music and videos from YouTube. | 18.03.36 | | `downloads` | Enables downloading music and videos from YouTube. | 18.03.36 |
@@ -36,12 +36,13 @@ The official Patch bundle provided by ReVanced and the community.
| `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 18.03.36 | | `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 18.03.36 |
| `hide-email-address` | Hides the email address in the account switcher. | 18.03.36 | | `hide-email-address` | Hides the email address in the account switcher. | 18.03.36 |
| `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 18.03.36 | | `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 18.03.36 |
| `hide-floating-microphone-button` | Hides the floating microphone button which appears in search. | 18.03.36 |
| `hide-info-cards` | Hides info cards in videos. | 18.03.36 | | `hide-info-cards` | Hides info cards in videos. | 18.03.36 |
| `hide-my-mix` | Hides mix playlists. | 18.03.36 | | `hide-my-mix` | Hides mix playlists. | 18.03.36 |
| `hide-player-buttons` | Adds the option to hide video player previous and next buttons. | all | | `hide-player-buttons` | Adds the option to hide video player previous and next buttons. | all |
| `hide-seekbar` | Hides the seekbar. | 18.03.36 | | `hide-seekbar` | Hides the seekbar. | 18.03.36 |
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 18.03.36 | | `hide-shorts-button` | Hides the shorts button on the navigation bar. | 18.03.36 |
| `hide-time` | Hides the videos time. | 18.03.36 | | `hide-timestamp` | Hides timestamp in video player. | 18.03.36 |
| `hide-video-action-buttons` | Adds the options to hide action buttons under a video. | 18.03.36 | | `hide-video-action-buttons` | Adds the options to hide action buttons under a video. | 18.03.36 |
| `hide-watch-in-vr` | Hides the option to watch in VR from the player settings flyout panel. | 18.03.36 | | `hide-watch-in-vr` | Hides the option to watch in VR from the player settings flyout panel. | 18.03.36 |
| `hide-watermark` | Hides creator's watermarks on videos. | 18.03.36 | | `hide-watermark` | Hides creator's watermarks on videos. | 18.03.36 |
@@ -228,7 +229,7 @@ The official Patch bundle provided by ReVanced and the community.
| 💊 Patch | 📜 Description | 🏹 Target Version | | 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:| |:--------:|:--------------:|:-----------------:|
| `pro-unlock` | Unlocks pro-only functions. | all | | `pro-unlock` | Unlocks pro-only functions. | 4.52 |
</details> </details>
### [📦 `de.dwd.warnapp`](https://play.google.com/store/apps/details?id=de.dwd.warnapp) ### [📦 `de.dwd.warnapp`](https://play.google.com/store/apps/details?id=de.dwd.warnapp)

View File

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

File diff suppressed because one or more lines are too long

View File

@@ -3,5 +3,5 @@ package app.revanced.patches.backdrops.misc.pro.annotations
import app.revanced.patcher.annotation.Compatibility import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package import app.revanced.patcher.annotation.Package
@Compatibility([Package("com.backdrops.wallpapers")]) @Compatibility([Package("com.backdrops.wallpapers", arrayOf("4.52"))])
internal annotation class ProUnlockCompatibility internal annotation class ProUnlockCompatibility

View File

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

View File

@@ -37,13 +37,6 @@ class GeneralAdsResourcePatch : ResourcePatch {
StringResource("revanced_adremover_separator_summary_on", "Gray separators are hidden"), StringResource("revanced_adremover_separator_summary_on", "Gray separators are hidden"),
StringResource("revanced_adremover_separator_summary_off", "Gray separators are shown") StringResource("revanced_adremover_separator_summary_off", "Gray separators are shown")
), ),
SwitchPreference(
"revanced_horizontal_video_shelf",
StringResource("revanced_horizontal_video_shelf_title", "Hide horizontal video shelf"),
true,
StringResource("revanced_horizontal_video_shelf_summary_on", "Shelf is hidden"),
StringResource("revanced_horizontal_video_shelf_summary_off", "Shelf is shown")
),
SwitchPreference( SwitchPreference(
"revanced_adremover_hide_channel_guidelines", "revanced_adremover_hide_channel_guidelines",
StringResource("revanced_adremover_hide_channel_guidelines_enabled_title", "Hide channel guidelines"), StringResource("revanced_adremover_hide_channel_guidelines_enabled_title", "Hide channel guidelines"),
@@ -214,12 +207,12 @@ class GeneralAdsResourcePatch : ResourcePatch {
StringResource("revanced_hide_related_videos_summary_off", "Related videos are shown") StringResource("revanced_hide_related_videos_summary_off", "Related videos are shown")
), ),
SwitchPreference( SwitchPreference(
"revanced_hide_channel_bar", "revanced_hide_image_shelf",
StringResource("revanced_hide_channel_bar_title", "Hide channel bar"), StringResource("revanced_hide_image_shelf", "Hide image shelf in search results"),
false, true,
StringResource("revanced_hide_channel_bar_summary_on", "Channel bar is hidden"), StringResource("revanced_hide_image_shelf_summary_on", "Image shelf is hidden"),
StringResource("revanced_hide_channel_bar_summary_off", "Channel bar is shown") StringResource("revanced_hide_image_shelf_summary_off", "Image shelf is shown")
), )
) )
PreferenceScreen.ADS.addPreferences( PreferenceScreen.ADS.addPreferences(

View File

@@ -1,20 +0,0 @@
package app.revanced.patches.youtube.layout.buttons.autoplay.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 AutoNavInformerFingerprint : MethodFingerprint(
"Z",
AccessFlags.PUBLIC or AccessFlags.FINAL,
opcodes = listOf(
Opcode.IGET_OBJECT,
Opcode.INVOKE_INTERFACE,
Opcode.MOVE_RESULT_OBJECT,
Opcode.CHECK_CAST,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
),
customFingerprint = { it.definingClass.endsWith("WillAutonavInformer;") }
)

View File

@@ -1,5 +1,6 @@
package app.revanced.patches.youtube.layout.buttons.autoplay.patch package app.revanced.patches.youtube.layout.buttons.autoplay.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
@@ -15,7 +16,6 @@ import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
import app.revanced.patches.shared.settings.preference.impl.StringResource import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.layout.buttons.autoplay.annotations.AutoplayButtonCompatibility import app.revanced.patches.youtube.layout.buttons.autoplay.annotations.AutoplayButtonCompatibility
import app.revanced.patches.youtube.layout.buttons.autoplay.fingerprints.AutoNavInformerFingerprint
import app.revanced.patches.youtube.layout.buttons.autoplay.fingerprints.LayoutConstructorFingerprint import app.revanced.patches.youtube.layout.buttons.autoplay.fingerprints.LayoutConstructorFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
@@ -31,9 +31,7 @@ import org.jf.dexlib2.iface.reference.MethodReference
@AutoplayButtonCompatibility @AutoplayButtonCompatibility
@Version("0.0.1") @Version("0.0.1")
class HideAutoplayButtonPatch : BytecodePatch( class HideAutoplayButtonPatch : BytecodePatch(
listOf( listOf(LayoutConstructorFingerprint)
LayoutConstructorFingerprint, AutoNavInformerFingerprint
)
) { ) {
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
@@ -43,49 +41,40 @@ class HideAutoplayButtonPatch : BytecodePatch(
true, true,
StringResource("revanced_hide_autoplay_button_summary_on", "Autoplay button is hidden"), StringResource("revanced_hide_autoplay_button_summary_on", "Autoplay button is hidden"),
StringResource("revanced_hide_autoplay_button_summary_off", "Autoplay button is shown") StringResource("revanced_hide_autoplay_button_summary_off", "Autoplay button is shown")
) ),
) )
val autoNavInformerMethod = AutoNavInformerFingerprint.result!!.mutableMethod LayoutConstructorFingerprint.result?.mutableMethod?.apply {
val layoutGenMethodInstructions = implementation!!.instructions
val layoutGenMethodResult = LayoutConstructorFingerprint.result!! // resolve the offsets such as ...
val layoutGenMethod = layoutGenMethodResult.mutableMethod val autoNavPreviewStubId = ResourceMappingPatch.resourceMappings.single {
val layoutGenMethodInstructions = layoutGenMethod.implementation!!.instructions it.name == "autonav_preview_stub"
}.id
// resolve the offsets such as ... // where to insert the branch instructions and ...
val autoNavPreviewStubId = ResourceMappingPatch.resourceMappings.single { val insertIndex = layoutGenMethodInstructions.indexOfFirst {
it.name == "autonav_preview_stub" (it as? WideLiteralInstruction)?.wideLiteral == autoNavPreviewStubId
}.id }
// where to insert the branch instructions and ...
val insertIndex = layoutGenMethodInstructions.indexOfFirst {
(it as? WideLiteralInstruction)?.wideLiteral == autoNavPreviewStubId
}
// where to branch away
val branchIndex = layoutGenMethodInstructions.subList(insertIndex + 1, layoutGenMethodInstructions.size - 1).indexOfFirst {
((it as? ReferenceInstruction)?.reference as? MethodReference)?.name == "addOnLayoutChangeListener"
} + 2
val jumpInstruction = layoutGenMethodInstructions[insertIndex + branchIndex] as Instruction // where to branch away
layoutGenMethod.addInstructions( val branchIndex =
insertIndex, """ layoutGenMethodInstructions.subList(insertIndex + 1, layoutGenMethodInstructions.size - 1)
.indexOfFirst {
((it as? ReferenceInstruction)?.reference as? MethodReference)?.name == "addOnLayoutChangeListener"
} + 2
val jumpInstruction = layoutGenMethodInstructions[insertIndex + branchIndex] as Instruction
addInstructions(
insertIndex,
"""
invoke-static {}, Lapp/revanced/integrations/patches/HideAutoplayButtonPatch;->isButtonShown()Z invoke-static {}, Lapp/revanced/integrations/patches/HideAutoplayButtonPatch;->isButtonShown()Z
move-result v11 move-result v11
if-eqz v11, :hidden if-eqz v11, :hidden
""", listOf(ExternalLabel("hidden", jumpInstruction)) """, listOf(ExternalLabel("hidden", jumpInstruction))
) )
} ?: return LayoutConstructorFingerprint.toErrorResult()
//force disable autoplay since it's hard to do without the button
autoNavInformerMethod.addInstructions(
0, """
invoke-static {}, Lapp/revanced/integrations/patches/HideAutoplayButtonPatch;->isButtonShown()Z
move-result v0
if-nez v0, :hidden
const/4 v0, 0x0
return v0
:hidden
nop
"""
)
return PatchResultSuccess() return PatchResultSuccess()
} }

View File

@@ -0,0 +1,13 @@
package app.revanced.patches.youtube.layout.hide.floatingmicrophone.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.49.37", "18.03.36")
)]
)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class HideFloatingMicrophoneButtonCompatibility

View File

@@ -0,0 +1,19 @@
package app.revanced.patches.youtube.layout.hide.floatingmicrophone.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.hide.floatingmicrophone.patch.HideFloatingMicrophoneButtonResourcePatch
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
object ShowFloatingMicrophoneButtonFingerprint : MethodFingerprint(
opcodes = listOf(
Opcode.IGET_BOOLEAN,
Opcode.IF_EQZ,
Opcode.RETURN_VOID
),
customFingerprint = { methodDef ->
methodDef.implementation?.instructions?.any {
(it as? WideLiteralInstruction)?.wideLiteral == HideFloatingMicrophoneButtonResourcePatch.fabButtonId
} == true
}
)

View File

@@ -0,0 +1,51 @@
package app.revanced.patches.youtube.layout.hide.floatingmicrophone.patch
import app.revanced.extensions.toErrorResult
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.extensions.addInstructions
import app.revanced.patcher.extensions.instruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.youtube.layout.hide.floatingmicrophone.annotations.HideFloatingMicrophoneButtonCompatibility
import app.revanced.patches.youtube.layout.hide.floatingmicrophone.fingerprints.ShowFloatingMicrophoneButtonFingerprint
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
@Patch
@Name("hide-floating-microphone-button")
@Description("Hides the floating microphone button which appears in search.")
@DependsOn([HideFloatingMicrophoneButtonResourcePatch::class])
@HideFloatingMicrophoneButtonCompatibility
@Version("0.0.1")
class HideFloatingMicrophoneButtonPatch : BytecodePatch(
listOf(ShowFloatingMicrophoneButtonFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
ShowFloatingMicrophoneButtonFingerprint.result?.let { result ->
with(result.mutableMethod) {
val insertIndex = result.scanResult.patternScanResult!!.startIndex + 1
val showButtonRegister = (instruction(insertIndex - 1) as TwoRegisterInstruction).registerA
addInstructions(
insertIndex,
"""
invoke-static {v$showButtonRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->hideFloatingMicrophoneButton(Z)Z
move-result v$showButtonRegister
"""
)
}
} ?: return ShowFloatingMicrophoneButtonFingerprint.toErrorResult()
return PatchResultSuccess()
}
private companion object {
const val INTEGRATIONS_CLASS_DESCRIPTOR =
"Lapp/revanced/integrations/patches/HideFloatingMicrophoneButtonPatch;"
}
}

View File

@@ -0,0 +1,42 @@
package app.revanced.patches.youtube.layout.hide.floatingmicrophone.patch
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.layout.hide.floatingmicrophone.annotations.HideFloatingMicrophoneButtonCompatibility
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
@HideFloatingMicrophoneButtonCompatibility
@Version("0.0.1")
class HideFloatingMicrophoneButtonResourcePatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult {
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
SwitchPreference(
"revanced_hide_floating_microphone_button",
StringResource(
"revanced_hide_floating_microphone_button_enabled_title",
"Hide floating microphone button"
),
true,
StringResource("revanced_hide_floating_microphone_button_summary_on", "Microphone button hidden"),
StringResource("revanced_hide_floating_microphone_button_summary_off", "Microphone button shown")
)
)
fabButtonId = ResourceMappingPatch.resourceMappings.find { it.type == "id" && it.name == "fab" }?.id
?: return PatchResultError("Can not find required fab button resource id")
return PatchResultSuccess()
}
internal companion object {
var fabButtonId: Long = -1
}
}

View File

@@ -19,11 +19,11 @@ import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
@Patch @Patch
@DependsOn([IntegrationsPatch::class, SettingsPatch::class]) @DependsOn([IntegrationsPatch::class, SettingsPatch::class])
@Name("hide-time") @Name("hide-timestamp")
@Description("Hides the videos time.") @Description("Hides timestamp in video player.")
@HideTimeCompatibility @HideTimeCompatibility
@Version("0.0.1") @Version("0.0.1")
class HideTimePatch : BytecodePatch( class HideTimestampPatch : BytecodePatch(
listOf( listOf(
TimeCounterFingerprint TimeCounterFingerprint
) )
@@ -31,17 +31,17 @@ class HideTimePatch : BytecodePatch(
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
SwitchPreference( SwitchPreference(
"revanced_hide_time", "revanced_hide_timestamp",
StringResource("revanced_hide_time_title", "Hide time"), StringResource("revanced_hide_timestamp_title", "Hide video timestamp"),
false, false,
StringResource("revanced_hide_time_summary_on", "Time is hidden"), StringResource("revanced_hide_timestamp_summary_on", "Timestamp is hidden"),
StringResource("revanced_hide_time_summary_off", "Time is shown") StringResource("revanced_hide_timestamp_summary_off", "Timestamp is shown")
) )
) )
TimeCounterFingerprint.result!!.mutableMethod.addInstructions( TimeCounterFingerprint.result!!.mutableMethod.addInstructions(
0, """ 0, """
invoke-static { }, Lapp/revanced/integrations/patches/HideTimePatch;->hideTime()Z invoke-static { }, Lapp/revanced/integrations/patches/HideTimestampPatch;->hideTimestamp()Z
move-result v0 move-result v0
if-eqz v0, :hide_time if-eqz v0, :hide_time
return-void return-void

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.Compatibility
import app.revanced.patcher.annotation.Package 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.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod 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.extensions.toErrorResult
import app.revanced.patcher.annotation.Description 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.patcher.patch.annotations.Patch
import app.revanced.patches.shared.settings.preference.impl.StringResource import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference 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.popup.annotations.PlayerPopupPanelsCompatibility
import app.revanced.patches.youtube.layout.panels.fullscreen.popup.fingerprints.EngagementPanelControllerFingerprint 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.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
@Patch @Patch
@DependsOn([IntegrationsPatch::class, SettingsPatch::class]) @DependsOn([IntegrationsPatch::class, SettingsPatch::class])
@Name("disable-fullscreen-panels-auto-popup") @Name("disable-player-popup-panels")
@Description("Disables fullscreen panels from appearing automatically when going fullscreen (playlist or live chat).") @Description("Disables panels from appearing automatically when going into fullscreen (playlist or live chat).")
@PlayerPopupPanelsCompatibility @PlayerPopupPanelsCompatibility
@Version("0.0.1") @Version("0.0.1")
class FullscreenPanelsPatch : BytecodePatch( class PlayerPopupPanelsPatch : BytecodePatch(
listOf( listOf(
EngagementPanelControllerFingerprint EngagementPanelControllerFingerprint
) )