From d5f89a903f019c199bdb27a50287124fc4b4978e Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Fri, 11 Aug 2023 02:51:27 +0200 Subject: [PATCH] build(Needs bump)!: Bump dependencies BREAKING CHANGE: This bump updates smali, a crucial dependency --- build.gradle.kts | 19 +- .../kotlin/app/revanced/patcher/Patcher.kt | 186 ++++++++---------- .../app/revanced/patcher/PatcherContext.kt | 2 +- .../app/revanced/patcher/PatcherOptions.kt | 13 +- .../app/revanced/patcher/data/Context.kt | 4 +- .../revanced/patcher/extensions/Extensions.kt | 2 +- .../extensions/InstructionExtensions.kt | 12 +- .../method/impl/MethodFingerprint.kt | 16 +- .../app/revanced/patcher/util/ClassMerger.kt | 6 +- .../patcher/util/ProxyBackedClassList.kt | 2 +- .../patcher/util/method/MethodWalker.kt | 8 +- .../patcher/util/patch/PatchBundle.kt | 2 +- .../revanced/patcher/util/proxy/ClassProxy.kt | 2 +- .../proxy/mutableTypes/MutableAnnotation.kt | 4 +- .../mutableTypes/MutableAnnotationElement.kt | 6 +- .../util/proxy/mutableTypes/MutableClass.kt | 8 +- .../util/proxy/mutableTypes/MutableField.kt | 6 +- .../util/proxy/mutableTypes/MutableMethod.kt | 8 +- .../mutableTypes/MutableMethodParameter.kt | 4 +- .../MutableAnnotationEncodedValue.kt | 6 +- .../encodedValue/MutableArrayEncodedValue.kt | 6 +- .../MutableBooleanEncodedValue.kt | 4 +- .../encodedValue/MutableByteEncodedValue.kt | 4 +- .../encodedValue/MutableCharEncodedValue.kt | 4 +- .../encodedValue/MutableDoubleEncodedValue.kt | 4 +- .../encodedValue/MutableEncodedValue.kt | 4 +- .../encodedValue/MutableEnumEncodedValue.kt | 6 +- .../encodedValue/MutableFieldEncodedValue.kt | 8 +- .../encodedValue/MutableFloatEncodedValue.kt | 4 +- .../encodedValue/MutableIntEncodedValue.kt | 4 +- .../encodedValue/MutableLongEncodedValue.kt | 4 +- .../encodedValue/MutableMethodEncodedValue.kt | 6 +- .../MutableMethodHandleEncodedValue.kt | 6 +- .../MutableMethodTypeEncodedValue.kt | 6 +- .../encodedValue/MutableNullEncodedValue.kt | 4 +- .../encodedValue/MutableShortEncodedValue.kt | 4 +- .../encodedValue/MutableStringEncodedValue.kt | 6 +- .../encodedValue/MutableTypeEncodedValue.kt | 4 +- .../patcher/util/smali/ExternalLabel.kt | 2 +- .../patcher/util/smali/InlineSmaliCompiler.kt | 16 +- .../extensions/InstructionExtensionsTest.kt | 14 +- .../usage/bytecode/ExampleBytecodePatch.kt | 28 +-- .../usage/bytecode/ExampleFingerprint.kt | 4 +- .../util/smali/InlineSmaliCompilerTest.kt | 16 +- 44 files changed, 243 insertions(+), 241 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 1f70773..c53b80d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,20 +10,23 @@ val githubPassword: String = project.findProperty("gpr.key") as? String ?: Syste repositories { mavenCentral() - maven { - url = uri("https://maven.pkg.github.com/revanced/multidexlib2") - credentials { - username = githubUsername - password = githubPassword + google() + listOf("multidexlib2", "apktool").forEach { repo -> + maven { + url = uri("https://maven.pkg.github.com/revanced/$repo") + credentials { + username = githubUsername + password = githubPassword + } } } } dependencies { implementation("xpp3:xpp3:1.1.4c") - implementation("app.revanced:smali:2.5.3-a3836654") - implementation("app.revanced:multidexlib2:2.5.3-a3836654") - implementation("app.revanced:apktool-lib:2.8.2-1") + implementation("com.android.tools.smali:smali:3.0.3") + implementation("app.revanced:multidexlib2:3.0.3.r2") + implementation("app.revanced:apktool-lib:2.8.2-2") implementation("org.jetbrains.kotlin:kotlin-reflect:1.8.22") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.20-RC") diff --git a/src/main/kotlin/app/revanced/patcher/Patcher.kt b/src/main/kotlin/app/revanced/patcher/Patcher.kt index 60bdf65..58bf2e5 100644 --- a/src/main/kotlin/app/revanced/patcher/Patcher.kt +++ b/src/main/kotlin/app/revanced/patcher/Patcher.kt @@ -10,25 +10,24 @@ import app.revanced.patcher.patch.* import brut.androlib.AaptInvoker import brut.androlib.ApkDecoder import brut.androlib.Config +import brut.androlib.apk.ApkInfo import brut.androlib.res.Framework import brut.androlib.res.ResourcesDecoder import brut.androlib.res.decoder.AndroidManifestResourceParser -import brut.androlib.res.decoder.ResAttrDecoder import brut.androlib.res.decoder.XmlPullStreamDecoder -import brut.androlib.res.util.ExtMXSerializer -import brut.androlib.res.util.ExtXmlSerializer import brut.androlib.res.xml.ResXmlPatcher import brut.directory.ExtFile +import com.android.tools.smali.dexlib2.Opcodes +import com.android.tools.smali.dexlib2.iface.DexFile +import com.android.tools.smali.dexlib2.writer.io.MemoryDataStore import lanchon.multidexlib2.BasicDexFileNamer import lanchon.multidexlib2.DexIO import lanchon.multidexlib2.MultiDexIO -import org.jf.dexlib2.Opcodes -import org.jf.dexlib2.iface.DexFile -import org.jf.dexlib2.writer.io.MemoryDataStore import java.io.Closeable import java.io.File import java.io.OutputStream import java.nio.file.Files +import java.util.logging.LogManager internal val NAMER = BasicDexFileNamer() @@ -37,18 +36,25 @@ internal val NAMER = BasicDexFileNamer() * @param options The options for the patcher. */ class Patcher(private val options: PatcherOptions) { - private val logger = options.logger - private val opcodes: Opcodes - private var resourceDecodingMode = ResourceDecodingMode.MANIFEST_ONLY - private var mergeIntegrations = false val context: PatcherContext + private val logger = options.logger + + private val opcodes: Opcodes + + private var resourceDecodingMode = ResourceDecodingMode.MANIFEST_ONLY + + private var mergeIntegrations = false + private val config = Config.getDefaultConfig().apply { + useAapt2 = true aaptPath = options.aaptPath frameworkDirectory = options.frameworkDirectory } init { + LogManager.getLogManager().getLogger("brut.*").useParentHandlers = false + logger.info("Reading dex files") // read dex files val dexFile = MultiDexIO.readDexFile(true, options.inputFile, NAMER, null, null) @@ -84,61 +90,61 @@ class Patcher(private val options: PatcherOptions) { fun save(): PatcherResult { var resourceFile: File? = null - when (resourceDecodingMode) { - ResourceDecodingMode.FULL -> { - logger.info("Compiling resources") + if (resourceDecodingMode == ResourceDecodingMode.FULL) { + logger.info("Compiling resources") - val cacheDirectory = ExtFile(options.resourceCacheDirectory) - val aaptFile = cacheDirectory.resolve("aapt_temp_file").also { - Files.deleteIfExists(it.toPath()) - }.also { resourceFile = it } + val cacheDirectory = ExtFile(options.resourceCacheDirectory) + val aaptFile = cacheDirectory.resolve("aapt_temp_file").also { + Files.deleteIfExists(it.toPath()) + }.also { resourceFile = it } - try { - AaptInvoker( - config, - context.packageMetadata.apkInfo - ).invokeAapt( - aaptFile, - cacheDirectory.resolve("AndroidManifest.xml").also { - ResXmlPatcher.fixingPublicAttrsInProviderAttributes(it) - }, - cacheDirectory.resolve("res"), - null, - null, - context.packageMetadata.apkInfo.usesFramework.let { usesFramework -> - usesFramework.ids.map { id -> - Framework(config).getFrameworkApk(id, usesFramework.tag) - }.toTypedArray() - } - ) - } finally { - cacheDirectory.close() - } + try { + AaptInvoker( + config, + context.packageMetadata.apkInfo + ).invokeAapt( + aaptFile, + cacheDirectory.resolve("AndroidManifest.xml").also { + ResXmlPatcher.fixingPublicAttrsInProviderAttributes(it) + }, + cacheDirectory.resolve("res"), + null, + null, + context.packageMetadata.apkInfo.usesFramework.let { usesFramework -> + usesFramework.ids.map { id -> + Framework(config).getFrameworkApk(id, usesFramework.tag) + }.toTypedArray() + } + ) + } finally { + cacheDirectory.close() } - else -> logger.info("Not compiling resources because resource patching is not required") } - logger.trace("Creating new dex file") - val newDexFile = object : DexFile { - override fun getClasses() = context.bytecodeContext.classes.also { it.replaceClasses() } - override fun getOpcodes() = this@Patcher.opcodes - } - - // write modified dex files logger.info("Writing modified dex files") - val dexFiles = mutableMapOf() - MultiDexIO.writeDexFile( - true, -1, // core count - dexFiles, NAMER, newDexFile, DexIO.DEFAULT_MAX_DEX_POOL_SIZE, null - ) - return PatcherResult( - dexFiles.map { - app.revanced.patcher.util.dex.DexFile(it.key, it.value.readAt(0)) - }, - context.packageMetadata.apkInfo.doNotCompress?.toList(), - resourceFile - ) + return mutableMapOf().apply { + MultiDexIO.writeDexFile( + true, + -1, // Defaults to amount of available cores. + this, + NAMER, + object : DexFile { + override fun getClasses() = context.bytecodeContext.classes.also { it.replaceClasses() } + override fun getOpcodes() = this@Patcher.opcodes + }, + DexIO.DEFAULT_MAX_DEX_POOL_SIZE, + null + ) + }.let { dexFiles -> + PatcherResult( + dexFiles.map { + app.revanced.patcher.util.dex.DexFile(it.key, it.value.readAt(0)) + }, + context.packageMetadata.apkInfo.doNotCompress?.toList(), + resourceFile + ) + } } /** @@ -178,57 +184,41 @@ class Patcher(private val options: PatcherOptions) { * @param mode The [ResourceDecodingMode] to use when decoding. */ private fun decodeResources(mode: ResourceDecodingMode) { - val extInputFile = ExtFile(options.inputFile) - try { - val resourcesDecoder = ResourcesDecoder(config, extInputFile) + val apkInfo = ApkInfo(ExtFile(options.inputFile)).also { context.packageMetadata.apkInfo = it } + // Needed to record uncompressed files. + val apkDecoder = ApkDecoder(config, apkInfo) + + // Needed to decode resources. + val resourcesDecoder = ResourcesDecoder(config, apkInfo) + + try { when (mode) { ResourceDecodingMode.FULL -> { - val outDir = File(options.resourceCacheDirectory) - if (outDir.exists()) { - logger.info("Deleting existing resource cache directory") - if (!outDir.deleteRecursively()) logger.error("Failed to delete existing resource cache directory") - } - - outDir.mkdirs() + val outDir = options.recreateResourceCacheDirectory() logger.info("Decoding resources") resourcesDecoder.decodeManifest(outDir) resourcesDecoder.decodeResources(outDir) - context.packageMetadata.also { - it.apkInfo = resourcesDecoder.apkInfo - }.apkInfo.doNotCompress = ApkDecoder(config, extInputFile).recordUncompressedFiles( - context.packageMetadata.apkInfo, resourcesDecoder.resFileMapping - ) + apkDecoder.recordUncompressedFiles(resourcesDecoder.resFileMapping) } ResourceDecodingMode.MANIFEST_ONLY -> { - logger.info("Decoding AndroidManifest.xml only, because resources are not needed") + logger.info("Decoding app manifest") - // Instead of using resourceDecoder.decodeManifest which decodes the whole file - // use the XmlPullStreamDecoder in order to get necessary information from the manifest - // used below. - XmlPullStreamDecoder(AndroidManifestResourceParser().apply { - attrDecoder = ResAttrDecoder().apply { this.resTable = resourcesDecoder.resTable } - }, ExtMXSerializer().apply { - setProperty( - ExtXmlSerializer.PROPERTY_SERIALIZER_INDENTATION, " " - ) - setProperty( - ExtXmlSerializer.PROPERTY_SERIALIZER_LINE_SEPARATOR, - System.getProperty("line.separator") - ) - setProperty( - ExtXmlSerializer.PROPERTY_DEFAULT_ENCODING, - "utf-8" - ) - setDisabledAttrEscape(true) - } + // Decode manually instead of using resourceDecoder.decodeManifest + // because it does not support decoding to an OutputStream. + XmlPullStreamDecoder( + AndroidManifestResourceParser(resourcesDecoder.resTable), + resourcesDecoder.resXmlSerializer ).decodeManifest( - extInputFile.directory.getFileInput("AndroidManifest.xml"), + apkInfo.apkFile.directory.getFileInput("AndroidManifest.xml"), // Older Android versions do not support OutputStream.nullOutputStream() - object : OutputStream() { override fun write(b: Int) { /* do nothing */ } } + object : OutputStream() { + override fun write(b: Int) { /* do nothing */ + } + } ) } } @@ -236,15 +226,13 @@ class Patcher(private val options: PatcherOptions) { // Get the package name and version from the manifest using the XmlPullStreamDecoder. // XmlPullStreamDecoder.decodeManifest() sets metadata.apkInfo. context.packageMetadata.let { metadata -> - metadata.apkInfo = resourcesDecoder.apkInfo - metadata.packageName = resourcesDecoder.resTable.currentResPackage.name - resourcesDecoder.apkInfo.versionInfo.let { + apkInfo.versionInfo.let { metadata.packageVersion = it.versionName ?: it.versionCode } } } finally { - extInputFile.close() + apkInfo.apkFile.close() } } diff --git a/src/main/kotlin/app/revanced/patcher/PatcherContext.kt b/src/main/kotlin/app/revanced/patcher/PatcherContext.kt index 941607d..de00605 100644 --- a/src/main/kotlin/app/revanced/patcher/PatcherContext.kt +++ b/src/main/kotlin/app/revanced/patcher/PatcherContext.kt @@ -4,7 +4,7 @@ import app.revanced.patcher.data.* import app.revanced.patcher.logging.Logger import app.revanced.patcher.patch.Patch import app.revanced.patcher.util.ClassMerger.merge -import org.jf.dexlib2.iface.ClassDef +import com.android.tools.smali.dexlib2.iface.ClassDef import java.io.File data class PatcherContext( diff --git a/src/main/kotlin/app/revanced/patcher/PatcherOptions.kt b/src/main/kotlin/app/revanced/patcher/PatcherOptions.kt index f6528b7..b5802ce 100644 --- a/src/main/kotlin/app/revanced/patcher/PatcherOptions.kt +++ b/src/main/kotlin/app/revanced/patcher/PatcherOptions.kt @@ -18,4 +18,15 @@ data class PatcherOptions( internal val aaptPath: String? = null, internal val frameworkDirectory: String? = null, internal val logger: Logger = NopLogger -) +) { + fun recreateResourceCacheDirectory() = File(resourceCacheDirectory).also { + if (it.exists()) { + logger.info("Deleting existing resource cache directory") + + if (!it.deleteRecursively()) + logger.error("Failed to delete existing resource cache directory") + } + + it.mkdirs() + } +} diff --git a/src/main/kotlin/app/revanced/patcher/data/Context.kt b/src/main/kotlin/app/revanced/patcher/data/Context.kt index 5083a42..987c245 100644 --- a/src/main/kotlin/app/revanced/patcher/data/Context.kt +++ b/src/main/kotlin/app/revanced/patcher/data/Context.kt @@ -2,8 +2,8 @@ package app.revanced.patcher.data import app.revanced.patcher.util.ProxyBackedClassList import app.revanced.patcher.util.method.MethodWalker -import org.jf.dexlib2.iface.ClassDef -import org.jf.dexlib2.iface.Method +import com.android.tools.smali.dexlib2.iface.ClassDef +import com.android.tools.smali.dexlib2.iface.Method import org.w3c.dom.Document import java.io.Closeable import java.io.File diff --git a/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt b/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt index a3ef1a1..baf7f54 100644 --- a/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt +++ b/src/main/kotlin/app/revanced/patcher/extensions/Extensions.kt @@ -1,7 +1,7 @@ package app.revanced.patcher.extensions import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod -import org.jf.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.AccessFlags /** * Create a label for the instruction at given index. diff --git a/src/main/kotlin/app/revanced/patcher/extensions/InstructionExtensions.kt b/src/main/kotlin/app/revanced/patcher/extensions/InstructionExtensions.kt index b989544..aa194ac 100644 --- a/src/main/kotlin/app/revanced/patcher/extensions/InstructionExtensions.kt +++ b/src/main/kotlin/app/revanced/patcher/extensions/InstructionExtensions.kt @@ -4,12 +4,12 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patcher.util.smali.toInstruction import app.revanced.patcher.util.smali.toInstructions -import org.jf.dexlib2.builder.BuilderInstruction -import org.jf.dexlib2.builder.BuilderOffsetInstruction -import org.jf.dexlib2.builder.Label -import org.jf.dexlib2.builder.MutableMethodImplementation -import org.jf.dexlib2.builder.instruction.* -import org.jf.dexlib2.iface.instruction.Instruction +import com.android.tools.smali.dexlib2.builder.BuilderInstruction +import com.android.tools.smali.dexlib2.builder.BuilderOffsetInstruction +import com.android.tools.smali.dexlib2.builder.Label +import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation +import com.android.tools.smali.dexlib2.builder.instruction.* +import com.android.tools.smali.dexlib2.iface.instruction.Instruction object InstructionExtensions { diff --git a/src/main/kotlin/app/revanced/patcher/fingerprint/method/impl/MethodFingerprint.kt b/src/main/kotlin/app/revanced/patcher/fingerprint/method/impl/MethodFingerprint.kt index 3cd2212..a611d9e 100644 --- a/src/main/kotlin/app/revanced/patcher/fingerprint/method/impl/MethodFingerprint.kt +++ b/src/main/kotlin/app/revanced/patcher/fingerprint/method/impl/MethodFingerprint.kt @@ -6,14 +6,14 @@ import app.revanced.patcher.fingerprint.Fingerprint import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod import app.revanced.patcher.patch.PatchResultError import app.revanced.patcher.util.proxy.ClassProxy -import org.jf.dexlib2.AccessFlags -import org.jf.dexlib2.Opcode -import org.jf.dexlib2.iface.ClassDef -import org.jf.dexlib2.iface.Method -import org.jf.dexlib2.iface.instruction.Instruction -import org.jf.dexlib2.iface.instruction.ReferenceInstruction -import org.jf.dexlib2.iface.reference.StringReference -import org.jf.dexlib2.util.MethodUtil +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.iface.ClassDef +import com.android.tools.smali.dexlib2.iface.Method +import com.android.tools.smali.dexlib2.iface.instruction.Instruction +import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction +import com.android.tools.smali.dexlib2.iface.reference.StringReference +import com.android.tools.smali.dexlib2.util.MethodUtil import java.util.* private typealias StringMatch = MethodFingerprintResult.MethodFingerprintScanResult.StringsScanResult.StringMatch diff --git a/src/main/kotlin/app/revanced/patcher/util/ClassMerger.kt b/src/main/kotlin/app/revanced/patcher/util/ClassMerger.kt index abac334..f7100f0 100644 --- a/src/main/kotlin/app/revanced/patcher/util/ClassMerger.kt +++ b/src/main/kotlin/app/revanced/patcher/util/ClassMerger.kt @@ -15,9 +15,9 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableField import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMutable import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable -import org.jf.dexlib2.AccessFlags -import org.jf.dexlib2.iface.ClassDef -import org.jf.dexlib2.util.MethodUtil +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.iface.ClassDef +import com.android.tools.smali.dexlib2.util.MethodUtil import kotlin.reflect.KFunction2 /** diff --git a/src/main/kotlin/app/revanced/patcher/util/ProxyBackedClassList.kt b/src/main/kotlin/app/revanced/patcher/util/ProxyBackedClassList.kt index ab9f540..f91cd8d 100644 --- a/src/main/kotlin/app/revanced/patcher/util/ProxyBackedClassList.kt +++ b/src/main/kotlin/app/revanced/patcher/util/ProxyBackedClassList.kt @@ -1,7 +1,7 @@ package app.revanced.patcher.util import app.revanced.patcher.util.proxy.ClassProxy -import org.jf.dexlib2.iface.ClassDef +import com.android.tools.smali.dexlib2.iface.ClassDef /** * A class that represents a set of classes and proxies. diff --git a/src/main/kotlin/app/revanced/patcher/util/method/MethodWalker.kt b/src/main/kotlin/app/revanced/patcher/util/method/MethodWalker.kt index 70efa01..a0d2ef0 100644 --- a/src/main/kotlin/app/revanced/patcher/util/method/MethodWalker.kt +++ b/src/main/kotlin/app/revanced/patcher/util/method/MethodWalker.kt @@ -2,10 +2,10 @@ package app.revanced.patcher.util.method import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod -import org.jf.dexlib2.iface.Method -import org.jf.dexlib2.iface.instruction.ReferenceInstruction -import org.jf.dexlib2.iface.reference.MethodReference -import org.jf.dexlib2.util.MethodUtil +import com.android.tools.smali.dexlib2.iface.Method +import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction +import com.android.tools.smali.dexlib2.iface.reference.MethodReference +import com.android.tools.smali.dexlib2.util.MethodUtil /** * Find a method from another method via instruction offsets. diff --git a/src/main/kotlin/app/revanced/patcher/util/patch/PatchBundle.kt b/src/main/kotlin/app/revanced/patcher/util/patch/PatchBundle.kt index f334486..118bb98 100644 --- a/src/main/kotlin/app/revanced/patcher/util/patch/PatchBundle.kt +++ b/src/main/kotlin/app/revanced/patcher/util/patch/PatchBundle.kt @@ -6,7 +6,7 @@ import app.revanced.patcher.data.Context import app.revanced.patcher.extensions.AnnotationExtensions.findAnnotationRecursively import app.revanced.patcher.extensions.PatchExtensions.patchName import app.revanced.patcher.patch.Patch -import org.jf.dexlib2.DexFileFactory +import com.android.tools.smali.dexlib2.DexFileFactory import java.io.File import java.net.URLClassLoader import java.util.jar.JarFile diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/ClassProxy.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/ClassProxy.kt index 780a2f9..1c60185 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/ClassProxy.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/ClassProxy.kt @@ -1,7 +1,7 @@ package app.revanced.patcher.util.proxy import app.revanced.patcher.util.proxy.mutableTypes.MutableClass -import org.jf.dexlib2.iface.ClassDef +import com.android.tools.smali.dexlib2.iface.ClassDef /** * A proxy class for a [ClassDef]. diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableAnnotation.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableAnnotation.kt index dadae85..e1040de 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableAnnotation.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableAnnotation.kt @@ -1,8 +1,8 @@ package app.revanced.patcher.util.proxy.mutableTypes import app.revanced.patcher.util.proxy.mutableTypes.MutableAnnotationElement.Companion.toMutable -import org.jf.dexlib2.base.BaseAnnotation -import org.jf.dexlib2.iface.Annotation +import com.android.tools.smali.dexlib2.base.BaseAnnotation +import com.android.tools.smali.dexlib2.iface.Annotation class MutableAnnotation(annotation: Annotation) : BaseAnnotation() { private val visibility = annotation.visibility diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableAnnotationElement.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableAnnotationElement.kt index f354516..f9e59dc 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableAnnotationElement.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableAnnotationElement.kt @@ -2,9 +2,9 @@ package app.revanced.patcher.util.proxy.mutableTypes import app.revanced.patcher.util.proxy.mutableTypes.encodedValue.MutableEncodedValue import app.revanced.patcher.util.proxy.mutableTypes.encodedValue.MutableEncodedValue.Companion.toMutable -import org.jf.dexlib2.base.BaseAnnotationElement -import org.jf.dexlib2.iface.AnnotationElement -import org.jf.dexlib2.iface.value.EncodedValue +import com.android.tools.smali.dexlib2.base.BaseAnnotationElement +import com.android.tools.smali.dexlib2.iface.AnnotationElement +import com.android.tools.smali.dexlib2.iface.value.EncodedValue class MutableAnnotationElement(annotationElement: AnnotationElement) : BaseAnnotationElement() { private var name = annotationElement.name diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableClass.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableClass.kt index a5a98d3..5c0c022 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableClass.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableClass.kt @@ -4,10 +4,10 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableAnnotation.Companion. import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMutable import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable import com.google.common.collect.Iterables -import org.jf.dexlib2.base.reference.BaseTypeReference -import org.jf.dexlib2.iface.ClassDef -import org.jf.dexlib2.util.FieldUtil -import org.jf.dexlib2.util.MethodUtil +import com.android.tools.smali.dexlib2.base.reference.BaseTypeReference +import com.android.tools.smali.dexlib2.iface.ClassDef +import com.android.tools.smali.dexlib2.util.FieldUtil +import com.android.tools.smali.dexlib2.util.MethodUtil class MutableClass(classDef: ClassDef) : ClassDef, BaseTypeReference() { // Class diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableField.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableField.kt index 5eeabec..1c0dec3 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableField.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableField.kt @@ -3,9 +3,9 @@ package app.revanced.patcher.util.proxy.mutableTypes import app.revanced.patcher.util.proxy.mutableTypes.MutableAnnotation.Companion.toMutable import app.revanced.patcher.util.proxy.mutableTypes.encodedValue.MutableEncodedValue import app.revanced.patcher.util.proxy.mutableTypes.encodedValue.MutableEncodedValue.Companion.toMutable -import org.jf.dexlib2.HiddenApiRestriction -import org.jf.dexlib2.base.reference.BaseFieldReference -import org.jf.dexlib2.iface.Field +import com.android.tools.smali.dexlib2.HiddenApiRestriction +import com.android.tools.smali.dexlib2.base.reference.BaseFieldReference +import com.android.tools.smali.dexlib2.iface.Field class MutableField(field: Field) : Field, BaseFieldReference() { private var definingClass = field.definingClass diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableMethod.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableMethod.kt index 9792b23..c026956 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableMethod.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableMethod.kt @@ -2,10 +2,10 @@ package app.revanced.patcher.util.proxy.mutableTypes import app.revanced.patcher.util.proxy.mutableTypes.MutableAnnotation.Companion.toMutable import app.revanced.patcher.util.proxy.mutableTypes.MutableMethodParameter.Companion.toMutable -import org.jf.dexlib2.HiddenApiRestriction -import org.jf.dexlib2.base.reference.BaseMethodReference -import org.jf.dexlib2.builder.MutableMethodImplementation -import org.jf.dexlib2.iface.Method +import com.android.tools.smali.dexlib2.HiddenApiRestriction +import com.android.tools.smali.dexlib2.base.reference.BaseMethodReference +import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation +import com.android.tools.smali.dexlib2.iface.Method class MutableMethod(method: Method) : Method, BaseMethodReference() { private var definingClass = method.definingClass diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableMethodParameter.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableMethodParameter.kt index a9e8391..bba8f37 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableMethodParameter.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/MutableMethodParameter.kt @@ -1,8 +1,8 @@ package app.revanced.patcher.util.proxy.mutableTypes import app.revanced.patcher.util.proxy.mutableTypes.MutableAnnotation.Companion.toMutable -import org.jf.dexlib2.base.BaseMethodParameter -import org.jf.dexlib2.iface.MethodParameter +import com.android.tools.smali.dexlib2.base.BaseMethodParameter +import com.android.tools.smali.dexlib2.iface.MethodParameter // TODO: finish overriding all members if necessary class MutableMethodParameter(parameter: MethodParameter) : MethodParameter, BaseMethodParameter() { diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableAnnotationEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableAnnotationEncodedValue.kt index f2df668..1609385 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableAnnotationEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableAnnotationEncodedValue.kt @@ -1,9 +1,9 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue import app.revanced.patcher.util.proxy.mutableTypes.MutableAnnotationElement.Companion.toMutable -import org.jf.dexlib2.base.value.BaseAnnotationEncodedValue -import org.jf.dexlib2.iface.AnnotationElement -import org.jf.dexlib2.iface.value.AnnotationEncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseAnnotationEncodedValue +import com.android.tools.smali.dexlib2.iface.AnnotationElement +import com.android.tools.smali.dexlib2.iface.value.AnnotationEncodedValue class MutableAnnotationEncodedValue(annotationEncodedValue: AnnotationEncodedValue) : BaseAnnotationEncodedValue(), MutableEncodedValue { diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableArrayEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableArrayEncodedValue.kt index cbcac8d..06b6067 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableArrayEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableArrayEncodedValue.kt @@ -1,9 +1,9 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue import app.revanced.patcher.util.proxy.mutableTypes.encodedValue.MutableEncodedValue.Companion.toMutable -import org.jf.dexlib2.base.value.BaseArrayEncodedValue -import org.jf.dexlib2.iface.value.ArrayEncodedValue -import org.jf.dexlib2.iface.value.EncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseArrayEncodedValue +import com.android.tools.smali.dexlib2.iface.value.ArrayEncodedValue +import com.android.tools.smali.dexlib2.iface.value.EncodedValue class MutableArrayEncodedValue(arrayEncodedValue: ArrayEncodedValue) : BaseArrayEncodedValue(), MutableEncodedValue { private val _value by lazy { diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableBooleanEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableBooleanEncodedValue.kt index 2610217..174ddcc 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableBooleanEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableBooleanEncodedValue.kt @@ -1,7 +1,7 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.base.value.BaseBooleanEncodedValue -import org.jf.dexlib2.iface.value.BooleanEncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseBooleanEncodedValue +import com.android.tools.smali.dexlib2.iface.value.BooleanEncodedValue class MutableBooleanEncodedValue(booleanEncodedValue: BooleanEncodedValue) : BaseBooleanEncodedValue(), MutableEncodedValue { diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableByteEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableByteEncodedValue.kt index 105ff25..83ec51f 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableByteEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableByteEncodedValue.kt @@ -1,7 +1,7 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.base.value.BaseByteEncodedValue -import org.jf.dexlib2.iface.value.ByteEncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseByteEncodedValue +import com.android.tools.smali.dexlib2.iface.value.ByteEncodedValue class MutableByteEncodedValue(byteEncodedValue: ByteEncodedValue) : BaseByteEncodedValue(), MutableEncodedValue { private var value = byteEncodedValue.value diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableCharEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableCharEncodedValue.kt index e15854f..4070c46 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableCharEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableCharEncodedValue.kt @@ -1,7 +1,7 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.base.value.BaseCharEncodedValue -import org.jf.dexlib2.iface.value.CharEncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseCharEncodedValue +import com.android.tools.smali.dexlib2.iface.value.CharEncodedValue class MutableCharEncodedValue(charEncodedValue: CharEncodedValue) : BaseCharEncodedValue(), MutableEncodedValue { private var value = charEncodedValue.value diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableDoubleEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableDoubleEncodedValue.kt index b20dc15..0683d79 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableDoubleEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableDoubleEncodedValue.kt @@ -1,7 +1,7 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.base.value.BaseDoubleEncodedValue -import org.jf.dexlib2.iface.value.DoubleEncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseDoubleEncodedValue +import com.android.tools.smali.dexlib2.iface.value.DoubleEncodedValue class MutableDoubleEncodedValue(doubleEncodedValue: DoubleEncodedValue) : BaseDoubleEncodedValue(), MutableEncodedValue { diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue.kt index d9888e7..c4f5c04 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue.kt @@ -1,7 +1,7 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.ValueType -import org.jf.dexlib2.iface.value.* +import com.android.tools.smali.dexlib2.ValueType +import com.android.tools.smali.dexlib2.iface.value.* interface MutableEncodedValue : EncodedValue { companion object { diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEnumEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEnumEncodedValue.kt index 8d29749..5b9fb74 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEnumEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEnumEncodedValue.kt @@ -1,8 +1,8 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.base.value.BaseEnumEncodedValue -import org.jf.dexlib2.iface.reference.FieldReference -import org.jf.dexlib2.iface.value.EnumEncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseEnumEncodedValue +import com.android.tools.smali.dexlib2.iface.reference.FieldReference +import com.android.tools.smali.dexlib2.iface.value.EnumEncodedValue class MutableEnumEncodedValue(enumEncodedValue: EnumEncodedValue) : BaseEnumEncodedValue(), MutableEncodedValue { private var value = enumEncodedValue.value diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableFieldEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableFieldEncodedValue.kt index 451e46c..1a2d87c 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableFieldEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableFieldEncodedValue.kt @@ -1,9 +1,9 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.ValueType -import org.jf.dexlib2.base.value.BaseFieldEncodedValue -import org.jf.dexlib2.iface.reference.FieldReference -import org.jf.dexlib2.iface.value.FieldEncodedValue +import com.android.tools.smali.dexlib2.ValueType +import com.android.tools.smali.dexlib2.base.value.BaseFieldEncodedValue +import com.android.tools.smali.dexlib2.iface.reference.FieldReference +import com.android.tools.smali.dexlib2.iface.value.FieldEncodedValue class MutableFieldEncodedValue(fieldEncodedValue: FieldEncodedValue) : BaseFieldEncodedValue(), MutableEncodedValue { private var value = fieldEncodedValue.value diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableFloatEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableFloatEncodedValue.kt index 0f82a90..e66a130 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableFloatEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableFloatEncodedValue.kt @@ -1,7 +1,7 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.base.value.BaseFloatEncodedValue -import org.jf.dexlib2.iface.value.FloatEncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseFloatEncodedValue +import com.android.tools.smali.dexlib2.iface.value.FloatEncodedValue class MutableFloatEncodedValue(floatEncodedValue: FloatEncodedValue) : BaseFloatEncodedValue(), MutableEncodedValue { private var value = floatEncodedValue.value diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableIntEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableIntEncodedValue.kt index 87b7724..ae81472 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableIntEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableIntEncodedValue.kt @@ -1,7 +1,7 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.base.value.BaseIntEncodedValue -import org.jf.dexlib2.iface.value.IntEncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseIntEncodedValue +import com.android.tools.smali.dexlib2.iface.value.IntEncodedValue class MutableIntEncodedValue(intEncodedValue: IntEncodedValue) : BaseIntEncodedValue(), MutableEncodedValue { private var value = intEncodedValue.value diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableLongEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableLongEncodedValue.kt index 2c4b10e..cc4194b 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableLongEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableLongEncodedValue.kt @@ -1,7 +1,7 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.base.value.BaseLongEncodedValue -import org.jf.dexlib2.iface.value.LongEncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseLongEncodedValue +import com.android.tools.smali.dexlib2.iface.value.LongEncodedValue class MutableLongEncodedValue(longEncodedValue: LongEncodedValue) : BaseLongEncodedValue(), MutableEncodedValue { private var value = longEncodedValue.value diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodEncodedValue.kt index 8eb7ec8..d66ccee 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodEncodedValue.kt @@ -1,8 +1,8 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.base.value.BaseMethodEncodedValue -import org.jf.dexlib2.iface.reference.MethodReference -import org.jf.dexlib2.iface.value.MethodEncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseMethodEncodedValue +import com.android.tools.smali.dexlib2.iface.reference.MethodReference +import com.android.tools.smali.dexlib2.iface.value.MethodEncodedValue class MutableMethodEncodedValue(methodEncodedValue: MethodEncodedValue) : BaseMethodEncodedValue(), MutableEncodedValue { diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodHandleEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodHandleEncodedValue.kt index 5fd0571..cbcfac5 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodHandleEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodHandleEncodedValue.kt @@ -1,8 +1,8 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.base.value.BaseMethodHandleEncodedValue -import org.jf.dexlib2.iface.reference.MethodHandleReference -import org.jf.dexlib2.iface.value.MethodHandleEncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseMethodHandleEncodedValue +import com.android.tools.smali.dexlib2.iface.reference.MethodHandleReference +import com.android.tools.smali.dexlib2.iface.value.MethodHandleEncodedValue class MutableMethodHandleEncodedValue(methodHandleEncodedValue: MethodHandleEncodedValue) : BaseMethodHandleEncodedValue(), diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodTypeEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodTypeEncodedValue.kt index 0c7dda7..d11e517 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodTypeEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodTypeEncodedValue.kt @@ -1,8 +1,8 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.base.value.BaseMethodTypeEncodedValue -import org.jf.dexlib2.iface.reference.MethodProtoReference -import org.jf.dexlib2.iface.value.MethodTypeEncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseMethodTypeEncodedValue +import com.android.tools.smali.dexlib2.iface.reference.MethodProtoReference +import com.android.tools.smali.dexlib2.iface.value.MethodTypeEncodedValue class MutableMethodTypeEncodedValue(methodTypeEncodedValue: MethodTypeEncodedValue) : BaseMethodTypeEncodedValue(), MutableEncodedValue { diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableNullEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableNullEncodedValue.kt index 339bd27..b4305fa 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableNullEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableNullEncodedValue.kt @@ -1,7 +1,7 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.base.value.BaseNullEncodedValue -import org.jf.dexlib2.iface.value.ByteEncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseNullEncodedValue +import com.android.tools.smali.dexlib2.iface.value.ByteEncodedValue class MutableNullEncodedValue : BaseNullEncodedValue(), MutableEncodedValue { companion object { diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableShortEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableShortEncodedValue.kt index 8b5af29..36a2465 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableShortEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableShortEncodedValue.kt @@ -1,7 +1,7 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.base.value.BaseShortEncodedValue -import org.jf.dexlib2.iface.value.ShortEncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseShortEncodedValue +import com.android.tools.smali.dexlib2.iface.value.ShortEncodedValue class MutableShortEncodedValue(shortEncodedValue: ShortEncodedValue) : BaseShortEncodedValue(), MutableEncodedValue { private var value = shortEncodedValue.value diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableStringEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableStringEncodedValue.kt index e2a839b..351924a 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableStringEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableStringEncodedValue.kt @@ -1,8 +1,8 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.base.value.BaseStringEncodedValue -import org.jf.dexlib2.iface.value.ByteEncodedValue -import org.jf.dexlib2.iface.value.StringEncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseStringEncodedValue +import com.android.tools.smali.dexlib2.iface.value.ByteEncodedValue +import com.android.tools.smali.dexlib2.iface.value.StringEncodedValue class MutableStringEncodedValue(stringEncodedValue: StringEncodedValue) : BaseStringEncodedValue(), MutableEncodedValue { diff --git a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableTypeEncodedValue.kt b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableTypeEncodedValue.kt index 37bb86b..a3b27c7 100644 --- a/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableTypeEncodedValue.kt +++ b/src/main/kotlin/app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableTypeEncodedValue.kt @@ -1,7 +1,7 @@ package app.revanced.patcher.util.proxy.mutableTypes.encodedValue -import org.jf.dexlib2.base.value.BaseTypeEncodedValue -import org.jf.dexlib2.iface.value.TypeEncodedValue +import com.android.tools.smali.dexlib2.base.value.BaseTypeEncodedValue +import com.android.tools.smali.dexlib2.iface.value.TypeEncodedValue class MutableTypeEncodedValue(typeEncodedValue: TypeEncodedValue) : BaseTypeEncodedValue(), MutableEncodedValue { private var value = typeEncodedValue.value diff --git a/src/main/kotlin/app/revanced/patcher/util/smali/ExternalLabel.kt b/src/main/kotlin/app/revanced/patcher/util/smali/ExternalLabel.kt index 971f8e9..e336de6 100644 --- a/src/main/kotlin/app/revanced/patcher/util/smali/ExternalLabel.kt +++ b/src/main/kotlin/app/revanced/patcher/util/smali/ExternalLabel.kt @@ -1,6 +1,6 @@ package app.revanced.patcher.util.smali -import org.jf.dexlib2.iface.instruction.Instruction +import com.android.tools.smali.dexlib2.iface.instruction.Instruction /** * A class that represents a label for an instruction. diff --git a/src/main/kotlin/app/revanced/patcher/util/smali/InlineSmaliCompiler.kt b/src/main/kotlin/app/revanced/patcher/util/smali/InlineSmaliCompiler.kt index 9c7f097..c1931c0 100644 --- a/src/main/kotlin/app/revanced/patcher/util/smali/InlineSmaliCompiler.kt +++ b/src/main/kotlin/app/revanced/patcher/util/smali/InlineSmaliCompiler.kt @@ -4,14 +4,14 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import org.antlr.runtime.CommonTokenStream import org.antlr.runtime.TokenSource import org.antlr.runtime.tree.CommonTreeNodeStream -import org.jf.dexlib2.AccessFlags -import org.jf.dexlib2.Opcodes -import org.jf.dexlib2.builder.BuilderInstruction -import org.jf.dexlib2.writer.builder.DexBuilder -import org.jf.smali.LexerErrorInterface -import org.jf.smali.smaliFlexLexer -import org.jf.smali.smaliParser -import org.jf.smali.smaliTreeWalker +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.Opcodes +import com.android.tools.smali.dexlib2.builder.BuilderInstruction +import com.android.tools.smali.dexlib2.writer.builder.DexBuilder +import com.android.tools.smali.smali.LexerErrorInterface +import com.android.tools.smali.smali.smaliFlexLexer +import com.android.tools.smali.smali.smaliParser +import com.android.tools.smali.smali.smaliTreeWalker import java.io.InputStreamReader private const val METHOD_TEMPLATE = """ diff --git a/src/test/kotlin/app/revanced/patcher/extensions/InstructionExtensionsTest.kt b/src/test/kotlin/app/revanced/patcher/extensions/InstructionExtensionsTest.kt index be77fcc..feed3aa 100644 --- a/src/test/kotlin/app/revanced/patcher/extensions/InstructionExtensionsTest.kt +++ b/src/test/kotlin/app/revanced/patcher/extensions/InstructionExtensionsTest.kt @@ -11,13 +11,13 @@ import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable import app.revanced.patcher.util.smali.ExternalLabel -import org.jf.dexlib2.AccessFlags -import org.jf.dexlib2.Opcode -import org.jf.dexlib2.builder.BuilderOffsetInstruction -import org.jf.dexlib2.builder.MutableMethodImplementation -import org.jf.dexlib2.builder.instruction.BuilderInstruction21s -import org.jf.dexlib2.iface.instruction.OneRegisterInstruction -import org.jf.dexlib2.immutable.ImmutableMethod +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.builder.BuilderOffsetInstruction +import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation +import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21s +import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction +import com.android.tools.smali.dexlib2.immutable.ImmutableMethod import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/app/revanced/patcher/usage/bytecode/ExampleBytecodePatch.kt b/src/test/kotlin/app/revanced/patcher/usage/bytecode/ExampleBytecodePatch.kt index f3bf0fc..f5697eb 100644 --- a/src/test/kotlin/app/revanced/patcher/usage/bytecode/ExampleBytecodePatch.kt +++ b/src/test/kotlin/app/revanced/patcher/usage/bytecode/ExampleBytecodePatch.kt @@ -15,20 +15,20 @@ import app.revanced.patcher.usage.resource.patch.ExampleResourcePatch import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMutable import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable import com.google.common.collect.ImmutableList -import org.jf.dexlib2.AccessFlags -import org.jf.dexlib2.Format -import org.jf.dexlib2.Opcode -import org.jf.dexlib2.builder.MutableMethodImplementation -import org.jf.dexlib2.builder.instruction.BuilderInstruction11x -import org.jf.dexlib2.builder.instruction.BuilderInstruction21c -import org.jf.dexlib2.iface.instruction.formats.Instruction21c -import org.jf.dexlib2.immutable.ImmutableField -import org.jf.dexlib2.immutable.ImmutableMethod -import org.jf.dexlib2.immutable.ImmutableMethodImplementation -import org.jf.dexlib2.immutable.reference.ImmutableFieldReference -import org.jf.dexlib2.immutable.reference.ImmutableStringReference -import org.jf.dexlib2.immutable.value.ImmutableFieldEncodedValue -import org.jf.dexlib2.util.Preconditions +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.Format +import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation +import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction11x +import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21c +import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c +import com.android.tools.smali.dexlib2.immutable.ImmutableField +import com.android.tools.smali.dexlib2.immutable.ImmutableMethod +import com.android.tools.smali.dexlib2.immutable.ImmutableMethodImplementation +import com.android.tools.smali.dexlib2.immutable.reference.ImmutableFieldReference +import com.android.tools.smali.dexlib2.immutable.reference.ImmutableStringReference +import com.android.tools.smali.dexlib2.immutable.value.ImmutableFieldEncodedValue +import com.android.tools.smali.dexlib2.util.Preconditions @Patch @Name("example-bytecode-patch") diff --git a/src/test/kotlin/app/revanced/patcher/usage/bytecode/ExampleFingerprint.kt b/src/test/kotlin/app/revanced/patcher/usage/bytecode/ExampleFingerprint.kt index e87b651..3cb5b06 100644 --- a/src/test/kotlin/app/revanced/patcher/usage/bytecode/ExampleFingerprint.kt +++ b/src/test/kotlin/app/revanced/patcher/usage/bytecode/ExampleFingerprint.kt @@ -2,8 +2,8 @@ package app.revanced.patcher.usage.bytecode import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint -import org.jf.dexlib2.AccessFlags -import org.jf.dexlib2.Opcode +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.Opcode @FuzzyPatternScanMethod(2) object ExampleFingerprint : MethodFingerprint( diff --git a/src/test/kotlin/app/revanced/patcher/util/smali/InlineSmaliCompilerTest.kt b/src/test/kotlin/app/revanced/patcher/util/smali/InlineSmaliCompilerTest.kt index ddd14ff..08b0393 100644 --- a/src/test/kotlin/app/revanced/patcher/util/smali/InlineSmaliCompilerTest.kt +++ b/src/test/kotlin/app/revanced/patcher/util/smali/InlineSmaliCompilerTest.kt @@ -5,14 +5,14 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWith import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.newLabel import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable -import org.jf.dexlib2.AccessFlags -import org.jf.dexlib2.Opcode -import org.jf.dexlib2.builder.BuilderInstruction -import org.jf.dexlib2.builder.MutableMethodImplementation -import org.jf.dexlib2.builder.instruction.BuilderInstruction21c -import org.jf.dexlib2.builder.instruction.BuilderInstruction21t -import org.jf.dexlib2.immutable.ImmutableMethod -import org.jf.dexlib2.immutable.reference.ImmutableStringReference +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.builder.BuilderInstruction +import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation +import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21c +import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21t +import com.android.tools.smali.dexlib2.immutable.ImmutableMethod +import com.android.tools.smali.dexlib2.immutable.reference.ImmutableStringReference import java.util.* import kotlin.test.Test import kotlin.test.assertEquals