mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-11 20:03:55 +01:00
Compare commits
9 Commits
v2.195.0-d
...
v2.195.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9c3748314 | ||
|
|
c14642a34b | ||
|
|
af2df3edd9 | ||
|
|
b5a7258f74 | ||
|
|
28fa499974 | ||
|
|
5fa89b6846 | ||
|
|
9588a47880 | ||
|
|
0dc06768d9 | ||
|
|
a04232ea91 |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,3 +1,24 @@
|
|||||||
|
# [2.195.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v2.195.0-dev.3...v2.195.0-dev.4) (2023-10-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Reddit - Sanitize sharing links:** Restore compatibility with newer versions of the app ([1671d8d](https://github.com/ReVanced/revanced-patches/commit/1671d8d826a08273fae5ccffc4a4ebfef9648fe2))
|
||||||
|
|
||||||
|
# [2.195.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v2.195.0-dev.2...v2.195.0-dev.3) (2023-10-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube:** Add `Spoof device dimensions` patch ([c8d409e](https://github.com/ReVanced/revanced-patches/commit/c8d409e1dbda6ac45fef01912ce7afad1022b4b7))
|
||||||
|
|
||||||
|
# [2.195.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.195.0-dev.1...v2.195.0-dev.2) (2023-10-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Indent option description correctly ([d4a9ea1](https://github.com/ReVanced/revanced-patches/commit/d4a9ea1f6c7ab9d25fd60695cce0965c7b5269a4))
|
||||||
|
|
||||||
# [2.195.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.194.1-dev.1...v2.195.0-dev.1) (2023-10-13)
|
# [2.195.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.194.1-dev.1...v2.195.0-dev.1) (2023-10-13)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
|
import org.gradle.kotlin.dsl.support.listFilesOrdered
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "1.8.20"
|
kotlin("jvm") version "1.8.20"
|
||||||
alias(libs.plugins.ksp)
|
alias(libs.plugins.ksp)
|
||||||
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "app.revanced"
|
group = "app.revanced"
|
||||||
@@ -27,6 +30,7 @@ dependencies {
|
|||||||
implementation(libs.guava)
|
implementation(libs.guava)
|
||||||
// Used in JsonGenerator.
|
// Used in JsonGenerator.
|
||||||
implementation(libs.gson)
|
implementation(libs.gson)
|
||||||
|
|
||||||
// A dependency to the Android library unfortunately fails the build, which is why this is required.
|
// A dependency to the Android library unfortunately fails the build, which is why this is required.
|
||||||
compileOnly(project("dummy"))
|
compileOnly(project("dummy"))
|
||||||
|
|
||||||
@@ -40,40 +44,74 @@ kotlin {
|
|||||||
tasks {
|
tasks {
|
||||||
register<DefaultTask>("generateBundle") {
|
register<DefaultTask>("generateBundle") {
|
||||||
description = "Generate dex files from build and bundle them in the jar file"
|
description = "Generate dex files from build and bundle them in the jar file"
|
||||||
|
|
||||||
dependsOn(build)
|
dependsOn(build)
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
val androidHome = System.getenv("ANDROID_HOME") ?: throw GradleException("ANDROID_HOME not found")
|
val d8 = File(System.getenv("ANDROID_HOME")).resolve("build-tools")
|
||||||
val d8 = "${androidHome}/build-tools/33.0.1/d8"
|
.listFilesOrdered().last().resolve("d8").absolutePath
|
||||||
val input = configurations.archives.get().allArtifacts.files.files.first().absolutePath
|
|
||||||
val work = layout.buildDirectory.dir("libs").get().asFile
|
val artifacts = configurations.archives.get().allArtifacts.files.files.first().absolutePath
|
||||||
|
val workingDirectory = layout.buildDirectory.dir("libs").get().asFile
|
||||||
|
|
||||||
exec {
|
exec {
|
||||||
workingDir = work
|
workingDir = workingDirectory
|
||||||
commandLine = listOf(d8, input)
|
commandLine = listOf(d8, artifacts)
|
||||||
}
|
}
|
||||||
|
|
||||||
exec {
|
exec {
|
||||||
workingDir = work
|
workingDir = workingDirectory
|
||||||
commandLine = listOf("zip", "-u", input, "classes.dex")
|
commandLine = listOf("zip", "-u", artifacts, "classes.dex")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
register<JavaExec>("generateMeta") {
|
register<JavaExec>("generateMeta") {
|
||||||
description = "Generate metadata for this bundle"
|
description = "Generate metadata for this bundle"
|
||||||
|
|
||||||
dependsOn(build)
|
dependsOn(build)
|
||||||
|
|
||||||
classpath = sourceSets["main"].runtimeClasspath
|
classpath = sourceSets["main"].runtimeClasspath
|
||||||
mainClass.set("app.revanced.meta.PatchesFileGenerator")
|
mainClass.set("app.revanced.meta.PatchesFileGenerator")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dummy task to fix the Gradle semantic-release plugin.
|
// Required to run tasks because Gradle semantic-release plugin runs the publish task.
|
||||||
// Remove this if you forked it to support building only.
|
// Tracking: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
|
||||||
// Tracking issue: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
|
named("publish") {
|
||||||
register<DefaultTask>("publish") {
|
dependsOn("generateBundle")
|
||||||
group = "publish"
|
dependsOn("generateMeta")
|
||||||
description = "Dummy task"
|
}
|
||||||
dependsOn(named("generateBundle"), named("generateMeta"))
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
create<MavenPublication>("revanced-patches-publication") {
|
||||||
|
from(components["java"])
|
||||||
|
|
||||||
|
pom {
|
||||||
|
name = "ReVanced Patches"
|
||||||
|
description = "Patches for ReVanced."
|
||||||
|
url = "https://revanced.app"
|
||||||
|
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name = "GNU General Public License v3.0"
|
||||||
|
url = "https://www.gnu.org/licenses/gpl-3.0.en.html"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
id = "ReVanced"
|
||||||
|
name = "ReVanced"
|
||||||
|
email = "contact@revanced.app"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scm {
|
||||||
|
connection = "scm:git:git://github.com/revanced/revanced-patches.git"
|
||||||
|
developerConnection = "scm:git:git@github.com:revanced/revanced-patches.git"
|
||||||
|
url = "https://github.com/revanced/revanced-patches"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
org.gradle.parallel = true
|
org.gradle.parallel = true
|
||||||
org.gradle.caching = true
|
org.gradle.caching = true
|
||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.195.0-dev.1
|
version = 2.195.0-dev.4
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -3,7 +3,7 @@ package app.revanced.patches.reddit.misc.tracking.url.fingerprints
|
|||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
object ShareLinkFormatterFingerprint : MethodFingerprint(
|
object ShareLinkFormatterFingerprint : MethodFingerprint(
|
||||||
returnType = "Ljava/lang/String;",
|
customFingerprint = { methodDef, classDef ->
|
||||||
parameters = listOf("Ljava/lang/String;", "Ljava/util/Map;"),
|
methodDef.definingClass.startsWith("Lcom/reddit/sharing/") && classDef.sourceFile == "UrlUtil.kt"
|
||||||
strings = listOf("uri.getQueryParameters(name)", "uri.queryParameterNames", "newUriBuilder.build().toString()"),
|
}
|
||||||
)
|
)
|
||||||
@@ -55,7 +55,10 @@ object CustomBrandingPatch : ResourcePatch() {
|
|||||||
Each of these folders has to have the following files:
|
Each of these folders has to have the following files:
|
||||||
|
|
||||||
${iconResourceFileNames.joinToString("\n") { "- $it" }}
|
${iconResourceFileNames.joinToString("\n") { "- $it" }}
|
||||||
""".trimIndent()
|
"""
|
||||||
|
.split("\n")
|
||||||
|
.joinToString("\n") { it.trimIndent() } // Remove the leading whitespace from each line.
|
||||||
|
.trimIndent(), // Remove the leading newline.
|
||||||
)
|
)
|
||||||
|
|
||||||
override fun execute(context: ResourceContext) {
|
override fun execute(context: ResourceContext) {
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.dimensions.spoof
|
||||||
|
|
||||||
|
import app.revanced.extensions.exception
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||||
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
|
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||||
|
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||||
|
import app.revanced.patches.youtube.misc.dimensions.spoof.fingerprints.DeviceDimensionsModelToStringFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||||
|
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||||
|
|
||||||
|
@Patch(
|
||||||
|
name = "Spoof device dimensions",
|
||||||
|
description = "Spoofs the device dimensions in order to unlock higher video qualities " +
|
||||||
|
"that may not be available on your device.",
|
||||||
|
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||||
|
compatiblePackages = [
|
||||||
|
CompatiblePackage(
|
||||||
|
"com.google.android.youtube",
|
||||||
|
[
|
||||||
|
"18.38.44"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
object SpoofDeviceDimensionsPatch : BytecodePatch(
|
||||||
|
setOf(DeviceDimensionsModelToStringFingerprint)
|
||||||
|
) {
|
||||||
|
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||||
|
"Lapp/revanced/integrations/patches/spoof/SpoofDeviceDimensionsPatch;"
|
||||||
|
|
||||||
|
override fun execute(context: BytecodeContext) {
|
||||||
|
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||||
|
SwitchPreference(
|
||||||
|
"revanced_spoof_device_dimensions",
|
||||||
|
StringResource("revanced_spoof_device_dimensions_title", "Spoof device dimensions"),
|
||||||
|
StringResource("revanced_spoof_device_dimensions_summary_on", "Device dimensions spoofed"),
|
||||||
|
StringResource("revanced_spoof_device_dimensions_summary_off", "Device dimensions not spoofed"),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
DeviceDimensionsModelToStringFingerprint.result
|
||||||
|
?.mutableClass?.methods?.find { method -> method.name == "<init>" }
|
||||||
|
// Override the parameters containing the dimensions.
|
||||||
|
?.addInstructions(
|
||||||
|
1, // Add after super call.
|
||||||
|
mapOf(
|
||||||
|
1 to "MinHeightOrWidth", // p1 = min height
|
||||||
|
2 to "MaxHeightOrWidth", // p2 = max height
|
||||||
|
3 to "MinHeightOrWidth", // p3 = min width
|
||||||
|
4 to "MaxHeightOrWidth" // p4 = max width
|
||||||
|
).map { (parameter, method) ->
|
||||||
|
"""
|
||||||
|
invoke-static { p$parameter }, $INTEGRATIONS_CLASS_DESCRIPTOR->get$method(I)I
|
||||||
|
move-result p$parameter
|
||||||
|
"""
|
||||||
|
}.joinToString("\n") { it }
|
||||||
|
) ?: throw DeviceDimensionsModelToStringFingerprint.exception
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.dimensions.spoof.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object DeviceDimensionsModelToStringFingerprint : MethodFingerprint(
|
||||||
|
returnType = "L",
|
||||||
|
strings = listOf("minh.", ";maxh.")
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user