mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-20 17:43:56 +00:00
Compare commits
9 Commits
v4.3.0-dev
...
v4.3.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d33d7d8f35 | ||
|
|
3200da8657 | ||
|
|
348e42a374 | ||
|
|
cbbac445b6 | ||
|
|
1593d1352a | ||
|
|
c6fedaa7bc | ||
|
|
d070aebec4 | ||
|
|
d583256f06 | ||
|
|
fc67d284f7 |
2
.github/workflows/build_pull_request.yml
vendored
2
.github/workflows/build_pull_request.yml
vendored
@@ -20,4 +20,6 @@ jobs:
|
|||||||
uses: burrunan/gradle-cache-action@v1
|
uses: burrunan/gradle-cache-action@v1
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: ./gradlew build --no-daemon
|
run: ./gradlew build --no-daemon
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
# [4.3.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v4.3.0-dev.4...v4.3.0-dev.5) (2024-02-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Remove unnecessary description from patch ([1a89dd9](https://github.com/ReVanced/revanced-patches/commit/1a89dd9f8cd0c614055a9da97338839b77a25ed1))
|
||||||
|
* **Twitter - Unlock downloads:** Unlock GIF downloads ([d0f91c8](https://github.com/ReVanced/revanced-patches/commit/d0f91c8550592723e1252e1af2971b508591dd59))
|
||||||
|
|
||||||
# [4.3.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v4.3.0-dev.3...v4.3.0-dev.4) (2024-02-22)
|
# [4.3.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v4.3.0-dev.3...v4.3.0-dev.4) (2024-02-22)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ This document describes how to contribute to ReVanced Patches.
|
|||||||
|
|
||||||
## 📖 Resources to help you get started
|
## 📖 Resources to help you get started
|
||||||
|
|
||||||
* The [documentation](https://github.com/ReVanced/revanced-patches/tree/docs/docs) provides the fundamentals of patches
|
* The [documentation](https://github.com/ReVanced/revanced-patcher/tree/docs/docs) contains the fundamentals
|
||||||
and everything necessary to create your own patch from scratch
|
of ReVanced Patcher and how to use ReVanced Patcher to create patches
|
||||||
* [Our backlog](https://github.com/orgs/ReVanced/projects/12) is where we keep track of what we're working on
|
* [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
|
* [Issues](https://github.com/ReVanced/revanced-patches/issues) are where we keep track of bugs and feature requests
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ are unaffected by this change.
|
|||||||
|
|
||||||
## 📝 How to contribute
|
## 📝 How to contribute
|
||||||
|
|
||||||
1. Before contributing, it is recommended to open an issue to discuss your change
|
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
|
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
|
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`
|
2. Development happens on the `dev` branch. Fork the repository and create your branch from `dev`
|
||||||
|
|||||||
20
README.md
20
README.md
@@ -67,7 +67,7 @@ This repository contains a collection of ReVanced Patches.
|
|||||||
|
|
||||||
## ❓ About
|
## ❓ About
|
||||||
|
|
||||||
Patches are small modifications to Android apps that allow you to change the behaviour of or add new features,
|
Patches are small modifications to Android apps that allow you to change the behavior of or add new features,
|
||||||
block ads, customize the appearance, and much more.
|
block ads, customize the appearance, and much more.
|
||||||
|
|
||||||
## 💪 Features
|
## 💪 Features
|
||||||
@@ -77,11 +77,11 @@ Some of the features the patches provide are:
|
|||||||
* 🚫 **Block ads**: Say goodbye to ads
|
* 🚫 **Block ads**: Say goodbye to ads
|
||||||
* ⭐ **Customize your app**: Personalize the appearance of apps with various layouts and themes
|
* ⭐ **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
|
* 🪄 **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,
|
* ⚙️ **Miscellaneous and general purpose**: Rename packages, enable debugging, disable screen capture restrictions,
|
||||||
export activities, etc.
|
export activities, etc.
|
||||||
* ✨ **And much more!**
|
* ✨ **And much more!**
|
||||||
|
|
||||||
For a full list of all available patches, visit [revanced.app/patches](https://revanced.app/patches).
|
For a complete list of all available patches, visit [revanced.app/patches](https://revanced.app/patches).
|
||||||
|
|
||||||
## 🚀 How to get started
|
## 🚀 How to get started
|
||||||
|
|
||||||
@@ -93,17 +93,13 @@ You can use [ReVanced CLI](https://github.com/ReVanced/revanced-cli) or [ReVance
|
|||||||
|
|
||||||
Thank you for considering contributing to ReVanced Patches. You can find the contribution guidelines [here](CONTRIBUTING.md).
|
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
|
### 🛠️ Building
|
||||||
|
|
||||||
In order to build ReVanced Patches, you can follow the [ReVanced documentation](https://github.com/ReVanced/revanced-documentation).
|
To build ReVanced Patches, you can follow the [ReVanced documentation](https://github.com/ReVanced/revanced-documentation).
|
||||||
|
|
||||||
## 📜 Licence
|
## 📜 Licence
|
||||||
|
|
||||||
ReVanced Patches is licensed under the GPLv3 licence. Please see the [licence file](LICENSE) for more information.
|
ReVanced Patches is licensed under the GPLv3 license. Please see the [license 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.
|
[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.
|
Any modifications to ReVanced Patches must also be made available under the GPL,
|
||||||
|
along with build & install instructions.
|
||||||
@@ -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 = 4.3.0-dev.4
|
version = 4.3.0-dev.5
|
||||||
|
|||||||
@@ -2,27 +2,36 @@ package app.revanced.patches.twitter.interaction.downloads
|
|||||||
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstructions
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstructions
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
||||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
import app.revanced.patcher.fingerprint.MethodFingerprintResult
|
import app.revanced.patcher.fingerprint.MethodFingerprintResult
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
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.patches.twitter.interaction.downloads.fingerprints.BuildMediaOptionsSheetFingerprint
|
||||||
import app.revanced.patches.twitter.interaction.downloads.fingerprints.ConstructMediaOptionsSheetFingerprint
|
import app.revanced.patches.twitter.interaction.downloads.fingerprints.ConstructMediaOptionsSheetFingerprint
|
||||||
import app.revanced.patches.twitter.interaction.downloads.fingerprints.ShowDownloadVideoUpsellBottomSheetFingerprint
|
import app.revanced.patches.twitter.interaction.downloads.fingerprints.ShowDownloadVideoUpsellBottomSheetFingerprint
|
||||||
import app.revanced.util.exception
|
import app.revanced.util.exception
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
name = "Unlock downloads",
|
name = "Unlock downloads",
|
||||||
description = "Unlocks the ability to download any video.",
|
description = "Unlocks the ability to download any video. GIFs can be downloaded via the menu on long press.",
|
||||||
compatiblePackages = [CompatiblePackage("com.twitter.android")]
|
compatiblePackages = [CompatiblePackage("com.twitter.android")],
|
||||||
)
|
)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
object UnlockDownloadsPatch : BytecodePatch(
|
object UnlockDownloadsPatch : BytecodePatch(
|
||||||
setOf(ConstructMediaOptionsSheetFingerprint, ShowDownloadVideoUpsellBottomSheetFingerprint)
|
setOf(
|
||||||
|
ConstructMediaOptionsSheetFingerprint,
|
||||||
|
ShowDownloadVideoUpsellBottomSheetFingerprint,
|
||||||
|
BuildMediaOptionsSheetFingerprint,
|
||||||
|
),
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
fun MethodFingerprint.patch(getRegisterAndIndex: MethodFingerprintResult.() -> Pair<Int, Int>) = result?.let {
|
fun MethodFingerprint.patch(getRegisterAndIndex: MethodFingerprintResult.() -> Pair<Int, Int>) = result?.let {
|
||||||
@@ -46,5 +55,29 @@ object UnlockDownloadsPatch : BytecodePatch(
|
|||||||
|
|
||||||
showDownloadButtonIndex to register
|
showDownloadButtonIndex to register
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make GIFs downloadable.
|
||||||
|
BuildMediaOptionsSheetFingerprint.result?.let {
|
||||||
|
val scanResult = it.scanResult.patternScanResult!!
|
||||||
|
it.mutableMethod.apply {
|
||||||
|
val checkMediaTypeIndex = scanResult.startIndex
|
||||||
|
val checkMediaTypeInstruction = getInstruction<TwoRegisterInstruction>(checkMediaTypeIndex)
|
||||||
|
|
||||||
|
// Treat GIFs as videos.
|
||||||
|
addInstructionsWithLabels(
|
||||||
|
checkMediaTypeIndex + 1,
|
||||||
|
"""
|
||||||
|
const/4 v${checkMediaTypeInstruction.registerB}, 0x2 # GIF
|
||||||
|
if-eq v${checkMediaTypeInstruction.registerA}, v${checkMediaTypeInstruction.registerB}, :video
|
||||||
|
""",
|
||||||
|
ExternalLabel("video", getInstruction(scanResult.endIndex)),
|
||||||
|
)
|
||||||
|
|
||||||
|
// Remove media.isDownloadable check.
|
||||||
|
removeInstruction(
|
||||||
|
getInstructions().first { insn -> insn.opcode == Opcode.IGET_BOOLEAN }.location.index + 1,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} ?: throw BuildMediaOptionsSheetFingerprint.exception
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package app.revanced.patches.twitter.interaction.downloads.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
|
||||||
|
internal object BuildMediaOptionsSheetFingerprint : MethodFingerprint(
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.IF_EQ,
|
||||||
|
Opcode.SGET_OBJECT,
|
||||||
|
Opcode.GOTO_16,
|
||||||
|
Opcode.NEW_INSTANCE,
|
||||||
|
),
|
||||||
|
strings = listOf("resources.getString(R.string.post_video)"),
|
||||||
|
)
|
||||||
@@ -7,9 +7,8 @@ import app.revanced.patches.twitter.misc.hook.patch.BaseHookPatch
|
|||||||
|
|
||||||
@Patch(
|
@Patch(
|
||||||
name = "Hide ads",
|
name = "Hide ads",
|
||||||
description = "Hides ads.",
|
|
||||||
dependencies = [JsonHookPatch::class],
|
dependencies = [JsonHookPatch::class],
|
||||||
compatiblePackages = [CompatiblePackage("com.twitter.android")]
|
compatiblePackages = [CompatiblePackage("com.twitter.android")],
|
||||||
)
|
)
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
object HideAdsHookPatch : BaseHookPatch("Lapp/revanced/integrations/twitter/patches/hook/patch/ads/AdsHook;")
|
object HideAdsHookPatch : BaseHookPatch("Lapp/revanced/integrations/twitter/patches/hook/patch/ads/AdsHook;")
|
||||||
|
|||||||
Reference in New Issue
Block a user