Skip to content

Commit 824d094

Browse files
authored
chore: Merge branch dev to main (#2693)
2 parents 65a32ee + 010471a commit 824d094

File tree

13 files changed

+152
-21
lines changed

13 files changed

+152
-21
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# [4.2.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v4.1.1-dev.1...v4.2.0-dev.1) (2024-02-08)
2+
3+
4+
### Features
5+
6+
* **X:** Add `Hide view count` patch ([bf064ec](https://github.com/ReVanced/revanced-patches/commit/bf064ecc1d5de8b592d14d34acfa1a4314c374ba))
7+
* **X:** Add `Unlock downloads` patch ([2c20844](https://github.com/ReVanced/revanced-patches/commit/2c20844eaae698f185a9d321e2c70bde4b485cee))
8+
9+
## [4.1.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v4.1.0...v4.1.1-dev.1) (2024-02-07)
10+
11+
12+
### Bug Fixes
13+
14+
* **Infinity for Reddit - Unlock subscription:** Do not crash by patching billing client ([7d76e2e](https://github.com/ReVanced/revanced-patches/commit/7d76e2e43c69b2b75f40a15a9147d041c77cbcd9))
15+
116
# [4.1.0](https://github.com/ReVanced/revanced-patches/compare/v4.0.2...v4.1.0) (2024-02-05)
217

318

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,5 @@ In order to build ReVanced Patches, you can follow the [ReVanced documentation](
105105
## 📜 Licence
106106

107107
ReVanced Patches is licensed under the GPLv3 licence. Please see the [licence file](LICENSE) for more information.
108-
[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.
108+
[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.
109109
Any modifications to ReVanced Patches must also be made available under the GPL along with build & install instructions.

api/revanced-patches.api

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,18 @@ public final class app/revanced/patches/twitch/misc/settings/SettingsResourcePat
10651065
public static final field INSTANCE Lapp/revanced/patches/twitch/misc/settings/SettingsResourcePatch;
10661066
}
10671067

1068+
public final class app/revanced/patches/twitter/interaction/downloads/UnlockDownloadsPatch : app/revanced/patcher/patch/BytecodePatch {
1069+
public static final field INSTANCE Lapp/revanced/patches/twitter/interaction/downloads/UnlockDownloadsPatch;
1070+
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
1071+
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
1072+
}
1073+
1074+
public final class app/revanced/patches/twitter/layout/viewcount/HideViewCountPatch : app/revanced/patcher/patch/BytecodePatch {
1075+
public static final field INSTANCE Lapp/revanced/patches/twitter/layout/viewcount/HideViewCountPatch;
1076+
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
1077+
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
1078+
}
1079+
10681080
public final class app/revanced/patches/twitter/misc/dynamiccolor/DynamicColorPatch : app/revanced/patcher/patch/ResourcePatch {
10691081
public static final field INSTANCE Lapp/revanced/patches/twitter/misc/dynamiccolor/DynamicColorPatch;
10701082
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
org.gradle.parallel = true
22
org.gradle.caching = true
33
kotlin.code.style = official
4-
version = 4.1.0
4+
version = 4.2.0-dev.1

patches.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/main/kotlin/app/revanced/patches/reddit/customclients/infinityforreddit/subscription/UnlockSubscriptionPatch.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ import app.revanced.patcher.patch.BytecodePatch
55
import app.revanced.patcher.patch.annotation.CompatiblePackage
66
import app.revanced.patcher.patch.annotation.Patch
77
import app.revanced.patches.reddit.customclients.infinityforreddit.api.SpoofClientPatch
8+
import app.revanced.patches.reddit.customclients.infinityforreddit.subscription.fingerprints.BillingClientOnServiceConnected
89
import app.revanced.patches.reddit.customclients.infinityforreddit.subscription.fingerprints.StartSubscriptionActivityFingerprint
9-
import app.revanced.patches.reddit.customclients.infinityforreddit.subscription.fingerprints.SubscriptionActivityOnCreateFingerprint
1010
import app.revanced.util.returnEarly
1111

1212
@Patch(
1313
name = "Unlock subscription",
1414
description = "Unlocks the subscription feature but requires a custom client ID.",
1515
compatiblePackages = [
16-
CompatiblePackage("ml.docilealligator.infinityforreddit")
16+
CompatiblePackage("ml.docilealligator.infinityforreddit"),
1717
],
18-
dependencies = [SpoofClientPatch::class]
18+
dependencies = [SpoofClientPatch::class],
1919
)
2020
@Suppress("unused")
2121
object UnlockSubscriptionPatch : BytecodePatch(
22-
setOf(StartSubscriptionActivityFingerprint, SubscriptionActivityOnCreateFingerprint)
22+
setOf(StartSubscriptionActivityFingerprint, BillingClientOnServiceConnected),
2323
) {
2424
override fun execute(context: BytecodeContext) =
25-
listOf(StartSubscriptionActivityFingerprint, SubscriptionActivityOnCreateFingerprint).returnEarly()
25+
listOf(StartSubscriptionActivityFingerprint, BillingClientOnServiceConnected).returnEarly()
2626
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package app.revanced.patches.reddit.customclients.infinityforreddit.subscription.fingerprints
2+
3+
import app.revanced.patcher.fingerprint.MethodFingerprint
4+
5+
internal object BillingClientOnServiceConnected : MethodFingerprint(
6+
strings = listOf("Billing service connected"),
7+
)

src/main/kotlin/app/revanced/patches/reddit/customclients/infinityforreddit/subscription/fingerprints/SubscriptionActivityOnCreateFingerprint.kt

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package app.revanced.patches.twitter.interaction.downloads
2+
3+
import app.revanced.patcher.data.BytecodeContext
4+
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
5+
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
6+
import app.revanced.patcher.extensions.InstructionExtensions.getInstructions
7+
import app.revanced.patcher.fingerprint.MethodFingerprint
8+
import app.revanced.patcher.fingerprint.MethodFingerprintResult
9+
import app.revanced.patcher.patch.BytecodePatch
10+
import app.revanced.patcher.patch.annotation.CompatiblePackage
11+
import app.revanced.patcher.patch.annotation.Patch
12+
import app.revanced.patches.twitter.interaction.downloads.fingerprints.ConstructMediaOptionsSheetFingerprint
13+
import app.revanced.patches.twitter.interaction.downloads.fingerprints.ShowDownloadVideoUpsellBottomSheetFingerprint
14+
import app.revanced.util.exception
15+
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
16+
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
17+
18+
@Patch(
19+
name = "Unlock downloads",
20+
description = "Unlocks the ability to download any video.",
21+
compatiblePackages = [CompatiblePackage("com.twitter.android")]
22+
)
23+
@Suppress("unused")
24+
object UnlockDownloadsPatch : BytecodePatch(
25+
setOf(ConstructMediaOptionsSheetFingerprint, ShowDownloadVideoUpsellBottomSheetFingerprint)
26+
) {
27+
override fun execute(context: BytecodeContext) {
28+
fun MethodFingerprint.patch(getRegisterAndIndex: MethodFingerprintResult.() -> Pair<Int, Int>) = result?.let {
29+
getRegisterAndIndex(it).let { (index, register) ->
30+
it.mutableMethod.addInstruction(index, "const/4 v$register, 0x1")
31+
}
32+
} ?: throw exception
33+
34+
// Allow downloads for non-premium users.
35+
ShowDownloadVideoUpsellBottomSheetFingerprint.patch {
36+
val checkIndex = scanResult.patternScanResult!!.startIndex
37+
val register = mutableMethod.getInstruction<OneRegisterInstruction>(checkIndex).registerA
38+
39+
checkIndex to register
40+
}
41+
42+
// Force show the download menu item.
43+
ConstructMediaOptionsSheetFingerprint.patch {
44+
val showDownloadButtonIndex = mutableMethod.getInstructions().lastIndex - 1
45+
val register = mutableMethod.getInstruction<TwoRegisterInstruction>(showDownloadButtonIndex).registerA
46+
47+
showDownloadButtonIndex to register
48+
}
49+
}
50+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package app.revanced.patches.twitter.interaction.downloads.fingerprints
2+
3+
import app.revanced.patcher.extensions.or
4+
import app.revanced.patcher.fingerprint.MethodFingerprint
5+
import com.android.tools.smali.dexlib2.AccessFlags
6+
7+
8+
internal object ConstructMediaOptionsSheetFingerprint : MethodFingerprint(
9+
returnType = "V",
10+
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
11+
strings = listOf("captionsState")
12+
)

0 commit comments

Comments
 (0)