Compare commits

...

29 Commits

Author SHA1 Message Date
semantic-release-bot
6ac5ed441f chore(release): 2.32.0 [skip ci]
# [2.32.0](https://github.com/revanced/revanced-patches/compare/v2.31.0...v2.32.0) (2022-08-04)

### Features

* `promo-code-unlock` patch ([#292](https://github.com/revanced/revanced-patches/issues/292)) ([7925ca9](7925ca97c4))
2022-08-04 17:05:39 +00:00
Technikte
7925ca97c4 feat: promo-code-unlock patch (#292) 2022-08-04 19:03:56 +02:00
semantic-release-bot
0c5f117d5d chore(release): 2.31.0 [skip ci]
# [2.31.0](https://github.com/revanced/revanced-patches/compare/v2.30.1...v2.31.0) (2022-08-03)

### Features

* remove `force-vp9-codec` patch ([#287](https://github.com/revanced/revanced-patches/issues/287)) ([6ab475c](6ab475c284))
2022-08-03 18:30:49 +00:00
epicsampler
6ab475c284 feat: remove force-vp9-codec patch (#287) 2022-08-03 20:28:39 +02:00
semantic-release-bot
75ac69455b chore(release): 2.30.1 [skip ci]
## [2.30.1](https://github.com/revanced/revanced-patches/compare/v2.30.0...v2.30.1) (2022-08-03)

### Bug Fixes

* migrate to new patcher api ([e42043b](e42043b939))
2022-08-03 01:56:55 +00:00
oSumAtrIX
e42043b939 fix: migrate to new patcher api 2022-08-03 03:53:35 +02:00
semantic-release-bot
5237c3a1a6 chore(release): 2.30.0 [skip ci]
# [2.30.0](https://github.com/revanced/revanced-patches/compare/v2.29.0...v2.30.0) (2022-08-03)

### Bug Fixes

* incorrect fingerprint version [skip ci] ([a9abab9](a9abab97d7))
* rollback to `Dependencies` annotation ([f82aae9](f82aae930b))

### Features

* set the correct theme of the settings screen ([7d6f205](7d6f205fd9))
2022-08-03 01:11:48 +00:00
oSumAtrIX
7d6f205fd9 feat: set the correct theme of the settings screen 2022-08-03 03:09:52 +02:00
oSumAtrIX
f82aae930b fix: rollback to Dependencies annotation 2022-08-03 03:09:39 +02:00
oSumAtrIX
83b11c92af refactor: remove unused annotation [skip ci] 2022-08-03 02:23:27 +02:00
oSumAtrIX
a9abab97d7 fix: incorrect fingerprint version [skip ci] 2022-08-03 02:01:56 +02:00
semantic-release-bot
a70da4f6c4 chore(release): 2.29.0 [skip ci]
# [2.29.0](https://github.com/revanced/revanced-patches/compare/v2.28.2...v2.29.0) (2022-08-02)

### Features

* add "Application Icon Path" option to branding ([e53b490](e53b490edf))
* add "Application Name" option to branding and move renaming to CustomBrandingPatch.kt ([19cc4a3](19cc4a3e91))
2022-08-02 21:51:01 +00:00
Sculas
e53b490edf feat: add "Application Icon Path" option to branding 2022-08-02 23:48:51 +02:00
Sculas
bfe995f635 build: update patcher lib to 3.3.0 2022-08-02 23:40:13 +02:00
Sculas
19cc4a3e91 feat: add "Application Name" option to branding and move renaming to CustomBrandingPatch.kt 2022-08-02 21:28:22 +02:00
Sculas
16f6486258 build: update patcher lib to 3.0.0 2022-08-02 21:15:43 +02:00
Sculas
47360ea3b7 refactor: migrate CustomBrandingPatch.kt to DependsOn 2022-08-02 20:24:19 +02:00
Sculas
5c5b3d562d refactor: migrate MicroGResourcePatch.kt to DependsOn 2022-08-02 20:22:57 +02:00
Sculas
a62316a8c8 refactor: cleanup MicroGResourcePatch.kt 2022-08-02 20:21:14 +02:00
semantic-release-bot
14f7d514d2 chore(release): 2.28.2 [skip ci]
## [2.28.2](https://github.com/revanced/revanced-patches/compare/v2.28.1...v2.28.2) (2022-08-02)

### Bug Fixes

* remove requirement for solution [skip ci] ([#271](https://github.com/revanced/revanced-patches/issues/271)) ([9ae3d05](9ae3d0546c))
2022-08-02 01:16:42 +00:00
oSumAtrIX
78d901338f build: bump patcher dependency version 2022-08-02 03:14:28 +02:00
Robert
9ae3d0546c fix: remove requirement for solution [skip ci] (#271) 2022-08-01 13:07:47 +02:00
oSumAtrIX
3076a16d14 refactor: use ResourceUtils.copyXmlNode 2022-08-01 04:13:51 +02:00
semantic-release-bot
f8e1f2fe18 chore(release): 2.28.1 [skip ci]
## [2.28.1](https://github.com/revanced/revanced-patches/compare/v2.28.0...v2.28.1) (2022-07-31)

### Bug Fixes

* add missing permission to reboot app ([#260](https://github.com/revanced/revanced-patches/issues/260)) ([a9611f3](a9611f304e))
2022-07-31 18:43:15 +00:00
Joey Peter
a9611f304e fix: add missing permission to reboot app (#260) 2022-07-31 20:41:35 +02:00
semantic-release-bot
7c0e183df5 chore(release): 2.28.0 [skip ci]
# [2.28.0](https://github.com/revanced/revanced-patches/compare/v2.27.0...v2.28.0) (2022-07-31)

### Features

* add `custom-video-buffer` patch ([15e1ced](15e1ced2c9))
2022-07-31 10:36:58 +00:00
Joey Peter
15e1ced2c9 feat: add custom-video-buffer patch 2022-07-31 12:34:49 +02:00
semantic-release-bot
bde7f99b5b chore(release): 2.27.0 [skip ci]
# [2.27.0](https://github.com/revanced/revanced-patches/compare/v2.26.0...v2.27.0) (2022-07-31)

### Features

* `settings` patch ([60866af](60866af97d))
2022-07-31 10:17:43 +00:00
oSumAtrIX
60866af97d feat: settings patch 2022-07-31 12:15:26 +02:00
66 changed files with 1189 additions and 422 deletions

View File

@@ -52,10 +52,10 @@ body:
label: Solution
description: If applicable, add a possible solution.
validations:
required: true
required: false
- type: textarea
attributes:
label: Additional context
description: Add additional context here.
validations:
required: false
required: false

View File

@@ -1,3 +1,73 @@
# [2.32.0](https://github.com/revanced/revanced-patches/compare/v2.31.0...v2.32.0) (2022-08-04)
### Features
* `promo-code-unlock` patch ([#292](https://github.com/revanced/revanced-patches/issues/292)) ([d5df2e6](https://github.com/revanced/revanced-patches/commit/d5df2e68f47cbb3d374b8ce24769872959014051))
# [2.31.0](https://github.com/revanced/revanced-patches/compare/v2.30.1...v2.31.0) (2022-08-03)
### Features
* remove `force-vp9-codec` patch ([#287](https://github.com/revanced/revanced-patches/issues/287)) ([e428978](https://github.com/revanced/revanced-patches/commit/e42897801b20e7439969954753e2c15c85eb41b5))
## [2.30.1](https://github.com/revanced/revanced-patches/compare/v2.30.0...v2.30.1) (2022-08-03)
### Bug Fixes
* migrate to new patcher api ([f43446e](https://github.com/revanced/revanced-patches/commit/f43446ed189e583302fcd899f5eb7517f2a77144))
# [2.30.0](https://github.com/revanced/revanced-patches/compare/v2.29.0...v2.30.0) (2022-08-03)
### Bug Fixes
* incorrect fingerprint version [skip ci] ([f8c62ae](https://github.com/revanced/revanced-patches/commit/f8c62ae16b088ff6d0e96a4ef62dc707cd83beb9))
* rollback to `Dependencies` annotation ([36a2ae8](https://github.com/revanced/revanced-patches/commit/36a2ae886c63f1d22bb1cca9e7110af6c3f6f2d3))
### Features
* set the correct theme of the settings screen ([70d850c](https://github.com/revanced/revanced-patches/commit/70d850cf295d306b0de9419efe6a4bbf3857d3a0))
# [2.29.0](https://github.com/revanced/revanced-patches/compare/v2.28.2...v2.29.0) (2022-08-02)
### Features
* add "Application Icon Path" option to branding ([1748d1e](https://github.com/revanced/revanced-patches/commit/1748d1e5badf61213d793ff7ae1d090ea2ea82f0))
* add "Application Name" option to branding and move renaming to CustomBrandingPatch.kt ([8dafe05](https://github.com/revanced/revanced-patches/commit/8dafe05b2c5e2b0291d46b02717d910721673712))
## [2.28.2](https://github.com/revanced/revanced-patches/compare/v2.28.1...v2.28.2) (2022-08-02)
### Bug Fixes
* remove requirement for solution [skip ci] ([#271](https://github.com/revanced/revanced-patches/issues/271)) ([553fad3](https://github.com/revanced/revanced-patches/commit/553fad3fe1bb79bdf34e9f91c0e1cbfda78e1054))
## [2.28.1](https://github.com/revanced/revanced-patches/compare/v2.28.0...v2.28.1) (2022-07-31)
### Bug Fixes
* add missing permission to reboot app ([#260](https://github.com/revanced/revanced-patches/issues/260)) ([6ced6df](https://github.com/revanced/revanced-patches/commit/6ced6df8ed7642dea51e1acd1c12f4de4874b972))
# [2.28.0](https://github.com/revanced/revanced-patches/compare/v2.27.0...v2.28.0) (2022-07-31)
### Features
* add `custom-video-buffer` patch ([9f117c7](https://github.com/revanced/revanced-patches/commit/9f117c74cdbdcf98eae97cf4c37f0baca451d695))
# [2.27.0](https://github.com/revanced/revanced-patches/compare/v2.26.0...v2.27.0) (2022-07-31)
### Features
* `settings` patch ([0e229a4](https://github.com/revanced/revanced-patches/commit/0e229a46cb5b8b74183c47a6eae08d667f941406))
# [2.26.0](https://github.com/revanced/revanced-patches/compare/v2.25.3...v2.26.0) (2022-07-31)

View File

@@ -37,6 +37,14 @@ Official patches by ReVanced
| `exclusive-audio-playback` | Enables the option to play music without video. | 5.16.51 |
</details>
### 📦 `de.dwd.warnapp`
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `promo-code-unlock` | Disables the validation of promo code. Any code will work to unlock all features. | all |
</details>
### 📦 `com.google.android.youtube`
<details>
@@ -51,16 +59,17 @@ Official patches by ReVanced
| `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 17.29.34 |
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.29.34 |
| `premium-heading` | Shows premium branding on the home screen. | all |
| `custom-branding` | Changes the YouTube launcher icon to be ReVanced's. | all |
| `custom-branding` | Changes the YouTube launcher icon and name to your choice (defaults to ReVanced). | all |
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 17.29.34 |
| `old-quality-layout` | Enables the original quality flyout menu. | 17.29.34 |
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 17.29.34 |
| `hide-watermark` | Hides creator's watermarks on videos. | 17.29.34 |
| `sponsorblock` | Integrate SponsorBlock. | 17.29.34 |
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.29.34 |
| `force-vp9-codec` | Forces the VP9 codec for videos. | 17.29.34 |
| `custom-video-buffer` | Lets you change the buffers of videos. Has no use without settings yet. | 17.29.34 |
| `always-autorepeat` | Always repeats the playing video again. | 17.29.34 |
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG | 17.29.34 |
| `settings` | Adds settings for ReVanced to YouTube. | all |
| `enable-debugging` | Enables app debugging by patching the manifest file. | all |
| `custom-playback-speed` | Adds more video playback speed options. | 17.29.34 |
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 17.29.34 |

View File

@@ -22,7 +22,7 @@ repositories {
dependencies {
implementation(kotlin("stdlib"))
implementation("app.revanced:revanced-patcher:2.4.0")
implementation("app.revanced:revanced-patcher:3.3.1")
implementation("app.revanced:multidexlib2:2.5.2.r2")
}

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.26.0
version = 2.32.0

View File

@@ -14,7 +14,6 @@ import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
import org.jf.dexlib2.immutable.reference.ImmutableMethodReference
import org.w3c.dom.Node
import java.io.OutputStream
import java.nio.file.Files
// TODO: this method does not make sense here
@@ -146,7 +145,7 @@ fun ResourceData.injectStrings(
// open source strings.xml
val sourceInputStream = classLoader.getResourceAsStream("$patchDirectoryPath/$relativePath")
?: throw PatchResultError("failed to open '$patchDirectoryPath/$relativePath'")
xmlEditor[sourceInputStream, OutputStream.nullOutputStream()].use { sourceStringsXml ->
xmlEditor[sourceInputStream].use { sourceStringsXml ->
val strings = sourceStringsXml.file.getElementsByTagName("resources").item(0).childNodes
// open target strings.xml

View File

@@ -7,7 +7,7 @@ import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.patch.PatchResult
@@ -27,7 +27,7 @@ import org.jf.dexlib2.iface.reference.StringReference
import org.jf.dexlib2.immutable.reference.ImmutableStringReference
@Patch
@Dependencies([MusicMicroGResourcePatch::class])
@DependsOn([MusicMicroGResourcePatch::class])
@Name("music-microg-support")
@Description("Allows YouTube Music ReVanced to run without root and under a different package name.")
@MusicMicroGPatchCompatibility

View File

@@ -1,13 +1,13 @@
package app.revanced.patches.youtube.misc.forcevp9.annotations
package app.revanced.patches.warnwetter.misc.promocode.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.26.35", "17.27.39", "17.28.34", "17.29.34")
"de.dwd.warnapp", arrayOf()
)]
)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class ForceVP9Compatibility
internal annotation class PromoCodeUnlockCompatibility

View File

@@ -0,0 +1,26 @@
package app.revanced.patches.warnwetter.misc.promocode.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patches.youtube.layout.createbutton.annotations.CreateButtonCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@Name("promo-code-unlock-fingerprint")
@MatchingMethod(
"Lde/dwd/warnapp/model/PromoTokenVerification;", "isValid"
)
@CreateButtonCompatibility
@Version("0.0.1")
object PromoCodeUnlockFingerprint : MethodFingerprint(
null,
null,
null,
null,
null,
{ methodDef ->
methodDef.definingClass.endsWith("PromoTokenVerification;") && methodDef.name == "isValid"
}
)

View File

@@ -0,0 +1,42 @@
package app.revanced.patches.warnwetter.misc.promocode.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.removeInstruction
import app.revanced.patcher.extensions.removeInstructions
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patches.warnwetter.misc.promocode.annotations.PromoCodeUnlockCompatibility
import app.revanced.patches.warnwetter.misc.promocode.fingerprints.PromoCodeUnlockFingerprint
@Patch
@Name("promo-code-unlock")
@Description("Disables the validation of promo code. Any code will work to unlock all features.")
@PromoCodeUnlockCompatibility
@Version("0.0.1")
class PromoCodeUnlockPatch : BytecodePatch(
listOf(
PromoCodeUnlockFingerprint
)
) {
override fun execute(data: BytecodeData): PatchResult {
val method = PromoCodeUnlockFingerprint.result!!.mutableMethod
method.addInstructions(
0,
"""
const/4 v0, 0x1
return v0
"""
)
return PatchResultSuccess()
}
}

View File

@@ -9,7 +9,7 @@ import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
@@ -38,7 +38,7 @@ import org.jf.dexlib2.iface.reference.StringReference
import org.jf.dexlib2.immutable.reference.ImmutableMethodReference
@Patch
@Dependencies([ResourceIdMappingProviderResourcePatch::class, IntegrationsPatch::class])
@DependsOn([ResourceIdMappingProviderResourcePatch::class, IntegrationsPatch::class])
@Name("general-ads")
@Description("Removes general ads.")
@GeneralAdsCompatibility

View File

@@ -9,7 +9,7 @@ import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.reso
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.ad.infocardsuggestions.annotations.HideInfocardSuggestionsCompatibility
@@ -19,7 +19,7 @@ import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
@Patch
@Dependencies([IntegrationsPatch::class])
@DependsOn([IntegrationsPatch::class])
@Name("hide-infocard-suggestions")
@Description("Hides infocards in videos.")
@HideInfocardSuggestionsCompatibility

View File

@@ -8,7 +8,7 @@ import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
@@ -17,7 +17,7 @@ import app.revanced.patches.youtube.ad.video.fingerprints.ShowVideoAdsFingerprin
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@Patch
@Dependencies([IntegrationsPatch::class])
@DependsOn([IntegrationsPatch::class])
@Name("video-ads")
@Description("Removes ads in the video player.")
@VideoAdsCompatibility

View File

@@ -8,7 +8,7 @@ import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.interaction.seekbar.annotation.SeekbarTappingCompatibility
@@ -22,7 +22,7 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction11n
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
@Patch
@Dependencies([IntegrationsPatch::class])
@DependsOn([IntegrationsPatch::class])
@Name("seekbar-tapping")
@Description("Enables tap-to-seek on the seekbar of the video player.")
@SeekbarTappingCompatibility

View File

@@ -7,7 +7,7 @@ import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.interaction.swipecontrols.annotation.SwipeControlsCompatibility
@@ -17,12 +17,12 @@ import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.playeroverlay.patch.PlayerOverlaysHookPatch
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
@Patch(include = false)
@Patch
@Name("swipe-controls")
@Description("Adds volume and brightness swipe controls.")
@SwipeControlsCompatibility
@Version("0.0.2")
@Dependencies(
@DependsOn(
[
IntegrationsPatch::class,
PlayerTypeHookPatch::class,

View File

@@ -6,7 +6,7 @@ import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.ResourceData
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.ResourcePatch
import app.revanced.patches.youtube.layout.amoled.annotations.AmoledCompatibility
@@ -15,7 +15,7 @@ import org.w3c.dom.Element
import java.io.File
@Patch
@Dependencies([FixLocaleConfigErrorPatch::class])
@DependsOn([FixLocaleConfigErrorPatch::class])
@Name("amoled")
@Description("Enables pure black theme.")
@AmoledCompatibility

View File

@@ -8,7 +8,7 @@ import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.removeInstruction
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
@@ -21,7 +21,7 @@ import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
@Patch
@Dependencies([ResourceIdMappingProviderResourcePatch::class, IntegrationsPatch::class])
@DependsOn([ResourceIdMappingProviderResourcePatch::class, IntegrationsPatch::class])
@Name("hide-autoplay-button")
@Description("Hides the autoplay button in the video player.")
@AutoplayButtonCompatibility

View File

@@ -7,7 +7,7 @@ import app.revanced.patcher.data.impl.ResourceData
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.ResourcePatch
import app.revanced.patches.youtube.layout.branding.header.annotations.PremiumHeadingCompatibility
@@ -17,7 +17,7 @@ import java.nio.file.StandardCopyOption
import kotlin.io.path.exists
@Patch
@Dependencies([FixLocaleConfigErrorPatch::class])
@DependsOn([FixLocaleConfigErrorPatch::class])
@Name("premium-heading")
@Description("Shows premium branding on the home screen.")
@PremiumHeadingCompatibility

View File

@@ -4,20 +4,21 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.ResourceData
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.*
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.ResourcePatch
import app.revanced.patches.youtube.layout.branding.icon.annotations.CustomBrandingCompatibility
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
import java.io.File
import java.io.FileInputStream
import java.io.InputStream
import java.nio.file.Files
@Patch
@Dependencies([FixLocaleConfigErrorPatch::class])
@DependsOn([FixLocaleConfigErrorPatch::class])
@Name("custom-branding")
@Description("Changes the YouTube launcher icon to be ReVanced's.")
@Description("Changes the YouTube launcher icon and name to your choice (defaults to ReVanced).")
@CustomBrandingCompatibility
@Version("0.0.1")
class CustomBrandingPatch : ResourcePatch() {
@@ -25,6 +26,7 @@ class CustomBrandingPatch : ResourcePatch() {
val resDirectory = data["res"]
if (!resDirectory.isDirectory) return PatchResultError("The res folder can not be found.")
// Icon branding
val iconNames = arrayOf(
"adaptiveproduct_youtube_background_color_108",
"adaptiveproduct_youtube_foreground_color_108",
@@ -40,15 +42,59 @@ class CustomBrandingPatch : ResourcePatch() {
"mdpi" to 48
).forEach { (iconDirectory, size) ->
iconNames.forEach iconLoop@{ iconName ->
val iconFile = this.javaClass.classLoader.getResourceAsStream("branding/$size/$iconName.png")
val iconFile = getIconStream("branding/$size/$iconName.png")
?: return PatchResultError("The icon $iconName can not be found.")
Files.write(
resDirectory.resolve("mipmap-$iconDirectory").resolve("$iconName.png").toPath(), iconFile.readAllBytes()
resDirectory.resolve("mipmap-$iconDirectory").resolve("$iconName.png").toPath(),
iconFile.readAllBytes()
)
}
}
// Name branding
val appName: String by options[keyAppName]
val manifest = data["AndroidManifest.xml"]
manifest.writeText(
manifest.readText()
.replace(
"android:label=\"@string/application_name",
"android:label=\"$appName"
)
)
return PatchResultSuccess()
}
override val options = PatchOptions(
PatchOption.StringOption(
key = keyAppName,
default = "YouTube ReVanced",
title = "Application Name",
description = "The name of the application it will show on your home screen.",
required = true
),
PatchOption.StringOption(
key = keyAppIconPath,
default = null,
title = "Application Icon Path",
description = "A path to the icon of the application."
)
)
private fun getIconStream(iconPath: String): InputStream? {
val appIconPath: String? by options[keyAppIconPath]
if (appIconPath == null) {
return this.javaClass.classLoader.getResourceAsStream(iconPath)
}
val file = File(appIconPath!!).resolve(iconPath)
if (!file.exists()) return null
return FileInputStream(file)
}
private companion object {
private const val keyAppName = "appName"
private const val keyAppIconPath = "appIconPath"
}
}

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.patch.PatchResult
@@ -14,7 +14,7 @@ import app.revanced.patches.youtube.layout.castbutton.annotations.CastButtonComp
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@Patch
@Dependencies([IntegrationsPatch::class])
@DependsOn([IntegrationsPatch::class])
@Name("hide-cast-button")
@Description("Hides the cast button in the video player.")
@CastButtonCompatibility

View File

@@ -8,7 +8,7 @@ import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.layout.createbutton.annotations.CreateButtonCompatibility
@@ -22,7 +22,7 @@ import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
import org.jf.dexlib2.iface.reference.MethodReference
@Patch
@Dependencies([IntegrationsPatch::class, ResourceIdMappingProviderResourcePatch::class])
@DependsOn([IntegrationsPatch::class, ResourceIdMappingProviderResourcePatch::class])
@Name("disable-create-button")
@Description("Hides the create button in the navigation bar.")
@CreateButtonCompatibility

View File

@@ -10,7 +10,7 @@ import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.reso
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.layout.fullscreenpanels.annotations.FullscreenPanelsCompatibility
@@ -20,7 +20,7 @@ import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@Patch
@Name("disable-fullscreen-panels")
@Dependencies([IntegrationsPatch::class])
@DependsOn([IntegrationsPatch::class])
@Description("Disables video description and comments panel in fullscreen view.")
@FullscreenPanelsCompatibility
@Version("0.0.1")

View File

@@ -8,7 +8,7 @@ import app.revanced.patcher.data.impl.toMethodWalker
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
@@ -24,7 +24,7 @@ import org.jf.dexlib2.iface.reference.MethodReference
@Patch
@Name("minimized-playback")
@Description("Enables minimized and background playback.")
@Dependencies([IntegrationsPatch::class])
@DependsOn([IntegrationsPatch::class])
@MinimizedPlaybackCompatibility
@Version("0.0.1")
class MinimizedPlaybackPatch : BytecodePatch(

View File

@@ -7,7 +7,7 @@ import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.layout.oldqualitylayout.annotations.OldQualityLayoutCompatibility
@@ -16,7 +16,7 @@ import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
@Patch
@Dependencies([IntegrationsPatch::class])
@DependsOn([IntegrationsPatch::class])
@Name("old-quality-layout")
@Description("Enables the original quality flyout menu.")
@OldQualityLayoutCompatibility

View File

@@ -8,7 +8,7 @@ import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.ReturnYouTubeDislikeCompatibility
@@ -20,7 +20,7 @@ import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.videoid.patch.VideoIdPatch
@Patch
@Dependencies([IntegrationsPatch::class, VideoIdPatch::class])
@DependsOn([IntegrationsPatch::class, VideoIdPatch::class])
@Name("return-youtube-dislike")
@Description("Shows the dislike count of videos using the Return YouTube Dislike API.")
@ReturnYouTubeDislikeCompatibility

View File

@@ -7,7 +7,7 @@ import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.layout.shorts.button.annotations.ShortsButtonCompatibility
@@ -17,7 +17,7 @@ import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Patch
@Dependencies([IntegrationsPatch::class])
@DependsOn([IntegrationsPatch::class])
@Name("hide-shorts-button")
@Description("Hides the shorts button on the navigation bar.")
@ShortsButtonCompatibility

View File

@@ -13,7 +13,7 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
@@ -37,7 +37,7 @@ import org.jf.dexlib2.immutable.ImmutableMethodParameter
import org.jf.dexlib2.util.MethodUtil
@Patch
@Dependencies(
@DependsOn(
dependencies = [IntegrationsPatch::class, ResourceIdMappingProviderResourcePatch::class, SponsorBlockResourcePatch::class, VideoIdPatch::class]
)
@Name("sponsorblock")

View File

@@ -2,20 +2,19 @@ package app.revanced.patches.youtube.layout.sponsorblock.resource.patch
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.DomFileEditor
import app.revanced.patcher.data.impl.ResourceData
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.impl.ResourcePatch
import app.revanced.patches.youtube.layout.sponsorblock.annotations.SponsorBlockCompatibility
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
import java.io.OutputStream
import app.revanced.util.resources.ResourceUtils.copyXmlNode
import java.nio.file.Files
@Name("sponsorblock-resource-patch")
@SponsorBlockCompatibility
@Dependencies([FixLocaleConfigErrorPatch::class])
@DependsOn([FixLocaleConfigErrorPatch::class])
@Version("0.0.1")
class SponsorBlockResourcePatch : ResourcePatch() {
override fun execute(data: ResourceData): PatchResult {
@@ -29,7 +28,7 @@ class SponsorBlockResourcePatch : ResourcePatch() {
// copy nodes from the resources node to the real resource node
"resources".copyXmlNode(
data.xmlEditor[stringsResourceInputStream, OutputStream.nullOutputStream()],
data.xmlEditor[stringsResourceInputStream],
data.xmlEditor["res/$stringsResourcePath"]
).close() // close afterwards
@@ -78,7 +77,7 @@ class SponsorBlockResourcePatch : ResourcePatch() {
val targetXmlEditor = data.xmlEditor["res/$path/$resource.xml"]
"RelativeLayout".copyXmlNode(
data.xmlEditor[hostingResourceStream, OutputStream.nullOutputStream()],
data.xmlEditor[hostingResourceStream],
targetXmlEditor
).also {
val children = targetXmlEditor.file.getElementsByTagName("RelativeLayout").item(0).childNodes
@@ -102,27 +101,4 @@ class SponsorBlockResourcePatch : ResourcePatch() {
}
return PatchResultSuccess()
}
/**
* Copies the specified node of the source [DomFileEditor] to the target [DomFileEditor].
* @param source the source [DomFileEditor].
* @param target the target [DomFileEditor]-
*/
private fun String.copyXmlNode(source: DomFileEditor, target: DomFileEditor): AutoCloseable {
val hostNodes = source.file.getElementsByTagName(this).item(0).childNodes
val destinationResourceFile = target.file
val destinationNode = destinationResourceFile.getElementsByTagName(this).item(0)
for (index in 0 until hostNodes.length) {
val node = hostNodes.item(index).cloneNode(true)
destinationResourceFile.adoptNode(node)
destinationNode.appendChild(node)
}
return AutoCloseable {
source.close()
target.close()
}
}
}

View File

@@ -10,7 +10,7 @@ import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.reso
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.layout.watermark.annotations.HideWatermarkCompatibility
@@ -19,7 +19,7 @@ import app.revanced.patches.youtube.layout.watermark.fingerprints.HideWatermarkF
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@Patch
@Dependencies([IntegrationsPatch::class])
@DependsOn([IntegrationsPatch::class])
@Name("hide-watermark")
@Description("Hides creator's watermarks on videos.")
@HideWatermarkCompatibility

View File

@@ -9,7 +9,7 @@ import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
@@ -20,8 +20,8 @@ import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.WideSearch
import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.WideSearchbarTwoParentFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@Patch(include = false)
@Dependencies([IntegrationsPatch::class])
@Patch
@DependsOn([IntegrationsPatch::class])
@Name("enable-wide-searchbar")
@Description("Replaces the search icon with a wide search bar. This will hide the YouTube logo when active.")
@WideSearchbarCompatibility

View File

@@ -10,7 +10,7 @@ import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.reso
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.misc.autorepeat.annotations.AutoRepeatCompatibility
@@ -18,8 +18,8 @@ import app.revanced.patches.youtube.misc.autorepeat.fingerprints.AutoRepeatFinge
import app.revanced.patches.youtube.misc.autorepeat.fingerprints.AutoRepeatParentFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@Patch(include = false)
@Dependencies([IntegrationsPatch::class])
@Patch
@DependsOn([IntegrationsPatch::class])
@Name("always-autorepeat")
@Description("Always repeats the playing video again.")
@AutoRepeatCompatibility

View File

@@ -9,7 +9,7 @@ import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.misc.customplaybackspeed.annotations.CustomPlaybackSpeedCompatibility
@@ -25,7 +25,7 @@ import org.jf.dexlib2.iface.reference.MethodReference
@Patch
@Name("custom-playback-speed")
@Description("Adds more video playback speed options.")
@Dependencies([IntegrationsPatch::class])
@DependsOn([IntegrationsPatch::class])
@CustomPlaybackSpeedCompatibility
@Version("0.0.1")
class CustomPlaybackSpeedPatch : BytecodePatch(

View File

@@ -1,48 +0,0 @@
package app.revanced.patches.youtube.misc.forcevp9.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.forcevp9.annotations.ForceVP9Compatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@Name("force-vp9-codec-fingerprint")
@MatchingMethod(
"Lpzs;", "aI"
)
@DirectPatternScanMethod
@ForceVP9Compatibility
@Version("0.0.1")
object ForceVP9CodecFingerprint : MethodFingerprint(
"Z", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "I"), listOf(
Opcode.SGET, Opcode.IF_NEZ, Opcode.INVOKE_STATIC
), null, null
)
/*
public static boolean aI(Context context, int i) {
if (b == 0) {
aH(context);
}
return b >= i; // Override to: return Lapp/revanced/integrations/patches/ForceCodecPatch->shouldForceVP9()
}
.method public static aI(Landroid/content/Context;I)Z
sget v0, Lpzs;->b:I
if-nez v0, :cond_7
invoke-static {p0}, Lpzs;->aH(Landroid/content/Context;)V
:cond_7
//remove after here, and inject only our code
sget p0, Lpzs;->b:I
if-lt p0, p1, :cond_d
const/4 p0, 0x1
return p0
:cond_d
const/4 p0, 0x0
return p0
.end method
*/

View File

@@ -1,73 +0,0 @@
package app.revanced.patches.youtube.misc.forcevp9.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.forcevp9.annotations.ForceVP9Compatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@Name("force-vp9-codec-fingerprint-two")
@MatchingMethod(
"Lpzs;", "aO"
)
@DirectPatternScanMethod
@ForceVP9Compatibility
@Version("0.0.1")
object ForceVP9CodecFingerprintTwo : MethodFingerprint(
"Z", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("I"), listOf(
Opcode.INVOKE_STATIC, Opcode.MOVE_RESULT_OBJECT, Opcode.CONST_4
), null, null
)
/*
public static boolean aO(int i) {
Pair aG = aG();
return (aG == null ? 0 : Math.min(((Integer) aG.first).intValue(), ((Integer) aG.second).intValue())) >= i;
//replace line with: return Lapp/revanced/integrations/patches/ForceCodecPatch/shouldForceVP9();
}
becomes:
public static boolean aO(int i) {
return Lapp/revanced/integrations/patches/ForceCodecPatch/shouldForceVP9();
}
.method public static aO(I)Z
invoke-static {}, Lpzs;->aG()Landroid/util/Pair;
move-result-object v0
const/4 v1, 0x0
if-nez v0, :cond_9
const/4 v0, 0x0
goto :goto_1d
:cond_9
iget-object v2, v0, Landroid/util/Pair;->first:Ljava/lang/Object;
check-cast v2, Ljava/lang/Integer;
invoke-virtual {v2}, Ljava/lang/Integer;->intValue()I
move-result v2
iget-object v0, v0, Landroid/util/Pair;->second:Ljava/lang/Object;
check-cast v0, Ljava/lang/Integer;
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
move-result v0
invoke-static {v2, v0}, Ljava/lang/Math;->min(II)I
move-result v0
:goto_1d
if-lt v0, p0, :cond_21
const/4 p0, 0x1
return p0
:cond_21
return v1
.end method
becomes:
.method public static aO(I)Z
invoke-static {}, Lapp/revanced/integrations/patches/ForceCodecPatch;->shouldForceVP9()Z
move-result v0
return v0
.end method
*/

View File

@@ -1,24 +0,0 @@
package app.revanced.patches.youtube.misc.forcevp9.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.forcevp9.annotations.ForceVP9Compatibility
import org.jf.dexlib2.AccessFlags
@Name("force-vp9-codec-parent-fingerprint")
@MatchingMethod(
"Lqaa;", "U"
)
@DirectPatternScanMethod
@ForceVP9Compatibility
@Version("0.0.1")
object ForceVP9ParentFingerprint : MethodFingerprint(
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf(), null,
listOf(
"sys.display-size", "x"
)
)

View File

@@ -1,30 +0,0 @@
package app.revanced.patches.youtube.misc.forcevp9.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.forcevp9.annotations.ForceVP9Compatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.reference.FieldReference
@Name("replace-device-info-parent-fingerprint")
@MatchingMethod(
"Lvjb;", "e"
)
@DirectPatternScanMethod
@ForceVP9Compatibility
@Version("0.0.1")
object ReplaceDeviceInfoFingerprint : MethodFingerprint(
"L", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), null,
null,
customFingerprint = { methodDef ->
methodDef.implementation!!.instructions.any {
((it as? ReferenceInstruction)?.reference as? FieldReference)?.definingClass.equals("Landroid/os/Build;")
&& ((it as? ReferenceInstruction)?.reference as? FieldReference)?.name.equals("MANUFACTURER")
}
}
)

View File

@@ -1,24 +0,0 @@
package app.revanced.patches.youtube.misc.forcevp9.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.forcevp9.annotations.ForceVP9Compatibility
import org.jf.dexlib2.AccessFlags
@Name("replace-device-info-parent-fingerprint")
@MatchingMethod(
"Lvjb;", "b"
)
@DirectPatternScanMethod
@ForceVP9Compatibility
@Version("0.0.1")
object ReplaceDeviceInfoParentFingerprint : MethodFingerprint(
"L", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), null,
listOf(
"Failed to read the client side experiments map from the disk"
)
)

View File

@@ -1,87 +0,0 @@
package app.revanced.patches.youtube.misc.forcevp9.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.removeInstruction
import app.revanced.patcher.extensions.removeInstructions
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.youtube.misc.forcevp9.annotations.ForceVP9Compatibility
import app.revanced.patches.youtube.misc.forcevp9.fingerprints.*
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.reference.FieldReference
@Patch(include = false)
@Dependencies([IntegrationsPatch::class])
@Name("force-vp9-codec")
@Description("Forces the VP9 codec for videos.")
@ForceVP9Compatibility
@Version("0.0.1")
class ForceVP9CodecPatch : BytecodePatch(
listOf(
ForceVP9ParentFingerprint, ReplaceDeviceInfoParentFingerprint
)
) {
override fun execute(data: BytecodeData): PatchResult {
val classDef = ForceVP9ParentFingerprint.result!!.classDef
ForceVP9CodecFingerprint.resolve(data, classDef)
ForceVP9CodecFingerprintTwo.resolve(data, classDef)
replaceInstructions(ForceVP9CodecFingerprint.result!!)
replaceInstructions(ForceVP9CodecFingerprintTwo.result!!)
ReplaceDeviceInfoFingerprint.resolve(data, ReplaceDeviceInfoParentFingerprint.result!!.classDef)
var method = ReplaceDeviceInfoFingerprint.result!!.mutableMethod
replaceDeviceInfos("Manufacturer", method)
replaceDeviceInfos("Model", method)
return PatchResultSuccess()
}
private fun replaceInstructions(result: MethodFingerprintResult) {
val method = result.mutableMethod
method.removeInstructions(0, method.implementation!!.instructions.size - 1)
method.addInstructions(
0, """
invoke-static {}, Lapp/revanced/integrations/patches/ForceCodecPatch;->shouldForceVP9()Z
move-result v0
return v0
"""
)
}
private fun replaceDeviceInfos(name: String, method: MutableMethod) {
var impl = method.implementation!!
//find target instruction for Build.name.uppercase() and replace that with our method
impl.instructions.filter {
((it as? ReferenceInstruction)?.reference as? FieldReference)?.let { field ->
//sget-object v1, Landroid/os/Build;->MANUFACTURER:Ljava/lang/String;
//sget-object v1, Landroid/os/Build;->MODEL:Ljava/lang/String;
field.definingClass == "Landroid/os/Build;" && field.name == name.uppercase()
} == true
}.forEach { instruction ->
val index = method.implementation!!.instructions.indexOf(instruction)
val register = (instruction as OneRegisterInstruction).registerA
// inject the call to
method.removeInstruction(index)
method.addInstructions(
index, """
invoke-static {}, Lapp/revanced/integrations/patches/ForceCodecPatch;->get$name()Ljava/lang/String;
move-result-object v$register
"""
)
}
}
}

View File

@@ -8,7 +8,7 @@ import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.misc.hdrbrightness.annotations.HDRBrightnessCompatibility
@@ -18,12 +18,12 @@ import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
import org.jf.dexlib2.iface.reference.FieldReference
@Patch(false)
@Patch
@Name("hdr-auto-brightness")
@Description("Makes the brightness of HDR videos follow the system default.")
@HDRBrightnessCompatibility
@Version("0.0.2")
@Dependencies([IntegrationsPatch::class])
@DependsOn([IntegrationsPatch::class])
class HDRBrightnessPatch : BytecodePatch(
listOf(
HDRBrightnessFingerprintXXZ

View File

@@ -9,7 +9,7 @@ import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
@@ -28,7 +28,7 @@ import org.jf.dexlib2.iface.reference.StringReference
import org.jf.dexlib2.immutable.reference.ImmutableStringReference
@Patch
@Dependencies(
@DependsOn(
[
MicroGResourcePatch::class,
HideCastButtonPatch::class,

View File

@@ -6,16 +6,16 @@ import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.ResourceData
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.impl.ResourcePatch
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
import app.revanced.patches.youtube.misc.microg.shared.Constants.BASE_MICROG_PACKAGE_NAME
import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_APP_NAME
import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_PACKAGE_NAME
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsResourcePatch
@Name("microg-resource-patch")
@Dependencies([FixLocaleConfigErrorPatch::class])
@DependsOn([FixLocaleConfigErrorPatch::class, SettingsResourcePatch::class])
@Description("Resource patch to allow YouTube ReVanced to run without root and under a different package name.")
@MicroGPatchCompatibility
@Version("0.0.1")
@@ -27,34 +27,40 @@ class MicroGResourcePatch : ResourcePatch() {
settingsElementIntent.setAttribute("android:targetClass", "org.microg.gms.ui.SettingsActivity")
val settingsElement = it.file.createElement("Preference")
settingsElement.setAttribute("android:title", "MicroG")
settingsElement.setAttribute("android:title", "@string/microg_settings")
settingsElement.appendChild(settingsElementIntent)
it.file.firstChild.appendChild(settingsElement)
}
val manifest = data.get("AndroidManifest.xml").readText()
data.get("AndroidManifest.xml").writeText(
manifest.replace(
"package=\"com.google.android.youtube", "package=\"$REVANCED_PACKAGE_NAME"
).replace(
"android:label=\"@string/application_name", "android:label=\"$REVANCED_APP_NAME"
).replace(
"android:authorities=\"com.google.android.youtube", "android:authorities=\"$REVANCED_PACKAGE_NAME"
).replace(
"com.google.android.youtube.permission.C2D_MESSAGE", "$REVANCED_PACKAGE_NAME.permission.C2D_MESSAGE"
).replace( // TODO: might not be needed
"com.google.android.youtube.lifecycle-trojan", "$REVANCED_PACKAGE_NAME.lifecycle-trojan"
).replace( // TODO: might not be needed
"com.google.android.youtube.photopicker_images", "$REVANCED_PACKAGE_NAME.photopicker_images"
).replace(
"com.google.android.c2dm", "$BASE_MICROG_PACKAGE_NAME.android.c2dm"
).replace(
"</queries>", "<package android:name=\"$BASE_MICROG_PACKAGE_NAME.android.gms\"/></queries>"
val settingsFragment = data["res/xml/settings_fragment.xml"]
settingsFragment.writeText(
settingsFragment.readText().replace(
"android:targetPackage=\"com.google.android.youtube",
"android:targetPackage=\"$REVANCED_PACKAGE_NAME"
)
)
val manifest = data["AndroidManifest.xml"]
manifest.writeText(
manifest.readText()
.replace(
"package=\"com.google.android.youtube", "package=\"$REVANCED_PACKAGE_NAME"
).replace(
"android:authorities=\"com.google.android.youtube", "android:authorities=\"$REVANCED_PACKAGE_NAME"
).replace(
"com.google.android.youtube.permission.C2D_MESSAGE", "$REVANCED_PACKAGE_NAME.permission.C2D_MESSAGE"
).replace( // might not be needed
"com.google.android.youtube.lifecycle-trojan", "$REVANCED_PACKAGE_NAME.lifecycle-trojan"
).replace( // might not be needed
"com.google.android.youtube.photopicker_images", "$REVANCED_PACKAGE_NAME.photopicker_images"
).replace(
"com.google.android.c2dm", "$BASE_MICROG_PACKAGE_NAME.android.c2dm"
).replace(
"</queries>", "<package android:name=\"$BASE_MICROG_PACKAGE_NAME.android.gms\"/></queries>"
)
)
return PatchResultSuccess()
}
}

View File

@@ -3,5 +3,4 @@ package app.revanced.patches.youtube.misc.microg.shared
object Constants {
internal const val BASE_MICROG_PACKAGE_NAME = "com.mgoogle"
internal const val REVANCED_PACKAGE_NAME = "app.revanced.android.youtube"
internal const val REVANCED_APP_NAME = "YouTube ReVanced"
}

View File

@@ -7,7 +7,7 @@ import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.playeroverlay.annotation.PlayerOverlaysHookCompatibility
@@ -17,7 +17,7 @@ import app.revanced.patches.youtube.misc.playeroverlay.fingerprint.PlayerOverlay
@Description("Hook for adding custom overlays to the video player.")
@PlayerOverlaysHookCompatibility
@Version("0.0.1")
@Dependencies([IntegrationsPatch::class])
@DependsOn([IntegrationsPatch::class])
class PlayerOverlaysHookPatch : BytecodePatch(
listOf(
PlayerOverlaysOnFinishInflateFingerprint

View File

@@ -7,7 +7,7 @@ import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.playertype.annotation.PlayerTypeHookCompatibility
@@ -17,7 +17,7 @@ import app.revanced.patches.youtube.misc.playertype.fingerprint.UpdatePlayerType
@Description("Hook to get the current player type of WatchWhileActivity")
@PlayerTypeHookCompatibility
@Version("0.0.1")
@Dependencies([IntegrationsPatch::class])
@DependsOn([IntegrationsPatch::class])
class PlayerTypeHookPatch : BytecodePatch(
listOf(
UpdatePlayerTypeFingerprint

View File

@@ -9,7 +9,7 @@ import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@@ -22,7 +22,7 @@ import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.reference.FieldReference
@Patch
@Dependencies([IntegrationsPatch::class, VideoIdPatch::class])
@DependsOn([IntegrationsPatch::class, VideoIdPatch::class])
@Name("remember-video-quality")
@Description("Adds the ability to remember the video quality you chose in the video quality flyout.")
@DefaultVideoQualityCompatibility

View File

@@ -0,0 +1,13 @@
package app.revanced.patches.youtube.misc.settings.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf()
)]
)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class SettingsCompatibility

View File

@@ -0,0 +1,26 @@
package app.revanced.patches.youtube.misc.settings.bytecode.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.ReturnYouTubeDislikeCompatibility
// TODO: This is more of a class fingerprint than a method fingerprint.
// Convert to a class fingerprint whenever possible.
@Name("license-activity-fingerprint")
@MatchingMethod(
"Lcom/google/android/libraries/social/licenses/LicenseActivity;", "onCreate"
)
@ReturnYouTubeDislikeCompatibility
@Version("0.0.1")
object LicenseActivityFingerprint : MethodFingerprint(
null,
null,
null,
null,
null,
{ methodDef ->
methodDef.definingClass.endsWith("LicenseActivity;") && methodDef.name == "onCreate"
}
)

View File

@@ -0,0 +1,27 @@
package app.revanced.patches.youtube.misc.settings.bytecode.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.ReturnYouTubeDislikeCompatibility
// TODO: This is more of a class fingerprint than a method fingerprint.
// Convert to a class fingerprint whenever possible.
@Name("revanced-settings-activity-fingerprint")
@MatchingMethod(
"Lapp/revanced/integrations/settingsmenu/ReVancedSettingActivity;", "initializeSettings"
)
@ReturnYouTubeDislikeCompatibility
@Version("0.0.1")
object ReVancedSettingsActivityFingerprint : MethodFingerprint(
null,
null,
null,
null,
null,
{ methodDef ->
methodDef.definingClass.endsWith("ReVancedSettingActivity;") && methodDef.name == "initializeSettings"
}
)

View File

@@ -0,0 +1,29 @@
package app.revanced.patches.youtube.misc.settings.bytecode.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.returnyoutubedislike.annotations.ReturnYouTubeDislikeCompatibility
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
@Name("theme-setter-fingerprint")
@MatchingMethod(
"Lfyq;", "a"
)
@ReturnYouTubeDislikeCompatibility
@Version("0.0.1")
object ThemeSetterFingerprint : MethodFingerprint(
"L",
null,
null,
listOf(Opcode.RETURN_OBJECT),
null,
{ methodDef ->
methodDef.implementation?.instructions?.any {
it.opcode.ordinal == Opcode.CONST.ordinal && (it as WideLiteralInstruction).wideLiteral == SettingsPatch.appearanceStringId
} == true
}
)

View File

@@ -0,0 +1,91 @@
package app.revanced.patches.youtube.misc.settings.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.impl.BytecodeData
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.extensions.addInstructions
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.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.util.smali.toInstruction
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.mapping.patch.ResourceIdMappingProviderResourcePatch
import app.revanced.patches.youtube.misc.settings.annotations.SettingsCompatibility
import app.revanced.patches.youtube.misc.settings.bytecode.fingerprints.LicenseActivityFingerprint
import app.revanced.patches.youtube.misc.settings.bytecode.fingerprints.ReVancedSettingsActivityFingerprint
import app.revanced.patches.youtube.misc.settings.bytecode.fingerprints.ThemeSetterFingerprint
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsResourcePatch
@Patch
@DependsOn(
[
IntegrationsPatch::class,
SettingsResourcePatch::class,
ResourceIdMappingProviderResourcePatch::class
]
)
@Name("settings")
@Description("Adds settings for ReVanced to YouTube.")
@SettingsCompatibility
@Version("0.0.1")
class SettingsPatch : BytecodePatch(
listOf(LicenseActivityFingerprint, ReVancedSettingsActivityFingerprint, ThemeSetterFingerprint)
) {
override fun execute(data: BytecodeData): PatchResult {
val licenseActivityResult = LicenseActivityFingerprint.result!!
val settingsResult = ReVancedSettingsActivityFingerprint.result!!
val themeSetterResult = ThemeSetterFingerprint.result!!
val licenseActivityClass = licenseActivityResult.mutableClass
val settingsClass = settingsResult.mutableClass
val onCreate = licenseActivityResult.mutableMethod
val setThemeMethodName = "setTheme"
val initializeSettings = settingsResult.mutableMethod
val setThemeInstruction =
"invoke-static {v0}, Lapp/revanced/integrations/utils/ThemeHelper;->setTheme(Ljava/lang/Object;)V".toInstruction(
themeSetterResult.mutableMethod
)
// add instructions to set the theme of the settings activity
themeSetterResult.mutableMethod.implementation!!.let {
it.addInstruction(
themeSetterResult.patternScanResult!!.startIndex,
setThemeInstruction
)
it.addInstruction(
it.instructions.size - 1, // add before return
setThemeInstruction
)
}
// add the setTheme call to the onCreate method to not affect the offsets.
onCreate.addInstructions(
1,
"""
invoke-static { p0 }, ${settingsClass.type}->${initializeSettings.name}(${licenseActivityClass.type})V
return-void
"""
)
// add the initializeSettings call to the onCreate method.
onCreate.addInstruction(
0,
"invoke-static { p0 }, ${settingsClass.type}->$setThemeMethodName(${licenseActivityClass.type})V"
)
return PatchResultSuccess()
}
internal companion object {
val appearanceStringId = ResourceIdMappingProviderResourcePatch.resourceMappings.find {
it.type == "string" && it.name == "app_theme_appearance_dark"
}!!.id
}
}

View File

@@ -0,0 +1,72 @@
package app.revanced.patches.youtube.misc.settings.resource.patch
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.ResourceData
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.impl.ResourcePatch
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
import app.revanced.patches.youtube.misc.settings.annotations.SettingsCompatibility
import app.revanced.util.resources.ResourceUtils
import app.revanced.util.resources.ResourceUtils.copyResources
import app.revanced.util.resources.ResourceUtils.copyXmlNode
import org.w3c.dom.Element
@Name("settings-resource-patch")
@SettingsCompatibility
@DependsOn([FixLocaleConfigErrorPatch::class])
@Version("0.0.1")
class SettingsResourcePatch : ResourcePatch() {
override fun execute(data: ResourceData): PatchResult {
/*
* Copy strings
*/
data.copyXmlNode("settings/host", "values/strings.xml", "resources")
/*
* Copy arrays
*/
data.copyXmlNode("settings/host", "values/arrays.xml", "resources")
/*
* Copy preference fragments
*/
data.copyXmlNode("settings/host", "xml/settings_fragment.xml", "PreferenceScreen")
/*
* Copy layout resources
*/
arrayOf(
ResourceUtils.ResourceGroup(
"layout",
"xsettings_toolbar.xml",
"xsettings_with_toolbar.xml",
"xsettings_with_toolbar_layout.xml"
),
ResourceUtils.ResourceGroup(
"xml",
"revanced_prefs.xml"
)
).forEach { resourceGroup ->
data.copyResources("settings", resourceGroup)
}
data.xmlEditor["AndroidManifest.xml"].use {
val manifestNode = it
.file
.getElementsByTagName("manifest")
.item(0) as Element
val element = it.file.createElement("uses-permission")
element.setAttribute("android:name", "android.permission.SCHEDULE_EXACT_ALARM")
manifestNode.appendChild(element)
}
return PatchResultSuccess()
}
}

View File

@@ -0,0 +1,13 @@
package app.revanced.patches.youtube.misc.videobuffer.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.25.34", "17.29.34")
)]
)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class CustomVideoBufferCompatibility

View File

@@ -0,0 +1,32 @@
package app.revanced.patches.youtube.misc.videobuffer.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.videobuffer.annotations.CustomVideoBufferCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
@Name("maxbuffer-fingerprint")
@MatchingMethod(
"Lcom/google/android/libraries/youtube/innertube/model/media/PlayerConfigModel;", "r"
)
@DirectPatternScanMethod
@CustomVideoBufferCompatibility
@Version("0.0.1")
object MaxBufferFingerprint : MethodFingerprint(
"I", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(),
listOf(Opcode.SGET_OBJECT, Opcode.IGET, Opcode.IF_EQZ, Opcode.RETURN),
null,
customFingerprint = { methodDef ->
methodDef.definingClass.equals("Lcom/google/android/libraries/youtube/innertube/model/media/PlayerConfigModel;")
&& methodDef.implementation!!.instructions.any {
((it as? NarrowLiteralInstruction)?.narrowLiteral == 120000)
&& methodDef.name.equals("r")
}
}
)

View File

@@ -0,0 +1,31 @@
package app.revanced.patches.youtube.misc.videobuffer.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.videobuffer.annotations.CustomVideoBufferCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
@Name("playbackbuffer-fingerprint")
@MatchingMethod(
"Lcom/google/android/libraries/youtube/innertube/model/media/PlayerConfigModel;", "p"
)
@DirectPatternScanMethod
@CustomVideoBufferCompatibility
@Version("0.0.1")
object PlaybackBufferFingerprint : MethodFingerprint(
"I", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(),
listOf(Opcode.IF_LEZ, Opcode.RETURN),
null,
customFingerprint = { methodDef ->
methodDef.definingClass.equals("Lcom/google/android/libraries/youtube/innertube/model/media/PlayerConfigModel;")
&& methodDef.implementation!!.instructions.any {
((it as? NarrowLiteralInstruction)?.narrowLiteral == 1600)
}
}
)

View File

@@ -0,0 +1,31 @@
package app.revanced.patches.youtube.misc.videobuffer.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.videobuffer.annotations.CustomVideoBufferCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
@Name("playbackbuffer-fingerprint")
@MatchingMethod(
"Lcom/google/android/libraries/youtube/innertube/model/media/PlayerConfigModel;", "t"
)
@DirectPatternScanMethod
@CustomVideoBufferCompatibility
@Version("0.0.1")
object ReBufferFingerprint : MethodFingerprint(
"I", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(),
listOf(Opcode.IF_LEZ, Opcode.RETURN),
null,
customFingerprint = { methodDef ->
methodDef.definingClass.equals("Lcom/google/android/libraries/youtube/innertube/model/media/PlayerConfigModel;")
&& methodDef.implementation!!.instructions.any {
((it as? NarrowLiteralInstruction)?.narrowLiteral == 5000)
}
}
)

View File

@@ -0,0 +1,73 @@
package app.revanced.patches.youtube.misc.videobuffer.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.impl.BytecodeData
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.misc.videobuffer.annotations.CustomVideoBufferCompatibility
import app.revanced.patches.youtube.misc.videobuffer.fingerprints.MaxBufferFingerprint
import app.revanced.patches.youtube.misc.videobuffer.fingerprints.PlaybackBufferFingerprint
import app.revanced.patches.youtube.misc.videobuffer.fingerprints.ReBufferFingerprint
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Patch
@Name("custom-video-buffer")
@Description("Lets you change the buffers of videos. Has no use without settings yet.")
@CustomVideoBufferCompatibility
@Version("0.0.1")
class CustomVideoBufferPatch : BytecodePatch(
listOf(
MaxBufferFingerprint, PlaybackBufferFingerprint, ReBufferFingerprint
)
) {
override fun execute(data: BytecodeData): PatchResult {
execMaxBuffer(data)
execPlaybackBuffer(data)
execReBuffer(data)
return PatchResultSuccess()
}
private fun execMaxBuffer(data: BytecodeData) {
val result = MaxBufferFingerprint.result!!
val method = result.mutableMethod
val index = result.patternScanResult!!.endIndex - 1
val register = (method.implementation!!.instructions.get(index) as OneRegisterInstruction).registerA
method.addInstructions(
index + 1, """
invoke-static {}, Lapp/revanced/integrations/patches/VideoBufferPatch;->getMaxBuffer()I
move-result v$register
"""
)
}
private fun execPlaybackBuffer(data: BytecodeData) {
val result = PlaybackBufferFingerprint.result!!
val method = result.mutableMethod
val index = result.patternScanResult!!.startIndex
val register = (method.implementation!!.instructions.get(index) as OneRegisterInstruction).registerA
method.addInstructions(
index + 1, """
invoke-static {}, Lapp/revanced/integrations/patches/VideoBufferPatch;->getPlaybackBuffer()I
move-result v$register
"""
)
}
private fun execReBuffer(data: BytecodeData) {
val result = ReBufferFingerprint.result!!
val method = result.mutableMethod
val index = result.patternScanResult!!.startIndex
val register = (method.implementation!!.instructions.get(index) as OneRegisterInstruction).registerA
method.addInstructions(
index + 1, """
invoke-static {}, Lapp/revanced/integrations/patches/VideoBufferPatch;->getReBuffer()I
move-result v$register
"""
)
}
}

View File

@@ -8,7 +8,7 @@ import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@@ -20,7 +20,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Description("Hook to detect when the video id changes")
@VideoIdCompatibility
@Version("0.0.1")
@Dependencies([IntegrationsPatch::class])
@DependsOn([IntegrationsPatch::class])
class VideoIdPatch : BytecodePatch(
listOf(
VideoIdFingerprint

View File

@@ -2,7 +2,6 @@ package app.revanced.util.resources
import app.revanced.patcher.data.impl.DomFileEditor
import app.revanced.patcher.data.impl.ResourceData
import java.io.OutputStream
import java.nio.file.Files
internal object ResourceUtils {
@@ -44,7 +43,7 @@ internal object ResourceUtils {
// Copy nodes from the resources node to the real resource node
elementTag.copyXmlNode(
this.xmlEditor[stringsResourceInputStream, OutputStream.nullOutputStream()],
this.xmlEditor[stringsResourceInputStream],
this.xmlEditor["res/$targetResource"]
).close()
}

View File

@@ -0,0 +1,14 @@
<resources>
<string-array name="revanced_button_location_entries">
<item>@string/revanced_button_location_entry_none</item>
<item>@string/revanced_button_location_entry_player</item>
<item>@string/revanced_button_location_entry_buttoncontainer</item>
<item>@string/revanced_button_location_entry_both</item>
</string-array>
<string-array name="revanced_button_location_entry_values">
<item>NONE</item>
<item>PLAYER</item>
<item>BUTTON_CONTAINER</item>
<item>BOTH</item>
</string-array>
</resources>

View File

@@ -0,0 +1,227 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="revanced_auto_repeat_button_summary_off">"Doesn't show auto-repeat button in the player overlay. Use the toggle below to control auto-repeat"</string>
<string name="revanced_auto_repeat_button_summary_on">Auto-repeat button is shown in the player overlay</string>
<string name="revanced_auto_repeat_button_title">Auto-repeat button</string>
<string name="revanced_auto_repeat_summary_off">Always Auto-repeat is off</string>
<string name="revanced_auto_repeat_summary_on">Always Auto-repeat is on</string>
<string name="revanced_auto_repeat_title">Always Auto-repeat</string>
<string name="revanced_branding_watermark_summary_off">Video watermark is hidden</string>
<string name="revanced_branding_watermark_summary_on">Video watermark is shown</string>
<string name="revanced_branding_watermark_title">Video watermark</string>
<string name="revanced_buffer_title">Buffer settings</string>
<string name="revanced_cast_button_summary_off">Cast button is hidden</string>
<string name="revanced_cast_button_summary_on">Cast button is shown</string>
<string name="revanced_cast_button_title">Cast button</string>
<string name="revanced_autoplay_button_summary_off">Autoplay button is hidden</string>
<string name="revanced_autoplay_button_summary_on">Autoplay button is shown</string>
<string name="revanced_autoplay_button_title">Autoplay button</string>
<string name="revanced_codec_override_title">Codec override</string>
<string name="revanced_debug_summary_off">Extra debug logging is disabled</string>
<string name="revanced_debug_summary_on">Extra Debug logging is enabled</string>
<string name="revanced_debug_title">Debug mode</string>
<string name="revanced_discord_summary">Tap to join ReVanced on Discord</string>
<string name="revanced_discord_title">Discord server</string>
<string name="revanced_hdr_full_brightness_summary_on">Video brightness will follow your device\'s brightness on HDR landscape videos</string>
<string name="revanced_hdr_full_brightness_summary_off">Video brightness is set to max on HDR landscape videos</string>
<string name="revanced_hdr_full_brightness_title">Override HDR Video Brightness</string>
<string name="revanced_info_cards_summary_off">Info cards are hidden</string>
<string name="revanced_info_cards_summary_on">Info cards are shown</string>
<string name="revanced_info_cards_title">Info cards</string>
<string name="revanced_layout_settings_title">Layout settings</string>
<string name="revanced_maximum_buffer_summary">"The maximum duration of media that the player will attempt to buffer (in milliseconds)
Default: 120000"</string>
<string name="revanced_maximum_buffer_title">Maximum buffer</string>
<string name="revanced_misc_title">Miscellaneous</string>
<string name="revanced_playback_start_summary">"The duration of media that must be buffered for playback to start or resume following a user action such as seeking (in milliseconds)
Default: 2500"</string>
<string name="revanced_playback_start_title">Playback start</string>
<string name="revanced_preferred_video_speed_summary">Select preferred video speed</string>
<string name="revanced_preferred_video_speed_title">Preferred video speed</string>
<string name="revanced_rebuffer_summary">"The duration of media that must be buffered for playback to resume after a rebuffer (in milliseconds). A rebuffer is defined to be caused by buffer depletion rather than a user action
Default: 5000"</string>
<string name="revanced_rebuffer_title">Rebuffer</string>
<string name="revanced_suggestion_summary_off">End screens are hidden</string>
<string name="revanced_suggestion_summary_on">End screens are shown</string>
<string name="revanced_suggestion_title">End screens</string>
<string name="revanced_support_summary">Support links</string>
<string name="revanced_support_title">Support</string>
<string name="revanced_video_settings_title">Video settings</string>
<string name="revanced_vp9_summary">Tap to force usage of the VP9 codec</string>
<string name="revanced_vp9_summary_off">VP9 codec not forced</string>
<string name="revanced_vp9_summary_on">VP9 codec is enabled by default for supported devices, disable if you encounter stuttering/slowness in videos</string>
<string name="revanced_vp9_title">VP9 codec</string>
<string name="revanced_new_actionbar_title">Wide search bar</string>
<string name="revanced_new_actionbar_summary_off">Search bar style is defined by the app</string>
<string name="revanced_new_actionbar_summary_on">Forcing wide search bar</string>
<string name="revanced_shorts_button_title">Show shorts button</string>
<string name="revanced_shorts_button_summary_off">Shorts button is hidden</string>
<string name="revanced_shorts_button_summary_on">Shorts button is shown</string>
<string name="revanced_fullscreen_panels_title">Fullscreen panels</string>
<string name="revanced_fullscreen_panels_summary_off">Fullscreen panels are hidden</string>
<string name="revanced_fullscreen_panels_summary_on">Fullscreen panels are shown</string>
<string name="revanced_zoom_to_fit_vertical_title">Dynamic player</string>
<string name="revanced_zoom_to_fit_vertical_summary_off">Dynamic player is defined automatically</string>
<string name="revanced_zoom_to_fit_vertical_summary_on">Dynamic player is forced on square and vertical videos</string>
<string name="revanced_auto_captions_summary_off">Captions aren\'t enabled automatically at 0% volume </string>
<string name="revanced_auto_captions_summary_on">Captions are enabled automatically at 0% volume</string>
<string name="revanced_auto_captions_title">Auto captions</string>
<string name="revanced_swipe_brightness_summary_off">Swipe controls for brightness are disabled</string>
<string name="revanced_swipe_brightness_summary_on">Swipe controls for brightness are enabled</string>
<string name="revanced_swipe_brightness_title">Swipe controls for Brightness</string>
<string name="revanced_swipe_screen_summary">Swipe controls for Brightness and Volume</string>
<string name="revanced_swipe_title">Swipe controls</string>
<string name="revanced_swipe_volume_summary_off">Swipe controls for volume are disabled</string>
<string name="revanced_swipe_volume_summary_on">Swipe controls for volume are enabled</string>
<string name="revanced_swipe_volume_title">Swipe controls for Volume</string>
<string name="revanced_swipe_pts_title">Press-to-Swipe</string>
<string name="revanced_swipe_pts_summary_off">Swipe controls are always active</string>
<string name="revanced_swipe_pts_summary_on">Swipe controls require a long-press before activating</string>
<string name="revanced_swipe_pts_haptic_title">Vibrate on Press-to-Swipe</string>
<string name="revanced_swipe_pts_haptic_summary_on">You\'ll get haptic feedback when activating Press-to-Swipe</string>
<string name="revanced_swipe_pts_haptic_summary_off">You won\'t get haptic feedback when activating Press-to-Swipe</string>
<string name="revanced_swipe_overlay_timeout_title">Overlay Timeout</string>
<string name="revanced_swipe_overlay_timeout_summary">How long the overlay is shown after changes (ms)</string>
<string name="revanced_swipe_overlay_text_size_title">Overlay Text Size</string>
<string name="revanced_swipe_overlay_text_size_summary">Text size on the overlay</string>
<string name="revanced_swipe_overlay_bg_alpha_title">Overlay Background Transparency</string>
<string name="revanced_swipe_overlay_bg_alpha_summary">Transparency value of the overlay background (0255)</string>
<string name="revanced_swipe_magnitude_threshold_title">Swipe Magnitude Threshold</string>
<string name="revanced_swipe_magnitude_threshold_summary">Minimum magnitude before a swipe is detected</string>
<string name="revanced_swipe_tablet_title">Tablet style</string>
<string name="revanced_swipe_tablet_summary_on">Tablet style is turned on. For example suggested videos are only partially working</string>
<string name="revanced_swipe_tablet_summary_off">Tablet style is turned off</string>
<string name="revanced_website_summary">Tap to open our website</string>
<string name="revanced_website_title">ReVanced website</string>
<string name="revanced_home_ads_summary_off">Home ADS are hidden</string>
<string name="revanced_home_ads_summary_on">Home ADS are shown</string>
<string name="revanced_home_ads_title">Home ADS</string>
<string name="revanced_video_ads_title">Video ADS</string>
<string name="revanced_video_ads_summary_off">Video ADS are hidden</string>
<string name="revanced_video_ads_summary_on">Video ADS are shown</string>
<string name="revanced_reel_summary_off">Stories are hidden</string>
<string name="revanced_reel_summary_on">Stories are shown</string>
<string name="revanced_reel_title">YouTube stories</string>
<string name="revanced_ad_settings_title">AD settings</string>
<string name="revanced_tablet_miniplayer_summary_off">Tablet miniplayer is not being used</string>
<string name="revanced_tablet_miniplayer_summary_on">Tablet miniplayer is being used</string>
<string name="revanced_tablet_miniplayer_title">Tablet miniplayer</string>
<string name="litho_comments">Comments removal</string>
<string name="litho_comments_off">Comments removal is turned off (new comments / phones only)</string>
<string name="litho_comments_on">Comments removal is turned on (new comments / phones only)</string>
<string name="litho_community_posts">Community post removal</string>
<string name="litho_community_posts_off">Community post removal is turned off</string>
<string name="litho_community_posts_on">Community post removal is turned on</string>
<string name="litho_compact_banner">Compact banner removal</string>
<string name="litho_compact_banner_off">Compact banner removal is turned off</string>
<string name="litho_compact_banner_on">Compact banner removal is turned on</string>
<string name="litho_compact_movie">Compact movie removal</string>
<string name="litho_compact_movie_off">Compact movie removal is turned off</string>
<string name="litho_compact_movie_on">Compact movie removal is turned on</string>
<string name="litho_general_ad_removal">General layout ad removal</string>
<string name="litho_general_ad_removal_off">General layout ad removal is turned off</string>
<string name="litho_general_ad_removal_on">General layout ad removal is turned on</string>
<string name="litho_horizontal_movie_shelf">Movie shelf removal</string>
<string name="litho_horizontal_movie_shelf_off">Movie shelf removal is turned off</string>
<string name="litho_horizontal_movie_shelf_on">Movie shelf removal is turned on</string>
<string name="litho_in_feed_survey">Survey removal</string>
<string name="litho_in_feed_survey_off">Feed survey removal is turned off</string>
<string name="litho_in_feed_survey_on">Feed survey removal is turned on</string>
<string name="litho_merchandise">Merchandise removal</string>
<string name="litho_merchandise_off">Merchandise removal is turned off</string>
<string name="litho_merchandise_on">Merchandise removal is turned on</string>
<string name="litho_movie_upsell">Movie upsell removal</string>
<string name="litho_movie_upsell_off">Movie upsell removal is turned off</string>
<string name="litho_movie_upsell_on">Movie upsell removal is turned on</string>
<string name="litho_emergency_box">Emergency box removal</string>
<string name="litho_emergency_box_on">Emergency box removal is turned on</string>
<string name="litho_emergency_box_off">Emergency box removal is turned off</string>
<string name="litho_info_panel">Info panel removal</string>
<string name="litho_info_panel_on">Info panel removal is turned on</string>
<string name="litho_info_panel_off">Info panel removal is turned off</string>
<string name="litho_medical_panel">Medical panel removal</string>
<string name="litho_medical_panel_on">Medical panel removal is turned on</string>
<string name="litho_medical_panel_off">Medical panel removal is turned off</string>
<string name="litho_paid_content">Paid content removal</string>
<string name="litho_paid_content_on">Paid content removal is turned on</string>
<string name="litho_paid_content_off">Paid content removal is turned off</string>
<string name="litho_suggested">Suggested for you removal</string>
<string name="litho_suggested_on">Suggested for you removal is turned on</string>
<string name="litho_suggested_off">Suggested for you removal is turned off</string>
<string name="litho_hide_suggestions">General Suggestions removal</string>
<string name="litho_hide_suggestions_on">General Suggestions removal is turned on</string>
<string name="litho_hide_suggestions_off">General Suggestions removal is turned off</string>
<string name="litho_latest_posts">Latest posts removal</string>
<string name="litho_latest_posts_on">Latest posts removal is turned on</string>
<string name="litho_latest_posts_off">Latest posts removal is turned off</string>
<string name="litho_channel_guidelines">Channel guidelines removal</string>
<string name="litho_channel_guidelines_on">Channel guidelines removal is turned on</string>
<string name="litho_channel_guidelines_off">Channel guidelines removal is turned off</string>
<string name="microg_notification_settings">Notification settings</string>
<string name="microg_notification_settings_summary">"1. Google device registration and Cloud Messaging need to be enabled for notifications.
2. ReVanced needs to be shown as registered under Cloud Messaging.
3. Current State in Cloud Messaging must be Connected."</string>
<string name="microg_settings">MicroG settings</string>
<string name="revanced_settings">ReVanced settings</string>
<string name="revanced_seekbar_tapping">Seekbar Tapping</string>
<string name="revanced_seekbar_tapping_off">Seekbar Tapping (video progress bar) is disabled</string>
<string name="revanced_seekbar_tapping_on">Seekbar Tapping (video progress bar) is enabled</string>
<string name="revanced_minimized_playback">Background playback</string>
<string name="revanced_minimized_playback_off">Background playback is disabled</string>
<string name="revanced_minimized_playback_on">Background playback is enabled</string>
<string name="pref_subtitles_scale_normal">Normal</string>
<string name="litho_shorts_shelf">Shorts Shelf</string>
<string name="litho_shorts_shelf_off">Shorts Shelf removal is turned off</string>
<string name="litho_shorts_shelf_on">Shorts Shelf removal is turned on</string>
<string name="revanced_create_button_summary_off">Create Button is hidden</string>
<string name="revanced_create_button_summary_on">Create Button is shown</string>
<string name="revanced_create_button_title">Create Button</string>
<string name="litho_community_guidelines">Community Guidelines</string>
<string name="litho_community_guidelines_off">Community Guidelines removal is turned off</string>
<string name="litho_community_guidelines_on">Community Guidelines removal is turned on</string>
<string name="revanced_copy_video_url_summary_off">Copy Link Button is hidden from the player overlay</string>
<string name="revanced_copy_video_url_summary_on">Copy Link Button is shown in the player overlay</string>
<string name="revanced_copy_video_url_timestamp_summary_off">Copy Link Button With Timestamp is hidden from the player overlay</string>
<string name="revanced_copy_video_url_timestamp_summary_on">Copy Link Button With Timestamp is shown in the player overlay</string>
<string name="revanced_copy_video_url_timestamp_title">Copy Link Button With Timestamp</string>
<string name="revanced_copy_video_url_title">Copy Link Button</string>
<string name="revanced_old_style_quality_settings_title">Quality Settings style</string>
<string name="revanced_old_style_quality_settings_summary_off">Using default style video quality settings</string>
<string name="revanced_old_style_quality_settings_summary_on">Using old style video quality settings</string>
<string name="revanced_videoadwhitelisting_title">Video ad whitelisting</string>
<string name="revanced_videoadwhitelisting_summary_off">Video ad whitelisting is turned off</string>
<string name="revanced_videoadwhitelisting_summary_on">Video ad whitelisting is turned on. Use the ADS button under the player to whitelist a channel</string>
<string name="revanced_whitelisting_ads">ADS</string>
<string name="revanced_whitelisting_sponsorblock">SponsorBlock</string>
<string name="revanced_whitelisting_added" formatted="false">Channel %s was added to the %s whitelist</string>
<string name="revanced_whitelisting_removed" formatted="false">Channel %s was removed from the %s whitelist</string>
<string name="revanced_whitelisting_add_failed" formatted="false">Failed to add channel %s to the %s whitelist</string>
<string name="revanced_whitelisting_remove_failed" formatted="false">Failed to remove channel %s from the %s whitelist</string>
<string name="revanced_whitelisting_fetch_failed" formatted="false">Failed to retrieve channel details, received code %d</string>
<string name="revanced_button_location_entry_none">Hidden</string>
<string name="revanced_button_location_entry_player">In player</string>
<string name="revanced_button_location_entry_buttoncontainer">Under player</string>
<string name="revanced_button_location_entry_both">Both</string>
<string name="revanced_ryd_settings_title">Return YouTube Dislike settings</string>
<string name="revanced_ryd_settings_summary">Uses the RYD API</string>
<string name="sb_settings">SponsorBlock settings</string>
<string name="sb_summary">Uses the sponsor.ajay.app API</string>
<string name="revanced_ryd_title">Enable RYD</string>
<string name="revanced_ryd_summary">Switch this on to see the dislike counts again</string>
<string name="revanced_ryd_attribution_title">Return YouTube Dislike Integration</string>
<string name="revanced_ryd_attribution_summary">This integration uses the RYD API from https://returnyoutubedislike.com. Tap to learn more</string>
</resources>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<Preference android:title="@string/revanced_ryd_settings_title" android:summary="@string/revanced_ryd_settings_summary">
<intent android:targetPackage="com.google.android.youtube" android:data="ryd_settings" android:targetClass="com.google.android.libraries.social.licenses.LicenseActivity"/>
</Preference>
<Preference android:title="@string/sb_settings" android:summary="@string/sb_summary">
<intent android:targetPackage="com.google.android.youtube" android:data="sponsorblock_settings" android:targetClass="com.google.android.libraries.social.licenses.LicenseActivity"/>
</Preference>
<Preference android:title="@string/revanced_settings">
<intent android:targetPackage="com.google.android.youtube" android:data="revanced_settings" android:targetClass="com.google.android.libraries.social.licenses.LicenseActivity"/>
</Preference>
</PreferenceScreen>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:background="@color/yt_white1" android:layout_width="match_parent" android:layout_height="wrap_content" android:elevation="4dp">
<android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:background="?attr/ytBrandBackgroundSolid" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" app:navigationIcon="@drawable/quantum_ic_arrow_back_white_24" app:title="ReVanced settings"/>
</FrameLayout>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<merge>
<include layout="@layout/xsettings_with_toolbar_layout"/>
</merge>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:fitsSystemWindows="true" android:layout_width="match_parent" android:layout_height="match_parent" android:transitionGroup="true">
<include layout="@layout/xsettings_toolbar"/>
<FrameLayout android:id="@+id/xsettings_fragments" android:layout_width="match_parent" android:layout_height="match_parent"/>
</LinearLayout>

View File

@@ -0,0 +1,180 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:yt="http://schemas.android.com/apk/res-auto">
<PreferenceCategory
android:layout_height="match_parent"
android:title="@string/revanced_settings" />
<PreferenceScreen android:title="@string/revanced_codec_override_title" android:key="revanced_override_codec">
<SwitchPreference android:title="@string/revanced_vp9_title" android:key="revanced_override_codec_enabled" android:defaultValue="false" android:summaryOn="@string/revanced_vp9_summary_on" android:summaryOff="@string/revanced_vp9_summary_off" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/revanced_video_settings_title" android:key="video_settings">
<SwitchPreference android:title="@string/revanced_old_style_quality_settings_title" android:key="revanced_use_old_style_quality_settings" android:defaultValue="true" android:summaryOn="@string/revanced_old_style_quality_settings_summary_on" android:summaryOff="@string/revanced_old_style_quality_settings_summary_off" />
<ListPreference android:title="@string/revanced_preferred_video_speed_title" android:key="revanced_pref_video_speed" android:summary="@string/revanced_preferred_video_speed_summary" />
<!--<SwitchPreference android:title="Auto captions" android:key="revanced_pref_auto_captions" android:defaultValue="false" android:summaryOn="Auto captions are turned on" android:summaryOff="Auto captions are turned off" />-->
</PreferenceScreen>
<!--<PreferenceScreen android:title="@string/revanced_videoadwhitelisting_title" android:key="video_ad_settings">
<SwitchPreference android:title="@string/revanced_videoadwhitelisting_title" android:key="revanced_whitelist_ads_enabled" android:defaultValue="false" android:summaryOn="@string/revanced_videoadwhitelisting_summary_on" android:summaryOff="@string/revanced_videoadwhitelisting_summary_off" />
</PreferenceScreen>-->
<PreferenceScreen
android:key="ad_settings"
android:title="@string/revanced_ad_settings_title">
<SwitchPreference
android:defaultValue="false"
android:key="revanced_home_ads_enabled"
android:summaryOff="@string/revanced_home_ads_summary_off"
android:summaryOn="@string/revanced_home_ads_summary_on"
android:title="@string/revanced_home_ads_title" />
<SwitchPreference
android:defaultValue="false"
android:key="revanced_video_ads_enabled"
android:summaryOff="@string/revanced_video_ads_summary_off"
android:summaryOn="@string/revanced_video_ads_summary_on"
android:title="@string/revanced_video_ads_title" />
<SwitchPreference
android:defaultValue="true"
android:key="revanced_adremover_ad_removal"
android:summaryOff="@string/litho_general_ad_removal_off"
android:summaryOn="@string/litho_general_ad_removal_on"
android:title="@string/litho_general_ad_removal" />
<SwitchPreference
android:defaultValue="true"
android:key="revanced_adremover_merchandise"
android:summaryOff="@string/litho_merchandise_off"
android:summaryOn="@string/litho_merchandise_on"
android:title="@string/litho_merchandise" />
<SwitchPreference
android:defaultValue="true"
android:key="revanced_adremover_community_posts_removal"
android:summaryOff="@string/litho_community_posts_off"
android:summaryOn="@string/litho_community_posts_on"
android:title="@string/litho_community_posts" />
<SwitchPreference
android:defaultValue="true"
android:key="revanced_adremover_compact_banner_removal"
android:summaryOff="@string/litho_compact_banner_off"
android:summaryOn="@string/litho_compact_banner_on"
android:title="@string/litho_compact_banner" />
<SwitchPreference
android:defaultValue="false"
android:key="revanced_adremover_comments_removal"
android:summaryOff="@string/litho_comments_off"
android:summaryOn="@string/litho_comments_on"
android:title="@string/litho_comments" />
<SwitchPreference
android:defaultValue="true"
android:key="revanced_adremover_movie"
android:summaryOff="@string/litho_compact_movie_off"
android:summaryOn="@string/litho_compact_movie_on"
android:title="@string/litho_compact_movie" />
<SwitchPreference
android:defaultValue="true"
android:key="revanced_adremover_feed_survey"
android:summaryOff="@string/litho_in_feed_survey_off"
android:summaryOn="@string/litho_in_feed_survey_on"
android:title="@string/litho_in_feed_survey" />
<SwitchPreference
android:defaultValue="true"
android:key="revanced_adremover_shorts_shelf"
android:summaryOff="@string/litho_shorts_shelf_off"
android:summaryOn="@string/litho_shorts_shelf_on"
android:title="@string/litho_shorts_shelf" />
<SwitchPreference
android:defaultValue="true"
android:key="revanced_adremover_community_guideline"
android:summaryOff="@string/litho_community_guidelines_off"
android:summaryOn="@string/litho_community_guidelines_on"
android:title="@string/litho_community_guidelines" />
<SwitchPreference
android:defaultValue="true"
android:key="revanced_adremover_emergency_box_removal"
android:summaryOff="@string/litho_emergency_box_off"
android:summaryOn="@string/litho_emergency_box_on"
android:title="@string/litho_emergency_box" />
<SwitchPreference
android:defaultValue="true"
android:key="revanced_adremover_info_panel"
android:summaryOff="@string/litho_info_panel_off"
android:summaryOn="@string/litho_info_panel_on"
android:title="@string/litho_info_panel" />
<SwitchPreference
android:defaultValue="true"
android:key="revanced_adremover_medical_panel"
android:summaryOff="@string/litho_medical_panel_off"
android:summaryOn="@string/litho_medical_panel_on"
android:title="@string/litho_medical_panel" />
<SwitchPreference
android:defaultValue="true"
android:key="revanced_adremover_paid_content"
android:summaryOff="@string/litho_paid_content_off"
android:summaryOn="@string/litho_paid_content_on"
android:title="@string/litho_paid_content" />
<SwitchPreference
android:defaultValue="true"
android:key="revanced_adremover_suggested"
android:summaryOff="@string/litho_suggested_off"
android:summaryOn="@string/litho_suggested_on"
android:title="@string/litho_suggested" />
<SwitchPreference
android:defaultValue="true"
android:key="revanced_adremover_hide_suggestions"
android:summaryOff="@string/litho_hide_suggestions_off"
android:summaryOn="@string/litho_hide_suggestions_on"
android:title="@string/litho_hide_suggestions" />
<SwitchPreference
android:defaultValue="true"
android:key="revanced_adremover_hide_latest_posts"
android:summaryOff="@string/litho_latest_posts_off"
android:summaryOn="@string/litho_latest_posts_on"
android:title="@string/litho_latest_posts" />
<SwitchPreference
android:defaultValue="true"
android:key="revanced_adremover_hide_channel_guidelines"
android:summaryOff="@string/litho_channel_guidelines_off"
android:summaryOn="@string/litho_channel_guidelines_on"
android:title="@string/litho_channel_guidelines" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/revanced_layout_settings_title" android:key="layout_settings">
<SwitchPreference android:title="@string/revanced_reel_title" android:key="revanced_reel_button_enabled" android:defaultValue="false" android:summaryOn="@string/revanced_reel_summary_on" android:summaryOff="@string/revanced_reel_summary_off" />
<SwitchPreference android:title="@string/revanced_suggestion_title" android:key="revanced_info_cards_enabled" android:defaultValue="false" android:summaryOn="@string/revanced_suggestion_summary_on" android:summaryOff="@string/revanced_suggestion_summary_off" />
<SwitchPreference android:title="@string/revanced_branding_watermark_title" android:key="revanced_branding_watermark_enabled" android:defaultValue="false" android:summaryOn="@string/revanced_branding_watermark_summary_on" android:summaryOff="@string/revanced_branding_watermark_summary_off" />
<SwitchPreference android:title="@string/revanced_cast_button_title" android:key="revanced_cast_button_enabled" android:defaultValue="false" android:summaryOn="@string/revanced_cast_button_summary_on" android:summaryOff="@string/revanced_cast_button_summary_off" />
<SwitchPreference android:title="@string/revanced_autoplay_button_title" android:key="revanced_autoplay_button_enabled" android:defaultValue="false" android:summaryOn="@string/revanced_autoplay_button_summary_on" android:summaryOff="@string/revanced_autoplay_button_summary_off" />
<!--<SwitchPreference android:title="@string/revanced_tablet_miniplayer_title" android:key="revanced_tablet_miniplayer" android:defaultValue="false" android:summaryOn="@string/revanced_tablet_miniplayer_summary_on" android:summaryOff="@string/revanced_tablet_miniplayer_summary_off" />-->
<SwitchPreference android:title="@string/revanced_create_button_title" android:key="revanced_create_button_enabled" android:defaultValue="false" android:summaryOn="@string/revanced_create_button_summary_on" android:summaryOff="@string/revanced_create_button_summary_off" />
<SwitchPreference android:title="@string/revanced_new_actionbar_title" android:key="revanced_new_actionbar" android:defaultValue="false" android:summaryOn="@string/revanced_new_actionbar_summary_on" android:summaryOff="@string/revanced_new_actionbar_summary_off" />
<SwitchPreference android:title="@string/revanced_shorts_button_title" android:key="revanced_shorts_button_enabled" android:defaultValue="false" android:summaryOn="@string/revanced_shorts_button_summary_on" android:summaryOff="@string/revanced_shorts_button_summary_off" />
<SwitchPreference android:title="@string/revanced_fullscreen_panels_title" android:key="revanced_fullscreen_panels_enabled" android:defaultValue="false" android:summaryOn="@string/revanced_fullscreen_panels_summary_on" android:summaryOff="@string/revanced_fullscreen_panels_summary_off" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/revanced_misc_title" android:key="misc_screen">
<SwitchPreference android:title="@string/revanced_auto_repeat_title" android:key="revanced_pref_auto_repeat" android:defaultValue="false" android:summaryOn="@string/revanced_auto_repeat_summary_on" android:summaryOff="@string/revanced_auto_repeat_summary_off" />
<!--<ListPreference android:entries="@array/revanced_button_location_entries" android:title="@string/revanced_copy_video_url_timestamp_title" android:key="revanced_pref_copy_video_url_timestamp_button_list" android:entryValues="@array/revanced_button_location_entry_values" />
<ListPreference android:entries="@array/revanced_button_location_entries" android:title="@string/revanced_copy_video_url_title" android:key="revanced_pref_copy_video_url_button_list" android:entryValues="@array/revanced_button_location_entry_values" />-->
<SwitchPreference android:title="@string/revanced_hdr_full_brightness_title" android:key="revanced_pref_hdr_autobrightness" android:defaultValue="false" android:summaryOn="@string/revanced_hdr_full_brightness_summary_on" android:summaryOff="@string/revanced_hdr_full_brightness_summary_off" />
<SwitchPreference android:title="@string/revanced_seekbar_tapping" android:key="revanced_enable_tap_seeking" android:defaultValue="true" android:summaryOn="@string/revanced_seekbar_tapping_on" android:summaryOff="@string/revanced_seekbar_tapping_off" />
<SwitchPreference android:title="@string/revanced_minimized_playback" android:key="revanced_enable_minimized_playback" android:defaultValue="true" android:summaryOn="@string/revanced_minimized_playback_on" android:summaryOff="@string/revanced_minimized_playback_off" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/revanced_swipe_title" android:key="swipe_screen" android:summary="@string/revanced_swipe_screen_summary">
<SwitchPreference android:title="@string/revanced_swipe_brightness_title" android:key="revanced_enable_swipe_brightness" android:defaultValue="false" android:summaryOn="@string/revanced_swipe_brightness_summary_on" android:summaryOff="@string/revanced_swipe_brightness_summary_off" />
<SwitchPreference android:title="@string/revanced_swipe_volume_title" android:key="revanced_enable_swipe_volume" android:defaultValue="false" android:summaryOn="@string/revanced_swipe_volume_summary_on" android:summaryOff="@string/revanced_swipe_volume_summary_off" />
<SwitchPreference android:title="@string/revanced_swipe_pts_title" android:key="revanced_enable_press_to_swipe" android:defaultValue="false" android:summaryOn="@string/revanced_swipe_pts_summary_on" android:summaryOff="@string/revanced_swipe_pts_summary_off" />
<SwitchPreference android:title="@string/revanced_swipe_pts_haptic_title" android:key="revanced_enable_swipe_haptic_feedback" android:defaultValue="false" android:summaryOn="@string/revanced_swipe_pts_haptic_summary_on" android:summaryOff="@string/revanced_swipe_pts_haptic_summary_off" />
<EditTextPreference android:inputType="number" android:title="@string/revanced_swipe_overlay_timeout_title" android:key="revanced_swipe_overlay_timeout" android:summary="@string/revanced_swipe_overlay_timeout_summary" android:defaultValue="500" />
<EditTextPreference android:inputType="number" android:title="@string/revanced_swipe_overlay_text_size_title" android:key="revanced_swipe_overlay_text_size" android:summary="@string/revanced_swipe_overlay_text_size_summary" android:defaultValue="22" />
<EditTextPreference android:inputType="number" android:title="@string/revanced_swipe_overlay_bg_alpha_title" android:key="revanced_swipe_overlay_background_alpha" android:summary="@string/revanced_swipe_overlay_bg_alpha_summary" android:defaultValue="127" />
<EditTextPreference android:inputType="number" android:title="@string/revanced_swipe_magnitude_threshold_title" android:key="revanced_swipe_magnitude_threshold" android:summary="@string/revanced_swipe_magnitude_threshold_summary" android:defaultValue="30" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/revanced_buffer_title" android:key="buffer_screen">
<EditTextPreference android:inputType="number" android:title="@string/revanced_maximum_buffer_title" android:key="revanced_pref_max_buffer_ms" android:summary="@string/revanced_maximum_buffer_summary" android:defaultValue="120000" />
<EditTextPreference android:inputType="number" android:title="@string/revanced_playback_start_title" android:key="revanced_pref_buffer_for_playback_ms" android:summary="@string/revanced_playback_start_summary" android:defaultValue="2500" />
<EditTextPreference android:inputType="number" android:title="@string/revanced_rebuffer_title" android:key="revanced_pref_buffer_for_playback_after_rebuffer_ms" android:summary="@string/revanced_rebuffer_summary" android:defaultValue="5000" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/revanced_support_title" android:key="support_screen" android:summary="@string/revanced_support_summary">
<Preference android:title="@string/revanced_discord_title" android:summary="@string/revanced_discord_summary">
<intent android:action="android.intent.action.VIEW" android:data="https://discord.gg/rF2YcEjcrT" />
</Preference>
<Preference android:title="@string/revanced_website_title" android:summary="@string/revanced_website_summary">
<intent android:action="android.intent.action.VIEW" android:data="https://revanced.app" />
</Preference>
</PreferenceScreen>
<SwitchPreference android:title="@string/revanced_debug_title" android:key="revanced_debug_enabled" android:defaultValue="false" android:summaryOn="@string/revanced_debug_summary_on" android:summaryOff="@string/revanced_debug_summary_off" />
</PreferenceScreen>

View File

@@ -57,7 +57,7 @@
<string name="about">About</string>
<string name="about_api">This app uses the API from SponsorBlock</string>
<string name="about_api_sum">Tap to learn more, and see downloads for other platforms at: sponsor.ajay.app</string>
<string name="about_madeby">Integration made by JakubWeg</string>
<string name="about_madeby">Integration made by JakubWeg, recoded by oSumAtrIX</string>
<string name="tap_skip">Tap to skip</string>
<string name="submit_failed_unknown_error" formatted="false">Unable to submit segments: Status: %d %s</string>
@@ -105,9 +105,6 @@
<string name="sb_guidelines_popup_already_read">Already read</string>
<string name="sb_guidelines_popup_open">Show me</string>
<string name="sb_settings">SponsorBlock settings</string>
<string name="sb_summary">Uses the sponsor.ajay.app API</string>
<string name="general_time_without_sb">Show time without segments</string>
<string name="general_time_without_sb_sum">This time appears in brackets next to the current time. This shows the total video duration minus any segments.</string>
<string name="general_whitelisting">Channel whitelisting</string>