mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-20 17:43:56 +00:00
Compare commits
10 Commits
v2.153.0-d
...
v2.154.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
270916bb43 | ||
|
|
3944521a01 | ||
|
|
b57eee8582 | ||
|
|
e4cc17e6ef | ||
|
|
3789a205cb | ||
|
|
efe814f2e1 | ||
|
|
e13db6934f | ||
|
|
7e8c544d42 | ||
|
|
8a3c0e1bcb | ||
|
|
ce0158db3a |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -40,7 +40,7 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: ./gradlew generateMeta clean --no-daemon
|
run: ./gradlew generateMeta clean --no-daemon
|
||||||
- name: Setup semantic-release
|
- name: Setup semantic-release
|
||||||
run: npm install semantic-release @saithodev/semantic-release-backmerge @semantic-release/git @semantic-release/changelog gradle-semantic-release-plugin -D
|
run: npm install semantic-release@19.0.5 @saithodev/semantic-release-backmerge @semantic-release/git @semantic-release/changelog gradle-semantic-release-plugin@1.7.4 -D
|
||||||
- name: Release
|
- name: Release
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
28
CHANGELOG.md
28
CHANGELOG.md
@@ -1,3 +1,31 @@
|
|||||||
|
# [2.154.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.153.0...v2.154.0-dev.1) (2023-01-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **youtube/hide-info-cards:** allow toggling visibility of info-cards ([#1464](https://github.com/revanced/revanced-patches/issues/1464)) ([e6dcb55](https://github.com/revanced/revanced-patches/commit/e6dcb55382441f03c4b1322ccd652a22db104254))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* `remove-screenshot-restriction` patch ([#1455](https://github.com/revanced/revanced-patches/issues/1455)) ([a16ab79](https://github.com/revanced/revanced-patches/commit/a16ab7969d98b1e05ac896a4b9aa834cdac8734e))
|
||||||
|
* **music:** update patches compatibility to v5.38.53 ([#1453](https://github.com/revanced/revanced-patches/issues/1453)) ([c7d116a](https://github.com/revanced/revanced-patches/commit/c7d116afd7293924760e7b6c1de0ba5d6cbd00a0))
|
||||||
|
* **youtube/return-youtube-dislike:** style for minimum width ([#1454](https://github.com/revanced/revanced-patches/issues/1454)) ([fd782aa](https://github.com/revanced/revanced-patches/commit/fd782aa0a37edf2344425c80afafb2c87851bc1a))
|
||||||
|
* **youtube:** `spoof-app-version` patch ([#1449](https://github.com/revanced/revanced-patches/issues/1449)) ([bd4d3b5](https://github.com/revanced/revanced-patches/commit/bd4d3b5706f26e398292df952ca8aec6c7dd1d6a))
|
||||||
|
|
||||||
|
# [2.153.0](https://github.com/revanced/revanced-patches/compare/v2.152.0...v2.153.0) (2023-01-07)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **youtube/general-ads:** move settings to correct preference screens ([cde45fc](https://github.com/revanced/revanced-patches/commit/cde45fca769eddea64072f13f836d46560a4a89a))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **youtube/remember-video-quality:** simplify settings switch state description ([9bd42ec](https://github.com/revanced/revanced-patches/commit/9bd42ec1a1b54b103cd2550211515acdaf90e9de))
|
||||||
|
* **youtube:** `remember-playback-rate` patch ([177e908](https://github.com/revanced/revanced-patches/commit/177e908dba260f184a2835b73b834563ca9c29fd))
|
||||||
|
|
||||||
# [2.153.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.152.1-dev.1...v2.153.0-dev.1) (2023-01-07)
|
# [2.153.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.152.1-dev.1...v2.153.0-dev.1) (2023-01-07)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
21
README.md
21
README.md
@@ -55,6 +55,7 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 17.49.37 |
|
| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 17.49.37 |
|
||||||
| `settings` | Adds settings for ReVanced to YouTube. | all |
|
| `settings` | Adds settings for ReVanced to YouTube. | all |
|
||||||
| `sponsorblock` | Integrate SponsorBlock. | 17.49.37 |
|
| `sponsorblock` | Integrate SponsorBlock. | 17.49.37 |
|
||||||
|
| `spoof-app-version` | Tricks YouTube into thinking, you are running an older version of the app. One of the side effects also includes restoring the old UI. | 17.49.37 |
|
||||||
| `swipe-controls` | Adds volume and brightness swipe controls. | 17.49.37 |
|
| `swipe-controls` | Adds volume and brightness swipe controls. | 17.49.37 |
|
||||||
| `tablet-mini-player` | Enables the tablet mini player layout. | 17.49.37 |
|
| `tablet-mini-player` | Enables the tablet mini player layout. | 17.49.37 |
|
||||||
| `theme` | Applies a custom theme. | all |
|
| `theme` | Applies a custom theme. | all |
|
||||||
@@ -66,16 +67,16 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|:--------:|:--------------:|:-----------------:|
|
||||||
| `background-play` | Enables playing music in the background. | 5.36.51 |
|
| `background-play` | Enables playing music in the background. | 5.38.53 |
|
||||||
| `codecs-unlock` | Adds more audio codec options. The new audio codecs usually result in better audio quality. | 5.36.51 |
|
| `codecs-unlock` | Adds more audio codec options. The new audio codecs usually result in better audio quality. | 5.38.53 |
|
||||||
| `compact-header` | Hides the music category bar at the top of the homepage. | 5.36.51 |
|
| `compact-header` | Hides the music category bar at the top of the homepage. | 5.38.53 |
|
||||||
| `exclusive-audio-playback` | Enables the option to play music without video. | 5.36.51 |
|
| `exclusive-audio-playback` | Enables the option to play music without video. | 5.38.53 |
|
||||||
| `hide-get-premium` | Removes all "Get Premium" evidences from the avatar menu. | 5.36.51 |
|
| `hide-get-premium` | Removes all "Get Premium" evidences from the avatar menu. | 5.38.53 |
|
||||||
| `minimized-playback-music` | Enables minimized playback on Kids music. | 5.36.51 |
|
| `minimized-playback-music` | Enables minimized playback on Kids music. | 5.38.53 |
|
||||||
| `music-microg-support` | Allows YouTube Music ReVanced to run without root and under a different package name. | 5.36.51 |
|
| `music-microg-support` | Allows YouTube Music ReVanced to run without root and under a different package name. | 5.38.53 |
|
||||||
| `music-video-ads` | Removes ads in the music player. | 5.36.51 |
|
| `music-video-ads` | Removes ads in the music player. | 5.38.53 |
|
||||||
| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the home screen. | 5.36.51 |
|
| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the home screen. | 5.38.53 |
|
||||||
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar. | 5.36.51 |
|
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar. | 5.38.53 |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### [📦 `com.ss.android.ugc.trill`](https://play.google.com/store/apps/details?id=com.ss.android.ugc.trill)
|
### [📦 `com.ss.android.ugc.trill`](https://play.google.com/store/apps/details?id=com.ss.android.ugc.trill)
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.153.0-dev.1
|
version = 2.154.0-dev.1
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,106 @@
|
|||||||
|
package app.revanced.patches.all.screenshot.removerestriction.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.findMutableMethodOf
|
||||||
|
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.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.Patch
|
||||||
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||||
|
import org.jf.dexlib2.iface.reference.MethodReference
|
||||||
|
|
||||||
|
@Patch(false)
|
||||||
|
@Name("remove-screenshot-restriction")
|
||||||
|
@Description("Removes the restriction of making screenshots.")
|
||||||
|
@Version("0.0.1")
|
||||||
|
class RemoveScreenshotRestrictionPatch : BytecodePatch() {
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/all/screenshot/removerestriction/RemoveScreenshotRestrictionPatch;"
|
||||||
|
}
|
||||||
|
|
||||||
|
// Information about method calls we want to replace
|
||||||
|
private enum class MethodCall(
|
||||||
|
val definedClassName: String,
|
||||||
|
val methodName: String,
|
||||||
|
val replacementMethodDefinition: String
|
||||||
|
) {
|
||||||
|
SetFlags(
|
||||||
|
"Landroid/view/Window;",
|
||||||
|
"setFlags",
|
||||||
|
"setFlags(Landroid/view/Window;II)V",
|
||||||
|
);
|
||||||
|
|
||||||
|
fun replaceInstruction(method: MutableMethod, instruction: Instruction35c, instructionIndex: Int) {
|
||||||
|
when (this) {
|
||||||
|
SetFlags -> {
|
||||||
|
method.replaceInstruction(
|
||||||
|
instructionIndex,
|
||||||
|
"invoke-static { v${instruction.registerC}, v${instruction.registerD}, v${instruction.registerE} }, ${INTEGRATIONS_CLASS_DESCRIPTOR}->${replacementMethodDefinition}"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun fromMethodReference(methodReference: MethodReference) = values().firstOrNull { search ->
|
||||||
|
search.definedClassName == methodReference.definingClass && search.methodName == methodReference.name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
// Find all instructions where one of the methods is called
|
||||||
|
buildMap {
|
||||||
|
context.classes.forEach { classDef ->
|
||||||
|
if (classDef.type == INTEGRATIONS_CLASS_DESCRIPTOR) {
|
||||||
|
// avoid infinite recursion
|
||||||
|
return@forEach
|
||||||
|
}
|
||||||
|
|
||||||
|
classDef.methods.let { methods ->
|
||||||
|
buildMap methodList@{
|
||||||
|
methods.forEach methods@{ method ->
|
||||||
|
with(method.implementation?.instructions ?: return@methods) {
|
||||||
|
ArrayDeque<Triple<MethodCall, Instruction35c, Int>>().also { patchIndices ->
|
||||||
|
this.forEachIndexed { index, instruction ->
|
||||||
|
if (instruction.opcode != Opcode.INVOKE_VIRTUAL) return@forEachIndexed
|
||||||
|
|
||||||
|
val invokeInstruction = instruction as Instruction35c
|
||||||
|
val methodRef = invokeInstruction.reference as MethodReference
|
||||||
|
val methodCall = MethodCall.fromMethodReference(methodRef) ?: return@forEachIndexed
|
||||||
|
|
||||||
|
patchIndices.add(Triple(methodCall, invokeInstruction, index))
|
||||||
|
}
|
||||||
|
}.also { if (it.isEmpty()) return@methods }.let { patches ->
|
||||||
|
put(method, patches)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.also { if (it.isEmpty()) return@forEach }.let { methodPatches ->
|
||||||
|
put(classDef, methodPatches)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.forEach { (classDef, methods) ->
|
||||||
|
// And finally replace the instructions...
|
||||||
|
with(context.proxy(classDef).mutableClass) {
|
||||||
|
methods.forEach { (method, patches) ->
|
||||||
|
val mutableMethod = findMutableMethodOf(method)
|
||||||
|
while (!patches.isEmpty()) {
|
||||||
|
val (methodType, instruction, instructionIndex) = patches.removeLast()
|
||||||
|
methodType.replaceInstruction(mutableMethod, instruction, instructionIndex)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,7 +21,8 @@ import app.revanced.patcher.annotation.Package
|
|||||||
"5.29.52",
|
"5.29.52",
|
||||||
"5.31.50",
|
"5.31.50",
|
||||||
"5.34.51",
|
"5.34.51",
|
||||||
"5.36.51"
|
"5.36.51",
|
||||||
|
"5.38.53"
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ import app.revanced.patcher.annotation.Package
|
|||||||
"5.29.52",
|
"5.29.52",
|
||||||
"5.31.50",
|
"5.31.50",
|
||||||
"5.34.51",
|
"5.34.51",
|
||||||
"5.36.51"
|
"5.36.51",
|
||||||
|
"5.38.53"
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ object CodecsLockFingerprint : MethodFingerprint(
|
|||||||
Opcode.INVOKE_STATIC,
|
Opcode.INVOKE_STATIC,
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
Opcode.INVOKE_INTERFACE,
|
Opcode.INVOKE_INTERFACE,
|
||||||
Opcode.INVOKE_DIRECT,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.RETURN_OBJECT
|
Opcode.RETURN_OBJECT
|
||||||
),
|
),
|
||||||
strings = listOf("eac3_supported")
|
strings = listOf("eac3_supported")
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ import app.revanced.patcher.annotation.Package
|
|||||||
"5.29.52",
|
"5.29.52",
|
||||||
"5.31.50",
|
"5.31.50",
|
||||||
"5.34.51",
|
"5.34.51",
|
||||||
"5.36.51"
|
"5.36.51",
|
||||||
|
"5.38.53"
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ import app.revanced.patcher.annotation.Package
|
|||||||
"5.29.52",
|
"5.29.52",
|
||||||
"5.31.50",
|
"5.31.50",
|
||||||
"5.34.51",
|
"5.34.51",
|
||||||
"5.36.51"
|
"5.36.51",
|
||||||
|
"5.38.53"
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ import app.revanced.patcher.annotation.Package
|
|||||||
"5.29.52",
|
"5.29.52",
|
||||||
"5.31.50",
|
"5.31.50",
|
||||||
"5.34.51",
|
"5.34.51",
|
||||||
"5.36.51"
|
"5.36.51",
|
||||||
|
"5.38.53"
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ import app.revanced.patcher.annotation.Package
|
|||||||
"5.29.52",
|
"5.29.52",
|
||||||
"5.31.50",
|
"5.31.50",
|
||||||
"5.34.51",
|
"5.34.51",
|
||||||
"5.36.51"
|
"5.36.51",
|
||||||
|
"5.38.53"
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ import app.revanced.patcher.annotation.Package
|
|||||||
"5.29.52",
|
"5.29.52",
|
||||||
"5.31.50",
|
"5.31.50",
|
||||||
"5.34.51",
|
"5.34.51",
|
||||||
"5.36.51"
|
"5.36.51",
|
||||||
|
"5.38.53"
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ import app.revanced.patcher.annotation.Package
|
|||||||
"5.29.52",
|
"5.29.52",
|
||||||
"5.31.50",
|
"5.31.50",
|
||||||
"5.34.51",
|
"5.34.51",
|
||||||
"5.36.51"
|
"5.36.51",
|
||||||
|
"5.38.53"
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ import app.revanced.patcher.annotation.Package
|
|||||||
"5.29.52",
|
"5.29.52",
|
||||||
"5.31.50",
|
"5.31.50",
|
||||||
"5.34.51",
|
"5.34.51",
|
||||||
"5.36.51"
|
"5.36.51",
|
||||||
|
"5.38.53"
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ import app.revanced.patcher.annotation.Package
|
|||||||
"5.29.52",
|
"5.29.52",
|
||||||
"5.31.50",
|
"5.31.50",
|
||||||
"5.34.51",
|
"5.34.51",
|
||||||
"5.36.51"
|
"5.36.51",
|
||||||
|
"5.38.53"
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class HideInfocardsPatch : BytecodePatch(
|
|||||||
"Landroid/view/View;->setVisibility(I)V")
|
"Landroid/view/View;->setVisibility(I)V")
|
||||||
}
|
}
|
||||||
|
|
||||||
replaceInstruction(
|
addInstructions(
|
||||||
invokeInstructionIndex,
|
invokeInstructionIndex,
|
||||||
"invoke-static {v${(instruction(invokeInstructionIndex) as? BuilderInstruction35c)?.registerC}}," +
|
"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,9 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
|
|||||||
|
|
||||||
val conversionContextParam = 5
|
val conversionContextParam = 5
|
||||||
val textRefParam = createComponentMethod.parameters.size - 2
|
val textRefParam = createComponentMethod.parameters.size - 2
|
||||||
val insertIndex = scanResult.stringsScanResult!!.matches.first().index - 2
|
// insert index must be 0, otherwise UI does not updated correctly in some situations
|
||||||
|
// such as switching from full screen or when using previous/next overlay buttons.
|
||||||
|
val insertIndex = 0
|
||||||
|
|
||||||
createComponentMethod.addInstructions(
|
createComponentMethod.addInstructions(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.spoofappversion.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility(
|
||||||
|
[Package(
|
||||||
|
"com.google.android.youtube", arrayOf("17.49.37")
|
||||||
|
)]
|
||||||
|
)
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class SpoofAppVersionCompatibility
|
||||||
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.spoofappversion.bytecode.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 SpoofAppVersionFingerprint : MethodFingerprint(
|
||||||
|
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), listOf(
|
||||||
|
Opcode.IGET_OBJECT,
|
||||||
|
Opcode.GOTO,
|
||||||
|
Opcode.CONST_STRING,
|
||||||
|
),
|
||||||
|
|
||||||
|
// Instead of applying a bytecode patch, it might be possible to only rely on code from the integrations and
|
||||||
|
// manually set the desired version string as this keyed value in the SharedPreferences.
|
||||||
|
// But, this bytecode patch is simple and it works.
|
||||||
|
strings = listOf("pref_override_build_version_name")
|
||||||
|
)
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.spoofappversion.bytecode.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.shared.settings.preference.impl.StringResource
|
||||||
|
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||||
|
import app.revanced.patches.youtube.layout.spoofappversion.annotations.SpoofAppVersionCompatibility
|
||||||
|
import app.revanced.patches.youtube.layout.spoofappversion.bytecode.fingerprints.SpoofAppVersionFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
||||||
|
@Name("spoof-app-version")
|
||||||
|
@Description("Tricks YouTube into thinking, you are running an older version of the app. One of the side effects also includes restoring the old UI.")
|
||||||
|
@SpoofAppVersionCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class SpoofAppVersionPatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
SpoofAppVersionFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
companion object {
|
||||||
|
const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/SpoofAppVersionPatch"
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||||
|
SwitchPreference(
|
||||||
|
"revanced_spoof_app_version",
|
||||||
|
StringResource("revanced_spoof_app_version_title", "Spoof app version"),
|
||||||
|
false,
|
||||||
|
StringResource("revanced_spoof_app_version_summary_on", "Version spoofed to 17.30.34. If switched off, the old UI layout may remain until logging out or clearing app data"),
|
||||||
|
StringResource("revanced_spoof_app_version_summary_off", "Version not spoofed")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
SpoofAppVersionFingerprint.result?.apply {
|
||||||
|
val insertIndex = scanResult.patternScanResult!!.startIndex + 1
|
||||||
|
val buildOverrideNameRegister =
|
||||||
|
(mutableMethod.implementation!!.instructions[insertIndex - 1] as OneRegisterInstruction).registerA
|
||||||
|
|
||||||
|
mutableMethod.addInstructions(
|
||||||
|
insertIndex,
|
||||||
|
"""
|
||||||
|
invoke-static {v$buildOverrideNameRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR;->getYouTubeVersionOverride(Ljava/lang/String;)Ljava/lang/String;
|
||||||
|
move-result-object v$buildOverrideNameRegister
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
} ?: return SpoofAppVersionFingerprint.toErrorResult()
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
<string name="revanced_ryd_failure_connection_timeout">Dislikes temporarily not available (API timed out)</string>
|
<string name="revanced_ryd_failure_connection_timeout">Dislikes temporarily not available (API timed out)</string>
|
||||||
<string name="revanced_ryd_failure_client_rate_limit_requested">Dislikes not available (client API limit reached)</string>
|
<string name="revanced_ryd_failure_client_rate_limit_requested">Dislikes not available (client API limit reached)</string>
|
||||||
|
|
||||||
<string name="revanced_ryd_failure_register_user">ReturnYouTubeDislike failed to register as new user</string>
|
<string name="revanced_ryd_failure_register_user">ReturnYouTubeDislike failed to register as new user</string>
|
||||||
<string name="revanced_ryd_failure_confirm_user">ReturnYouTubeDislike failed to confirm new user</string>
|
<string name="revanced_ryd_failure_confirm_user">ReturnYouTubeDislike failed to confirm new user</string>
|
||||||
<string name="revanced_ryd_failure_send_vote_failed">ReturnYouTubeDislike failed to send vote</string>
|
<string name="revanced_ryd_failure_send_vote_failed">ReturnYouTubeDislike failed to send vote</string>
|
||||||
@@ -17,6 +16,10 @@
|
|||||||
<string name="revanced_ryd_dislike_percentage_summary_on">Dislikes shown as percentage</string>
|
<string name="revanced_ryd_dislike_percentage_summary_on">Dislikes shown as percentage</string>
|
||||||
<string name="revanced_ryd_dislike_percentage_summary_off">Dislikes shown as number</string>
|
<string name="revanced_ryd_dislike_percentage_summary_off">Dislikes shown as number</string>
|
||||||
|
|
||||||
|
<string name="revanced_ryd_compact_layout_title">Compact like button</string>
|
||||||
|
<string name="revanced_ryd_compact_layout_summary_on">Like button styled for minimum width</string>
|
||||||
|
<string name="revanced_ryd_compact_layout_summary_off">Like button styled for best appearance</string>
|
||||||
|
|
||||||
<string name="revanced_ryd_attribution_title">ReturnYouTubeDislike.com</string>
|
<string name="revanced_ryd_attribution_title">ReturnYouTubeDislike.com</string>
|
||||||
<string name="revanced_ryd_attribution_summary">Dislike data is provided by the Return YouTube Dislike API. Tap here to learn more.</string>
|
<string name="revanced_ryd_attribution_summary">Dislike data is provided by the Return YouTube Dislike API. Tap here to learn more.</string>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user