Compare commits

..

13 Commits

Author SHA1 Message Date
semantic-release-bot
cc197735fe chore(release): 2.164.0-dev.1 [skip ci]
# [2.164.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.163.0...v2.164.0-dev.1) (2023-02-22)

### Features

* **photomath:** `unlock-plus` patch ([#1633](https://github.com/revanced/revanced-patches/issues/1633)) ([8158388](81583886b6))
* **youtube:** remove patch `open-links-directly` ([725ff39](725ff39997))
2023-02-22 15:36:55 +00:00
oSumAtrIX
725ff39997 feat(youtube): remove patch open-links-directly
The patch did not serve any real purpose

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-22 16:23:07 +01:00
nik2143
81583886b6 feat(photomath): unlock-plus patch (#1633)
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-22 16:23:07 +01:00
semantic-release-bot
37d22d8dc7 chore(release): 2.163.0 [skip ci]
# [2.163.0](https://github.com/revanced/revanced-patches/compare/v2.162.0...v2.163.0) (2023-02-22)

### Bug Fixes

* **tiktok/show-seekbar:** fix crash when showing seekbar ([#1643](https://github.com/revanced/revanced-patches/issues/1643)) ([1e2b0cd](1e2b0cd8c4))
* **twitter:** make `hide-promoted-ads` patch compatible with any version ([531d491](531d4913ab))
* use correct fingerprint ([b2e4691](b2e4691e88))
* **youtube/disable-fullscreen-panels-auto-popup:** use proper descriptions ([115025f](115025f5d0))
* **youtube/general-ads:** fix switch description wording ([9ac0977](9ac0977427))
* **youtube/hide-time:** use correct integrations class ([5a7ce48](5a7ce48847))
* **youtube/hide-watch-in-vr:** fix descriptions ([fd62566](fd62566cbf))
* **youtube/open-links-directly:** reference correct integrations method ([98df006](98df006527))

### Features

* **androidtwelvewidgets:** `unlock-paid-widgets` patch ([#1641](https://github.com/revanced/revanced-patches/issues/1641)) ([942b424](942b424fc9))
* **music:** remove patches constraint on app version ([#1638](https://github.com/revanced/revanced-patches/issues/1638)) ([3c37ccc](3c37ccce87))
* **twitter:** `hide-recommended-users` patch ([72d8316](72d8316ed2))
* **twitter:** constrain patches compatibility to working versions ([#1646](https://github.com/revanced/revanced-patches/issues/1646)) ([4fd1487](4fd1487469))
* use better patch descriptions ([3153f73](3153f73ceb))
* **youtube/general-ads:** hide channel bar ([d8d24a8](d8d24a8dd1))
* **youtube/general-ads:** hide horizontal video shelf ([5a62eb1](5a62eb1a28))
* **youtube/open-links-directly:** skip every redirect url ([547e7cc](547e7cc119))
2023-02-22 05:52:10 +00:00
oSumAtrIX
b7ccf85a2f chore: merge branch dev to main (#1639) 2023-02-22 06:49:34 +01:00
oSumAtrIX
154dcf6cb4 ci: add backmerge target branch
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-22 06:45:15 +01:00
semantic-release-bot
b110348af0 chore(release): 2.163.0-dev.5 [skip ci]
# [2.163.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.163.0-dev.4...v2.163.0-dev.5) (2023-02-22)

### Bug Fixes

* use correct fingerprint ([b2e4691](b2e4691e88))
* **youtube/hide-time:** use correct integrations class ([5a7ce48](5a7ce48847))

### Features

* use better patch descriptions ([3153f73](3153f73ceb))
2023-02-22 05:11:10 +00:00
oSumAtrIX
3153f73ceb feat: use better patch descriptions
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-22 06:08:57 +01:00
oSumAtrIX
5ca5d4c64a refactor(youtube/hide-info-cards): fix casing
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-22 06:06:00 +01:00
oSumAtrIX
5a7ce48847 fix(youtube/hide-time): use correct integrations class
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-22 05:59:15 +01:00
oSumAtrIX
dfccd1cc0a refactor(youtube/hide-time): use correct label name
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-22 05:59:00 +01:00
oSumAtrIX
0606f3a9be refactor(youtube/hide-seekbar): use correct label name
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-22 05:58:48 +01:00
oSumAtrIX
b2e4691e88 fix: use correct fingerprint
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-02-22 05:55:29 +01:00
26 changed files with 241 additions and 141 deletions

View File

@@ -39,7 +39,7 @@
[
"@saithodev/semantic-release-backmerge",
{
backmergeBranches: ["dev"],
backmergeBranches: [{"from": "dev", "to": "main"}],
clearWorkspace: true
}
]

View File

@@ -1,3 +1,50 @@
# [2.164.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.163.0...v2.164.0-dev.1) (2023-02-22)
### Features
* **photomath:** `unlock-plus` patch ([#1633](https://github.com/revanced/revanced-patches/issues/1633)) ([a673514](https://github.com/revanced/revanced-patches/commit/a673514f848e583513924a6a9b8cfbb56153cc3a))
* **youtube:** remove patch `open-links-directly` ([79291a0](https://github.com/revanced/revanced-patches/commit/79291a0d34bd9514cbef5d97c21c59dfbffad287))
# [2.163.0](https://github.com/revanced/revanced-patches/compare/v2.162.0...v2.163.0) (2023-02-22)
### Bug Fixes
* **tiktok/show-seekbar:** fix crash when showing seekbar ([#1643](https://github.com/revanced/revanced-patches/issues/1643)) ([160b716](https://github.com/revanced/revanced-patches/commit/160b71644dfdf8efd1f19cdf8e9f572fe1b86d9d))
* **twitter:** make `hide-promoted-ads` patch compatible with any version ([3dbc5ff](https://github.com/revanced/revanced-patches/commit/3dbc5ff2722559211232999ae29e7fabafe3b857))
* use correct fingerprint ([84fe9c3](https://github.com/revanced/revanced-patches/commit/84fe9c36461586f25ace146e0e29597e3dfc99ca))
* **youtube/disable-fullscreen-panels-auto-popup:** use proper descriptions ([4c82487](https://github.com/revanced/revanced-patches/commit/4c824876b45e32c5b79a9817b0a362f31bd13879))
* **youtube/general-ads:** fix switch description wording ([9003977](https://github.com/revanced/revanced-patches/commit/9003977c00d8056c38fd31476d2e367fb3aa9030))
* **youtube/hide-time:** use correct integrations class ([539ccf4](https://github.com/revanced/revanced-patches/commit/539ccf43a884ab3ff812884279aa75f42ba872d5))
* **youtube/hide-watch-in-vr:** fix descriptions ([f261e64](https://github.com/revanced/revanced-patches/commit/f261e64b10db9cddee2a850feab16c8c7092c333))
* **youtube/open-links-directly:** reference correct integrations method ([e14893e](https://github.com/revanced/revanced-patches/commit/e14893ec89d002287123196396946fff557b7ef4))
### Features
* **androidtwelvewidgets:** `unlock-paid-widgets` patch ([#1641](https://github.com/revanced/revanced-patches/issues/1641)) ([44b74ae](https://github.com/revanced/revanced-patches/commit/44b74ae268c3f534dbaecc0adc00767e9b9c0e51))
* **music:** remove patches constraint on app version ([#1638](https://github.com/revanced/revanced-patches/issues/1638)) ([fe64881](https://github.com/revanced/revanced-patches/commit/fe64881c83a7dd42761dbd67689fbc0ddcb73d78))
* **twitter:** `hide-recommended-users` patch ([e8c9a91](https://github.com/revanced/revanced-patches/commit/e8c9a91a92fafcc79ce521f62c3865827df55d0f))
* **twitter:** constrain patches compatibility to working versions ([#1646](https://github.com/revanced/revanced-patches/issues/1646)) ([d984bdc](https://github.com/revanced/revanced-patches/commit/d984bdc8b17dea127880b696ee1bed1503762707))
* use better patch descriptions ([931aa0f](https://github.com/revanced/revanced-patches/commit/931aa0fba631d1740986131219eff94c4c1b2306))
* **youtube/general-ads:** hide channel bar ([c74c77d](https://github.com/revanced/revanced-patches/commit/c74c77d12568dda54d971d1998f7e73a45543a3b))
* **youtube/general-ads:** hide horizontal video shelf ([169e2ba](https://github.com/revanced/revanced-patches/commit/169e2ba67024210450ef6cc74e734d3e7f162cbe))
* **youtube/open-links-directly:** skip every redirect url ([f155e26](https://github.com/revanced/revanced-patches/commit/f155e261d4973d304c57e0144ddd8e115e6103ee))
# [2.163.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.163.0-dev.4...v2.163.0-dev.5) (2023-02-22)
### Bug Fixes
* use correct fingerprint ([84fe9c3](https://github.com/revanced/revanced-patches/commit/84fe9c36461586f25ace146e0e29597e3dfc99ca))
* **youtube/hide-time:** use correct integrations class ([539ccf4](https://github.com/revanced/revanced-patches/commit/539ccf43a884ab3ff812884279aa75f42ba872d5))
### Features
* use better patch descriptions ([931aa0f](https://github.com/revanced/revanced-patches/commit/931aa0fba631d1740986131219eff94c4c1b2306))
# [2.163.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.163.0-dev.3...v2.163.0-dev.4) (2023-02-22)

View File

@@ -36,7 +36,7 @@ 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-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-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-player-buttons` | Adds the option to hide video player previous and next buttons. | all |
| `hide-seekbar` | Hides the seekbar. | 18.03.36 |
@@ -48,7 +48,6 @@ The official Patch bundle provided by ReVanced and the community.
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 18.03.36 |
| `minimized-playback` | Enables minimized and background playback. | 18.03.36 |
| `old-quality-layout` | Enables the original video quality flyout in the video player settings | 18.03.36 |
| `open-links-directly` | Skips over redirection URLs to external links. | 18.03.36 |
| `open-links-externally` | Open links outside of the app directly in your browser. | 18.03.36 |
| `premium-heading` | Shows premium branding on the home screen. | all |
| `remember-playback-rate` | Adds the ability to remember the playback rate you chose in the video playback rate flyout. | 18.03.36 |
@@ -264,6 +263,14 @@ The official Patch bundle provided by ReVanced and the community.
| `unlock-paid-widgets` | Unlocks paid widgets of the app | all |
</details>
### [📦 `com.microblink.photomath`](https://play.google.com/store/apps/details?id=com.microblink.photomath)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-plus` | Unlocks plus features. | all |
</details>
### [📦 `io.yuka.android`](https://play.google.com/store/apps/details?id=io.yuka.android)
<details>

View File

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

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,9 @@
package app.revanced.patches.photomath.detection.signature.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("com.microblink.photomath")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class DisableSignatureDetectionCompatibility

View File

@@ -0,0 +1,21 @@
package app.revanced.patches.photomath.detection.signature.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.Opcode
object CheckSignatureFingerprint : MethodFingerprint(
strings = listOf(
"currentSignature"
),
opcodes = listOf(
Opcode.CONST_STRING,
Opcode.CONST_STRING,
Opcode.INVOKE_STATIC,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT,
)
)

View File

@@ -0,0 +1,13 @@
package app.revanced.patches.photomath.detection.signature.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
object MainOnCreateFingerprint : MethodFingerprint(
returnType = "V",
access = AccessFlags.PUBLIC or AccessFlags.FINAL,
customFingerprint = { methodDef ->
methodDef.definingClass == "Lcom/microblink/photomath/PhotoMath;" && methodDef.name == "onCreate"
}
)

View File

@@ -0,0 +1,42 @@
package app.revanced.patches.photomath.detection.signature.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.instruction
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patches.photomath.detection.signature.annotations.DisableSignatureDetectionCompatibility
import app.revanced.patches.photomath.detection.signature.fingerprints.CheckSignatureFingerprint
import app.revanced.patches.photomath.detection.signature.fingerprints.MainOnCreateFingerprint
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Description("Disables detection of incorrect signature.")
@DisableSignatureDetectionCompatibility
@Version("0.0.1")
class SignatureDetectionPatch : BytecodePatch(
listOf(
MainOnCreateFingerprint
)
) {
override fun execute(context: BytecodeContext): PatchResult {
val mainOnCreate = MainOnCreateFingerprint.result!!
val patternResult = CheckSignatureFingerprint.also {
it.resolve(context, mainOnCreate.method, mainOnCreate.classDef)
}.result!!.scanResult.patternScanResult!!
mainOnCreate.mutableMethod.apply {
val signatureCheckInstruction = instruction(patternResult.endIndex)
val checkRegister = (signatureCheckInstruction as OneRegisterInstruction).registerA
replaceInstruction(signatureCheckInstruction.location.index, "const/4 v$checkRegister, 0x1")
}
return PatchResultSuccess()
}
}

View File

@@ -0,0 +1,9 @@
package app.revanced.patches.photomath.misc.unlockplus.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("com.microblink.photomath")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class UnlockPlusCompatibilty

View File

@@ -0,0 +1,16 @@
package app.revanced.patches.photomath.misc.unlockplus.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
object IsPlusUnlockedFingerprint : MethodFingerprint(
returnType = "Z",
access = AccessFlags.PUBLIC or AccessFlags.FINAL,
strings = listOf(
"genius"
),
customFingerprint = {
methodDef -> methodDef.definingClass.endsWith("/User;")
}
)

View File

@@ -0,0 +1,43 @@
package app.revanced.patches.photomath.misc.unlockplus.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.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.photomath.detection.signature.patch.SignatureDetectionPatch
import app.revanced.patches.photomath.misc.unlockplus.annotations.UnlockPlusCompatibilty
import app.revanced.patches.photomath.misc.unlockplus.fingerprints.IsPlusUnlockedFingerprint
@Patch
@Name("unlock-plus")
@DependsOn([SignatureDetectionPatch::class])
@Description("Unlocks plus features.")
@UnlockPlusCompatibilty
@Version("0.0.1")
class UnlockPlusPatch : BytecodePatch(
listOf(
IsPlusUnlockedFingerprint
)
) {
override fun execute(context: BytecodeContext): PatchResult {
IsPlusUnlockedFingerprint.result?.mutableMethod?.apply {
addInstructions(
0,
"""
const/4 v0, 0x1
return v0
"""
)
} ?: return IsPlusUnlockedFingerprint.toErrorResult()
return PatchResultSuccess()
}
}

View File

@@ -180,10 +180,10 @@ class GeneralAdsResourcePatch : ResourcePatch {
),
SwitchPreference(
"revanced_adremover_info_panel",
StringResource("revanced_adremover_info_panel_enabled_title", "Hide info-panels"),
StringResource("revanced_adremover_info_panel_enabled_title", "Hide info panels"),
true,
StringResource("revanced_adremover_info_panel_enabled_summary_on", "Info-panels are hidden"),
StringResource("revanced_adremover_info_panel_enabled_summary_off", "Info-panels are shown")
StringResource("revanced_adremover_info_panel_enabled_summary_on", "Info panels are hidden"),
StringResource("revanced_adremover_info_panel_enabled_summary_off", "Info panels are shown")
),
SwitchPreference(
"revanced_adremover_medical_panel",

View File

@@ -34,10 +34,10 @@ class AutoCaptionsPatch : BytecodePatch(
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
SwitchPreference(
"revanced_autocaptions_enabled",
StringResource("revanced_autocaptions_enabled_title", "Disable auto-captions"),
StringResource("revanced_autocaptions_enabled_title", "Disable auto captions"),
false,
StringResource("revanced_autocaptions_summary_on", "Auto-captions are disabled"),
StringResource("revanced_autocaptions_summary_off", "Auto-captions are enabled")
StringResource("revanced_autocaptions_summary_on", "Auto captions are disabled"),
StringResource("revanced_autocaptions_summary_off", "Auto captions are enabled")
)
)

View File

@@ -10,10 +10,10 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patches.music.layout.upgradebutton.fingerprints.PivotBarConstructorFingerprint
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
import app.revanced.patches.youtube.layout.buttons.pivotbar.shared.annotations.PivotBarCompatibility
import app.revanced.patches.youtube.layout.buttons.pivotbar.shared.fingerprints.InitializeButtonsFingerprint
import app.revanced.patches.youtube.layout.buttons.pivotbar.shared.fingerprints.PivotBarConstructorFingerprint
@DependsOn([ResourceMappingPatch::class])
@PivotBarCompatibility

View File

@@ -44,11 +44,11 @@ class HidePlayerButtonsPatch : BytecodePatch(
false,
StringResource(
"revanced_hide_player_buttons_summary_on",
"The buttons are hidden"
"Buttons are hidden"
),
StringResource(
"revanced_hide_player_buttons_summary_off",
"The buttons are shown"
"Buttons are shown"
)
)
)

View File

@@ -28,10 +28,10 @@ class HideEndscreenCardsResourcePatch : ResourcePatch {
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
SwitchPreference(
"revanced_hide_endscreen_cards",
StringResource("revanced_hide_endscreen_cards_title", "Hide end-screen cards"),
StringResource("revanced_hide_endscreen_cards_title", "Hide end screen cards"),
true,
StringResource("revanced_hide_endscreen_cards_summary_on", "End-screen cards are hidden"),
StringResource("revanced_hide_endscreen_cards_summary_off", "End-screen cards are shown")
StringResource("revanced_hide_endscreen_cards_summary_on", "End screen cards are hidden"),
StringResource("revanced_hide_endscreen_cards_summary_off", "End screen cards are shown")
),
)

View File

@@ -25,10 +25,10 @@ import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
@Patch
@DependsOn([IntegrationsPatch::class, HideInfocardsResourcePatch::class])
@Name("hide-info-cards")
@Description("Hides info-cards in videos.")
@Description("Hides info cards in videos.")
@HideInfocardsCompatibility
@Version("0.0.1")
class HideInfocardsPatch : BytecodePatch(
class HideInfoCardsPatch : BytecodePatch(
listOf(
InfocardsIncognitoParentFingerprint,
InfocardsMethodCallFingerprint,
@@ -47,7 +47,7 @@ class HideInfocardsPatch : BytecodePatch(
addInstructions(
invokeInstructionIndex,
"invoke-static {v${(instruction(invokeInstructionIndex) as? BuilderInstruction35c)?.registerC}}," +
" Lapp/revanced/integrations/patches/HideInfocardsPatch;->hideInfocardsIncognito(Landroid/view/View;)V"
" Lapp/revanced/integrations/patches/HideInfoCardsPatch;->hideInfoCardsIncognito(Landroid/view/View;)V"
)
}
@@ -59,7 +59,7 @@ class HideInfocardsPatch : BytecodePatch(
hideInfocardsCallMethod.addInstructions(
invokeInterfaceIndex, """
invoke-static {}, Lapp/revanced/integrations/patches/HideInfocardsPatch;->hideInfocardsMethodCall()Z
invoke-static {}, Lapp/revanced/integrations/patches/HideInfoCardsPatch;->hideInfoCardsMethodCall()Z
move-result v$toggleRegister
if-nez v$toggleRegister, :hide_info_cards
""",

View File

@@ -24,10 +24,10 @@ class HideInfocardsResourcePatch : ResourcePatch {
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
SwitchPreference(
"revanced_hide_infocards",
StringResource("revanced_hide_infocards_title", "Hide info-cards"),
StringResource("revanced_hide_infocards_title", "Hide info cards"),
true,
StringResource("revanced_hide_infocards_summary_on", "Info-cards are hidden"),
StringResource("revanced_hide_infocards_summary_off", "Info-cards are shown")
StringResource("revanced_hide_infocards_summary_on", "Info cards are hidden"),
StringResource("revanced_hide_infocards_summary_off", "Info cards are shown")
)
)

View File

@@ -46,9 +46,9 @@ class HideSeekbarPatch : BytecodePatch(
const/4 v0, 0x0
invoke-static { }, Lapp/revanced/integrations/patches/HideSeekbarPatch;->hideSeekbar()Z
move-result v0
if-eqz v0, :hide_time_and_seekbar
if-eqz v0, :hide_seekbar
return-void
:hide_time_and_seekbar
:hide_seekbar
nop
"""
)

View File

@@ -41,11 +41,11 @@ class HideTimePatch : BytecodePatch(
TimeCounterFingerprint.result!!.mutableMethod.addInstructions(
0, """
invoke-static { }, Lapp/revanced/integrations/patches/HideTimeAndSeekbarPatch;->hideTimeAndSeekbar()Z
invoke-static { }, Lapp/revanced/integrations/patches/HideTimePatch;->hideTime()Z
move-result v0
if-eqz v0, :hide_time_and_seekbar
if-eqz v0, :hide_time
return-void
:hide_time_and_seekbar
:hide_time
nop
"""
)

View File

@@ -13,6 +13,8 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.layout.tabletminiplayer.annotations.TabletMiniPlayerCompatibility
import app.revanced.patches.youtube.layout.tabletminiplayer.fingerprints.MiniPlayerDimensionsCalculatorFingerprint
import app.revanced.patches.youtube.layout.tabletminiplayer.fingerprints.MiniPlayerOverrideFingerprint
@@ -20,8 +22,6 @@ import app.revanced.patches.youtube.layout.tabletminiplayer.fingerprints.MiniPla
import app.revanced.patches.youtube.layout.tabletminiplayer.fingerprints.MiniPlayerResponseModelSizeCheckFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Patch
@@ -40,10 +40,10 @@ class TabletMiniPlayerPatch : BytecodePatch(
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
SwitchPreference(
"revanced_tablet_miniplayer",
StringResource("revanced_tablet_miniplayer_title", "Enable the tablet Mini-player"),
StringResource("revanced_tablet_miniplayer_title", "Enable tablet mini player"),
false,
StringResource("revanced_tablet_miniplayer_summary_on", "Tablet Mini-player is enabled"),
StringResource("revanced_tablet_miniplayer_summary_off", "Tablet Mini-player is disabled")
StringResource("revanced_tablet_miniplayer_summary_on", "Mini player is enabled"),
StringResource("revanced_tablet_miniplayer_summary_off", "Mini player is disabled")
)
)

View File

@@ -1,13 +0,0 @@
package app.revanced.patches.youtube.misc.openlinksdirectly.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 OpenLinksDirectlyCompatibility

View File

@@ -1,19 +0,0 @@
package app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.openlinksdirectly.annotations.OpenLinksDirectlyCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@OpenLinksDirectlyCompatibility
object OpenLinksDirectlyPrimaryFingerprint : MethodFingerprint(
"L", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf(
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.RETURN_OBJECT,
Opcode.CHECK_CAST,
Opcode.SGET,
Opcode.SGET_OBJECT
)
)

View File

@@ -1,14 +0,0 @@
package app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.openlinksdirectly.annotations.OpenLinksDirectlyCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@OpenLinksDirectlyCompatibility
object OpenLinksDirectlySecondaryFingerprint : MethodFingerprint(
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), listOf(
Opcode.INVOKE_STATIC, Opcode.MOVE_RESULT_OBJECT
), listOf("://")
)

View File

@@ -1,61 +0,0 @@
package app.revanced.patches.youtube.misc.openlinksdirectly.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.instruction
import app.revanced.patcher.extensions.replaceInstruction
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.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.openlinksdirectly.annotations.OpenLinksDirectlyCompatibility
import app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints.OpenLinksDirectlyPrimaryFingerprint
import app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints.OpenLinksDirectlySecondaryFingerprint
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
@Patch
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
@Name("open-links-directly")
@Description("Skips over redirection URLs to external links.")
@OpenLinksDirectlyCompatibility
@Version("0.0.1")
class OpenLinksDirectlyPatch : BytecodePatch(
listOf(OpenLinksDirectlyPrimaryFingerprint, OpenLinksDirectlySecondaryFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
SettingsPatch.PreferenceScreen.MISC.addPreferences(
SwitchPreference(
"revanced_uri_redirect",
StringResource("revanced_uri_redirect_title", "Bypass URL redirects"),
true,
StringResource("revanced_uri_redirect_summary_on", "Bypassing URL redirects"),
StringResource("revanced_uri_redirect_summary_off", "Following default redirect policy")
)
)
arrayOf(OpenLinksDirectlyPrimaryFingerprint, OpenLinksDirectlySecondaryFingerprint)
.map { it.result ?: return it.toErrorResult() }
.forEach { result ->
result.mutableMethod.apply {
val insertIndex = result.scanResult.patternScanResult!!.startIndex
val uriRegister = (instruction(insertIndex) as Instruction35c).registerC
replaceInstruction(
insertIndex,
"invoke-static {v$uriRegister}," +
"Lapp/revanced/integrations/patches/OpenLinksDirectlyPatch;" +
"->" +
"parseRedirectUri(Ljava/lang/String;)Landroid/net/Uri;"
)
}
}
return PatchResultSuccess()
}
}