Compare commits

..

17 Commits

Author SHA1 Message Date
semantic-release-bot
13f888375b chore(release): 2.168.0-dev.7 [skip ci]
# [2.168.0-dev.7](https://github.com/revanced/revanced-patches/compare/v2.168.0-dev.6...v2.168.0-dev.7) (2023-04-20)

### Bug Fixes

* **youtube/microg-support:** remove incorrect patch dependency ([cf89537](cf895378c7))
* **youtube/microg-support:** rename patch correctly ([acfdd6c](acfdd6c35f))
* **youtube/spoof-signature-verification:** depend on `client-spoof` patch ([333327e](333327e0f9))

### Features

* use better patch description ([6d976b5](6d976b59bf))
2023-04-20 01:26:50 +00:00
oSumAtrIX
333327e0f9 fix(youtube/spoof-signature-verification): depend on client-spoof patch 2023-04-20 03:24:23 +02:00
oSumAtrIX
6d976b59bf feat: use better patch description 2023-04-20 03:24:23 +02:00
oSumAtrIX
acfdd6c35f fix(youtube/microg-support): rename patch correctly 2023-04-20 03:20:35 +02:00
oSumAtrIX
cf895378c7 fix(youtube/microg-support): remove incorrect patch dependency 2023-04-20 03:19:56 +02:00
oSumAtrIX
b4302a731a refactor: apply Kotlin coding conventions 2023-04-20 03:19:02 +02:00
semantic-release-bot
0770a3c06b chore(release): 2.168.0-dev.6 [skip ci]
# [2.168.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.168.0-dev.5...v2.168.0-dev.6) (2023-04-20)

### Features

