chore: merge branch dev to main (#1452)

This commit is contained in:
oSumAtrIX 2023-01-13 16:03:22 +01:00 committed by GitHub
commit c4757b7762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 325 additions and 66 deletions

View File

@ -11,6 +11,7 @@ env:
jobs:
pull-request:
name: Open pull request
runs-on: ubuntu-latest
steps:
- name: Checkout

View File

@ -1,4 +1,5 @@
name: Release
on:
workflow_dispatch:
push:
@ -9,6 +10,7 @@ on:
branches:
- main
- dev
jobs:
release:
name: Release
@ -40,8 +42,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew generateMeta clean --no-daemon
- 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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
run: npx semantic-release

View File

@ -1,3 +1,32 @@
# [2.154.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.154.0-dev.2...v2.154.0-dev.3) (2023-01-13)
### Features
* **tiktok:** update patches compatibility to v27.8.3 ([#1483](https://github.com/revanced/revanced-patches/issues/1483)) ([e72b3bd](https://github.com/revanced/revanced-patches/commit/e72b3bd4e22f5ade7193ba6a3cdf61fcd91fba55))
# [2.154.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.154.0-dev.1...v2.154.0-dev.2) (2023-01-13)
### Features
* **music:** update patches compatibility to v5.39.52 ([#1484](https://github.com/revanced/revanced-patches/issues/1484)) ([81d6527](https://github.com/revanced/revanced-patches/commit/81d65273be81b5934e1cca543850db58f8df019e))
# [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)

View File

@ -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 |
| `settings` | Adds settings for ReVanced to YouTube. | all |
| `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 |
| `tablet-mini-player` | Enables the tablet mini player layout. | 17.49.37 |
| `theme` | Applies a custom theme. | all |
@ -66,16 +67,16 @@ The official Patch bundle provided by ReVanced and the community.
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `background-play` | Enables playing music in the background. | 5.36.51 |
| `codecs-unlock` | Adds more audio codec options. The new audio codecs usually result in better audio quality. | 5.36.51 |
| `compact-header` | Hides the music category bar at the top of the homepage. | 5.36.51 |
| `exclusive-audio-playback` | Enables the option to play music without video. | 5.36.51 |
| `hide-get-premium` | Removes all "Get Premium" evidences from the avatar menu. | 5.36.51 |
| `minimized-playback-music` | Enables minimized playback on Kids music. | 5.36.51 |
| `music-microg-support` | Allows YouTube Music ReVanced to run without root and under a different package name. | 5.36.51 |
| `music-video-ads` | Removes ads in the music player. | 5.36.51 |
| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the home screen. | 5.36.51 |
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar. | 5.36.51 |
| `background-play` | Enables playing music in the background. | 5.39.52 |
| `codecs-unlock` | Adds more audio codec options. The new audio codecs usually result in better audio quality. | 5.39.52 |
| `compact-header` | Hides the music category bar at the top of the homepage. | 5.39.52 |
| `exclusive-audio-playback` | Enables the option to play music without video. | 5.39.52 |
| `hide-get-premium` | Removes all "Get Premium" evidences from the avatar menu. | 5.39.52 |
| `minimized-playback-music` | Enables minimized playback on Kids music. | 5.39.52 |
| `music-microg-support` | Allows YouTube Music ReVanced to run without root and under a different package name. | 5.39.52 |
| `music-video-ads` | Removes ads in the music player. | 5.39.52 |
| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the home screen. | 5.39.52 |
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar. | 5.39.52 |
</details>
### [📦 `com.ss.android.ugc.trill`](https://play.google.com/store/apps/details?id=com.ss.android.ugc.trill)
@ -84,14 +85,14 @@ The official Patch bundle provided by ReVanced and the community.
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `disable-login-requirement` | Do not force login. | all |
| `downloads` | Removes download restrictions and changes the default path to download to. | all |
| `feed-filter` | Filters tiktok videos: removing ads, removing livestreams. | all |
| `downloads` | Removes download restrictions and changes the default path to download to. | 27.8.3 |
| `feed-filter` | Filters tiktok videos: removing ads, removing livestreams. | 27.8.3 |
| `fix-google-login` | Allows logging in with a Google account. | all |
| `hide-ads` | Removes ads from TikTok. | all |
| `playback-speed` | Enables the playback speed option for all videos. | all |
| `settings` | Adds ReVanced settings to TikTok. | all |
| `settings` | Adds ReVanced settings to TikTok. | 27.8.3 |
| `show-seekbar` | Shows progress bar for all video. | all |
| `sim-spoof` | Spoofs the information which is retrieved from the sim-card. | all |
| `sim-spoof` | Spoofs the information which is retrieved from the sim-card. | 27.8.3 |
</details>
### [📦 `com.zhiliaoapp.musically`](https://play.google.com/store/apps/details?id=com.zhiliaoapp.musically)
@ -100,14 +101,14 @@ The official Patch bundle provided by ReVanced and the community.
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `disable-login-requirement` | Do not force login. | all |
| `downloads` | Removes download restrictions and changes the default path to download to. | all |
| `feed-filter` | Filters tiktok videos: removing ads, removing livestreams. | all |
| `downloads` | Removes download restrictions and changes the default path to download to. | 27.8.3 |
| `feed-filter` | Filters tiktok videos: removing ads, removing livestreams. | 27.8.3 |
| `fix-google-login` | Allows logging in with a Google account. | all |
| `hide-ads` | Removes ads from TikTok. | all |
| `playback-speed` | Enables the playback speed option for all videos. | all |
| `settings` | Adds ReVanced settings to TikTok. | all |
| `settings` | Adds ReVanced settings to TikTok. | 27.8.3 |
| `show-seekbar` | Shows progress bar for all video. | all |
| `sim-spoof` | Spoofs the information which is retrieved from the sim-card. | all |
| `sim-spoof` | Spoofs the information which is retrieved from the sim-card. | 27.8.3 |
</details>
### [📦 `tv.twitch.android.app`](https://play.google.com/store/apps/details?id=tv.twitch.android.app)
@ -201,6 +202,14 @@ The official Patch bundle provided by ReVanced and the community.
| `promo-code-unlock` | Disables the validation of promo code. Any code will work to unlock all features. | all |
</details>
### [📦 `com.awedea.nyx`](https://play.google.com/store/apps/details?id=com.awedea.nyx)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks all pro features. | all |
</details>
### [📦 `co.windyapp.android`](https://play.google.com/store/apps/details?id=co.windyapp.android)
<details>
@ -209,6 +218,14 @@ The official Patch bundle provided by ReVanced and the community.
| `unlock-pro` | Unlocks all pro features. | all |
</details>
### [📦 `ginlemon.iconpackstudio`](https://play.google.com/store/apps/details?id=ginlemon.iconpackstudio)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks all pro features. | all |
</details>
### [📦 `org.totschnig.myexpenses`](https://play.google.com/store/apps/details?id=org.totschnig.myexpenses)
<details>
@ -217,14 +234,6 @@ The official Patch bundle provided by ReVanced and the community.
| `unlock-pro` | Unlocks all professional features. | all |
</details>
### [📦 `com.awedea.nyx`](https://play.google.com/store/apps/details?id=com.awedea.nyx)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks all pro features. | all |
</details>
### [📦 `com.ithebk.expensemanager`](https://play.google.com/store/apps/details?id=com.ithebk.expensemanager)
<details>
@ -233,14 +242,6 @@ The official Patch bundle provided by ReVanced and the community.
| `unlock-pro` | Unlocks pro features. | all |
</details>
### [📦 `ginlemon.iconpackstudio`](https://play.google.com/store/apps/details?id=ginlemon.iconpackstudio)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks all pro features. | all |
</details>
### [📦 `com.ticktick.task`](https://play.google.com/store/apps/details?id=com.ticktick.task)
<details>

View File

@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.153.0
version = 2.154.0-dev.3

File diff suppressed because one or more lines are too long

View File

@ -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()
}
}

View File

@ -21,7 +21,9 @@ import app.revanced.patcher.annotation.Package
"5.29.52",
"5.31.50",
"5.34.51",
"5.36.51"
"5.36.51",
"5.38.53",
"5.39.52"
)
)]
)

View File

@ -21,7 +21,9 @@ import app.revanced.patcher.annotation.Package
"5.29.52",
"5.31.50",
"5.34.51",
"5.36.51"
"5.36.51",
"5.38.53",
"5.39.52"
)
)]
)

View File

@ -22,7 +22,7 @@ object CodecsLockFingerprint : MethodFingerprint(
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_INTERFACE,
Opcode.INVOKE_DIRECT,
Opcode.INVOKE_VIRTUAL,
Opcode.RETURN_OBJECT
),
strings = listOf("eac3_supported")

View File

@ -21,7 +21,9 @@ import app.revanced.patcher.annotation.Package
"5.29.52",
"5.31.50",
"5.34.51",
"5.36.51"
"5.36.51",
"5.38.53",
"5.39.52"
)
)]
)

View File

@ -20,7 +20,9 @@ import app.revanced.patcher.annotation.Package
"5.29.52",
"5.31.50",
"5.34.51",
"5.36.51"
"5.36.51",
"5.38.53",
"5.39.52"
)
)]
)

View File

@ -21,7 +21,9 @@ import app.revanced.patcher.annotation.Package
"5.29.52",
"5.31.50",
"5.34.51",
"5.36.51"
"5.36.51",
"5.38.53",
"5.39.52"
)
)]
)

View File

@ -21,7 +21,9 @@ import app.revanced.patcher.annotation.Package
"5.29.52",
"5.31.50",
"5.34.51",
"5.36.51"
"5.36.51",
"5.38.53",
"5.39.52"
)
)]
)

View File

@ -23,7 +23,9 @@ import app.revanced.patcher.annotation.Package
"5.29.52",
"5.31.50",
"5.34.51",
"5.36.51"
"5.36.51",
"5.38.53",
"5.39.52"
)
)]
)

View File

@ -21,7 +21,9 @@ import app.revanced.patcher.annotation.Package
"5.29.52",
"5.31.50",
"5.34.51",
"5.36.51"
"5.36.51",
"5.38.53",
"5.39.52"
)
)]
)

View File

@ -21,7 +21,9 @@ import app.revanced.patcher.annotation.Package
"5.29.52",
"5.31.50",
"5.34.51",
"5.36.51"
"5.36.51",
"5.38.53",
"5.39.52"
)
)]
)

View File

@ -21,7 +21,9 @@ import app.revanced.patcher.annotation.Package
"5.29.52",
"5.31.50",
"5.34.51",
"5.36.51"
"5.36.51",
"5.38.53",
"5.39.52"
)
)]
)

View File

@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[
Package("com.ss.android.ugc.trill"),
Package("com.zhiliaoapp.musically")
Package("com.ss.android.ugc.trill", arrayOf("27.8.3")),
Package("com.zhiliaoapp.musically", arrayOf("27.8.3"))
]
)
@Target(AnnotationTarget.CLASS)

View File

@ -5,7 +5,7 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
object FeedApiServiceLIZFingerprint : MethodFingerprint(
access = AccessFlags.PUBLIC or AccessFlags.STATIC or AccessFlags.FINAL or AccessFlags.SYNTHETIC,
access = AccessFlags.PUBLIC or AccessFlags.STATIC or AccessFlags.SYNTHETIC,
customFingerprint = { methodDef ->
methodDef.definingClass.endsWith("/FeedApiService;") && methodDef.name == "LIZ"
}

View File

@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[
Package("com.ss.android.ugc.trill"),
Package("com.zhiliaoapp.musically")
Package("com.ss.android.ugc.trill", arrayOf("27.8.3")),
Package("com.zhiliaoapp.musically", arrayOf("27.8.3"))
]
)
@Target(AnnotationTarget.CLASS)

View File

@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[
Package("com.ss.android.ugc.trill"),
Package("com.zhiliaoapp.musically")
Package("com.ss.android.ugc.trill", arrayOf("27.8.3")),
Package("com.zhiliaoapp.musically", arrayOf("27.8.3"))
]
)
@Target(AnnotationTarget.CLASS)

View File

@ -9,7 +9,6 @@ object AboutViewFingerprint : MethodFingerprint(
opcodes = listOf(
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.MOVE,
Opcode.INVOKE_DIRECT_RANGE,
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
@ -18,8 +17,7 @@ object AboutViewFingerprint : MethodFingerprint(
Opcode.CONST,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.SGET_OBJECT,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.NEW_INSTANCE,

View File

@ -5,8 +5,8 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[
Package("com.ss.android.ugc.trill"),
Package("com.zhiliaoapp.musically")
Package("com.ss.android.ugc.trill", arrayOf("27.8.3")),
Package("com.zhiliaoapp.musically", arrayOf("27.8.3"))
]
)
@Target(AnnotationTarget.CLASS)

View File

@ -45,7 +45,7 @@ class HideInfocardsPatch : BytecodePatch(
"Landroid/view/View;->setVisibility(I)V")
}
replaceInstruction(
addInstructions(
invokeInstructionIndex,
"invoke-static {v${(instruction(invokeInstructionIndex) as? BuilderInstruction35c)?.registerC}}," +
" Lapp/revanced/integrations/patches/HideInfocardsPatch;->hideInfocardsIncognito(Landroid/view/View;)V"

View File

@ -59,7 +59,9 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
val conversionContextParam = 5
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(
insertIndex,

View File

@ -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

View File

@ -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")
)

View File

@ -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()
}
}

View File

@ -67,7 +67,7 @@ class BottomControlsResourcePatch : ResourcePatch {
element.attributes.getNamedItem("yt:layout_constraintRight_toLeftOf").nodeValue =
"$namespace/$lastLeftOf"
// set lastLeftOf attribute to the the current element
// set lastLeftOf attribute to the current element
val nameSpaceLength = 5
lastLeftOf = element.attributes.getNamedItem("android:id").nodeValue.substring(nameSpaceLength)
@ -82,4 +82,4 @@ class BottomControlsResourcePatch : ResourcePatch {
override fun close() {
targetXmlEditor.close()
}
}
}

View File

@ -3,7 +3,6 @@
<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_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_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_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_summary">Dislike data is provided by the Return YouTube Dislike API. Tap here to learn more.</string>