mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-19 09:03:58 +00:00
Compare commits
19 Commits
v2.148.0-d
...
v2.149.1-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1db7eebeaa | ||
|
|
50e210d94f | ||
|
|
ad6fab930d | ||
|
|
7966be827f | ||
|
|
6a6f05e2cb | ||
|
|
752b12b66d | ||
|
|
623a9bce98 | ||
|
|
6441b031e3 | ||
|
|
4227ffa40f | ||
|
|
9158fd5054 | ||
|
|
7f529d1038 | ||
|
|
bb38c02b51 | ||
|
|
b927e8b93f | ||
|
|
ba4676d500 | ||
|
|
1af1bf8342 | ||
|
|
2374af6f82 | ||
|
|
4da3e4f369 | ||
|
|
f89027609f | ||
|
|
7e3184b5f7 |
2
.github/workflows/pull_request.yml
vendored
2
.github/workflows/pull_request.yml
vendored
@@ -7,7 +7,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
MESSAGE: merge branch \`${{ github.head_ref || github.ref_name }}\` to \`main\`
|
MESSAGE: merge branch `${{ github.head_ref || github.ref_name }}` to `main`
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pull-request:
|
pull-request:
|
||||||
|
|||||||
70
CHANGELOG.md
70
CHANGELOG.md
@@ -1,3 +1,73 @@
|
|||||||
|
## [2.149.1-dev.2](https://github.com/revanced/revanced-patches/compare/v2.149.1-dev.1...v2.149.1-dev.2) (2022-12-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **youtube/general-ads:** resolve fingerprint to correct method ([#1404](https://github.com/revanced/revanced-patches/issues/1404)) ([e135485](https://github.com/revanced/revanced-patches/commit/e1354852501cb582549cbf0634b1a15e1d0012d9))
|
||||||
|
|
||||||
|
## [2.149.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.149.0...v2.149.1-dev.1) (2022-12-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **youtube/bottom-controls-resource-patch:** use correct length for `nameSpaceLength` ([#1401](https://github.com/revanced/revanced-patches/issues/1401)) ([7190066](https://github.com/revanced/revanced-patches/commit/7190066a8ded8b59970483a81d7902526d552093))
|
||||||
|
|
||||||
|
# [2.149.0](https://github.com/revanced/revanced-patches/compare/v2.148.0...v2.149.0) (2022-12-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **tasker/unlock-license:** resolve fingerprint correctly ([92d7857](https://github.com/revanced/revanced-patches/commit/92d78576f033dd7155c80cb08d5911048b06c36c))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **youtube/general-ads-patch:** hide channel member shelf ([#1380](https://github.com/revanced/revanced-patches/issues/1380)) ([ce2b104](https://github.com/revanced/revanced-patches/commit/ce2b104f508f1581ec531446d60bd3d41dafbd2c))
|
||||||
|
|
||||||
|
# [2.149.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.148.0...v2.149.0-dev.1) (2022-12-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **tasker/unlock-license:** resolve fingerprint correctly ([92d7857](https://github.com/revanced/revanced-patches/commit/92d78576f033dd7155c80cb08d5911048b06c36c))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **youtube/general-ads-patch:** hide channel member shelf ([#1380](https://github.com/revanced/revanced-patches/issues/1380)) ([ce2b104](https://github.com/revanced/revanced-patches/commit/ce2b104f508f1581ec531446d60bd3d41dafbd2c))
|
||||||
|
|
||||||
|
# [2.148.0](https://github.com/revanced/revanced-patches/compare/v2.147.0...v2.148.0) (2022-12-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **youtube/general-ads:** don't early return when not necessary ([#1353](https://github.com/revanced/revanced-patches/issues/1353)) ([003a400](https://github.com/revanced/revanced-patches/commit/003a400ce41ff543fb5484c576f5ec2df0a87273))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **tasker:** `unlock-license` patch ([#1339](https://github.com/revanced/revanced-patches/issues/1339)) ([78a43b8](https://github.com/revanced/revanced-patches/commit/78a43b8abd972172eab99519dfa636ce77d9e64f))
|
||||||
|
* **twitter:** `hide-views-stats` patch ([#1371](https://github.com/revanced/revanced-patches/issues/1371)) ([2f04a06](https://github.com/revanced/revanced-patches/commit/2f04a06e3b782931870d973fd0937f8731062f12))
|
||||||
|
* **youtube/general-ads-patch:** hide guidelines for subscriber ([#1352](https://github.com/revanced/revanced-patches/issues/1352)) ([2d10932](https://github.com/revanced/revanced-patches/commit/2d1093251d5d50b476ca44f76acb9a8597b37aea))
|
||||||
|
* **youtube/theme:** add option to color the seekbar ([53b91fe](https://github.com/revanced/revanced-patches/commit/53b91fe2b5a41f1a63deec8d919f2a1bc1cae12a))
|
||||||
|
* **youtube/theme:** include the patch by default ([c363997](https://github.com/revanced/revanced-patches/commit/c3639975683fb0ca0e271e8fc3ef7fbf79f33414))
|
||||||
|
* **youtube:** `hide-breaking-news-shelf` patch ([#1381](https://github.com/revanced/revanced-patches/issues/1381)) ([38a9877](https://github.com/revanced/revanced-patches/commit/38a987744fbb49c2b7d5d0e69297e95f5ee405c4))
|
||||||
|
|
||||||
|
# [2.148.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.148.0-dev.5...v2.148.0-dev.6) (2022-12-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **youtube/theme:** add option to color the seekbar ([53b91fe](https://github.com/revanced/revanced-patches/commit/53b91fe2b5a41f1a63deec8d919f2a1bc1cae12a))
|
||||||
|
* **youtube/theme:** include the patch by default ([c363997](https://github.com/revanced/revanced-patches/commit/c3639975683fb0ca0e271e8fc3ef7fbf79f33414))
|
||||||
|
|
||||||
|
# [2.148.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.148.0-dev.4...v2.148.0-dev.5) (2022-12-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **youtube:** `hide-breaking-news-shelf` patch ([#1381](https://github.com/revanced/revanced-patches/issues/1381)) ([38a9877](https://github.com/revanced/revanced-patches/commit/38a987744fbb49c2b7d5d0e69297e95f5ee405c4))
|
||||||
|
|
||||||
# [2.148.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.148.0-dev.3...v2.148.0-dev.4) (2022-12-29)
|
# [2.148.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.148.0-dev.3...v2.148.0-dev.4) (2022-12-29)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
17
README.md
17
README.md
@@ -28,6 +28,7 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
| `hide-album-cards` | Hides the album cards below the artist description. | 17.49.37 |
|
| `hide-album-cards` | Hides the album cards below the artist description. | 17.49.37 |
|
||||||
| `hide-artist-card` | Hides the artist card below the searchbar. | 17.49.37 |
|
| `hide-artist-card` | Hides the artist card below the searchbar. | 17.49.37 |
|
||||||
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.49.37 |
|
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.49.37 |
|
||||||
|
| `hide-breaking-news-shelf` | Hides the breaking news shelf on the homepage tab. | 17.49.37 |
|
||||||
| `hide-captions-button` | Hides the captions button on video player. | 17.49.37 |
|
| `hide-captions-button` | Hides the captions button on video player. | 17.49.37 |
|
||||||
| `hide-cast-button` | Hides the cast button in the video player. | all |
|
| `hide-cast-button` | Hides the cast button in the video player. | all |
|
||||||
| `hide-create-button` | Hides the create button in the navigation bar. | 17.49.37 |
|
| `hide-create-button` | Hides the create button in the navigation bar. | 17.49.37 |
|
||||||
@@ -198,14 +199,6 @@ 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 |
|
| `promo-code-unlock` | Disables the validation of promo code. Any code will work to unlock all features. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### [📦 `net.dinglisch.android.taskerm`](https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `unlock-license` | Unlocks the trial version. | all |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `co.windyapp.android`](https://play.google.com/store/apps/details?id=co.windyapp.android)
|
### [📦 `co.windyapp.android`](https://play.google.com/store/apps/details?id=co.windyapp.android)
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
@@ -254,6 +247,14 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
| `unlock-themes` | Unlocks all themes. | all |
|
| `unlock-themes` | Unlocks all themes. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
### [📦 `net.dinglisch.android.taskerm`](https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm)
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `unlock-trial` | Unlocks the trial version. | all |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 📝 JSON Format
|
## 📝 JSON Format
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.148.0-dev.4
|
version = 2.149.1-dev.2
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,14 +0,0 @@
|
|||||||
package app.revanced.patches.tasker.license.unlock.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
object CheckLicenseFingerprint : MethodFingerprint(
|
|
||||||
strings = listOf("just(IsLicensedResult(true))"),
|
|
||||||
opcodes = listOf(
|
|
||||||
Opcode.GOTO,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
|
||||||
Opcode.INVOKE_VIRTUAL
|
|
||||||
)
|
|
||||||
)
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
package app.revanced.patches.tasker.license.unlock.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.instruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.tasker.license.unlock.annotations.UnlockLicenseCompatibility
|
|
||||||
import app.revanced.patches.tasker.license.unlock.fingerprints.CheckLicenseFingerprint
|
|
||||||
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
|
|
||||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
|
||||||
import org.jf.dexlib2.iface.reference.MethodReference
|
|
||||||
import org.jf.dexlib2.immutable.instruction.ImmutableInstruction35c
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("unlock-license")
|
|
||||||
@Description("Unlocks the trial version.")
|
|
||||||
@UnlockLicenseCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class UnlockLicensePatch : BytecodePatch(
|
|
||||||
listOf(
|
|
||||||
CheckLicenseFingerprint
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext) = CheckLicenseFingerprint.result?.let { result ->
|
|
||||||
val patchIndex = result.scanResult.patternScanResult!!.endIndex
|
|
||||||
|
|
||||||
with(result.mutableMethod.instruction(patchIndex) as FiveRegisterInstruction) {
|
|
||||||
ImmutableInstruction35c(
|
|
||||||
opcode,
|
|
||||||
registerCount,
|
|
||||||
registerC,
|
|
||||||
0, // registerE is 1, registerD is now 0 instead of 1 bypassing the license verification
|
|
||||||
registerE,
|
|
||||||
registerF,
|
|
||||||
registerG,
|
|
||||||
(this as ReferenceInstruction).reference as MethodReference
|
|
||||||
)
|
|
||||||
}
|
|
||||||
PatchResultSuccess()
|
|
||||||
} ?: CheckLicenseFingerprint.toErrorResult()
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.patches.tasker.license.unlock.annotations
|
package app.revanced.patches.tasker.trial.unlock.annotations
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
import app.revanced.patcher.annotation.Package
|
import app.revanced.patcher.annotation.Package
|
||||||
@@ -6,4 +6,4 @@ import app.revanced.patcher.annotation.Package
|
|||||||
@Compatibility([Package("net.dinglisch.android.taskerm")])
|
@Compatibility([Package("net.dinglisch.android.taskerm")])
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
internal annotation class UnlockLicenseCompatibility
|
internal annotation class UnlockTrialCompatibility
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package app.revanced.patches.tasker.trial.unlock.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object CheckLicenseFingerprint : MethodFingerprint(
|
||||||
|
strings = listOf("Can't check license")
|
||||||
|
)
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package app.revanced.patches.tasker.trial.unlock.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.addInstruction
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.tasker.trial.unlock.annotations.UnlockTrialCompatibility
|
||||||
|
import app.revanced.patches.tasker.trial.unlock.fingerprints.CheckLicenseFingerprint
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("unlock-trial")
|
||||||
|
@Description("Unlocks the trial version.")
|
||||||
|
@UnlockTrialCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class UnlockLicensePatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
CheckLicenseFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext) = CheckLicenseFingerprint
|
||||||
|
.result
|
||||||
|
?.mutableMethod
|
||||||
|
// Return the method early, which prompts the user with a non dismissible dialog, when the trial period is over.
|
||||||
|
?.addInstruction(0, "return-void")
|
||||||
|
?.let { PatchResultSuccess() }
|
||||||
|
?: CheckLicenseFingerprint.toErrorResult()
|
||||||
|
}
|
||||||
@@ -109,6 +109,13 @@ class GeneralAdsResourcePatch : ResourcePatch {
|
|||||||
StringResource("revanced_adremover_subscribers_community_guidelines_enabled_summary_on", "Subscribers community guidelines are hidden"),
|
StringResource("revanced_adremover_subscribers_community_guidelines_enabled_summary_on", "Subscribers community guidelines are hidden"),
|
||||||
StringResource("revanced_adremover_subscribers_community_guidelines_enabled_summary_off", "Subscribers community guidelines are shown")
|
StringResource("revanced_adremover_subscribers_community_guidelines_enabled_summary_off", "Subscribers community guidelines are shown")
|
||||||
),
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"revanced_adremover_channel_member_shelf_removal",
|
||||||
|
StringResource("revanced_adremover_channel_member_shelf_enabled_title", "Hide channel member shelf"),
|
||||||
|
true,
|
||||||
|
StringResource("revanced_adremover_channel_member_shelf_enabled_summary_on", "Channel member shelf is hidden"),
|
||||||
|
StringResource("revanced_adremover_channel_member_shelf_enabled_summary_off", "Channel member shelf is shown")
|
||||||
|
),
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_adremover_emergency_box_removal",
|
"revanced_adremover_emergency_box_removal",
|
||||||
StringResource("revanced_adremover_emergency_box_enabled_title", "Hide emergency boxes"),
|
StringResource("revanced_adremover_emergency_box_enabled_title", "Hide emergency boxes"),
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.homepage.breakingnews.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 BreakingNewsCompatibility
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.homepage.breakingnews.bytecode.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patches.youtube.layout.homepage.breakingnews.resource.patch.BreakingNewsResourcePatch
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
||||||
|
|
||||||
|
object BreakingNewsFingerprint : MethodFingerprint(
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.CONST,
|
||||||
|
Opcode.CONST_4,
|
||||||
|
Opcode.INVOKE_VIRTUAL,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.CHECK_CAST,
|
||||||
|
Opcode.IPUT_OBJECT,
|
||||||
|
),
|
||||||
|
customFingerprint = { methodDef ->
|
||||||
|
methodDef.implementation?.instructions?.any { instruction ->
|
||||||
|
instruction.opcode.ordinal == Opcode.CONST.ordinal &&
|
||||||
|
(instruction as? WideLiteralInstruction)?.wideLiteral == BreakingNewsResourcePatch.horizontalCardListId
|
||||||
|
} == true
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.homepage.breakingnews.bytecode.patch
|
||||||
|
|
||||||
|
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.addInstruction
|
||||||
|
import app.revanced.patcher.extensions.instruction
|
||||||
|
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.youtube.layout.homepage.breakingnews.annotations.BreakingNewsCompatibility
|
||||||
|
import app.revanced.patches.youtube.layout.homepage.breakingnews.bytecode.fingerprints.BreakingNewsFingerprint
|
||||||
|
import app.revanced.patches.youtube.layout.homepage.breakingnews.resource.patch.BreakingNewsResourcePatch
|
||||||
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@DependsOn([IntegrationsPatch::class, BreakingNewsResourcePatch::class])
|
||||||
|
@Name("hide-breaking-news-shelf")
|
||||||
|
@Description("Hides the breaking news shelf on the homepage tab.")
|
||||||
|
@BreakingNewsCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class BreakingNewsPatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
BreakingNewsFingerprint,
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
val breakingNewsResult = BreakingNewsFingerprint.result!!
|
||||||
|
val breakingNewsMethod = breakingNewsResult.mutableMethod
|
||||||
|
|
||||||
|
val moveResultObjectIndex =
|
||||||
|
breakingNewsResult.scanResult.patternScanResult!!.endIndex - 2
|
||||||
|
|
||||||
|
breakingNewsMethod.addInstruction(
|
||||||
|
moveResultObjectIndex + 1, """
|
||||||
|
invoke-static {v${(breakingNewsMethod.instruction(moveResultObjectIndex) as OneRegisterInstruction).registerA}}, Lapp/revanced/integrations/patches/HideBreakingNewsPatch;->hideBreakingNews(Landroid/view/View;)V
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.homepage.breakingnews.resource.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.ResourceContext
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
|
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||||
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
|
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||||
|
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||||
|
|
||||||
|
@Name("breaking-news-shelf-resource-patch")
|
||||||
|
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||||
|
@Version("0.0.1")
|
||||||
|
class BreakingNewsResourcePatch : ResourcePatch {
|
||||||
|
companion object {
|
||||||
|
internal var horizontalCardListId: Long = -1
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
|
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||||
|
SwitchPreference(
|
||||||
|
"revanced_hide_breaking_news",
|
||||||
|
StringResource("revanced_hide_breaking_news_title", "Hide breaking news"),
|
||||||
|
true,
|
||||||
|
StringResource("revanced_hide_breaking_news_summary_on", "Breaking news are hidden"),
|
||||||
|
StringResource("revanced_hide_breaking_news_summary_off", "Breaking news are shown")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
horizontalCardListId = ResourceMappingPatch.resourceMappings.single {
|
||||||
|
it.type == "layout" && it.name == "horizontal_card_list"
|
||||||
|
}.id
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,7 +13,7 @@ import app.revanced.util.resources.ResourceUtils
|
|||||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||||
import org.w3c.dom.Element
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
@Patch(include = false)
|
@Patch
|
||||||
@DependsOn([LithoThemePatch::class, FixLocaleConfigErrorPatch::class])
|
@DependsOn([LithoThemePatch::class, FixLocaleConfigErrorPatch::class])
|
||||||
@Name("theme")
|
@Name("theme")
|
||||||
@Description("Applies a custom theme.")
|
@Description("Applies a custom theme.")
|
||||||
@@ -23,6 +23,7 @@ class ThemePatch : ResourcePatch {
|
|||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
val darkThemeBackgroundColor = darkThemeBackgroundColor!!
|
val darkThemeBackgroundColor = darkThemeBackgroundColor!!
|
||||||
val lightThemeBackgroundColor = lightThemeBackgroundColor!!
|
val lightThemeBackgroundColor = lightThemeBackgroundColor!!
|
||||||
|
val darkThemeSeekbarColor = darkThemeSeekbarColor!!
|
||||||
|
|
||||||
context.xmlEditor["res/values/colors.xml"].use { editor ->
|
context.xmlEditor["res/values/colors.xml"].use { editor ->
|
||||||
val resourcesNode = editor.file.getElementsByTagName("resources").item(0) as Element
|
val resourcesNode = editor.file.getElementsByTagName("resources").item(0) as Element
|
||||||
@@ -31,20 +32,20 @@ class ThemePatch : ResourcePatch {
|
|||||||
val node = resourcesNode.childNodes.item(i) as? Element ?: continue
|
val node = resourcesNode.childNodes.item(i) as? Element ?: continue
|
||||||
|
|
||||||
node.textContent = when (node.getAttribute("name")) {
|
node.textContent = when (node.getAttribute("name")) {
|
||||||
"yt_black0", "yt_black1", "yt_black1_opacity95", "yt_black1_opacity98", "yt_black2", "yt_black3",
|
"yt_black0", "yt_black1", "yt_black1_opacity95", "yt_black1_opacity98", "yt_black2", "yt_black3", "yt_black4", "yt_status_bar_background_dark", "material_grey_850" -> darkThemeBackgroundColor
|
||||||
"yt_black4", "yt_status_bar_background_dark", "material_grey_850" -> darkThemeBackgroundColor
|
|
||||||
|
|
||||||
"yt_white1", "yt_white1_opacity95", "yt_white1_opacity98", "yt_white2", "yt_white3", "yt_white4",
|
"yt_white1", "yt_white1_opacity95", "yt_white1_opacity98", "yt_white2", "yt_white3", "yt_white4",
|
||||||
-> lightThemeBackgroundColor
|
-> lightThemeBackgroundColor
|
||||||
|
|
||||||
|
"inline_time_bar_colorized_bar_played_color_dark" -> darkThemeSeekbarColor
|
||||||
else -> continue
|
else -> continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// copies the resource file to change the splash screen color
|
// copies the resource file to change the splash screen color
|
||||||
context.copyResources("theme",
|
context.copyResources(
|
||||||
ResourceUtils.ResourceGroup("values-night-v31", "styles.xml")
|
"theme", ResourceUtils.ResourceGroup("values-night-v31", "styles.xml")
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
@@ -68,5 +69,14 @@ class ThemePatch : ResourcePatch {
|
|||||||
description = "The background color of the light theme. Can be a hex color or a resource reference.",
|
description = "The background color of the light theme. Can be a hex color or a resource reference.",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var darkThemeSeekbarColor: String? by option(
|
||||||
|
PatchOption.StringOption(
|
||||||
|
key = "darkThemeSeekbarColor",
|
||||||
|
default = "#ffff0000",
|
||||||
|
title = "Dark theme seekbar color",
|
||||||
|
description = "The background color of the seekbar of the dark theme. Leave empty for default color.",
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ object CanScrollVerticallyFingerprint : MethodFingerprint(
|
|||||||
"Z",
|
"Z",
|
||||||
parameters = emptyList(),
|
parameters = emptyList(),
|
||||||
opcodes = listOf(
|
opcodes = listOf(
|
||||||
|
Opcode.MOVE_RESULT,
|
||||||
|
Opcode.RETURN,
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.MOVE_RESULT,
|
Opcode.MOVE_RESULT,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class BottomControlsResourcePatch : ResourcePatch {
|
|||||||
"$namespace/$lastLeftOf"
|
"$namespace/$lastLeftOf"
|
||||||
|
|
||||||
// set lastLeftOf attribute to the the current element
|
// set lastLeftOf attribute to the the current element
|
||||||
val nameSpaceLength = 4
|
val nameSpaceLength = 5
|
||||||
lastLeftOf = element.attributes.getNamedItem("android:id").nodeValue.substring(nameSpaceLength)
|
lastLeftOf = element.attributes.getNamedItem("android:id").nodeValue.substring(nameSpaceLength)
|
||||||
|
|
||||||
// copy the element
|
// copy the element
|
||||||
|
|||||||
Reference in New Issue
Block a user