* **photomath/unlock-plus:** bump compatibility to `8.21.1` ([#1926](https://github.com/revanced/revanced-patches/issues/1926)) ([39f9333](39f933389a))
2023-04-20 00:36:09 +00:00
badawoll
39f933389a feat(photomath/unlock-plus): bump compatibility to 8.21.1 (#1926) 2023-04-20 02:33:51 +02:00
semantic-release-bot
4b5f257b53 chore(release): 2.168.0-dev.5 [skip ci]
# [2.168.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.168.0-dev.4...v2.168.0-dev.5) (2023-04-19)

### Bug Fixes

* **youtube/hide-video-action-buttons:** change 'Hide create, clip and thanks buttons' to default off ([#1923](https://github.com/revanced/revanced-patches/issues/1923)) ([dcfa408](dcfa4089d4))
2023-04-19 08:22:52 +00:00
LisoUseInAIKyrios
dcfa4089d4 fix(youtube/hide-video-action-buttons): change 'Hide create, clip and thanks buttons' to default off (#1923) 2023-04-19 12:20:48 +04:00
semantic-release-bot
28ea913f06 chore(release): 2.168.0-dev.4 [skip ci]
# [2.168.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.168.0-dev.3...v2.168.0-dev.4) (2023-04-19)

### Bug Fixes

* **youtube/return-youtube-dislike:** render dislikes when scrolling into the screen ([#1873](https://github.com/revanced/revanced-patches/issues/1873)) ([c54cef5](c54cef5078))
2023-04-19 06:37:30 +00:00
LisoUseInAIKyrios
c54cef5078 fix(youtube/return-youtube-dislike): render dislikes when scrolling into the screen (#1873)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-04-19 10:35:44 +04:00
semantic-release-bot
261357017d chore(release): 2.168.0-dev.3 [skip ci]
# [2.168.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.168.0-dev.2...v2.168.0-dev.3) (2023-04-18)

### Bug Fixes

* **youtubevanced/hide-ads:** remove broken ad filter ([#1881](https://github.com/revanced/revanced-patches/issues/1881)) ([27d5864](27d5864684))

### Features

* **memegenerator:** `unlock-pro` patch ([#1902](https://github.com/revanced/revanced-patches/issues/1902)) ([01a73c0](01a73c0a9c))
2023-04-18 23:48:57 +00:00
badawoll
01a73c0a9c feat(memegenerator): unlock-pro patch (#1902)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-04-19 01:47:17 +02:00
johnconner122
27d5864684 fix(youtubevanced/hide-ads): remove broken ad filter (#1881) 2023-04-19 01:45:47 +02:00
semantic-release-bot
509f56b5b7 chore(release): 2.168.0-dev.2 [skip ci]
# [2.168.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.168.0-dev.1...v2.168.0-dev.2) (2023-04-16)

### Features

* **youtube/sponsorblock:** skip to video highlight ([#1874](https://github.com/revanced/revanced-patches/issues/1874)) ([1b7a3e3](1b7a3e34ed))
2023-04-16 18:19:54 +00:00
LisoUseInAIKyrios
1b7a3e34ed feat(youtube/sponsorblock): skip to video highlight (#1874) 2023-04-16 22:18:16 +04:00
28 changed files with 471 additions and 140 deletions

View File

@@ -1,3 +1,57 @@
# [2.168.0-dev.7](https://github.com/revanced/revanced-patches/compare/v2.168.0-dev.6...v2.168.0-dev.7) (2023-04-20)
### Bug Fixes
* **youtube/microg-support:** remove incorrect patch dependency ([ec85a47](https://github.com/revanced/revanced-patches/commit/ec85a478cbcc252debf902918b8e90c797f57478))
* **youtube/microg-support:** rename patch correctly ([d5c7d63](https://github.com/revanced/revanced-patches/commit/d5c7d63f75b6d9c1817f71a090516dc321eca086))
* **youtube/spoof-signature-verification:** depend on `client-spoof` patch ([5547bd1](https://github.com/revanced/revanced-patches/commit/5547bd1ceb73bbfc934157ce87482226780a1f10))
### Features
* use better patch description ([32c0805](https://github.com/revanced/revanced-patches/commit/32c08056963fab4c5e69f8e5be7479f4b26cacc2))
# [2.168.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.168.0-dev.5...v2.168.0-dev.6) (2023-04-20)
### Features
* **photomath/unlock-plus:** bump compatibility to `8.21.1` ([#1926](https://github.com/revanced/revanced-patches/issues/1926)) ([33b77fa](https://github.com/revanced/revanced-patches/commit/33b77fac657c5bb1e1fac6ce745f65f71dabf6ad))
# [2.168.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.168.0-dev.4...v2.168.0-dev.5) (2023-04-19)
### Bug Fixes
* **youtube/hide-video-action-buttons:** change 'Hide create, clip and thanks buttons' to default off ([#1923](https://github.com/revanced/revanced-patches/issues/1923)) ([734e328](https://github.com/revanced/revanced-patches/commit/734e328767c017d535a0359f8ba5e5816f4b17b8))
# [2.168.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.168.0-dev.3...v2.168.0-dev.4) (2023-04-19)
### Bug Fixes
* **youtube/return-youtube-dislike:** render dislikes when scrolling into the screen ([#1873](https://github.com/revanced/revanced-patches/issues/1873)) ([6f851e4](https://github.com/revanced/revanced-patches/commit/6f851e425337ff78437330624a3cd7167cc4f920))
# [2.168.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.168.0-dev.2...v2.168.0-dev.3) (2023-04-18)
### Bug Fixes
* **youtubevanced/hide-ads:** remove broken ad filter ([#1881](https://github.com/revanced/revanced-patches/issues/1881)) ([2be5194](https://github.com/revanced/revanced-patches/commit/2be5194797e310a7a6cf2693fedd422405ae580c))
### Features
* **memegenerator:** `unlock-pro` patch ([#1902](https://github.com/revanced/revanced-patches/issues/1902)) ([3daf875](https://github.com/revanced/revanced-patches/commit/3daf875a2e64a5a32bcdffb5a9b15ee2a66d2741))
# [2.168.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.168.0-dev.1...v2.168.0-dev.2) (2023-04-16)
### Features
* **youtube/sponsorblock:** skip to video highlight ([#1874](https://github.com/revanced/revanced-patches/issues/1874)) ([ed335fb](https://github.com/revanced/revanced-patches/commit/ed335fb9a0009d74078564dcbbeabc99d2323bb4))
# [2.168.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.167.1...v2.168.0-dev.1) (2023-04-16)

View File

@@ -10,7 +10,7 @@ The official Patch bundle provided by ReVanced and the community.
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `always-autorepeat` | Always repeats the playing video again. | 18.08.37 |
| `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all |
| `client-spoof` | Spoofs a patched client to allow playback. | all |
| `comments` | Hides components related to comments. | 18.08.37 |
| `copy-video-url` | Adds buttons in player to copy video links. | 18.08.37 |
| `custom-branding` | Changes the YouTube launcher icon and name to your choice (defaults to ReVanced). | all |
@@ -46,7 +46,6 @@ The official Patch bundle provided by ReVanced and the community.
| `hide-video-action-buttons` | Adds the options to hide action buttons under a video. | 18.08.37 |
| `hide-watch-in-vr` | Hides the option to watch in VR from the player settings flyout panel. | 18.08.37 |
| `hide-watermark` | Hides creator's watermarks on videos. | 18.08.37 |
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 18.08.37 |
| `minimized-playback` | Enables minimized and background playback. | 18.08.37 |
| `old-quality-layout` | Enables the original video quality flyout in the video player settings | 18.08.37 |
| `open-links-externally` | Open links outside of the app directly in your browser. | 18.08.37 |
@@ -58,10 +57,11 @@ The official Patch bundle provided by ReVanced and the community.
| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 18.08.37 |
| `sponsorblock` | Integrates SponsorBlock which allows skipping video segments such as sponsored content. | 18.08.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. | 18.08.37 |
| `spoof-signature-verification` | Spoofs the client to prevent playback issues. | 18.08.37 |
| `spoof-signature-verification` | Spoofs a patched client to prevent playback issues. | 18.08.37 |
| `swipe-controls` | Adds volume and brightness swipe controls. | 18.08.37 |
| `tablet-mini-player` | Enables the tablet mini player layout. | 18.08.37 |
| `theme` | Applies a custom theme. | all |
| `vanced-microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 18.08.37 |
| `video-ads` | Removes ads in the video player. | 18.08.37 |
</details>
@@ -164,7 +164,7 @@ The official Patch bundle provided by ReVanced and the community.
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all |
| `client-spoof` | Spoofs a patched client to allow playback. | all |
| `hide-ads` | Removes general ads. | all |
</details>
@@ -287,7 +287,7 @@ The official Patch bundle provided by ReVanced and the community.
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-plus` | Unlocks plus features. | all |
| `unlock-plus` | Unlocks plus features. | 8.9.0 |
</details>
### [📦 `io.yuka.android`](https://play.google.com/store/apps/details?id=io.yuka.android)
@@ -338,6 +338,14 @@ The official Patch bundle provided by ReVanced and the community.
| `unlock-pro` | Unlocks all professional features. | 3.4.9 |
</details>
### [📦 `com.zombodroid.MemeGenerator`](https://play.google.com/store/apps/details?id=com.zombodroid.MemeGenerator)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks pro features. | 4.6364 |
</details>
### [📦 `com.awedea.nyx`](https://play.google.com/store/apps/details?id=com.awedea.nyx)
<details>

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.168.0-dev.1
version = 2.168.0-dev.7

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,24 @@
package app.revanced.patches.memegenerator.detection.license.fingerprint
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 LicenseValidationFingerprint : MethodFingerprint(
returnType = "Z",
access = AccessFlags.PUBLIC or AccessFlags.STATIC,
parameters = listOf("Landroid/content/Context;"),
opcodes = listOf(
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_WIDE,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_WIDE,
Opcode.CMP_LONG,
Opcode.IF_GEZ,
Opcode.CONST_4,
Opcode.RETURN,
Opcode.CONST_4,
Opcode.RETURN
)
)

View File

@@ -0,0 +1,31 @@
package app.revanced.patches.memegenerator.detection.license.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.replaceInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patches.memegenerator.detection.license.fingerprint.LicenseValidationFingerprint
@Description("Disables Firebase license validation.")
@Version("0.0.1")
class LicenseValidationPatch : BytecodePatch(
listOf(LicenseValidationFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
LicenseValidationFingerprint.result?.apply {
mutableMethod.replaceInstructions(
0,
"""
const/4 p0, 0x1
return p0
"""
)
} ?: throw LicenseValidationFingerprint.toErrorResult()
return PatchResultSuccess()
}
}

View File

@@ -0,0 +1,35 @@
package app.revanced.patches.memegenerator.detection.signature.fingerprint
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@FuzzyPatternScanMethod(2)
object VerifySignatureFingerprint : MethodFingerprint(
returnType = "Z",
access = AccessFlags.PUBLIC or AccessFlags.STATIC,
parameters = listOf("Landroid/app/Activity;"),
opcodes = listOf(
Opcode.SGET_OBJECT,
Opcode.IF_NEZ,
Opcode.INVOKE_STATIC,
Opcode.CONST_4,
Opcode.CONST_4,
Opcode.SGET_OBJECT,
Opcode.ARRAY_LENGTH,
Opcode.IF_GE,
Opcode.AGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.SGET_OBJECT,
Opcode.IF_EQZ,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.IF_EQZ,
Opcode.CONST_4,
Opcode.RETURN,
Opcode.ADD_INT_LIT8
),
)

View File

@@ -0,0 +1,31 @@
package app.revanced.patches.memegenerator.detection.signature.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.replaceInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patches.memegenerator.detection.signature.fingerprint.VerifySignatureFingerprint
@Description("Disables detection of incorrect signature.")
@Version("0.0.1")
class SignatureVerificationPatch : BytecodePatch(
listOf(VerifySignatureFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
VerifySignatureFingerprint.result?.apply {
mutableMethod.replaceInstructions(
0,
"""
const/4 p0, 0x1
return p0
"""
)
} ?: throw VerifySignatureFingerprint.toErrorResult()
return PatchResultSuccess()
}
}

View File

@@ -0,0 +1,8 @@
package app.revanced.patches.memegenerator.misc.pro.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("com.zombodroid.MemeGenerator", arrayOf("4.6364"))])
@Target(AnnotationTarget.CLASS)
internal annotation class UnlockProCompatibility

View File

@@ -0,0 +1,22 @@
package app.revanced.patches.memegenerator.misc.pro.fingerprint
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 IsFreeVersionFingerprint : MethodFingerprint(
returnType = "Ljava/lang/Boolean;",
access = AccessFlags.PUBLIC or AccessFlags.STATIC,
strings = listOf("free"),
parameters = listOf("Landroid/content/Context;"),
opcodes = listOf(
Opcode.SGET,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.CONST_STRING,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.IF_EQZ
)
)

View File

@@ -0,0 +1,45 @@
package app.revanced.patches.memegenerator.misc.pro.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.replaceInstructions
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.memegenerator.detection.license.patch.LicenseValidationPatch
import app.revanced.patches.memegenerator.detection.signature.patch.SignatureVerificationPatch
import app.revanced.patches.memegenerator.misc.pro.annotations.UnlockProCompatibility
import app.revanced.patches.memegenerator.misc.pro.fingerprint.IsFreeVersionFingerprint
@Patch
@Name("unlock-pro")
@Description("Unlocks pro features.")
@DependsOn([
SignatureVerificationPatch::class,
LicenseValidationPatch::class
])
@UnlockProCompatibility
@Version("0.0.1")
class UnlockProVersionPatch : BytecodePatch(
listOf(
IsFreeVersionFingerprint
)
) {
override fun execute(context: BytecodeContext): PatchResult {
IsFreeVersionFingerprint.result?.apply {
mutableMethod.replaceInstructions(0,
"""
sget-object p0, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean;
return-object p0
"""
)
} ?: throw IsFreeVersionFingerprint.toErrorResult()
return PatchResultSuccess()
}
}

View File

@@ -1,30 +0,0 @@
package app.revanced.patches.photomath.detection.signature.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.microblink.photomath", arrayOf(
"8.6.0",
"8.7.0",
"8.8.0",
"8.9.0",
"8.10.0",
"8.11.0",
"8.12.0",
"8.13.0",
"8.14.0",
"8.15.0",
"8.16.0",
"8.17.0",
"8.18.0",
"8.18.1",
"8.19.0",
"8.20.0",
"8.21.0",
)
)]
)
@Target(AnnotationTarget.CLASS)
internal annotation class DisableSignatureDetectionCompatibility

View File

@@ -9,12 +9,10 @@ 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.patches.photomath.detection.signature.annotations.DisableSignatureDetectionCompatibility
import app.revanced.patches.photomath.detection.signature.fingerprints.CheckSignatureFingerprint
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Description("Disables detection of incorrect signature.")
@DisableSignatureDetectionCompatibility
@Version("0.0.2")
class SignatureDetectionPatch : BytecodePatch(
listOf(

View File

@@ -3,6 +3,28 @@ package app.revanced.patches.photomath.misc.unlockplus.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("com.microblink.photomath")])
@Compatibility(
[Package(
"com.microblink.photomath", arrayOf(
"8.6.0",
"8.7.0",
"8.8.0",
"8.9.0",
"8.10.0",
"8.11.0",
"8.12.0",
"8.13.0",
"8.14.0",
"8.15.0",
"8.16.0",
"8.17.0",
"8.18.0",
"8.18.1",
"8.19.0",
"8.20.0",
"8.21.0",
)
)]
)
@Target(AnnotationTarget.CLASS)
internal annotation class UnlockPlusCompatibilty
internal annotation class UnlockPlusCompatibilty

View File

@@ -1,5 +1,6 @@
package app.revanced.patches.shared.misc.fix.spoof.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
@@ -16,22 +17,26 @@ import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
@Patch
@Name("client-spoof")
@Description("Spoofs the YouTube or Vanced client to prevent playback issues.")
@Description("Spoofs a patched client to allow playback.")
@ClientSpoofCompatibility
@Version("0.0.1")
class ClientSpoofPatch : BytecodePatch(
listOf(UserAgentHeaderBuilderFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
val result = UserAgentHeaderBuilderFingerprint.result!!
val method = result.mutableMethod
UserAgentHeaderBuilderFingerprint.result?.let { result ->
val insertIndex = result.scanResult.patternScanResult!!.endIndex
result.mutableMethod.apply {
val packageNameRegister = (instruction(insertIndex) as FiveRegisterInstruction).registerD
addInstruction(insertIndex, "const-string v$packageNameRegister, \"$ORIGINAL_PACKAGE_NAME\"")
}
val insertIndex = result.scanResult.patternScanResult!!.endIndex
val packageNameRegister = (method.instruction(insertIndex) as FiveRegisterInstruction).registerD
val originalPackageName = "com.google.android.youtube"
method.addInstruction(insertIndex, "const-string v$packageNameRegister, \"$originalPackageName\"")
} ?: return UserAgentHeaderBuilderFingerprint.toErrorResult()
return PatchResultSuccess()
}
private companion object {
private const val ORIGINAL_PACKAGE_NAME = "com.google.android.youtube"
}
}

View File

@@ -61,7 +61,7 @@ class HideButtonsPatch : ResourcePatch {
SwitchPreference(
"revanced_hide_action_button",
StringResource("revanced_hide_action_button_title", "Hide create, clip and thanks buttons"),
true,
false,
StringResource("revanced_hide_action_button_summary_on", "Buttons are hidden"),
StringResource("revanced_hide_action_button_summary_off", "Buttons are shown")
),

View File

@@ -10,11 +10,12 @@ object ShortsTextComponentParentFingerprint : MethodFingerprint(
access = AccessFlags.PROTECTED or AccessFlags.FINAL,
parameters = listOf("L", "L"),
opcodes = listOf(
Opcode.IF_EQZ,
Opcode.CONST_4,
Opcode.IF_EQ,
Opcode.CONST_4,
Opcode.IF_EQ,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.GOTO,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.RETURN_VOID,
Opcode.IGET_OBJECT,
Opcode.CHECK_CAST,

View File

@@ -0,0 +1,34 @@
package app.revanced.patches.youtube.layout.returnyoutubedislike.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
/**
* Resolves against the same method that [TextComponentContextFingerprint] resolves to.
*/
object TextComponentAtomicReferenceFingerprint : MethodFingerprint(
returnType = "L",
access = AccessFlags.PROTECTED or AccessFlags.FINAL,
parameters = listOf("L"),
opcodes = listOf(
Opcode.MOVE_OBJECT, // available unused register
Opcode.MOVE_OBJECT_FROM16,
Opcode.MOVE_OBJECT_FROM16,
Opcode.MOVE_FROM16,
Opcode.INVOKE_VIRTUAL, // CharSequence atomic reference
Opcode.MOVE_RESULT_OBJECT,
Opcode.CHECK_CAST,
Opcode.MOVE_OBJECT, // CharSequence reference, and control flow label. Insert code here.
Opcode.INVOKE_VIRTUAL_RANGE,
Opcode.MOVE_RESULT,
Opcode.IF_EQZ,
Opcode.INVOKE_VIRTUAL_RANGE,
Opcode.MOVE_RESULT_OBJECT,
Opcode.GOTO,
Opcode.CONST_4,
Opcode.INVOKE_VIRTUAL_RANGE,
Opcode.MOVE_RESULT_OBJECT,
)
)

View File

@@ -0,0 +1,24 @@
package app.revanced.patches.youtube.layout.returnyoutubedislike.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
/**
* Resolves against the same method that [TextComponentContextFingerprint] resolves to.
*/
object TextComponentContextFingerprint : MethodFingerprint(
returnType = "L",
access = AccessFlags.PROTECTED or AccessFlags.FINAL,
parameters = listOf("L"),
opcodes = listOf(
Opcode.IGET_OBJECT, // conversion context field name
Opcode.IGET_OBJECT,
Opcode.IGET_OBJECT,
Opcode.IGET_BOOLEAN,
Opcode.IGET,
Opcode.IGET,
Opcode.IGET,
)
)

View File

@@ -1,14 +0,0 @@
package app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.Opcode
object TextReferenceFingerprint : MethodFingerprint(
opcodes = listOf(
Opcode.INVOKE_STATIC_RANGE,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_DIRECT,
Opcode.INVOKE_VIRTUAL
)
)

View File

@@ -1,11 +0,0 @@
package app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.Opcode
object TextReferenceParamFingerprint : MethodFingerprint(
opcodes = listOf(
Opcode.MOVE_OBJECT,
Opcode.MOVE_OBJECT_FROM16 // the first occurrence of this instruction uses the register for the text object
)
)

View File

@@ -9,6 +9,7 @@ import app.revanced.patcher.data.toMethodWalker
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.instruction
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
@@ -25,8 +26,8 @@ import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
@Patch
@@ -52,13 +53,13 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
)
) {
override fun execute(context: BytecodeContext): PatchResult {
// region Inject newVideoLoaded event handler
// region Inject newVideoLoaded event handler to update dislikes when a new video is loaded.
VideoIdPatch.injectCall("$INTEGRATIONS_PATCH_CLASS_DESCRIPTOR->newVideoLoaded(Ljava/lang/String;)V")
// endregion
// region Hook interaction
// region Hook like/dislike/remove like button clicks to send votes to the API.
listOf(
LikeFingerprint.toPatch(Vote.LIKE),
@@ -78,39 +79,56 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
// endregion
// region Hook components
// region Hook creation of Spans and the cached lookup of them.
TextReferenceFingerprint.also {
// Alternatively the hook can be made at the creation of Spans in TextComponentSpec,
// And it works in all situations except it fails to update the Span when the user dislikes,
// since the underlying (likes only) text did not change.
// This hook handles all situations, as it's where the created Spans are stored and later reused.
TextComponentContextFingerprint.also {
it.resolve(
context,
TextComponentConstructorFingerprint.result!!.classDef
)
}.result?.let { result ->
val moveTextRefParamInstructionIndex = TextReferenceParamFingerprint.also {
if (!TextReferenceParamFingerprint.resolve(context, result.method, result.classDef))
return TextReferenceParamFingerprint.toErrorResult()
}.result!!.scanResult.patternScanResult!!.endIndex
}.result?.also { result ->
if (!TextComponentAtomicReferenceFingerprint.resolve(context, result.method, result.classDef))
throw TextComponentAtomicReferenceFingerprint.toErrorResult()
}?.let { textComponentContextFingerprintResult ->
val conversionContextIndex = textComponentContextFingerprintResult
.scanResult.patternScanResult!!.startIndex
val atomicReferenceStartIndex = TextComponentAtomicReferenceFingerprint.result!!
.scanResult.patternScanResult!!.startIndex
result.mutableMethod.apply {
val insertIndex = result.scanResult.patternScanResult!!.endIndex
textComponentContextFingerprintResult.mutableMethod.apply {
// Get the conversion context obfuscated field name, and the registers for the AtomicReference and CharSequence
val conversionContextFieldName =
(instruction(conversionContextIndex) as ReferenceInstruction).reference.toString()
val contextRegister = // any free register
(instruction(atomicReferenceStartIndex) as TwoRegisterInstruction).registerB
val atomicReferenceRegister =
(instruction(atomicReferenceStartIndex + 4) as BuilderInstruction35c).registerC
val atomicReferenceInstruction = (instruction(insertIndex - 1) as FiveRegisterInstruction)
val conversionContextParam = atomicReferenceInstruction.registerC
val textRefParam = (instruction(moveTextRefParamInstructionIndex) as TwoRegisterInstruction).registerA
// Overwritten after injected code, which is why it can be used.
val clobberRegister = atomicReferenceInstruction.registerD
val insertIndex = atomicReferenceStartIndex + 7
val moveCharSequenceInstruction = instruction(insertIndex) as TwoRegisterInstruction
val charSequenceRegister = moveCharSequenceInstruction.registerB
// Insert as first instructions at the control flow label.
// Must replace the existing instruction to preserve the label, and then insert the remaining instructions.
replaceInstruction(insertIndex, "move-object/from16 v$contextRegister, p0")
addInstructions(
insertIndex,
"""
# required instruction, otherwise register might be out of range
move-object/from16 v$clobberRegister, v$textRefParam
invoke-static {v$clobberRegister, v$conversionContextParam}, $ON_COMPONENT_CREATED_DESCRIPTOR
insertIndex + 1, """
iget-object v$contextRegister, v$contextRegister, $conversionContextFieldName # copy obfuscated context field into free register
invoke-static {v$contextRegister, v$atomicReferenceRegister, v$charSequenceRegister}, $INTEGRATIONS_PATCH_CLASS_DESCRIPTOR->onLithoTextLoaded(Ljava/lang/Object;Ljava/util/concurrent/atomic/AtomicReference;Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
move-result-object v$charSequenceRegister
move-object v${moveCharSequenceInstruction.registerA}, v${moveCharSequenceInstruction.registerB} # original instruction at the insertion point
"""
)
}
} ?: return TextReferenceFingerprint.toErrorResult()
} ?: return TextComponentContextFingerprint.toErrorResult()
// endregion
// region Hook for Short videos.
ShortsTextComponentParentFingerprint.result?.let {
context
@@ -123,22 +141,23 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
return PatchResultError("Method signature did not match: $this $parameterTypes")
val insertIndex = implementation!!.instructions.size - 1
val spannedParameterRegister = (instruction(insertIndex) as OneRegisterInstruction).registerA
val parameter = (instruction(insertIndex - 2) as BuilderInstruction35c).reference
if (!parameter.toString().endsWith("Landroid/text/Spanned;"))
return PatchResultError("Method signature parameter did not match: $parameter")
addInstructions(
insertIndex,
"""
invoke-static {v$spannedParameterRegister}, $INTEGRATIONS_PATCH_CLASS_DESCRIPTOR->onShortsComponentCreated(Landroid/text/Spanned;)Landroid/text/Spanned;
move-result-object v$spannedParameterRegister
"""
)
insertShorts(insertIndex, spannedParameterRegister)
}
}
// Additional hook, called after user dislikes.
with(it.mutableMethod) {
val insertIndex = it.scanResult.patternScanResult!!.startIndex + 2
val overwriteRegister = (implementation!!.instructions.elementAt(insertIndex - 1)
as OneRegisterInstruction).registerA
insertShorts(insertIndex, overwriteRegister)
}
} ?: return ShortsTextComponentParentFingerprint.toErrorResult()
// endregion
@@ -150,17 +169,21 @@ class ReturnYouTubeDislikePatch : BytecodePatch(
const val INTEGRATIONS_PATCH_CLASS_DESCRIPTOR =
"Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;"
const val ON_COMPONENT_CREATED_DESCRIPTOR =
"$INTEGRATIONS_PATCH_CLASS_DESCRIPTOR->onComponentCreated(Ljava/lang/Object;Ljava/util/concurrent/atomic/AtomicReference;)V"
private fun MethodFingerprint.toPatch(voteKind: Vote) = VotePatch(this, voteKind)
}
private data class VotePatch(val fingerprint: MethodFingerprint, val voteKind: Vote)
private enum class Vote(val value: Int) {
LIKE(1),
DISLIKE(-1),
REMOVE_LIKE(0)
}
private data class VotePatch(val fingerprint: MethodFingerprint, val voteKind: Vote)
private enum class Vote(val value: Int) {
LIKE(1),
DISLIKE(-1),
REMOVE_LIKE(0)
private fun MutableMethod.insertShorts(index: Int, register: Int) {
addInstructions(
index, """
invoke-static {v$register}, $INTEGRATIONS_PATCH_CLASS_DESCRIPTOR->onShortsComponentCreated(Landroid/text/Spanned;)Landroid/text/Spanned;
move-result-object v$register
"""
)
}
}
}

View File

@@ -14,6 +14,7 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.shared.misc.fix.spoof.patch.ClientSpoofPatch
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.misc.fix.playback.annotation.ProtobufSpoofCompatibility
@@ -27,9 +28,14 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Patch
@Name("spoof-signature-verification")
@Description("Spoofs the client to prevent playback issues.")
@Description("Spoofs a patched client to prevent playback issues.")
@ProtobufSpoofCompatibility
@DependsOn([IntegrationsPatch::class, SettingsPatch::class, PlayerTypeHookPatch::class])
@DependsOn([
IntegrationsPatch::class,
SettingsPatch::class,
PlayerTypeHookPatch::class,
ClientSpoofPatch::class
])
@Version("0.0.1")
class SpoofSignatureVerificationPatch : BytecodePatch(
listOf(

View File

@@ -25,10 +25,9 @@ import app.revanced.util.microg.MicroGBytecodeHelper
[
MicroGResourcePatch::class,
HideCastButtonPatch::class,
ClientSpoofPatch::class
]
)
@Name("microg-support")
@Name("vanced-microg-support")
@Description("Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG.")
@MicroGPatchCompatibility
@Version("0.0.1")

View File

@@ -47,8 +47,7 @@ class HideAdsPatch : BytecodePatch(
"hero_promo_image",
"statement_banner",
"primetime_promo",
"carousel_footered_layout",
"feature_grid_interstitial"
"carousel_footered_layout"
).forEach { component ->
addInstructions(
insertIndex, """

View File

@@ -44,6 +44,8 @@
<string name="sb_segments_selfpromo_sum">Similar to \'Sponsor\' except for unpaid or self promotion. Includes sections about merchandise, donations, or information about who they collaborated with</string>
<string name="sb_segments_interaction">Interaction Reminder (Subscribe)</string>
<string name="sb_segments_interaction_sum">A short reminder to like, subscribe or follow them in the middle of content. If it is long or about something specific, it should instead be under self promotion</string>
<string name="sb_segments_highlight">Highlight</string>
<string name="sb_segments_highlight_sum">The part of the video that most people are looking for</string>
<string name="sb_segments_intro">Intermission/Intro Animation</string>
<string name="sb_segments_intro_sum">An interval without actual content. Could be a pause, static frame, or repeating animation. Does not include transitions containing information</string>
<string name="sb_segments_outro">Endcards/Credits</string>
@@ -56,9 +58,11 @@
<string name="sb_segments_nomusic_sum">Only for use in music videos. Sections of music videos without music, that aren\'t already covered by another category</string>
<string name="sb_skip_button_compact">Skip</string>
<string name="sb_skip_button_compact_highlight">Highlight</string>
<string name="sb_skip_button_sponsor">Skip sponsor</string>
<string name="sb_skip_button_selfpromo">Skip promo</string>
<string name="sb_skip_button_interaction">Skip interact</string>
<string name="sb_skip_button_highlight">Skip to highlight</string>
<string name="sb_skip_button_intro_beginning">Skip intro</string>
<string name="sb_skip_button_intro_middle">Skip intermission</string>
<string name="sb_skip_button_intro_end">Skip intermission</string>
@@ -73,6 +77,7 @@
<string name="sb_skipped_sponsor">Skipped sponsor</string>
<string name="sb_skipped_selfpromo">Skipped self promotion</string>
<string name="sb_skipped_interaction">Skipped annoying reminder</string>
<string name="sb_skipped_highlight">Skipped to highlight</string>
<string name="sb_skipped_intro_beginning">Skipped intro</string>
<string name="sb_skipped_intro_middle">Skipped intermission</string>
<string name="sb_skipped_intro_end">Skipped intermission</string>
@@ -119,7 +124,7 @@
<string name="sb_new_segment_choose_category">Choose the segment category</string>
<string name="sb_new_segment_disabled_category">Category is disabled in settings. Enable category to submit.</string>
<string name="sb_new_segment_title">New SponsorBlock segment</string>
<string name="sb_new_segment_mark_time_as_question" formatted="false">Set %02d:%02d:%04d as the start or end of a new segment?</string>
<string name="sb_new_segment_mark_time_as_question" formatted="false">Set %02d:%02d:%03d as the start or end of a new segment?</string>
<string name="sb_new_segment_mark_start">start</string>
<string name="sb_new_segment_mark_end">end</string>
<string name="sb_new_segment_now">now</string>
@@ -127,6 +132,7 @@
<string name="sb_new_segment_time_end">Time the segment ends at</string>
<string name="sb_new_segment_confirm_title">Are the times correct?</string>
<string name="sb_new_segment_confirm_content" formatted="false">The segment lasts from %02d:%02d to %02d:%02d (%d minutes %02d seconds)\nIs it ready to submit?</string>
<string name="sb_new_segment_start_is_before_end">Start must be before the end</string>
<string name="sb_new_segment_mark_locations_first">Mark two locations on the time bar first</string>
<string name="sb_new_segment_preview_segment_first">Preview the segment, and ensure it skips smoothly</string>
<string name="sb_new_segment_edit_by_hand_title">Edit timing of segment manually</string>

View File

@@ -1,6 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<app.revanced.integrations.sponsorblock.ui.SkipSponsorButton
android:id="@+id/sb_skip_highlight_button"
android:contentDescription="@string/sb_skip_button_compact_highlight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/inline_controls_bottom_bar_height"
android:focusable="true"
android:visibility="gone" />
<app.revanced.integrations.sponsorblock.ui.SkipSponsorButton
android:id="@+id/sb_skip_sponsor_button"
android:contentDescription="@string/sb_skip_button_compact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/inline_controls_bottom_bar_height"
android:focusable="true"
android:visibility="gone" />
<app.revanced.integrations.sponsorblock.ui.NewSegmentLayout
android:id="@+id/sb_new_segment_view"
android:layout_width="wrap_content"
@@ -10,14 +32,4 @@
android:layout_marginBottom="@dimen/brand_interaction_default_bottom_margin"
android:focusable="true"
android:visibility="gone" />
<app.revanced.integrations.sponsorblock.ui.SkipSponsorButton
android:id="@+id/sb_skip_sponsor_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/inline_controls_bottom_bar_height"
android:focusable="true"
android:visibility="gone" />
</merge>

View File

@@ -7,7 +7,6 @@
android:layout_width="wrap_content"
android:layout_height="32dp"
android:layout_gravity="center_vertical"
android:contentDescription="@string/sb_skip_button_compact"
android:orientation="horizontal"
android:padding="8dp">