Skip to content

Commit

Permalink
build: bump patcher to 19.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
inotia00 committed Oct 27, 2023
1 parent 1edc5f1 commit d9ab09f
Show file tree
Hide file tree
Showing 396 changed files with 486 additions and 6,455 deletions.
5,958 changes: 0 additions & 5,958 deletions CHANGELOG.md

Large diffs are not rendered by default.

33 changes: 15 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import org.gradle.kotlin.dsl.support.listFilesOrdered

plugins {
kotlin("jvm") version "1.9.10"
alias(libs.plugins.ksp)
}

group = "app.revanced"
Expand All @@ -22,12 +23,9 @@ repositories {
dependencies {
implementation(libs.revanced.patcher)
implementation(libs.smali)
implementation(libs.revanced.patch.annotation.processor)
// Used in JsonGenerator.
implementation(libs.gson)
implementation(libs.flexver)

ksp(libs.revanced.patch.annotation.processor)
}

kotlin {
Expand All @@ -40,19 +38,20 @@ tasks {
dependsOn(build)

doLast {
val androidHome = System.getenv("ANDROID_HOME") ?: throw GradleException("ANDROID_HOME not found")
val d8 = "${androidHome}/build-tools/34.0.0/d8"
val input = configurations.archives.get().allArtifacts.files.files.first().absolutePath
val work = layout.buildDirectory.dir("libs").get().asFile
val d8 = File(System.getenv("ANDROID_HOME")).resolve("build-tools")
.listFilesOrdered().last().resolve("d8").absolutePath

val artifacts = configurations.archives.get().allArtifacts.files.files.first().absolutePath
val workingDirectory = layout.buildDirectory.dir("libs").get().asFile

exec {
workingDir = work
commandLine = listOf(d8, input)
workingDir = workingDirectory
commandLine = listOf(d8, artifacts)
}

exec {
workingDir = work
commandLine = listOf("zip", "-u", input, "classes.dex")
workingDir = workingDirectory
commandLine = listOf("zip", "-u", artifacts, "classes.dex")
}
}
}
Expand All @@ -65,12 +64,10 @@ tasks {
mainClass.set("app.revanced.meta.PatchesFileGenerator")
}

// 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
// Required to run tasks because Gradle semantic-release plugin runs the publish task.
// Tracking: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
register<DefaultTask>("publish") {
group = "publish"
description = "Dummy task"
dependsOn(named("generateBundle"), named("generateMeta"))
dependsOn("generateBundle")
dependsOn("generateMeta")
}
}
10 changes: 2 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
[versions]
revanced-patcher = "17.0.0"
revanced-patch-annotation-processor = "17.0.0"
ksp = "1.9.10-1.0.13"
revanced-patcher = "19.0.0"
smali = "3.0.3"
gson = "2.10.1"
flexver = "1.1.1"

[libraries]
revanced-patcher = { module = "app.revanced.revanced-patcher:revanced-patcher", version.ref = "revanced-patcher" }
revanced-patch-annotation-processor = { module = "app.revanced.revanced-patcher:revanced-patch-annotation-processor", version.ref = "revanced-patch-annotation-processor" }
revanced-patcher = { module = "app.revanced:revanced-patcher", version.ref = "revanced-patcher" }
smali = { module = "com.android.tools.smali:smali", version.ref = "smali" }
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
flexver = { module = "com.unascribed:flexver-java", version.ref = "flexver" }

[plugins]
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
2 changes: 1 addition & 1 deletion src/main/kotlin/app/revanced/extensions/Extensions.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.revanced.extensions

import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
import app.revanced.patcher.util.proxy.mutableTypes.MutableField
Expand Down
4 changes: 3 additions & 1 deletion src/main/kotlin/app/revanced/meta/JsonGenerator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ internal class JsonGenerator : PatchesFileGenerator {
it.options.values.map { option ->
JsonPatch.Option(
option.key,
option.value,
option.default,
option.values,
option.title,
option.description,
option.required
Expand All @@ -41,6 +42,7 @@ internal class JsonGenerator : PatchesFileGenerator {
class Option(
val key: String,
val default: Any?,
val values: Map<String, Any?>?,
val title: String?,
val description: String?,
val required: Boolean,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package app.revanced.patches.music.account.component.fingerprints

import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.MenuEntry
import app.revanced.util.bytecode.isWideLiteralExists

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package app.revanced.patches.music.account.handle.fingerprints

import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.AccountSwitcherAccessibility
import app.revanced.util.bytecode.isWideLiteralExists

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package app.revanced.patches.music.account.handle.fingerprints

import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.NamesInactiveAccountThumbnailSize
import app.revanced.util.bytecode.isWideLiteralExists
import com.android.tools.smali.dexlib2.Opcode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package app.revanced.patches.music.account.tos.fingerprints

import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.TosFooter
import app.revanced.util.bytecode.isWideLiteralExists

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import app.revanced.extensions.exception
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.revanced.patches.music.actionbar.label.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.revanced.patches.music.flyoutpanel.compactdialog.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.DialogSolid
import app.revanced.util.bytecode.isWideLiteralExists
import com.android.tools.smali.dexlib2.AccessFlags
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package app.revanced.patches.music.flyoutpanel.sleeptimer.fingerprints

import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.util.bytecode.isWide32LiteralExists

object SleepTimerFingerprint : MethodFingerprint(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.patch.options.types.StringPatchOption.Companion.stringPatchOption
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption

@Patch(
name = "Custom branding Music name",
Expand All @@ -27,41 +27,50 @@ import app.revanced.patcher.patch.options.types.StringPatchOption.Companion.stri
object CustomBrandingNamePatch : ResourcePatch() {
override fun execute(context: ResourceContext) {

val longName = MusicLongName
?: throw PatchException("Invalid app name.")
AppNameNotification?.let { notificationName ->
AppNameLauncher?.let { launcherName ->
context.xmlEditor["res/values/strings.xml"].use { editor ->
val document = editor.file

val shortName = MusicShortName
?: throw PatchException("Invalid app name.")
mapOf(
"app_name" to notificationName,
"app_launcher_name" to launcherName
).forEach { (k, v) ->
val stringElement = document.createElement("string")

context.xmlEditor["res/values/strings.xml"].use { editor ->
val document = editor.file

mapOf(
"app_name" to longName,
"app_launcher_name" to shortName
).forEach { (k, v) ->
val stringElement = document.createElement("string")

stringElement.setAttribute("name", k)
stringElement.textContent = v

document.getElementsByTagName("resources").item(0).appendChild(stringElement)
}
}
stringElement.setAttribute("name", k)
stringElement.textContent = v

document.getElementsByTagName("resources").item(0)
.appendChild(stringElement)
}
}
} ?: throw PatchException("Invalid app name.")
} ?: throw PatchException("Invalid app name.")
}

internal var MusicLongName by stringPatchOption(
key = "MusicLongName",
default = "ReVanced Extended Music",
title = "Application Name of YouTube Music",
description = "The name of the YouTube Music it will show on your notification panel."
private const val APP_NAME_NOTIFICATION = "ReVanced Extended Music"
private const val APP_NAME_LAUNCHER = "RVX Music"

internal var AppNameNotification by stringPatchOption(
key = "AppNameNotification",
default = APP_NAME_NOTIFICATION,
values = mapOf(
"Full name" to APP_NAME_NOTIFICATION,
"Short name" to APP_NAME_LAUNCHER
),
title = "App name in notification panel",
description = "The name of the app as it appears in the notification panel."
)

internal var MusicShortName by stringPatchOption(
key = "MusicShortName",
default = "RVX Music",
title = "Application Name of YouTube Music",
description = "The name of the YouTube Music it will show on your home screen."
internal var AppNameLauncher by stringPatchOption(
key = "AppNameLauncher",
default = APP_NAME_LAUNCHER,
values = mapOf(
"Full name" to APP_NAME_NOTIFICATION,
"Short name" to APP_NAME_LAUNCHER
),
title = "App name in launcher",
description = "The name of the app as it appears in the launcher."
)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.revanced.patches.music.general.castbutton.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags

object MediaRouteButtonFingerprint : MethodFingerprint(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.revanced.patches.music.general.castbutton.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.PlayerOverlayChip
import app.revanced.util.bytecode.isWideLiteralExists
import com.android.tools.smali.dexlib2.AccessFlags
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package app.revanced.patches.music.general.categorybar.fingerprints

import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.ChipCloud
import app.revanced.util.bytecode.isWideLiteralExists
import com.android.tools.smali.dexlib2.Opcode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import app.revanced.extensions.exception
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.revanced.patches.music.general.floatingbutton.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.revanced.patches.music.general.floatingbutton.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.util.bytecode.isNarrowLiteralExists
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.revanced.patches.music.general.landscapemode.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.IsTablet
import app.revanced.util.bytecode.isWideLiteralExists
import com.android.tools.smali.dexlib2.AccessFlags
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.revanced.patches.music.general.oldstylelibraryshelf.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.util.bytecode.isWide32LiteralExists
import com.android.tools.smali.dexlib2.AccessFlags

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.revanced.patches.music.general.startpage.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.revanced.patches.music.general.tooltip.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.ToolTipContentView
import app.revanced.util.bytecode.isWideLiteralExists
import com.android.tools.smali.dexlib2.AccessFlags
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.revanced.patches.music.misc.backgroundplay.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package app.revanced.patches.music.misc.exclusiveaudio.fingerprints

import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint

object DataSavingSettingsFragmentFingerprint : MethodFingerprint(
returnType = "V",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.revanced.patches.music.misc.exclusiveaudio.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags

object MusicBrowserServiceFingerprint : MethodFingerprint(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app.revanced.patches.music.misc.exclusiveaudio.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.util.bytecode.isWide32LiteralExists
import com.android.tools.smali.dexlib2.AccessFlags

Expand Down
Loading

0 comments on commit d9ab09f

Please sign in to comment.