Compare commits

...

8 Commits

Author SHA1 Message Date
semantic-release-bot
632b50e1fe chore(release): 2.191.0-dev.4 [skip ci]
# [2.191.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.3...v2.191.0-dev.4) (2023-09-14)

### Features

* **Twitch - Block embedded ads:** Switch from `ttv.lol` to `luminous.dev` ([2957d37](2957d3791a))
2023-09-14 21:25:36 +00:00
oSumAtrIX
2957d3791a feat(Twitch - Block embedded ads): Switch from ttv.lol to luminous.dev 2023-09-14 23:11:13 +02:00
semantic-release-bot
f894561817 chore(release): 2.191.0-dev.3 [skip ci]
# [2.191.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.2...v2.191.0-dev.3) (2023-09-14)

### Features

* **TU Dortmund:** Add `Show on lockscreen` patch ([#2947](https://github.com/ReVanced/revanced-patches/issues/2947)) ([04bc0f5](04bc0f54e3))
* **Tumblr:** Add `Disable blog notification reminder` patch ([74df205](74df205be5))
* **Tumblr:** Add `Disable gift message popup` patch ([3fc6453](3fc64530c5))
2023-09-14 01:15:14 +00:00
Traktores
04bc0f54e3 feat(TU Dortmund): Add Show on lockscreen patch (#2947)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-09-14 03:12:22 +02:00
Temm
3fc64530c5 feat(Tumblr): Add Disable gift message popup patch 2023-09-14 03:09:04 +02:00
Temm
74df205be5 feat(Tumblr): Add Disable blog notification reminder patch 2023-09-14 03:09:04 +02:00
oSumAtrIX
a09797710e docs: Add readme 2023-09-14 02:53:26 +02:00
oSumAtrIX
5f43afcbaf docs: Add contribution guidelines 2023-09-14 02:52:56 +02:00
15 changed files with 402 additions and 9 deletions

View File

@@ -1,3 +1,19 @@
# [2.191.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.3...v2.191.0-dev.4) (2023-09-14)
### Features
* **Twitch - Block embedded ads:** Switch from `ttv.lol` to `luminous.dev` ([0fe115e](https://github.com/ReVanced/revanced-patches/commit/0fe115e8f98ccdc86d318090fc92fe77cece1dd8))
# [2.191.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.2...v2.191.0-dev.3) (2023-09-14)
### Features
* **TU Dortmund:** Add `Show on lockscreen` patch ([#2947](https://github.com/ReVanced/revanced-patches/issues/2947)) ([9a18326](https://github.com/ReVanced/revanced-patches/commit/9a18326aeb68d7518594d0eab326ca845b9bdbdd))
* **Tumblr:** Add `Disable blog notification reminder` patch ([29f19b9](https://github.com/ReVanced/revanced-patches/commit/29f19b9378c7e167137f38fa4517ae19382ca4f6))
* **Tumblr:** Add `Disable gift message popup` patch ([a4d6b4e](https://github.com/ReVanced/revanced-patches/commit/a4d6b4e5ce6065d932f3895b4996e7dc1e5f7c67))
# [2.191.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.191.0-dev.1...v2.191.0-dev.2) (2023-09-11)

106
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,106 @@
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
src="assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<img height="24px" src="assets/revanced-logo/revanced-logo-round.svg" />
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</a>&nbsp;&nbsp;&nbsp;
<a href="https://twitter.com/revancedapp">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032018-6da37214-7474-4641-a1da-7af7db3a31cd.png" />
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/channel/UCLktAUh5Gza9zAJBStwxNdw">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</a>&nbsp;&nbsp;&nbsp;
<br>
<br>
Continuing the legacy of Vanced
</p>
# 📙 ReVanced Patches contribution guidelines
This document describes how to contribute to ReVanced Patches.
## 📖 Resources to help you get started
* The [documentation](https://github.com/ReVanced/revanced-patches/tree/docs/docs) provides the fundamentals of patches
and everything necessary to create your own patch from scratch
* [Our backlog](https://github.com/orgs/ReVanced/projects/12) is where we keep track of what we're working on
* [Issues](https://github.com/ReVanced/revanced-patches/issues) are where we keep track of bugs and feature requests
## 🙏 Submitting a patch request
Patches can be requested by opening an issue using the
[Patch request issue template](https://github.com/ReVanced/revanced-patches/issues/new?assignees=&labels=patch-request&projects=&template=patch-request.yml&title=feat%3A+).
> **Note**
> Requests can be accepted or rejected at the discretion of maintainers of ReVanced Patches.
> Good motivation has to be provided for a request to be accepted.
## 🐞 Submitting a bug report
If you encounter a bug while using ReVanced Patches, open an issue using the
[Bug report issue template](https://github.com/ReVanced/revanced-patches/issues/new?assignees=&labels=bug&projects=&template=bug-issue.yml&title=bug%3A+).
## 🧑‍⚖️ Guidelines for requesting or contributing patches
To maintain a high-quality and ethical collection of patches, the following guidelines for requesting
or contributing patches are effective as of September 14, 2023. Any patches present prior to this date
are unaffected by this change.
> **Note**
> We generally adhere to the guidelines outlined below. However, we may make exceptions
> in specific cases based on our discretion. Pull requests for patches that deviate from the guidelines
> will be evaluated individually. While a patch may not align with our general guidelines,
> we will consider its acceptance on a case-by-case basis, taking into account its impact on user experience
> and ethical considerations. We reserve the right to make exceptions for patches that provide significant value.
✅ Examples for acceptable patches include:
* Customizations: Feel free to contribute patches that allow users to personalize their experience
* Ad-Blocking: Patches aimed at enhancing user privacy and blocking intrusive advertisements are appreciated
* Feature additions: Patches that add new features or change behaviour to the app are welcome
❌ Examples for unacceptable patches include:
* Payment circumvention: We do not accept patches that exist solely to bypass payment for the app or any of its features
* Malicious patches: Patches that are malicious in nature are not allowed
## 📝 How to contribute
1. Before contributing, it is recommended to open an issue to discuss your change
with the maintainers of ReVanced Patches. This will help you determine whether your change is acceptable
and whether it is worth your time to implement it
2. Development happens on the `dev` branch. Fork the repository and create your branch from `dev`
3. Commit your changes. In case you are contributing a new patch, make sure to follow the conventions for patches
described in the [documentation](https://github.com/ReVanced/revanced-patches/tree/docs/docs)
4. Submit a pull request to the `dev` branch of the repository and reference issues
that your pull request closes in the description of your pull request
5. Our team will review your pull request and provide feedback. Once your pull request is approved,
it will be merged into the `dev` branch and will be included in the next release of ReVanced Patches
❤️ Thank you for considering contributing to ReVanced Patches,
ReVanced

View File

@@ -1,3 +1,91 @@
## 🧩 ReVanced Patches
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
src="assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<img height="24px" src="assets/revanced-logo/revanced-logo-round.svg" />
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</a>&nbsp;&nbsp;&nbsp;
<a href="https://twitter.com/revancedapp">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032018-6da37214-7474-4641-a1da-7af7db3a31cd.png" />
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/channel/UCLktAUh5Gza9zAJBStwxNdw">
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</a>&nbsp;&nbsp;&nbsp;
<br>
<br>
Continuing the legacy of Vanced
</p>
Patches for ReVanced.
# 🧩 ReVanced Patches
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/ReVanced/revanced-patches/release.yml)
![GPLv3 License](https://img.shields.io/badge/License-GPL%20v3-yellow.svg)
This repository contains a collection of ReVanced Patches.
## ❓ About
Patches are small modifications to Android apps that allow you to change the behaviour of or add new features,
block ads, customize the appearance, and much more.
## 💪 Features
Some of the features the patches provide are:
* 🚫 **Block ads**: Say goodbye to ads
***Customize your app**: Personalize the appearance of apps with various layouts and themes
* 🪄 **Add new features**: Extend the functionality of apps with lots of new features
* ⚙️ **Miscellaneous and general purpose**: Rename packages, enable debugging, disable screen capture restrictions,
export activities, etc.
***And much more!**
For a full list of all available patches, visit [revanced.app/patches](https://revanced.app/patches).
## 🚀 How to get started
You can use [ReVanced CLI](https://github.com/ReVanced/revanced-cli) or [ReVanced Manager](https://github.com/ReVanced/revanced-manager) to use ReVanced Patches.
## 📚 Everything else
### 📙 Contributing
Thank you for considering contributing to ReVanced Patches. You can find the contribution guidelines [here](CONTRIBUTING.md).
### 📃 Documentation
The documentation provides the fundamentals of patches and everything necessary to create your own patch from scratch.
You can find it [here](https://github.com/ReVanced/revanced-patches/tree/docs/docs).
### 🛠️ Building
In order to build ReVanced Patches, you can follow the [ReVanced documentation](https://github.com/ReVanced/revanced-documentation).
## 📜 Licence
ReVanced Patches is licensed under the GPLv3 licence. Please see the [licence file](LICENSE) for more information.
[tl;dr](https://www.tldrlegal.com/license/gnu-general-public-license-v3-gpl-3) you may copy, distribute and modify ReVanced patches as long as you track changes/dates in source files.
Any modifications to ReVanced Patches must also be made available under the GPL along with build & install instructions.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 800 800" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g id="Logo"><g id="Ring"><circle id="Ring-Background" serif:id="Ring Background" cx="400" cy="400" r="400" style="fill:#1b1b1b;"/><path id="Ring1" serif:id="Ring" d="M400,0c220.766,0 400,179.234 400,400c-0,220.766 -179.234,400 -400,400c-220.766,-0 -400,-179.234 -400,-400c0,-220.766 179.234,-400 400,-400Zm-0,36c200.897,-0 364,163.103 364,364c0,200.897 -163.103,364 -364,364c-200.897,0 -364,-163.103 -364,-364c-0,-200.897 163.103,-364 364,-364Z" style="fill:url(#_Linear1);"/></g><g id="Shape"><path id="V-Shape" serif:id="V Shape" d="M538.74,269.872c1.481,-3.382 1.157,-7.283 -0.863,-10.373c-2.021,-3.091 -5.464,-4.954 -9.156,-4.954c-5.148,0 -10.435,0 -14.165,0c-3.1,0 -5.907,1.834 -7.153,4.672c-12.468,28.396 -78.273,178.273 -100.25,228.328c-1.246,2.838 -4.053,4.671 -7.154,4.671c-3.1,0 -5.907,-1.833 -7.153,-4.671c-21.977,-50.055 -87.782,-199.932 -100.25,-228.328c-1.246,-2.838 -4.053,-4.672 -7.153,-4.672c-3.73,0 -9.017,0 -14.164,0c-3.693,0 -7.135,1.863 -9.156,4.954c-2.02,3.09 -2.344,6.991 -0.863,10.373c23.557,53.766 101.872,232.519 117.871,269.034c1.743,3.979 5.674,6.549 10.018,6.549c6.293,-0 15.408,-0 21.701,-0c4.344,-0 8.275,-2.57 10.018,-6.549c15.999,-36.515 94.315,-215.268 117.872,-269.034Z" style="fill:#fff;"/><path id="Diamond" d="M408.119,395.312c-1.675,2.901 -4.77,4.688 -8.119,4.688c-3.349,-0 -6.444,-1.787 -8.119,-4.688c-16.997,-29.44 -56.156,-97.264 -73.153,-126.704c-1.675,-2.901 -1.675,-6.474 0,-9.375c1.675,-2.901 4.77,-4.688 8.119,-4.688c33.995,0 112.311,0 146.306,0c3.349,0 6.444,1.787 8.119,4.688c1.675,2.901 1.675,6.474 -0,9.375c-16.997,29.44 -56.156,97.264 -73.153,126.704Z" style="fill:url(#_Linear2);"/></g></g><defs><linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(4.89859e-14,800,-800,4.89859e-14,400.001,3.31681e-10)"><stop offset="0" style="stop-color:#f04e98;stop-opacity:1"/><stop offset="0.5" style="stop-color:#5f65d4;stop-opacity:1"/><stop offset="1" style="stop-color:#4e98f0;stop-opacity:1"/></linearGradient><linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.77155e-14,289.317,-282.535,1.73003e-14,400,254.545)"><stop offset="0" style="stop-color:#f04e98;stop-opacity:1"/><stop offset="0.5" style="stop-color:#5f65d4;stop-opacity:1"/><stop offset="1" style="stop-color:#4e98f0;stop-opacity:1"/></linearGradient></defs></svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
kotlin.code.style = official
version = 2.191.0-dev.2
version = 2.191.0-dev.4

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,15 @@
package app.revanced.patches.tudortmund.lockscreen.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
object BrightnessFingerprint : MethodFingerprint(
returnType = "V",
accessFlags = AccessFlags.PUBLIC.value,
parameters = listOf(),
customFingerprint = { method, classDef ->
method.name == "run"
&& method.definingClass.contains("/ScreenPlugin\$")
&& classDef.fields.any { it.type == "Ljava/lang/Float;" }
}
)

View File

@@ -0,0 +1,93 @@
package app.revanced.patches.tudortmund.lockscreen.patch
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Package
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.annotations.RequiresIntegrations
import app.revanced.patches.tudortmund.lockscreen.fingerprints.BrightnessFingerprint
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.Instruction35c
import com.android.tools.smali.dexlib2.iface.reference.FieldReference
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
@Patch
@Name("Show on lockscreen")
@Description("Shows student id and student ticket on lockscreen.")
@Compatibility([Package("de.tudortmund.app")])
@RequiresIntegrations
class ShowOnLockscreenPatch : BytecodePatch(
listOf(BrightnessFingerprint)
) {
override fun execute(context: BytecodeContext) {
BrightnessFingerprint.result?.mutableMethod?.apply {
// Find the instruction where the brightness value is loaded into a register
val brightnessInstruction = implementation!!.instructions.firstNotNullOf { instruction ->
if (instruction.opcode != Opcode.IGET_OBJECT) return@firstNotNullOf null
val getInstruction = instruction as Instruction22c
val fieldReference = getInstruction.reference as FieldReference
if (fieldReference.type != "Ljava/lang/Float;") return@firstNotNullOf null
instruction
}
// Search for the instruction where we get the android.view.Window via the Activity.
// Gets the index of that instruction and the register of the Activity.
val (windowIndex, activityRegister) = implementation!!.instructions.withIndex()
.firstNotNullOf { (index, instruction) ->
if (instruction.opcode != Opcode.INVOKE_VIRTUAL)
return@firstNotNullOf null
val invokeInstruction = instruction as Instruction35c
val methodRef = invokeInstruction.reference as MethodReference
if (methodRef.name != "getWindow" || methodRef.returnType != "Landroid/view/Window;")
return@firstNotNullOf null
Pair(index, invokeInstruction.registerC)
}
// The register in which the brightness value is loaded
val brightnessRegister = brightnessInstruction.registerA
// Replaces the getWindow call with our custom one to run the lockscreen code
replaceInstruction(
windowIndex,
"invoke-static { v$activityRegister, v$brightnessRegister }, " +
"$INTEGRATIONS_CLASS_DESCRIPTOR->" +
"getWindow" +
"(Landroidx/appcompat/app/AppCompatActivity;F)" +
"Landroid/view/Window;"
)
// Normally, the brightness is loaded into a register after the getWindow call.
// In order to pass the brightness value to our custom getWindow implementation,
// we need to add the same instructions before the getWindow call.
// The Float object is loaded into the brightness register and gets converted to a float.
addInstructions(
windowIndex,
"""
invoke-virtual { v$brightnessRegister }, Ljava/lang/Float;->floatValue()F
move-result v$brightnessRegister
"""
)
addInstruction(windowIndex, brightnessInstruction)
} ?: throw BrightnessFingerprint.exception
}
private companion object {
const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/tudortmund/lockscreen/ShowOnLockscreenPatch;"
}
}

View File

@@ -0,0 +1,9 @@
package app.revanced.patches.tumblr.annoyances.notifications.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
// The BlogNotifyCtaDialog asks you if you want to enable notifications for a blog.
// It shows whenever you visit a certain blog for the second time and disables itself
// if it was shown a total of 3 times (stored in app storage).
// This targets the BlogNotifyCtaDialog.isEnabled() method to let it always return false.
object IsBlogNotifyEnabledFingerprint : MethodFingerprint(strings = listOf("isEnabled --> ", "blog_notify_enabled"))

View File

@@ -0,0 +1,30 @@
package app.revanced.patches.tumblr.annoyances.notifications.patch
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Package
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.tumblr.annoyances.notifications.fingerprints.IsBlogNotifyEnabledFingerprint
@Patch
@Name("Disable blog notification reminder")
@Description("Disables the reminder to enable notifications for blogs you visit.")
@Compatibility([Package("com.tumblr")])
class DisableBlogNotificationReminderPatch : BytecodePatch(
listOf(IsBlogNotifyEnabledFingerprint)
) {
override fun execute(context: BytecodeContext) =
IsBlogNotifyEnabledFingerprint.result?.mutableMethod?.addInstructions(
0,
"""
# Return false for BlogNotifyCtaDialog.isEnabled() method.
const/4 v0, 0x0
return v0
"""
) ?: throw IsBlogNotifyEnabledFingerprint.exception
}

View File

@@ -0,0 +1,9 @@
package app.revanced.patches.tumblr.annoyances.popups.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
// This method is responsible for loading and displaying the visual Layout of the Gift Message Popup.
object ShowGiftMessagePopupFingerprint : MethodFingerprint(
strings = listOf("activity", "anchorView"),
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("GiftMessagePopup;") }
)

View File

@@ -0,0 +1,24 @@
package app.revanced.patches.tumblr.annoyances.popups.patch
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Package
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.tumblr.annoyances.popups.fingerprints.ShowGiftMessagePopupFingerprint
@Patch
@Name("Disable gift message popup")
@Description("Disables the popup suggesting to buy TumblrMart items for other people.")
@Compatibility([Package("com.tumblr")])
class DisableGiftMessagePopupPatch : BytecodePatch(
listOf(ShowGiftMessagePopupFingerprint)
) {
override fun execute(context: BytecodeContext) =
ShowGiftMessagePopupFingerprint.result?.mutableMethod?.addInstructions(0, "return-void")
?: throw ShowGiftMessagePopupFingerprint.exception
}

View File

@@ -3,8 +3,8 @@ package app.revanced.patches.twitch.ad.embedded.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.annotations.DependsOn
@@ -21,7 +21,7 @@ import app.revanced.patches.twitch.misc.settings.bytecode.patch.SettingsPatch
@Patch
@DependsOn([VideoAdsPatch::class, IntegrationsPatch::class, SettingsPatch::class])
@Name("Block embedded ads")
@Description("Blocks embedded stream ads using services like TTV.lol or PurpleAdBlocker.")
@Description("Blocks embedded stream ads using services like Luminous or PurpleAdBlocker.")
@EmbeddedAdsCompatibility
class EmbeddedAdsPatch : BytecodePatch(
listOf(CreateUsherClientFingerprint)
@@ -50,7 +50,7 @@ class EmbeddedAdsPatch : BytecodePatch(
"revanced_hls_proxies",
listOf(
StringResource("revanced_proxy_disabled", "Disabled"),
StringResource("revanced_proxy_ttv_lol", "TTV LOL proxy"),
StringResource("revanced_proxy_luminous", "Luminous proxy"),
StringResource("revanced_proxy_purpleadblock", "PurpleAdBlock proxy"),
)
),
@@ -58,11 +58,11 @@ class EmbeddedAdsPatch : BytecodePatch(
"revanced_hls_proxies_values",
listOf(
StringResource("key_revanced_proxy_disabled", "disabled"),
StringResource("key_revanced_proxy_ttv_lol", "ttv-lol"),
StringResource("key_revanced_proxy_luminous", "luminous"),
StringResource("key_revanced_proxy_purpleadblock", "purpleadblock")
)
),
default = "ttv-lol"
default = "luminous"
)
)