Compare commits

...

15 Commits

Author SHA1 Message Date
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
semantic-release-bot
6580f71392 chore(release): 2.26.0 [skip ci]
# [2.26.0](https://github.com/revanced/revanced-patches/compare/v2.25.3...v2.26.0) (2022-07-31)

### Features

* `ResourceUtils` helper class ([9c57961](9c57961680))
2022-07-31 00:28:57 +00:00
oSumAtrIX
9c57961680 feat: ResourceUtils helper class 2022-07-31 02:27:09 +02:00
semantic-release-bot
1d7a9ac437 chore(release): 2.25.3 [skip ci]
## [2.25.3](https://github.com/revanced/revanced-patches/compare/v2.25.2...v2.25.3) (2022-07-29)

### Bug Fixes

* actually call `VideoInformation.setCurrentVideoId` first ([51e08fb](51e08fb0b6))
2022-07-29 01:34:59 +00:00
oSumAtrIX
51e08fb0b6 fix: actually call VideoInformation.setCurrentVideoId first 2022-07-29 03:32:28 +02:00
oSumAtrIX
91feea1c50 refactor: do not account for order in VideoIdPatch.injectCall (#246) 2022-07-29 03:20:55 +02:00
33 changed files with 971 additions and 49 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,45 @@
## [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)
### Features
* `ResourceUtils` helper class ([e0e1144](https://github.com/revanced/revanced-patches/commit/e0e11447a7ac184d43c75955854c52c6992ff667))
## [2.25.3](https://github.com/revanced/revanced-patches/compare/v2.25.2...v2.25.3) (2022-07-29)
### Bug Fixes
* actually call `VideoInformation.setCurrentVideoId` first ([5c62d0a](https://github.com/revanced/revanced-patches/commit/5c62d0a2e0217de1b9563a41b4e94ed63230440f))
## [2.25.2](https://github.com/revanced/revanced-patches/compare/v2.25.1...v2.25.2) (2022-07-26)

View File

@@ -59,8 +59,10 @@ Official patches by ReVanced
| `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:2.9.0")
implementation("app.revanced:multidexlib2:2.5.2.r2")
}

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.25.2
version = 2.28.2

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

@@ -17,7 +17,7 @@ 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

View File

@@ -2,7 +2,6 @@ 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
@@ -10,7 +9,7 @@ import app.revanced.patcher.patch.annotations.Dependencies
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")
@@ -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

@@ -20,7 +20,7 @@ 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)
@Patch
@Dependencies([IntegrationsPatch::class])
@Name("enable-wide-searchbar")
@Description("Replaces the search icon with a wide search bar. This will hide the YouTube logo when active.")

View File

@@ -18,7 +18,7 @@ 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)
@Patch
@Dependencies([IntegrationsPatch::class])
@Name("always-autorepeat")
@Description("Always repeats the playing video again.")

View File

@@ -22,7 +22,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.reference.FieldReference
@Patch(include = false)
@Patch
@Dependencies([IntegrationsPatch::class])
@Name("force-vp9-codec")
@Description("Forces the VP9 codec for videos.")

View File

@@ -18,7 +18,7 @@ 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

View File

@@ -13,9 +13,10 @@ import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibi
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])
@Dependencies([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,12 +28,18 @@ 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 settings_fragment = data.get("res/xml/settings_fragment.xml")
val text = settings_fragment.readText()
settings_fragment.writeText(
text.replace("android:targetPackage=\"com.google.android.youtube", "android:targetPackage=\"$REVANCED_PACKAGE_NAME")
)
val manifest = data.get("AndroidManifest.xml").readText()
data.get("AndroidManifest.xml").writeText(

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,28 @@
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("license-activity-fingerprint")
@MatchingMethod(
"Lcom/google/android/libraries/social/licenses/LicenseActivity;", "onCreate"
)
@FuzzyPatternScanMethod(2)
@ReturnYouTubeDislikeCompatibility
@Version("0.0.2")
object LicenseActivityFingerprint : MethodFingerprint(
null,
null,
null,
null,
null,
{ methodDef ->
methodDef.definingClass.endsWith("LicenseActivity;") && methodDef.name == "onCreate"
}
)

View File

@@ -0,0 +1,28 @@
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"
)
@FuzzyPatternScanMethod(2)
@ReturnYouTubeDislikeCompatibility
@Version("0.0.2")
object ReVancedSettingsActivityFingerprint : MethodFingerprint(
null,
null,
null,
null,
null,
{ methodDef ->
methodDef.definingClass.endsWith("ReVancedSettingActivity;") && methodDef.name == "initializeSettings"
}
)

View File

@@ -0,0 +1,56 @@
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.Dependencies
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
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.resource.patch.SettingsResourcePatch
@Patch
@Dependencies([IntegrationsPatch::class, SettingsResourcePatch::class])
@Name("settings")
@Description("Adds settings for ReVanced to YouTube.")
@SettingsCompatibility
@Version("0.0.1")
class SettingsPatch : BytecodePatch(
listOf(LicenseActivityFingerprint, ReVancedSettingsActivityFingerprint)
) {
override fun execute(data: BytecodeData): PatchResult {
val licenseActivityResult = LicenseActivityFingerprint.result!!
val settingsResult = ReVancedSettingsActivityFingerprint.result!!
val licenseActivityClass = licenseActivityResult.mutableClass
val settingsClass = settingsResult.mutableClass
val onCreate = licenseActivityResult.mutableMethod
val setThemeMethodName = "setTheme"
val initializeSettings = settingsResult.mutableMethod
// First 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()
}
}

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.Dependencies
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
@Dependencies([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

@@ -35,15 +35,18 @@ class VideoIdPatch : BytecodePatch(
injectCall("Lapp/revanced/integrations/videoplayer/VideoInformation;->setCurrentVideoId(Ljava/lang/String;)V")
offset++ // offset so setCurrentVideoId is called before any injected call
return PatchResultSuccess()
}
companion object {
private lateinit var result: MethodFingerprintResult
private var videoIdRegister: Int = 0
private lateinit var insertMethod: MutableMethod
private var offset = 2
private var videoIdRegister: Int = 0
private lateinit var result: MethodFingerprintResult
private lateinit var insertMethod: MutableMethod
/**
* Adds an invoke-static instruction, called with the new id when the video changes
* @param methodDescriptor which method to call. Params have to be `Ljava/lang/String;`
@@ -52,10 +55,9 @@ class VideoIdPatch : BytecodePatch(
methodDescriptor: String
) {
insertMethod.addInstructions(
result.patternScanResult!!.endIndex + offset, // after the move-result-object
result.patternScanResult!!.endIndex + offset, // move-result-object offset
"invoke-static {v$videoIdRegister}, $methodDescriptor"
)
offset++ // so additional instructions get added later
}
}
}

View File

@@ -0,0 +1,74 @@
package app.revanced.util.resources
import app.revanced.patcher.data.impl.DomFileEditor
import app.revanced.patcher.data.impl.ResourceData
import java.nio.file.Files
internal object ResourceUtils {
/**
* Copy resources from the current class loader to the resource directory.
* @param sourceResourceDirectory The source resource directory name.
* @param resources The resources to copy.
*/
internal fun ResourceData.copyResources(sourceResourceDirectory: String, vararg resources: ResourceGroup) {
val classLoader = ResourceUtils.javaClass.classLoader
val targetResourceDirectory = this["res"]
for (resourceGroup in resources) {
resourceGroup.resources.forEach { resource ->
val resourceFile = "${resourceGroup.resourceDirectoryName}/$resource"
Files.copy(
classLoader.getResourceAsStream("$sourceResourceDirectory/$resourceFile")!!,
targetResourceDirectory.resolve(resourceFile).toPath()
)
}
}
}
/**
* Resource names mapped to their corresponding resource data.
* @param resourceDirectoryName The name of the directory of the resource.
* @param resources A list of resource names.
*/
internal class ResourceGroup(val resourceDirectoryName: String, vararg val resources: String)
/**
* Copy resources from the current class loader to the resource directory.
* @param resourceDirectory The directory of the resource.
* @param targetResource The target resource.
* @param elementTag The element to copy.
*/
internal fun ResourceData.copyXmlNode(resourceDirectory: String, targetResource: String, elementTag: String) {
val stringsResourceInputStream = ResourceUtils.javaClass.classLoader.getResourceAsStream("$resourceDirectory/$targetResource")!!
// Copy nodes from the resources node to the real resource node
elementTag.copyXmlNode(
this.xmlEditor[stringsResourceInputStream],
this.xmlEditor["res/$targetResource"]
).close()
}
/**
* Copies the specified node of the source [DomFileEditor] to the target [DomFileEditor].
* @param source the source [DomFileEditor].
* @param target the target [DomFileEditor]-
* @return AutoCloseable that closes the target [DomFileEditor]s.
*/
internal 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

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