Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14b520395e | ||
|
|
0f204afa2a | ||
|
|
d71290f6f1 | ||
|
|
114e78171f | ||
|
|
0cfead3914 | ||
|
|
4a20de0410 | ||
|
|
f69bd0e636 | ||
|
|
eed04277d1 | ||
|
|
df05aecdcf | ||
|
|
680371ab30 | ||
|
|
a465f89354 | ||
|
|
4c633847b2 | ||
|
|
75f03dbf28 | ||
|
|
9c2934d617 | ||
|
|
5e94f464fc | ||
|
|
a3f5c11050 | ||
|
|
09e837d2e0 | ||
|
|
fcb80dc71f |
@@ -10,7 +10,6 @@
|
|||||||
"@semantic-release/commit-analyzer",
|
"@semantic-release/commit-analyzer",
|
||||||
"@semantic-release/release-notes-generator",
|
"@semantic-release/release-notes-generator",
|
||||||
"@semantic-release/changelog",
|
"@semantic-release/changelog",
|
||||||
"gradle-semantic-release-plugin",
|
|
||||||
[
|
[
|
||||||
"@semantic-release/git",
|
"@semantic-release/git",
|
||||||
{
|
{
|
||||||
|
|||||||
52
CHANGELOG.md
@@ -1,3 +1,55 @@
|
|||||||
|
# [1.5.0](https://github.com/revanced/revanced-patches/compare/v1.4.0...v1.5.0) (2022-06-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* sync version ([6170e36](https://github.com/revanced/revanced-patches/commit/6170e3689d9c8998be94a8464352af620cccd11b))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* `hide-cast-button` patch ([2cd531e](https://github.com/revanced/revanced-patches/commit/2cd531eb5a334f3cf91cba4556f07e863cd9ec1b))
|
||||||
|
|
||||||
|
# [1.4.0](https://github.com/revanced/revanced-patches/compare/v1.3.1...v1.4.0) (2022-06-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add size `48px` for `custom-branding` patch ([f81872b](https://github.com/revanced/revanced-patches/commit/f81872b8e41da215517fdb59364130d8ce681607))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* `premium-heading` patch ([78913bf](https://github.com/revanced/revanced-patches/commit/78913bf1e80f5b91d0dee506fdfe3f875e8e6988))
|
||||||
|
|
||||||
|
## [1.3.1](https://github.com/revanced/revanced-patches/compare/v1.3.0...v1.3.1) (2022-06-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* `custom-branding` patch failing to get resources ([efb6d4c](https://github.com/revanced/revanced-patches/commit/efb6d4c2be515185fc9bd29c40ce202f0d684cee))
|
||||||
|
|
||||||
|
# [1.3.0](https://github.com/revanced/revanced-patches/compare/v1.2.2...v1.3.0) (2022-06-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* `custom-branding` patch ([0d65ea8](https://github.com/revanced/revanced-patches/commit/0d65ea8cdb0e02287f6be6855cd3d28823a61e70))
|
||||||
|
|
||||||
|
## [1.2.2](https://github.com/revanced/revanced-patches/compare/v1.2.1...v1.2.2) (2022-06-13)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* environment variable not found in gradle build script ([0da15fb](https://github.com/revanced/revanced-patches/commit/0da15fb0effac0566d080d7b85e9fbe46c3dd34d))
|
||||||
|
|
||||||
|
## [1.2.1](https://github.com/revanced/revanced-patches/compare/v1.2.0...v1.2.1) (2022-06-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* fix high battery consumption due to chromecast not working with `microg` ([dd8b01a](https://github.com/revanced/revanced-patches/commit/dd8b01a5c5d75b00ea4d04ce35bc43942c1b0409))
|
||||||
|
|
||||||
# [1.2.0](https://github.com/revanced/revanced-patches/compare/v1.1.0...v1.2.0) (2022-06-11)
|
# [1.2.0](https://github.com/revanced/revanced-patches/compare/v1.1.0...v1.2.0) (2022-06-11)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,59 +1,22 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "1.6.21"
|
kotlin("jvm") version "1.7.0"
|
||||||
java
|
|
||||||
`maven-publish`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "app.revanced"
|
group = "app.revanced"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
mavenLocal()
|
|
||||||
maven {
|
maven {
|
||||||
url = uri("https://maven.pkg.github.com/revanced/revanced-patcher") // note the "r"!
|
url = uri("https://maven.pkg.github.com/revanced/revanced-patcher")
|
||||||
credentials {
|
credentials {
|
||||||
// DO NOT set these variables in the project's gradle.properties.
|
username = project.findProperty("gpr.user") as? String ?: System.getenv("GITHUB_ACTOR")
|
||||||
// Instead, you should set them in:
|
password = project.findProperty("gpr.key") as? String ?: System.getenv("GITHUB_TOKEN")
|
||||||
// Windows: %homepath%\.gradle\gradle.properties
|
|
||||||
// Linux: ~/.gradle/gradle.properties
|
|
||||||
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR") // DO NOT CHANGE!
|
|
||||||
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN") // DO NOT CHANGE!
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.6.21")
|
implementation(kotlin("stdlib"))
|
||||||
|
|
||||||
implementation("app.revanced:revanced-patcher:1.1.0")
|
implementation("app.revanced:revanced-patcher:1.1.0")
|
||||||
implementation("org.jetbrains.kotlin:kotlin-reflect:1.6.21")
|
}
|
||||||
}
|
|
||||||
|
|
||||||
java {
|
|
||||||
withSourcesJar()
|
|
||||||
withJavadocJar()
|
|
||||||
}
|
|
||||||
|
|
||||||
val isGitHubCI = System.getenv("GITHUB_ACTOR") != null
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
repositories {
|
|
||||||
if (isGitHubCI) {
|
|
||||||
maven {
|
|
||||||
name = "GitHubPackages"
|
|
||||||
url = uri("https://maven.pkg.github.com/revanced/revanced-patches") // note the "s"!
|
|
||||||
credentials {
|
|
||||||
username = System.getenv("GITHUB_ACTOR")
|
|
||||||
password = System.getenv("GITHUB_TOKEN")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
mavenLocal()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
publications {
|
|
||||||
register<MavenPublication>("gpr") {
|
|
||||||
from(components["java"])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 1.2.0
|
version = 1.4.1
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.branding.header.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 PremiumHeadingCompatibility
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.branding.header.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.implementation.ResourceData
|
||||||
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.implementation.ResourcePatch
|
||||||
|
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
||||||
|
import app.revanced.patcher.patch.implementation.misc.PatchResultError
|
||||||
|
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
||||||
|
import app.revanced.patches.youtube.layout.branding.header.annotations.PremiumHeadingCompatibility
|
||||||
|
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||||
|
import java.nio.file.Files
|
||||||
|
import java.nio.file.StandardCopyOption
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Dependencies(
|
||||||
|
dependencies = [FixLocaleConfigErrorPatch::class]
|
||||||
|
)
|
||||||
|
@Name("premium-heading")
|
||||||
|
@Description("Show the premium branding on the the YouTube home screen.")
|
||||||
|
@PremiumHeadingCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class PremiumHeadingPatch : ResourcePatch() {
|
||||||
|
override fun execute(data: ResourceData): PatchResult {
|
||||||
|
val resDirectory = data.get("res")
|
||||||
|
if (!resDirectory.isDirectory) return PatchResultError("The res folder can not be found.")
|
||||||
|
|
||||||
|
val (original, replacement) = "yt_premium_wordmark_header" to "yt_wordmark_header"
|
||||||
|
val modes = arrayOf("light", "dark")
|
||||||
|
|
||||||
|
arrayOf("xxxhdpi", "xxhdpi", "xhdpi", "hdpi", "mdpi").forEach { size ->
|
||||||
|
val headingDirectory = resDirectory.resolve("drawable-$size")
|
||||||
|
modes.forEach {mode ->
|
||||||
|
Files.copy(
|
||||||
|
headingDirectory.resolve("${original}_$mode.png").toPath(),
|
||||||
|
headingDirectory.resolve("${replacement}_$mode.png").toPath(),
|
||||||
|
StandardCopyOption.REPLACE_EXISTING
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.branding.icon.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 CustomBrandingCompatibility
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.branding.icon.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.implementation.ResourceData
|
||||||
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.implementation.ResourcePatch
|
||||||
|
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
||||||
|
import app.revanced.patcher.patch.implementation.misc.PatchResultError
|
||||||
|
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
||||||
|
import app.revanced.patches.youtube.layout.branding.icon.annotations.CustomBrandingCompatibility
|
||||||
|
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||||
|
import java.nio.file.Files
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Dependencies(
|
||||||
|
dependencies = [FixLocaleConfigErrorPatch::class]
|
||||||
|
)
|
||||||
|
@Name("custom-branding")
|
||||||
|
@Description("Change the branding of YouTube.")
|
||||||
|
@CustomBrandingCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class CustomBrandingPatch : ResourcePatch() {
|
||||||
|
override fun execute(data: ResourceData): PatchResult {
|
||||||
|
val resDirectory = data.get("res")
|
||||||
|
if (!resDirectory.isDirectory) return PatchResultError("The res folder can not be found.")
|
||||||
|
|
||||||
|
val iconNames = arrayOf(
|
||||||
|
"adaptiveproduct_youtube_background_color_108",
|
||||||
|
"adaptiveproduct_youtube_foreground_color_108",
|
||||||
|
"ic_launcher",
|
||||||
|
"ic_launcher_round"
|
||||||
|
)
|
||||||
|
|
||||||
|
mapOf(
|
||||||
|
"xxxhdpi" to 192,
|
||||||
|
"xxhdpi" to 144,
|
||||||
|
"xhdpi" to 96,
|
||||||
|
"hdpi" to 72,
|
||||||
|
"mdpi" to 48
|
||||||
|
).forEach { (iconDirectory, size) ->
|
||||||
|
iconNames.forEach iconLoop@{ iconName ->
|
||||||
|
val iconFile = this.javaClass.classLoader.getResourceAsStream("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()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.castbutton.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 CastButtonCompatibility
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.castbutton.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.implementation.BytecodeData
|
||||||
|
import app.revanced.patcher.data.implementation.proxy
|
||||||
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.implementation.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
||||||
|
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.util.smali.toInstructions
|
||||||
|
import app.revanced.patches.youtube.layout.castbutton.annotations.CastButtonCompatibility
|
||||||
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||||
|
@Name("hide-cast-button")
|
||||||
|
@Description("Patch to hide the cast button.")
|
||||||
|
@CastButtonCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class HideCastButtonPatch : BytecodePatch(listOf()) {
|
||||||
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
|
data.classes.forEach { classDef ->
|
||||||
|
classDef.methods.forEach { method ->
|
||||||
|
if (classDef.type.endsWith("MediaRouteButton;") && method.name == "setVisibility") {
|
||||||
|
val implementation =
|
||||||
|
data.proxy(classDef).resolve().methods.first { it.name == "setVisibility" }.implementation!!
|
||||||
|
|
||||||
|
implementation.addInstructions(
|
||||||
|
0, """
|
||||||
|
invoke-static {p1}, Lfi/razerman/youtube/XGlobals;->getCastButtonOverrideV2(I)I
|
||||||
|
move-result p1
|
||||||
|
""".trimIndent().toInstructions("I", 2, false)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction11x
|
|||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Dependencies(dependencies = [IntegrationsPatch::class])
|
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||||
@Name("shorts-button")
|
@Name("disable-shorts-button")
|
||||||
@Description("Hide the shorts button.")
|
@Description("Hide the shorts button.")
|
||||||
@ShortsButtonCompatibility
|
@ShortsButtonCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
|
|||||||
@@ -15,15 +15,13 @@ import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
|||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
||||||
import app.revanced.patcher.util.smali.toInstruction
|
import app.revanced.patcher.util.smali.toInstruction
|
||||||
import app.revanced.patcher.util.smali.toInstructions
|
import app.revanced.patcher.util.smali.toInstructions
|
||||||
|
import app.revanced.patches.youtube.layout.castbutton.patch.HideCastButtonPatch
|
||||||
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||||
import app.revanced.patches.youtube.misc.microg.patch.resource.MicroGResourcePatch
|
import app.revanced.patches.youtube.misc.microg.patch.resource.MicroGResourcePatch
|
||||||
import app.revanced.patches.youtube.misc.microg.patch.resource.enum.StringReplaceMode
|
import app.revanced.patches.youtube.misc.microg.patch.resource.enum.StringReplaceMode
|
||||||
import app.revanced.patches.youtube.misc.microg.shared.Constants.BASE_MICROG_PACKAGE_NAME
|
import app.revanced.patches.youtube.misc.microg.shared.Constants.BASE_MICROG_PACKAGE_NAME
|
||||||
import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_PACKAGE_NAME
|
import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_PACKAGE_NAME
|
||||||
import app.revanced.patches.youtube.misc.microg.signatures.GooglePlayUtilitySignature
|
import app.revanced.patches.youtube.misc.microg.signatures.*
|
||||||
import app.revanced.patches.youtube.misc.microg.signatures.IntegrityCheckSignature
|
|
||||||
import app.revanced.patches.youtube.misc.microg.signatures.PrimeSignature
|
|
||||||
import app.revanced.patches.youtube.misc.microg.signatures.ServiceCheckSignature
|
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
import org.jf.dexlib2.builder.MutableMethodImplementation
|
import org.jf.dexlib2.builder.MutableMethodImplementation
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21c
|
import org.jf.dexlib2.builder.instruction.BuilderInstruction21c
|
||||||
@@ -32,19 +30,26 @@ import org.jf.dexlib2.iface.reference.StringReference
|
|||||||
import org.jf.dexlib2.immutable.reference.ImmutableStringReference
|
import org.jf.dexlib2.immutable.reference.ImmutableStringReference
|
||||||
|
|
||||||
@Patch(include = false)
|
@Patch(include = false)
|
||||||
@Dependencies(dependencies = [MicroGResourcePatch::class])
|
@Dependencies(
|
||||||
@Name("microg-patch")
|
dependencies = [MicroGResourcePatch::class, HideCastButtonPatch::class]
|
||||||
|
)
|
||||||
|
@Name("microg-support")
|
||||||
@Description("Patch to allow YouTube ReVanced to run without root and under a different package name.")
|
@Description("Patch to allow YouTube ReVanced to run without root and under a different package name.")
|
||||||
@MicroGPatchCompatibility
|
@MicroGPatchCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class MicroGBytecodePatch : BytecodePatch(
|
class MicroGBytecodePatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
IntegrityCheckSignature, ServiceCheckSignature, GooglePlayUtilitySignature, PrimeSignature
|
IntegrityCheckSignature,
|
||||||
|
ServiceCheckSignature,
|
||||||
|
GooglePlayUtilitySignature,
|
||||||
|
CastDynamiteModuleSignature,
|
||||||
|
CastDynamiteModuleV2Signature,
|
||||||
|
CastContextFetchSignature,
|
||||||
|
PrimeSignature,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
// smali patches
|
disablePlayServiceChecksAndFixCastIssues()
|
||||||
disablePlayServiceChecks()
|
|
||||||
data.classes.forEach { classDef ->
|
data.classes.forEach { classDef ->
|
||||||
var proxiedClass: MutableClass? = null
|
var proxiedClass: MutableClass? = null
|
||||||
|
|
||||||
@@ -52,6 +57,7 @@ class MicroGBytecodePatch : BytecodePatch(
|
|||||||
val implementation = method.implementation ?: return@methodLoop
|
val implementation = method.implementation ?: return@methodLoop
|
||||||
|
|
||||||
var proxiedImplementation: MutableMethodImplementation? = null
|
var proxiedImplementation: MutableMethodImplementation? = null
|
||||||
|
|
||||||
implementation.instructions.forEachIndexed { i, instruction ->
|
implementation.instructions.forEachIndexed { i, instruction ->
|
||||||
if (instruction.opcode != Opcode.CONST_STRING) return@forEachIndexed
|
if (instruction.opcode != Opcode.CONST_STRING) return@forEachIndexed
|
||||||
|
|
||||||
@@ -111,10 +117,11 @@ class MicroGBytecodePatch : BytecodePatch(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signatures.last()
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun disablePlayServiceChecks() {
|
private fun disablePlayServiceChecksAndFixCastIssues() {
|
||||||
for (i in 0 until signatures.count() - 1) {
|
for (i in 0 until signatures.count() - 1) {
|
||||||
val result = signatures.elementAt(i).result!!
|
val result = signatures.elementAt(i).result!!
|
||||||
val stringInstructions = when (result.immutableMethod.returnType.first()) {
|
val stringInstructions = when (result.immutableMethod.returnType.first()) {
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ package app.revanced.patches.youtube.misc.microg.shared
|
|||||||
object Constants {
|
object Constants {
|
||||||
internal const val BASE_MICROG_PACKAGE_NAME = "com.mgoogle"
|
internal const val BASE_MICROG_PACKAGE_NAME = "com.mgoogle"
|
||||||
internal const val REVANCED_PACKAGE_NAME = "app.revanced.android.youtube"
|
internal const val REVANCED_PACKAGE_NAME = "app.revanced.android.youtube"
|
||||||
internal const val REVANCED_APP_NAME = "YouTube ReVanced"
|
internal const val REVANCED_APP_NAME = "ReVanced"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.microg.signatures
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
||||||
|
import app.revanced.patcher.signature.implementation.method.annotation.DirectPatternScanMethod
|
||||||
|
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||||
|
|
||||||
|
@Name("cast-context-fetch-signature")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Lvvz;", "a"
|
||||||
|
)
|
||||||
|
@DirectPatternScanMethod
|
||||||
|
@MicroGPatchCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
object CastContextFetchSignature : MethodSignature(
|
||||||
|
null, null, null, null,
|
||||||
|
listOf("Error fetching CastContext.")
|
||||||
|
)
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.microg.signatures
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
||||||
|
import app.revanced.patcher.signature.implementation.method.annotation.DirectPatternScanMethod
|
||||||
|
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||||
|
|
||||||
|
@Name("cast-module-signature")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Llqh;", "c"
|
||||||
|
)
|
||||||
|
@DirectPatternScanMethod
|
||||||
|
@MicroGPatchCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
object CastDynamiteModuleSignature : MethodSignature(
|
||||||
|
null, null, null, null,
|
||||||
|
listOf("com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl")
|
||||||
|
)
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.microg.signatures
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
||||||
|
import app.revanced.patcher.signature.implementation.method.annotation.DirectPatternScanMethod
|
||||||
|
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||||
|
|
||||||
|
@Name("cast-context-fetch-signature")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Lmcf;", "c"
|
||||||
|
)
|
||||||
|
@DirectPatternScanMethod
|
||||||
|
@MicroGPatchCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
object CastDynamiteModuleV2Signature : MethodSignature(
|
||||||
|
null, null, null, null,
|
||||||
|
listOf("Failed to load module via V2: ")
|
||||||
|
)
|
||||||
|
After Width: | Height: | Size: 483 B |
|
After Width: | Height: | Size: 5.0 KiB |
BIN
src/main/resources/branding/144/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
src/main/resources/branding/144/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 163 B |
|
After Width: | Height: | Size: 6.1 KiB |
BIN
src/main/resources/branding/192/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
src/main/resources/branding/192/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 191 B |
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/main/resources/branding/48/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
src/main/resources/branding/48/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 276 B |
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/main/resources/branding/72/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
src/main/resources/branding/72/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 343 B |
|
After Width: | Height: | Size: 2.9 KiB |
BIN
src/main/resources/branding/96/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
src/main/resources/branding/96/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |