Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41cf8e3fa9 | ||
|
|
aec1602a39 | ||
|
|
e00281819c | ||
|
|
48cf778d56 | ||
|
|
e6506bd4b4 | ||
|
|
3a29b6db64 | ||
|
|
cecee8f70e | ||
|
|
e5cad5f022 | ||
|
|
85e584f65a | ||
|
|
78fe1b67ea | ||
|
|
9c33d67d80 | ||
|
|
16d234e761 | ||
|
|
635f65e5a1 | ||
|
|
3ef5d2a29d | ||
|
|
5797e15b06 | ||
|
|
c987357959 | ||
|
|
e452969cdd | ||
|
|
7484f52bc4 | ||
|
|
938dd030b0 | ||
|
|
990806118f | ||
|
|
6ae1e1d0aa | ||
|
|
ed6a0e5403 | ||
|
|
d48a8e93a2 | ||
|
|
51f0a011a7 | ||
|
|
0a6a9e9f4b | ||
|
|
8669a22689 | ||
|
|
1e44644c73 | ||
|
|
5c31dd409f | ||
|
|
354a1c81ab | ||
|
|
76fb0b3797 | ||
|
|
06ea9cb23f | ||
|
|
efd7c4c8eb | ||
|
|
ee80ef909f | ||
|
|
0e76fbfc1b | ||
|
|
14b520395e | ||
|
|
0f204afa2a | ||
|
|
d71290f6f1 | ||
|
|
114e78171f | ||
|
|
0cfead3914 | ||
|
|
4a20de0410 | ||
|
|
f69bd0e636 | ||
|
|
eed04277d1 | ||
|
|
df05aecdcf | ||
|
|
680371ab30 | ||
|
|
a465f89354 |
13
.github/workflows/release.yml
vendored
@@ -30,23 +30,12 @@ jobs:
|
|||||||
node-version: "lts/*"
|
node-version: "lts/*"
|
||||||
- name: Setup Android SDK
|
- name: Setup Android SDK
|
||||||
uses: android-actions/setup-android@v2
|
uses: android-actions/setup-android@v2
|
||||||
- name: Make gradlew executable
|
|
||||||
run: chmod +x gradlew
|
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: ./gradlew build
|
run: ./gradlew build clean
|
||||||
- name: Install Android build-tools
|
- name: Install Android build-tools
|
||||||
run: sdkmanager "build-tools;32.0.0"
|
run: sdkmanager "build-tools;32.0.0"
|
||||||
- name: Generate Patches DEX
|
|
||||||
run: |
|
|
||||||
mkdir -p bin
|
|
||||||
fn=$(find build/libs -maxdepth 1 | grep -P "[\d]+\.jar")
|
|
||||||
out=bin/$(basename "$fn" | sed 's/jar/dex/g')
|
|
||||||
$ANDROID_HOME/build-tools/32.0.0/d8 $fn
|
|
||||||
mv *.dex $out
|
|
||||||
- name: Clean build
|
|
||||||
run: ./gradlew clean
|
|
||||||
- name: Setup semantic-release
|
- name: Setup semantic-release
|
||||||
run: npm install -g semantic-release @semantic-release/git @semantic-release/changelog gradle-semantic-release-plugin -D
|
run: npm install -g semantic-release @semantic-release/git @semantic-release/changelog gradle-semantic-release-plugin -D
|
||||||
- name: Release
|
- name: Release
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
"@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",
|
||||||
{
|
{
|
||||||
@@ -27,7 +28,7 @@
|
|||||||
"path": "build/libs/*.jar"
|
"path": "build/libs/*.jar"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "bin/*.dex"
|
"path": "build/libs/*.dex"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
129
CHANGELOG.md
@@ -1,3 +1,132 @@
|
|||||||
|
## [1.8.2](https://github.com/revanced/revanced-patches/compare/v1.8.1...v1.8.2) (2022-06-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* migrate to breaking changes from patcher ([2c0a419](https://github.com/revanced/revanced-patches/commit/2c0a4196fed2fbdcd454ed882b720898d3050c51))
|
||||||
|
* old usage of `toInstructions` extension method ([65ddd52](https://github.com/revanced/revanced-patches/commit/65ddd522dca19e0590d9cb6fdb2d85ad7b98481e))
|
||||||
|
|
||||||
|
## [1.8.1](https://github.com/revanced/revanced-patches/compare/v1.8.0...v1.8.1) (2022-06-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add execute permission to `./gradlew` file ([ff7a560](https://github.com/revanced/revanced-patches/commit/ff7a5602f68428111fea6c60cbea694592039ef1))
|
||||||
|
|
||||||
|
# [1.8.0](https://github.com/revanced/revanced-patches/compare/v1.7.0...v1.8.0) (2022-06-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* bump compatibility of patches for Youtube to v17.23.35 ([3748d05](https://github.com/revanced/revanced-patches/commit/3748d0533e62a8871ab2202ce9b61170a90dae62))
|
||||||
|
|
||||||
|
# [1.7.0](https://github.com/revanced/revanced-patches/compare/v1.6.4...v1.7.0) (2022-06-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* `disable-fullscreen-panels` patch ([3bf0561](https://github.com/revanced/revanced-patches/commit/3bf056163500b006d1a20c5f3a3e0c92fec13bd8))
|
||||||
|
|
||||||
|
## [1.6.4](https://github.com/revanced/revanced-patches/compare/v1.6.3...v1.6.4) (2022-06-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* update patcher version ([#35](https://github.com/revanced/revanced-patches/issues/35)) ([1a379df](https://github.com/revanced/revanced-patches/commit/1a379dfd974b9f92d4bd0d5d7a4711eb6d1060b3)), closes [#34](https://github.com/revanced/revanced-patches/issues/34)
|
||||||
|
|
||||||
|
## [1.6.3](https://github.com/revanced/revanced-patches/compare/v1.6.2...v1.6.3) (2022-06-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* wrong dex path ([170fbbb](https://github.com/revanced/revanced-patches/commit/170fbbb99e4a2dbe3e0febe44d07a692aa9d7224))
|
||||||
|
|
||||||
|
## [1.6.2](https://github.com/revanced/revanced-patches/compare/v1.6.1...v1.6.2) (2022-06-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* broken gradle task ([91483a8](https://github.com/revanced/revanced-patches/commit/91483a8fbf92559d079dc52f846f5f871f5d6b5c))
|
||||||
|
|
||||||
|
## [1.6.1](https://github.com/revanced/revanced-patches/compare/v1.6.0...v1.6.1) (2022-06-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* broken gradle task ([4d07961](https://github.com/revanced/revanced-patches/commit/4d07961c8afd24da7f8879d11419147f2e100f05))
|
||||||
|
|
||||||
|
# [1.6.0](https://github.com/revanced/revanced-patches/compare/v1.5.3...v1.6.0) (2022-06-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* broken gradle task ([28e3f55](https://github.com/revanced/revanced-patches/commit/28e3f554ea6a7144416523fe48ce7adbb613b263))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* generate dex files using gradle task ([c34c1be](https://github.com/revanced/revanced-patches/commit/c34c1be21f50b4f720a7cd81e0dfe5ef6330caab))
|
||||||
|
|
||||||
|
## [1.5.3](https://github.com/revanced/revanced-patches/compare/v1.5.2...v1.5.3) (2022-06-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* forgot about this ([7102a25](https://github.com/revanced/revanced-patches/commit/7102a25dc618f19b324b01870d23f5418f375b2a))
|
||||||
|
|
||||||
|
## [1.5.2](https://github.com/revanced/revanced-patches/compare/v1.5.1...v1.5.2) (2022-06-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* dummy task for Gradle semantic-release plugin ([f6a8911](https://github.com/revanced/revanced-patches/commit/f6a8911906dfe52fcdb685daf7a02d6d0052cba9))
|
||||||
|
* releases ([30d5c9a](https://github.com/revanced/revanced-patches/commit/30d5c9a67ccf88ca6ac00d0a9f2a2e330f8092dd))
|
||||||
|
|
||||||
|
## [1.5.1](https://github.com/revanced/revanced-patches/compare/v1.5.0...v1.5.1) (2022-06-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Reverts
|
||||||
|
|
||||||
|
* Revert "Changed app name to ReVanced (#21)" (#24) ([70a48c5](https://github.com/revanced/revanced-patches/commit/70a48c5f35cd236612352a1dbbf50487625e6e96)), closes [#21](https://github.com/revanced/revanced-patches/issues/21) [#24](https://github.com/revanced/revanced-patches/issues/24)
|
||||||
|
|
||||||
|
# [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)
|
## [1.2.2](https://github.com/revanced/revanced-patches/compare/v1.2.1...v1.2.2) (2022-06-13)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,5 +18,38 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib"))
|
implementation(kotlin("stdlib"))
|
||||||
|
|
||||||
implementation("app.revanced:revanced-patcher:1.1.0")
|
implementation("app.revanced:revanced-patcher:1.3.0")
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks {
|
||||||
|
register<DefaultTask>("generateDex") {
|
||||||
|
description = "Generate dex files from build"
|
||||||
|
dependsOn(build)
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
val androidHome = System.getenv("ANDROID_HOME") ?: throw GradleException("ANDROID_HOME not found")
|
||||||
|
val d8 = "${androidHome}/build-tools/32.0.0/d8"
|
||||||
|
val input = configurations.archives.get().allArtifacts.files.files.first().absolutePath
|
||||||
|
val output = input.replace(".jar", ".dex")
|
||||||
|
val work = File("${buildDir}/libs")
|
||||||
|
|
||||||
|
exec {
|
||||||
|
workingDir = work
|
||||||
|
commandLine = listOf(d8, input)
|
||||||
|
}
|
||||||
|
|
||||||
|
exec {
|
||||||
|
workingDir = work
|
||||||
|
commandLine = listOf("mv", "classes.dex", output)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Dummy task to fix the Gradle semantic-release plugin.
|
||||||
|
// Remove this if you forked it to support building only.
|
||||||
|
// Tracking issue: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
|
||||||
|
register<DefaultTask>("publish") {
|
||||||
|
group = "publish"
|
||||||
|
description = "Dummy task"
|
||||||
|
dependsOn(named("generateDex"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 1.2.1
|
version = 1.8.2
|
||||||
|
|||||||
@@ -25,13 +25,13 @@ class CodecsUnlockPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
var result = signatures.first().result!!
|
var result = CodecsLockSignature.result!!
|
||||||
|
|
||||||
val implementation = result.method.implementation!!
|
val implementation = result.method.implementation!!
|
||||||
|
|
||||||
val instructionIndex = result.scanResult.startIndex
|
val instructionIndex = result.scanResult.startIndex
|
||||||
|
|
||||||
result = signatures.last().result!!
|
result = AllCodecsReferenceSignature.result!!
|
||||||
val codecMethod =
|
val codecMethod =
|
||||||
data.toMethodWalker(result.immutableMethod).nextMethod(result.scanResult.startIndex).getMethod()
|
data.toMethodWalker(result.immutableMethod).nextMethod(result.scanResult.startIndex).getMethod()
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class ExclusiveAudioPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result = signatures.first().result!!.findParentMethod(@Name("audio-only-enabler-method") @MatchingMethod(
|
val result = ExclusiveAudioSignature.result!!.findParentMethod(@Name("audio-only-enabler-method") @MatchingMethod(
|
||||||
"Lgmd;",
|
"Lgmd;",
|
||||||
"d"
|
"d"
|
||||||
) @DirectPatternScanMethod @ExclusiveAudioCompatibility @Version(
|
) @DirectPatternScanMethod @ExclusiveAudioCompatibility @Version(
|
||||||
|
|||||||
@@ -25,20 +25,18 @@ class RemoveTasteBuilderPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result = signatures.first().result!!
|
val result = TasteBuilderConstructorSignature.result!!
|
||||||
val implementation = result.method.implementation!!
|
val implementation = result.method.implementation!!
|
||||||
|
|
||||||
val insertIndex = result.scanResult.endIndex - 8
|
val insertIndex = result.scanResult.endIndex - 8
|
||||||
|
|
||||||
val register = (implementation.instructions[insertIndex] as Instruction22c).registerA
|
val register = (implementation.instructions[insertIndex] as Instruction22c).registerA
|
||||||
|
|
||||||
val instructionList = """
|
result.method.addInstructions(
|
||||||
|
insertIndex, """
|
||||||
const/16 v1, 0x8
|
const/16 v1, 0x8
|
||||||
invoke-virtual {v${register}, v1}, Landroid/view/View;->setVisibility(I)V
|
invoke-virtual {v${register}, v1}, Landroid/view/View;->setVisibility(I)V
|
||||||
""".trimIndent().toInstructions().toMutableList()
|
"""
|
||||||
|
|
||||||
implementation.addInstructions(
|
|
||||||
insertIndex, instructionList
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class RemoveUpgradeButtonPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result = signatures.first().result!!
|
val result = PivotBarConstructorSignature.result!!
|
||||||
val implementation = result.method.implementation!!
|
val implementation = result.method.implementation!!
|
||||||
|
|
||||||
val pivotBarElementFieldRef =
|
val pivotBarElementFieldRef =
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class BackgroundPlayPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
signatures.first().result!!.method.implementation!!.addInstructions(
|
BackgroundPlaybackDisableSignature.result!!.method.implementation!!.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
const/4 v0, 0x1
|
const/4 v0, 0x1
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.19.36", "17.20.37", "17.22.36")
|
"com.google.android.youtube", arrayOf("17.19.36", "17.20.37", "17.22.36", "17.23.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -242,25 +242,23 @@ class GeneralBytecodeAdsPatch : BytecodePatch(
|
|||||||
BuilderInstruction21t(Opcode.IF_EQZ, 1, lithoRemoveLabel)
|
BuilderInstruction21t(Opcode.IF_EQZ, 1, lithoRemoveLabel)
|
||||||
|
|
||||||
// create blocks
|
// create blocks
|
||||||
val parameters = lithoMethod.parameterTypes.joinToString("") { it }
|
|
||||||
val registers = lithoMethodImplementation.registerCount
|
|
||||||
val block1 = """
|
val block1 = """
|
||||||
invoke-static/range {p3}, $thisType->getTemplateName($templateNameParameterType)Ljava/lang/String;
|
invoke-static/range {p3}, $thisType->getTemplateName($templateNameParameterType)Ljava/lang/String;
|
||||||
move-result-object v0
|
move-result-object v0
|
||||||
""".trimIndent().toInstructions(parameters, registers, false)
|
""".trimIndent().toInstructions(lithoMethod)
|
||||||
val block2 = """
|
val block2 = """
|
||||||
move-object/from16 v1, p3
|
move-object/from16 v1, p3
|
||||||
iget-object v2, v1, $templateNameParameterType->b:Ljava/nio/ByteBuffer;
|
iget-object v2, v1, $templateNameParameterType->b:Ljava/nio/ByteBuffer;
|
||||||
invoke-static {v0, v2}, Lfi/razerman/youtube/litho/LithoAdRemoval;->containsAd(Ljava/lang/String;Ljava/nio/ByteBuffer;)Z
|
invoke-static {v0, v2}, Lfi/razerman/youtube/litho/LithoAdRemoval;->containsAd(Ljava/lang/String;Ljava/nio/ByteBuffer;)Z
|
||||||
move-result v1
|
move-result v1
|
||||||
""".trimIndent().toInstructions(parameters, registers, false)
|
""".trimIndent().toInstructions(lithoMethod)
|
||||||
val block3 = """
|
val block3 = """
|
||||||
move-object/from16 v2, p1
|
move-object/from16 v2, p1
|
||||||
invoke-static {v2}, $descriptor1
|
invoke-static {v2}, $descriptor1
|
||||||
move-result-object v0
|
move-result-object v0
|
||||||
iget-object v0, v0, $descriptor2
|
iget-object v0, v0, $descriptor2
|
||||||
return-object v0
|
return-object v0
|
||||||
""".trimIndent().toInstructions(parameters, registers, false)
|
""".trimIndent().toInstructions(lithoMethod)
|
||||||
|
|
||||||
// insert blocks and branch instructions
|
// insert blocks and branch instructions
|
||||||
lithoMethodImplementation.insertBlocks(
|
lithoMethodImplementation.insertBlocks(
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36")
|
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class VideoAdsPatch : BytecodePatch(
|
|||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result =
|
val result =
|
||||||
signatures.first().result!!.findParentMethod(@Name("show-video-ads-method-signature") @MatchingMethod(
|
ShowVideoAdsConstructorSignature.result!!.findParentMethod(@Name("show-video-ads-method-signature") @MatchingMethod(
|
||||||
definingClass = "zai"
|
definingClass = "zai"
|
||||||
) @DirectPatternScanMethod @VideoAdsCompatibility @Version("0.0.1") object : MethodSignature(
|
) @DirectPatternScanMethod @VideoAdsCompatibility @Version("0.0.1") object : MethodSignature(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"), null
|
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"), null
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.17.34", "17.19.36", "17.20.37", "17.22.36")
|
"com.google.android.youtube", arrayOf("17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class EnableSeekbarTappingPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
var result = signatures.first().result!!
|
var result = SeekbarTappingParentSignature.result!!
|
||||||
|
|
||||||
val tapSeekMethods = mutableMapOf<String, Method>()
|
val tapSeekMethods = mutableMapOf<String, Method>()
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ class EnableSeekbarTappingPatch : BytecodePatch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// replace map because we dont need the upper one anymore
|
// replace map because we dont need the upper one anymore
|
||||||
result = signatures.last().result!!
|
result = SeekbarTappingSignature.result!!
|
||||||
|
|
||||||
val implementation = result.method.implementation!!
|
val implementation = result.method.implementation!!
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36")
|
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -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,43 @@
|
|||||||
|
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.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 setVisibilityMethod =
|
||||||
|
data.proxy(classDef).resolve().methods.first { it.name == "setVisibility" }
|
||||||
|
|
||||||
|
setVisibilityMethod.addInstructions(
|
||||||
|
0, """
|
||||||
|
invoke-static {p1}, Lfi/razerman/youtube/XGlobals;->getCastButtonOverrideV2(I)I
|
||||||
|
move-result p1
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36")
|
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class CreateButtonRemoverPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result = signatures.first().result!!
|
val result = CreateButtonSignature.result!!
|
||||||
|
|
||||||
// Get the required register which holds the view object we need to pass to the method hideCreateButton
|
// Get the required register which holds the view object we need to pass to the method hideCreateButton
|
||||||
val implementation = result.method.implementation!!
|
val implementation = result.method.implementation!!
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.fullscreenpanels.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility(
|
||||||
|
[Package(
|
||||||
|
"com.google.android.youtube", arrayOf("17.23.35")
|
||||||
|
)]
|
||||||
|
)
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class FullscreenPanelsCompatibility
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.fullscreenpanels.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.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.patches.youtube.layout.fullscreenpanels.annotations.FullscreenPanelsCompatibility
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("disable-fullscreen-panels")
|
||||||
|
@Description("Disable comments panel in fullscreen view.")
|
||||||
|
@FullscreenPanelsCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class FullscreenPanelsRemovalPatch : BytecodePatch(listOf()) {
|
||||||
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
|
val classDef = data.classes.first { it.type.endsWith("FullscreenEngagementPanelOverlay;") }
|
||||||
|
val method = data.proxy(classDef).resolve().methods.first { it.name == "<init>" }
|
||||||
|
val implementation = method.implementation!!
|
||||||
|
|
||||||
|
method.addInstructions(
|
||||||
|
implementation.instructions.count() - 1,
|
||||||
|
"""
|
||||||
|
const/4 v1, 0x0
|
||||||
|
iput-boolean v1, v0, ${classDef.type}->a:Z
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36")
|
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class MinimizedPlaybackPatch : BytecodePatch(
|
|||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
// Instead of removing all instructions like Vanced,
|
// Instead of removing all instructions like Vanced,
|
||||||
// we return the method at the beginning instead
|
// we return the method at the beginning instead
|
||||||
signatures.first().result!!.method.implementation!!.addInstructions(
|
MinimizedPlaybackManagerSignature.result!!.method.implementation!!.addInstructions(
|
||||||
0, """
|
0, """
|
||||||
const/4 v0, 0x1
|
const/4 v0, 0x1
|
||||||
return v0
|
return v0
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.17.34", "17.19.36", "17.20.37", "17.22.36")
|
"com.google.android.youtube", arrayOf("17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class OldQualityLayoutPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result = signatures.first().result!!.findParentMethod(@Name("old-quality-signature") @MatchingMethod(
|
val result = OldQualityParentSignature.result!!.findParentMethod(@Name("old-quality-signature") @MatchingMethod(
|
||||||
definingClass = "Libh"
|
definingClass = "Libh"
|
||||||
) @FuzzyPatternScanMethod(2) @OldQualityLayoutCompatibility @Version("0.0.1") object : MethodSignature(
|
) @FuzzyPatternScanMethod(2) @OldQualityLayoutCompatibility @Version("0.0.1") object : MethodSignature(
|
||||||
"L", AccessFlags.FINAL or AccessFlags.PRIVATE, listOf("Z"), listOf(
|
"L", AccessFlags.FINAL or AccessFlags.PRIVATE, listOf("Z"), listOf(
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34")
|
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.23.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class HideReelsPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result = signatures.first().result!!
|
val result = HideReelsSignature.result!!
|
||||||
val implementation = result.method.implementation!!
|
val implementation = result.method.implementation!!
|
||||||
|
|
||||||
// HideReel will hide the reel view before it is being used,
|
// HideReel will hide the reel view before it is being used,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36")
|
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -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")
|
||||||
@@ -28,12 +28,12 @@ class ShortsButtonRemoverPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result1 = signatures.first().result!!
|
val result1 = PivotBarButtonTabenumSignature.result!!
|
||||||
val implementation1 = result1.method.implementation!!
|
val implementation1 = result1.method.implementation!!
|
||||||
val moveEnumInstruction = implementation1.instructions[result1.scanResult.endIndex]
|
val moveEnumInstruction = implementation1.instructions[result1.scanResult.endIndex]
|
||||||
val enumRegister = (moveEnumInstruction as Instruction11x).registerA
|
val enumRegister = (moveEnumInstruction as Instruction11x).registerA
|
||||||
|
|
||||||
val result2 = signatures.last().result!!
|
val result2 = PivotBarButtonsViewSignature.result!!
|
||||||
val implementation2 = result2.method.implementation!!
|
val implementation2 = result2.method.implementation!!
|
||||||
val moveViewInstruction = implementation2.instructions[result2.scanResult.endIndex]
|
val moveViewInstruction = implementation2.instructions[result2.scanResult.endIndex]
|
||||||
val viewRegister = (moveViewInstruction as Instruction11x).registerA
|
val viewRegister = (moveViewInstruction as Instruction11x).registerA
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.03.38", "17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36")
|
"com.google.android.youtube", arrayOf("17.03.38", "17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class IntegrationsPatch : BytecodePatch(
|
|||||||
if (data.findClass("Lapp/revanced/integrations/Globals") == null)
|
if (data.findClass("Lapp/revanced/integrations/Globals") == null)
|
||||||
return PatchResultError("Integrations have not been merged yet. This patch can not succeed without the integrations.")
|
return PatchResultError("Integrations have not been merged yet. This patch can not succeed without the integrations.")
|
||||||
|
|
||||||
val result = signatures.first().result!!
|
val result = InitSignature.result!!
|
||||||
|
|
||||||
val implementation = result.method.implementation!!
|
val implementation = result.method.implementation!!
|
||||||
val count = implementation.registerCount - 1
|
val count = implementation.registerCount - 1
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36")
|
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.14.35", "17.19.36", "17.20.37", "17.22.36")
|
"com.google.android.youtube", arrayOf("17.14.35", "17.19.36", "17.20.37", "17.22.36", "17.23.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ 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.manifest.patch.FixLocaleConfigErrorPatch
|
||||||
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
|
||||||
@@ -24,14 +26,19 @@ import app.revanced.patches.youtube.misc.microg.signatures.*
|
|||||||
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
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21s
|
|
||||||
import org.jf.dexlib2.iface.instruction.formats.Instruction21c
|
import org.jf.dexlib2.iface.instruction.formats.Instruction21c
|
||||||
import org.jf.dexlib2.iface.reference.StringReference
|
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,
|
||||||
|
FixLocaleConfigErrorPatch::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")
|
||||||
@@ -56,17 +63,6 @@ class MicroGBytecodePatch : BytecodePatch(
|
|||||||
|
|
||||||
var proxiedImplementation: MutableMethodImplementation? = null
|
var proxiedImplementation: MutableMethodImplementation? = null
|
||||||
|
|
||||||
// disable cast button since it is unsupported by microg and causes battery issues
|
|
||||||
// the code is here instead of the fixCastIssues method because we do not need a signature this way
|
|
||||||
if (classDef.type.endsWith("MediaRouteButton;") && method.name == "setVisibility") {
|
|
||||||
proxiedClass = data.proxy(classDef).resolve()
|
|
||||||
proxiedImplementation = proxiedClass!!.methods.first { it.name == "setVisibility" }.implementation
|
|
||||||
|
|
||||||
proxiedImplementation!!.replaceInstruction(
|
|
||||||
0, BuilderInstruction21s(Opcode.CONST_16, 1, 8) // 8 == HIDDEN
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
@@ -74,13 +70,11 @@ class MicroGBytecodePatch : BytecodePatch(
|
|||||||
|
|
||||||
val replaceMode = if (stringValue.equalsAny(
|
val replaceMode = if (stringValue.equalsAny(
|
||||||
"com.google.android.gms",
|
"com.google.android.gms",
|
||||||
"com.google.android.youtube.fileprovider",
|
|
||||||
"com.google.android.c2dm.intent.REGISTER",
|
"com.google.android.c2dm.intent.REGISTER",
|
||||||
"com.google.android.c2dm.permission.SEND",
|
"com.google.android.c2dm.permission.SEND",
|
||||||
"com.google.iid.TOKEN_REQUEST",
|
"com.google.iid.TOKEN_REQUEST",
|
||||||
"com.google",
|
"com.google",
|
||||||
"com.google.android.gms.auth.accounts",
|
"com.google.android.gms.auth.accounts",
|
||||||
"com.google.android.youtube.SuggestionProvider",
|
|
||||||
"com.google.android.c2dm.intent.REGISTRATION",
|
"com.google.android.c2dm.intent.REGISTRATION",
|
||||||
"com.google.android.gsf.action.GET_GLS",
|
"com.google.android.gsf.action.GET_GLS",
|
||||||
"com.google.android.gsf.login",
|
"com.google.android.gsf.login",
|
||||||
@@ -126,13 +120,19 @@ class MicroGBytecodePatch : BytecodePatch(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
signatures.last()
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun disablePlayServiceChecksAndFixCastIssues() {
|
private fun disablePlayServiceChecksAndFixCastIssues() {
|
||||||
for (i in 0 until signatures.count() - 1) {
|
listOf(
|
||||||
val result = signatures.elementAt(i).result!!
|
IntegrityCheckSignature,
|
||||||
|
ServiceCheckSignature,
|
||||||
|
GooglePlayUtilitySignature,
|
||||||
|
CastDynamiteModuleSignature,
|
||||||
|
CastDynamiteModuleV2Signature,
|
||||||
|
CastContextFetchSignature
|
||||||
|
).forEach { signature ->
|
||||||
|
val result = signature.result!!
|
||||||
val stringInstructions = when (result.immutableMethod.returnType.first()) {
|
val stringInstructions = when (result.immutableMethod.returnType.first()) {
|
||||||
'L' -> """
|
'L' -> """
|
||||||
const/4 v0, 0x0
|
const/4 v0, 0x0
|
||||||
@@ -152,7 +152,7 @@ class MicroGBytecodePatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
val implementation = signatures.last().result!!.method.implementation!!
|
val implementation = PrimeSignature.result!!.method.implementation!!
|
||||||
|
|
||||||
var register = 2
|
var register = 2
|
||||||
val index = implementation.instructions.indexOfFirst {
|
val index = implementation.instructions.indexOfFirst {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.ResourceData
|
import app.revanced.patcher.data.implementation.ResourceData
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.implementation.ResourcePatch
|
import app.revanced.patcher.patch.implementation.ResourcePatch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
||||||
@@ -39,10 +40,6 @@ class MicroGResourcePatch : ResourcePatch() {
|
|||||||
"android:label=\"@string/application_name", "android:label=\"$REVANCED_APP_NAME"
|
"android:label=\"@string/application_name", "android:label=\"$REVANCED_APP_NAME"
|
||||||
).replace(
|
).replace(
|
||||||
"android:authorities=\"com.google.android.youtube", "android:authorities=\"$REVANCED_PACKAGE_NAME"
|
"android:authorities=\"com.google.android.youtube", "android:authorities=\"$REVANCED_PACKAGE_NAME"
|
||||||
).replace(
|
|
||||||
"com.google.android.youtube.fileprovider", "$REVANCED_PACKAGE_NAME.fileprovider"
|
|
||||||
).replace(
|
|
||||||
"com.google.android.youtube.SuggestionProvider", "$REVANCED_PACKAGE_NAME.SuggestionProvider"
|
|
||||||
).replace(
|
).replace(
|
||||||
"com.google.android.youtube.permission.C2D_MESSAGE", "$REVANCED_PACKAGE_NAME.permission.C2D_MESSAGE"
|
"com.google.android.youtube.permission.C2D_MESSAGE", "$REVANCED_PACKAGE_NAME.permission.C2D_MESSAGE"
|
||||||
).replace( // TODO: might not be needed
|
).replace( // TODO: might not be needed
|
||||||
|
|||||||
|
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 |