From 445603145979a6f67823a79f9d6cd140299cff37 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sat, 14 Oct 2023 19:09:05 +0200 Subject: [PATCH] feat: Remove patch annotation processor Unfortunately processing annotations required generating new classes which turned out to be quite cumbersome to work with, especially when trying to publish an API. Therefor, the patch annotation retention is now `RUNTIME`. BREAKING CHANGE: Various patch constructor signatures have changed. --- api/revanced-patcher.api | 914 ++++++++++++++++++ build.gradle.kts | 3 +- gradle/libs.versions.toml | 8 - .../revanced-patch-annotation-processor.api | 24 - .../build.gradle.kts | 45 - .../settings.gradle.kts | 2 - .../annotation/processor/PatchProcessor.kt | 207 ---- .../processor/PatchProcessorProvider.kt | 9 - ...ols.ksp.processing.SymbolProcessorProvider | 1 - .../processor/TestPatchAnnotationProcessor.kt | 147 --- .../samples/dependencies/DependencyPatch.kt | 10 - .../samples/dependencies/DependentPatch.kt | 12 - .../manualdependency/DependencyPatch.kt | 10 - .../manualdependency/DependentPatch.kt | 17 - .../samples/null/NullPropertiesPatch.kt | 14 - .../processor/samples/options/OptionsPatch.kt | 19 - .../samples/processing/ProcessablePatch.kt | 10 - revanced-patcher/build.gradle.kts | 1 - .../revanced/patcher/patch/BytecodePatch.kt | 18 +- .../app/revanced/patcher/patch/Patch.kt | 69 +- .../revanced/patcher/patch/ResourcePatch.kt | 18 +- .../patch/annotation/PatchAnnotations.kt | 1 - settings.gradle.kts | 2 +- 23 files changed, 971 insertions(+), 590 deletions(-) delete mode 100644 revanced-patch-annotation-processor/api/revanced-patch-annotation-processor.api delete mode 100644 revanced-patch-annotation-processor/build.gradle.kts delete mode 100644 revanced-patch-annotation-processor/settings.gradle.kts delete mode 100644 revanced-patch-annotation-processor/src/main/kotlin/app/revanced/patcher/patch/annotation/processor/PatchProcessor.kt delete mode 100644 revanced-patch-annotation-processor/src/main/kotlin/app/revanced/patcher/patch/annotation/processor/PatchProcessorProvider.kt delete mode 100644 revanced-patch-annotation-processor/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider delete mode 100644 revanced-patch-annotation-processor/src/test/kotlin/app/revanced/patcher/patch/annotation/processor/TestPatchAnnotationProcessor.kt delete mode 100644 revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/dependencies/DependencyPatch.kt delete mode 100644 revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/dependencies/DependentPatch.kt delete mode 100644 revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/limitations/manualdependency/DependencyPatch.kt delete mode 100644 revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/limitations/manualdependency/DependentPatch.kt delete mode 100644 revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/null/NullPropertiesPatch.kt delete mode 100644 revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/options/OptionsPatch.kt delete mode 100644 revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/processing/ProcessablePatch.kt rename {revanced-patch-annotation-processor => revanced-patcher}/src/main/kotlin/app/revanced/patcher/patch/annotation/PatchAnnotations.kt (97%) diff --git a/api/revanced-patcher.api b/api/revanced-patcher.api index e69de29..d727f2d 100644 --- a/api/revanced-patcher.api +++ b/api/revanced-patcher.api @@ -0,0 +1,914 @@ +public abstract interface class app/revanced/patcher/IntegrationsConsumer { + public abstract fun acceptIntegrations (Ljava/util/List;)V +} + +public final class app/revanced/patcher/PackageMetadata { + public final fun getPackageName ()Ljava/lang/String; + public final fun getPackageVersion ()Ljava/lang/String; +} + +public abstract class app/revanced/patcher/PatchBundleLoader : java/util/Set, kotlin/jvm/internal/markers/KMappedMarker { + public synthetic fun (Ljava/lang/ClassLoader;[Ljava/io/File;Lkotlin/jvm/functions/Function1;Ljava/util/Set;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun add (Lapp/revanced/patcher/patch/Patch;)Z + public synthetic fun add (Ljava/lang/Object;)Z + public fun addAll (Ljava/util/Collection;)Z + public fun clear ()V + public fun contains (Lapp/revanced/patcher/patch/Patch;)Z + public final fun contains (Ljava/lang/Object;)Z + public fun containsAll (Ljava/util/Collection;)Z + public fun getSize ()I + public fun isEmpty ()Z + public fun iterator ()Ljava/util/Iterator; + public fun remove (Ljava/lang/Object;)Z + public fun removeAll (Ljava/util/Collection;)Z + public fun retainAll (Ljava/util/Collection;)Z + public final fun size ()I + public fun toArray ()[Ljava/lang/Object; + public fun toArray ([Ljava/lang/Object;)[Ljava/lang/Object; +} + +public final class app/revanced/patcher/PatchBundleLoader$Dex : app/revanced/patcher/PatchBundleLoader { + public fun ([Ljava/io/File;)V + public fun ([Ljava/io/File;Ljava/io/File;)V + public synthetic fun ([Ljava/io/File;Ljava/io/File;ILkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class app/revanced/patcher/PatchBundleLoader$Jar : app/revanced/patcher/PatchBundleLoader { + public fun ([Ljava/io/File;)V +} + +public abstract interface class app/revanced/patcher/PatchExecutorFunction : java/util/function/Function { +} + +public final class app/revanced/patcher/Patcher : app/revanced/patcher/IntegrationsConsumer, app/revanced/patcher/PatchExecutorFunction, app/revanced/patcher/PatchesConsumer, java/io/Closeable, java/util/function/Supplier { + public fun (Lapp/revanced/patcher/PatcherOptions;)V + public fun acceptIntegrations (Ljava/util/List;)V + public fun acceptPatches (Ljava/util/List;)V + public synthetic fun apply (Ljava/lang/Object;)Ljava/lang/Object; + public fun apply (Z)Lkotlinx/coroutines/flow/Flow; + public fun close ()V + public fun get ()Lapp/revanced/patcher/PatcherResult; + public synthetic fun get ()Ljava/lang/Object; + public final fun getContext ()Lapp/revanced/patcher/PatcherContext; +} + +public final class app/revanced/patcher/PatcherContext { + public final fun getPackageMetadata ()Lapp/revanced/patcher/PackageMetadata; +} + +public abstract class app/revanced/patcher/PatcherException : java/lang/Exception { + public synthetic fun (Ljava/lang/String;Ljava/lang/Throwable;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class app/revanced/patcher/PatcherException$CircularDependencyException : app/revanced/patcher/PatcherException { +} + +public final class app/revanced/patcher/PatcherOptions { + public fun (Ljava/io/File;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;)V + public synthetic fun (Ljava/io/File;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ljava/io/File;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;Z)V + public synthetic fun (Ljava/io/File;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun copy (Ljava/io/File;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;Z)Lapp/revanced/patcher/PatcherOptions; + public static synthetic fun copy$default (Lapp/revanced/patcher/PatcherOptions;Ljava/io/File;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Lapp/revanced/patcher/PatcherOptions; + public fun equals (Ljava/lang/Object;)Z + public fun hashCode ()I + public final fun recreateResourceCacheDirectory ()Ljava/io/File; + public fun toString ()Ljava/lang/String; +} + +public final class app/revanced/patcher/PatcherResult { + public fun (Ljava/util/List;Ljava/io/File;Ljava/util/List;)V + public synthetic fun (Ljava/util/List;Ljava/io/File;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/util/List; + public final fun component2 ()Ljava/io/File; + public final fun component3 ()Ljava/util/List; + public final fun copy (Ljava/util/List;Ljava/io/File;Ljava/util/List;)Lapp/revanced/patcher/PatcherResult; + public static synthetic fun copy$default (Lapp/revanced/patcher/PatcherResult;Ljava/util/List;Ljava/io/File;Ljava/util/List;ILjava/lang/Object;)Lapp/revanced/patcher/PatcherResult; + public fun equals (Ljava/lang/Object;)Z + public final fun getDexFiles ()Ljava/util/List; + public final fun getDoNotCompress ()Ljava/util/List; + public final fun getResourceFile ()Ljava/io/File; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class app/revanced/patcher/PatcherResult$PatchedDexFile { + public fun (Ljava/lang/String;Ljava/io/InputStream;)V + public final fun getName ()Ljava/lang/String; + public final fun getStream ()Ljava/io/InputStream; +} + +public abstract interface class app/revanced/patcher/PatchesConsumer { + public abstract fun acceptPatches (Ljava/util/List;)V +} + +public final class app/revanced/patcher/data/BytecodeContext : app/revanced/patcher/data/Context { + public final fun findClass (Ljava/lang/String;)Lapp/revanced/patcher/util/proxy/ClassProxy; + public final fun findClass (Lkotlin/jvm/functions/Function1;)Lapp/revanced/patcher/util/proxy/ClassProxy; + public synthetic fun get ()Ljava/lang/Object; + public fun get ()Ljava/util/List; + public final fun getClasses ()Lapp/revanced/patcher/util/ProxyClassList; + public final fun proxy (Lcom/android/tools/smali/dexlib2/iface/ClassDef;)Lapp/revanced/patcher/util/proxy/ClassProxy; + public final fun toMethodWalker (Lcom/android/tools/smali/dexlib2/iface/Method;)Lapp/revanced/patcher/util/method/MethodWalker; +} + +public abstract interface class app/revanced/patcher/data/Context : java/util/function/Supplier { +} + +public final class app/revanced/patcher/data/ResourceContext : app/revanced/patcher/data/Context, java/lang/Iterable, kotlin/jvm/internal/markers/KMappedMarker { + public fun get ()Ljava/io/File; + public synthetic fun get ()Ljava/lang/Object; + public final fun get (Ljava/lang/String;)Ljava/io/File; + public final fun getXmlEditor ()Lapp/revanced/patcher/data/ResourceContext$XmlFileHolder; + public fun iterator ()Ljava/util/Iterator; +} + +public final class app/revanced/patcher/data/ResourceContext$XmlFileHolder { + public fun (Lapp/revanced/patcher/data/ResourceContext;)V + public final fun get (Ljava/io/InputStream;)Lapp/revanced/patcher/util/DomFileEditor; + public final fun get (Ljava/lang/String;)Lapp/revanced/patcher/util/DomFileEditor; +} + +public final class app/revanced/patcher/extensions/ExtensionsKt { + public static final fun newLabel (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;I)Lcom/android/tools/smali/dexlib2/builder/Label; + public static final fun or (ILcom/android/tools/smali/dexlib2/AccessFlags;)I + public static final fun or (Lcom/android/tools/smali/dexlib2/AccessFlags;I)I + public static final fun or (Lcom/android/tools/smali/dexlib2/AccessFlags;Lcom/android/tools/smali/dexlib2/AccessFlags;)I +} + +public final class app/revanced/patcher/extensions/InstructionExtensions { + public static final field INSTANCE Lapp/revanced/patcher/extensions/InstructionExtensions; + public final fun addInstruction (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;ILcom/android/tools/smali/dexlib2/builder/BuilderInstruction;)V + public final fun addInstruction (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;ILjava/lang/String;)V + public final fun addInstruction (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;Lcom/android/tools/smali/dexlib2/builder/BuilderInstruction;)V + public final fun addInstruction (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;Ljava/lang/String;)V + public final fun addInstructions (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;ILjava/lang/String;)V + public final fun addInstructions (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;ILjava/util/List;)V + public final fun addInstructions (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;Ljava/lang/String;)V + public final fun addInstructions (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;Ljava/util/List;)V + public final fun addInstructions (Lcom/android/tools/smali/dexlib2/builder/MutableMethodImplementation;ILjava/util/List;)V + public final fun addInstructions (Lcom/android/tools/smali/dexlib2/builder/MutableMethodImplementation;Ljava/util/List;)V + public final fun addInstructionsWithLabels (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;ILjava/lang/String;[Lapp/revanced/patcher/util/smali/ExternalLabel;)V + public final fun getInstruction (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;I)Lcom/android/tools/smali/dexlib2/builder/BuilderInstruction; + public final fun getInstruction (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;I)Ljava/lang/Object; + public final fun getInstruction (Lcom/android/tools/smali/dexlib2/builder/MutableMethodImplementation;I)Lcom/android/tools/smali/dexlib2/builder/BuilderInstruction; + public final fun getInstruction (Lcom/android/tools/smali/dexlib2/builder/MutableMethodImplementation;I)Ljava/lang/Object; + public final fun getInstructions (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;)Ljava/util/List; + public final fun removeInstruction (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;I)V + public final fun removeInstructions (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;I)V + public final fun removeInstructions (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;II)V + public final fun removeInstructions (Lcom/android/tools/smali/dexlib2/builder/MutableMethodImplementation;I)V + public final fun removeInstructions (Lcom/android/tools/smali/dexlib2/builder/MutableMethodImplementation;II)V + public final fun replaceInstruction (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;ILcom/android/tools/smali/dexlib2/builder/BuilderInstruction;)V + public final fun replaceInstruction (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;ILjava/lang/String;)V + public final fun replaceInstructions (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;ILjava/lang/String;)V + public final fun replaceInstructions (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;ILjava/util/List;)V + public final fun replaceInstructions (Lcom/android/tools/smali/dexlib2/builder/MutableMethodImplementation;ILjava/util/List;)V +} + +public final class app/revanced/patcher/extensions/MethodFingerprintExtensions { + public static final field INSTANCE Lapp/revanced/patcher/extensions/MethodFingerprintExtensions; + public final fun getFuzzyPatternScanMethod (Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprint;)Lapp/revanced/patcher/fingerprint/method/annotation/FuzzyPatternScanMethod; +} + +public abstract interface class app/revanced/patcher/fingerprint/Fingerprint { +} + +public abstract interface annotation class app/revanced/patcher/fingerprint/method/annotation/FuzzyPatternScanMethod : java/lang/annotation/Annotation { + public abstract fun threshold ()I +} + +public abstract class app/revanced/patcher/fingerprint/method/impl/MethodFingerprint : app/revanced/patcher/fingerprint/Fingerprint { + public static final field Companion Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprint$Companion; + public fun ()V + public fun (Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Iterable;Ljava/lang/Iterable;Ljava/lang/Iterable;Lkotlin/jvm/functions/Function2;)V + public synthetic fun (Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Iterable;Ljava/lang/Iterable;Ljava/lang/Iterable;Lkotlin/jvm/functions/Function2;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun getResult ()Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult; + public final fun setResult (Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult;)V +} + +public final class app/revanced/patcher/fingerprint/method/impl/MethodFingerprint$Companion { + public final fun resolve (Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprint;Lapp/revanced/patcher/data/BytecodeContext;Lcom/android/tools/smali/dexlib2/iface/ClassDef;)Z + public final fun resolve (Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprint;Lapp/revanced/patcher/data/BytecodeContext;Lcom/android/tools/smali/dexlib2/iface/Method;Lcom/android/tools/smali/dexlib2/iface/ClassDef;)Z + public final fun resolve (Ljava/lang/Iterable;Lapp/revanced/patcher/data/BytecodeContext;Ljava/lang/Iterable;)V +} + +public final class app/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult { + public fun (Lcom/android/tools/smali/dexlib2/iface/Method;Lcom/android/tools/smali/dexlib2/iface/ClassDef;Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult;Lapp/revanced/patcher/data/BytecodeContext;)V + public final fun component1 ()Lcom/android/tools/smali/dexlib2/iface/Method; + public final fun component2 ()Lcom/android/tools/smali/dexlib2/iface/ClassDef; + public final fun component3 ()Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult; + public final fun copy (Lcom/android/tools/smali/dexlib2/iface/Method;Lcom/android/tools/smali/dexlib2/iface/ClassDef;Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult;Lapp/revanced/patcher/data/BytecodeContext;)Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult; + public static synthetic fun copy$default (Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult;Lcom/android/tools/smali/dexlib2/iface/Method;Lcom/android/tools/smali/dexlib2/iface/ClassDef;Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult;Lapp/revanced/patcher/data/BytecodeContext;ILjava/lang/Object;)Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult; + public fun equals (Ljava/lang/Object;)Z + public final fun getClassDef ()Lcom/android/tools/smali/dexlib2/iface/ClassDef; + public final fun getMethod ()Lcom/android/tools/smali/dexlib2/iface/Method; + public final fun getMutableClass ()Lapp/revanced/patcher/util/proxy/mutableTypes/MutableClass; + public final fun getMutableMethod ()Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod; + public final fun getScanResult ()Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class app/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult { + public fun (Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$PatternScanResult;Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$StringsScanResult;)V + public final fun component1 ()Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$PatternScanResult; + public final fun component2 ()Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$StringsScanResult; + public final fun copy (Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$PatternScanResult;Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$StringsScanResult;)Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult; + public static synthetic fun copy$default (Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult;Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$PatternScanResult;Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$StringsScanResult;ILjava/lang/Object;)Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult; + public fun equals (Ljava/lang/Object;)Z + public final fun getPatternScanResult ()Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$PatternScanResult; + public final fun getStringsScanResult ()Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$StringsScanResult; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class app/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$PatternScanResult { + public fun (IILjava/util/List;)V + public synthetic fun (IILjava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()I + public final fun component2 ()I + public final fun component3 ()Ljava/util/List; + public final fun copy (IILjava/util/List;)Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$PatternScanResult; + public static synthetic fun copy$default (Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$PatternScanResult;IILjava/util/List;ILjava/lang/Object;)Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$PatternScanResult; + public fun equals (Ljava/lang/Object;)Z + public final fun getEndIndex ()I + public final fun getStartIndex ()I + public final fun getWarnings ()Ljava/util/List; + public fun hashCode ()I + public final fun setWarnings (Ljava/util/List;)V + public fun toString ()Ljava/lang/String; +} + +public final class app/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$PatternScanResult$Warning { + public fun (Lcom/android/tools/smali/dexlib2/Opcode;Lcom/android/tools/smali/dexlib2/Opcode;II)V + public final fun component1 ()Lcom/android/tools/smali/dexlib2/Opcode; + public final fun component2 ()Lcom/android/tools/smali/dexlib2/Opcode; + public final fun component3 ()I + public final fun component4 ()I + public final fun copy (Lcom/android/tools/smali/dexlib2/Opcode;Lcom/android/tools/smali/dexlib2/Opcode;II)Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$PatternScanResult$Warning; + public static synthetic fun copy$default (Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$PatternScanResult$Warning;Lcom/android/tools/smali/dexlib2/Opcode;Lcom/android/tools/smali/dexlib2/Opcode;IIILjava/lang/Object;)Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$PatternScanResult$Warning; + public fun equals (Ljava/lang/Object;)Z + public final fun getCorrectOpcode ()Lcom/android/tools/smali/dexlib2/Opcode; + public final fun getInstructionIndex ()I + public final fun getPatternIndex ()I + public final fun getWrongOpcode ()Lcom/android/tools/smali/dexlib2/Opcode; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class app/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$StringsScanResult { + public fun (Ljava/util/List;)V + public final fun component1 ()Ljava/util/List; + public final fun copy (Ljava/util/List;)Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$StringsScanResult; + public static synthetic fun copy$default (Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$StringsScanResult;Ljava/util/List;ILjava/lang/Object;)Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$StringsScanResult; + public fun equals (Ljava/lang/Object;)Z + public final fun getMatches ()Ljava/util/List; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class app/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$StringsScanResult$StringMatch { + public fun (Ljava/lang/String;I)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()I + public final fun copy (Ljava/lang/String;I)Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$StringsScanResult$StringMatch; + public static synthetic fun copy$default (Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$StringsScanResult$StringMatch;Ljava/lang/String;IILjava/lang/Object;)Lapp/revanced/patcher/fingerprint/method/impl/MethodFingerprintResult$MethodFingerprintScanResult$StringsScanResult$StringMatch; + public fun equals (Ljava/lang/Object;)Z + public final fun getIndex ()I + public final fun getString ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public abstract interface class app/revanced/patcher/logging/Logger { + public abstract fun error (Ljava/lang/String;)V + public abstract fun info (Ljava/lang/String;)V + public abstract fun trace (Ljava/lang/String;)V + public abstract fun warn (Ljava/lang/String;)V +} + +public final class app/revanced/patcher/logging/Logger$DefaultImpls { + public static fun error (Lapp/revanced/patcher/logging/Logger;Ljava/lang/String;)V + public static fun info (Lapp/revanced/patcher/logging/Logger;Ljava/lang/String;)V + public static fun trace (Lapp/revanced/patcher/logging/Logger;Ljava/lang/String;)V + public static fun warn (Lapp/revanced/patcher/logging/Logger;Ljava/lang/String;)V +} + +public final class app/revanced/patcher/logging/impl/NopLogger : app/revanced/patcher/logging/Logger { + public static final field INSTANCE Lapp/revanced/patcher/logging/impl/NopLogger; + public fun error (Ljava/lang/String;)V + public fun info (Ljava/lang/String;)V + public fun trace (Ljava/lang/String;)V + public fun warn (Ljava/lang/String;)V +} + +public abstract class app/revanced/patcher/patch/BytecodePatch : app/revanced/patcher/patch/Patch { + public fun ()V + public fun (Ljava/util/Set;)V + public synthetic fun (Ljava/util/Set;ILkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public abstract class app/revanced/patcher/patch/Patch { + public fun equals (Ljava/lang/Object;)Z + public abstract fun execute (Lapp/revanced/patcher/data/Context;)V + public final fun getCompatiblePackages ()Ljava/util/Set; + public final fun getDependencies ()Ljava/util/Set; + public final fun getDescription ()Ljava/lang/String; + public final fun getName ()Ljava/lang/String; + public final fun getOptions ()Lapp/revanced/patcher/patch/options/PatchOptions; + public final fun getRequiresIntegrations ()Z + public final fun getUse ()Z + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class app/revanced/patcher/patch/Patch$CompatiblePackage { + public fun (Ljava/lang/String;Ljava/util/Set;)V + public synthetic fun (Ljava/lang/String;Ljava/util/Set;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun getName ()Ljava/lang/String; + public final fun getVersions ()Ljava/util/Set; +} + +public final class app/revanced/patcher/patch/PatchException : java/lang/Exception { + public fun (Ljava/lang/String;)V + public fun (Ljava/lang/String;Ljava/lang/Throwable;)V + public fun (Ljava/lang/Throwable;)V +} + +public final class app/revanced/patcher/patch/PatchResult { + public final fun getException ()Lapp/revanced/patcher/patch/PatchException; + public final fun getPatch ()Lapp/revanced/patcher/patch/Patch; +} + +public abstract class app/revanced/patcher/patch/ResourcePatch : app/revanced/patcher/patch/Patch { + public fun ()V +} + +public abstract interface annotation class app/revanced/patcher/patch/annotation/CompatiblePackage : java/lang/annotation/Annotation { + public abstract fun name ()Ljava/lang/String; + public abstract fun versions ()[Ljava/lang/String; +} + +public abstract interface annotation class app/revanced/patcher/patch/annotation/Patch : java/lang/annotation/Annotation { + public abstract fun compatiblePackages ()[Lapp/revanced/patcher/patch/annotation/CompatiblePackage; + public abstract fun dependencies ()[Ljava/lang/Class; + public abstract fun description ()Ljava/lang/String; + public abstract fun name ()Ljava/lang/String; + public abstract fun requiresIntegrations ()Z + public abstract fun use ()Z +} + +public abstract class app/revanced/patcher/patch/options/PatchOption { + public fun (Ljava/lang/String;Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;)V + public final fun getDescription ()Ljava/lang/String; + public final fun getKey ()Ljava/lang/String; + public final fun getRequired ()Z + public final fun getTitle ()Ljava/lang/String; + public final fun getValidate ()Lkotlin/jvm/functions/Function1; + public final fun getValue ()Ljava/lang/Object; + public final fun getValue (Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object; + public final fun setValue (Ljava/lang/Object;)V + public final fun setValue (Ljava/lang/Object;Lkotlin/reflect/KProperty;Ljava/lang/Object;)V +} + +public abstract class app/revanced/patcher/patch/options/PatchOptionException : java/lang/Exception { + public synthetic fun (Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class app/revanced/patcher/patch/options/PatchOptionException$InvalidValueTypeException : app/revanced/patcher/patch/options/PatchOptionException { + public fun (Ljava/lang/String;Ljava/lang/String;)V +} + +public final class app/revanced/patcher/patch/options/PatchOptionException$PatchOptionNotFoundException : app/revanced/patcher/patch/options/PatchOptionException { + public fun (Ljava/lang/String;)V +} + +public final class app/revanced/patcher/patch/options/PatchOptionException$ValueRequiredException : app/revanced/patcher/patch/options/PatchOptionException { + public fun (Lapp/revanced/patcher/patch/options/PatchOption;)V +} + +public final class app/revanced/patcher/patch/options/PatchOptionException$ValueValidationException : app/revanced/patcher/patch/options/PatchOptionException { + public fun (Ljava/lang/Object;Lapp/revanced/patcher/patch/options/PatchOption;)V +} + +public final class app/revanced/patcher/patch/options/PatchOptions : java/util/Map, kotlin/jvm/internal/markers/KMutableMap { + public fun ()V + public fun clear ()V + public final fun containsKey (Ljava/lang/Object;)Z + public fun containsKey (Ljava/lang/String;)Z + public fun containsValue (Lapp/revanced/patcher/patch/options/PatchOption;)Z + public final fun containsValue (Ljava/lang/Object;)Z + public final fun entrySet ()Ljava/util/Set; + public final fun get (Ljava/lang/Object;)Lapp/revanced/patcher/patch/options/PatchOption; + public final synthetic fun get (Ljava/lang/Object;)Ljava/lang/Object; + public fun get (Ljava/lang/String;)Lapp/revanced/patcher/patch/options/PatchOption; + public fun getEntries ()Ljava/util/Set; + public fun getKeys ()Ljava/util/Set; + public fun getSize ()I + public fun getValues ()Ljava/util/Collection; + public fun isEmpty ()Z + public final fun keySet ()Ljava/util/Set; + public synthetic fun put (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; + public fun put (Ljava/lang/String;Lapp/revanced/patcher/patch/options/PatchOption;)Lapp/revanced/patcher/patch/options/PatchOption; + public fun putAll (Ljava/util/Map;)V + public final fun register (Lapp/revanced/patcher/patch/options/PatchOption;)V + public final fun remove (Ljava/lang/Object;)Lapp/revanced/patcher/patch/options/PatchOption; + public final synthetic fun remove (Ljava/lang/Object;)Ljava/lang/Object; + public fun remove (Ljava/lang/String;)Lapp/revanced/patcher/patch/options/PatchOption; + public final fun set (Ljava/lang/String;Ljava/lang/Object;)V + public final fun size ()I + public final fun values ()Ljava/util/Collection; +} + +public final class app/revanced/patcher/patch/options/types/BooleanPatchOption : app/revanced/patcher/patch/options/PatchOption { + public static final field Companion Lapp/revanced/patcher/patch/options/types/BooleanPatchOption$Companion; + public synthetic fun (Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class app/revanced/patcher/patch/options/types/BooleanPatchOption$Companion { + public final fun booleanPatchOption (Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;)Lapp/revanced/patcher/patch/options/types/BooleanPatchOption; + public static synthetic fun booleanPatchOption$default (Lapp/revanced/patcher/patch/options/types/BooleanPatchOption$Companion;Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lapp/revanced/patcher/patch/options/types/BooleanPatchOption; +} + +public final class app/revanced/patcher/patch/options/types/FloatPatchOption : app/revanced/patcher/patch/options/PatchOption { + public static final field Companion Lapp/revanced/patcher/patch/options/types/FloatPatchOption$Companion; + public synthetic fun (Ljava/lang/String;Ljava/lang/Float;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class app/revanced/patcher/patch/options/types/FloatPatchOption$Companion { + public final fun floatPatchOption (Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;Ljava/lang/Float;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;)Lapp/revanced/patcher/patch/options/types/FloatPatchOption; + public static synthetic fun floatPatchOption$default (Lapp/revanced/patcher/patch/options/types/FloatPatchOption$Companion;Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;Ljava/lang/Float;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lapp/revanced/patcher/patch/options/types/FloatPatchOption; +} + +public final class app/revanced/patcher/patch/options/types/IntPatchOption : app/revanced/patcher/patch/options/PatchOption { + public static final field Companion Lapp/revanced/patcher/patch/options/types/IntPatchOption$Companion; + public synthetic fun (Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class app/revanced/patcher/patch/options/types/IntPatchOption$Companion { + public final fun intPatchOption (Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;)Lapp/revanced/patcher/patch/options/types/IntPatchOption; + public static synthetic fun intPatchOption$default (Lapp/revanced/patcher/patch/options/types/IntPatchOption$Companion;Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lapp/revanced/patcher/patch/options/types/IntPatchOption; +} + +public final class app/revanced/patcher/patch/options/types/LongPatchOption : app/revanced/patcher/patch/options/PatchOption { + public static final field Companion Lapp/revanced/patcher/patch/options/types/LongPatchOption$Companion; + public synthetic fun (Ljava/lang/String;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class app/revanced/patcher/patch/options/types/LongPatchOption$Companion { + public final fun longPatchOption (Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;)Lapp/revanced/patcher/patch/options/types/LongPatchOption; + public static synthetic fun longPatchOption$default (Lapp/revanced/patcher/patch/options/types/LongPatchOption$Companion;Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lapp/revanced/patcher/patch/options/types/LongPatchOption; +} + +public final class app/revanced/patcher/patch/options/types/StringPatchOption : app/revanced/patcher/patch/options/PatchOption { + public static final field Companion Lapp/revanced/patcher/patch/options/types/StringPatchOption$Companion; + public synthetic fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class app/revanced/patcher/patch/options/types/StringPatchOption$Companion { + public final fun stringPatchOption (Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;)Lapp/revanced/patcher/patch/options/types/StringPatchOption; + public static synthetic fun stringPatchOption$default (Lapp/revanced/patcher/patch/options/types/StringPatchOption$Companion;Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lapp/revanced/patcher/patch/options/types/StringPatchOption; +} + +public final class app/revanced/patcher/patch/options/types/array/BooleanArrayPatchOption : app/revanced/patcher/patch/options/PatchOption { + public static final field Companion Lapp/revanced/patcher/patch/options/types/array/BooleanArrayPatchOption$Companion; + public synthetic fun (Ljava/lang/String;[Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class app/revanced/patcher/patch/options/types/array/BooleanArrayPatchOption$Companion { + public final fun booleanArrayPatchOption (Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;[Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;)Lapp/revanced/patcher/patch/options/types/array/BooleanArrayPatchOption; + public static synthetic fun booleanArrayPatchOption$default (Lapp/revanced/patcher/patch/options/types/array/BooleanArrayPatchOption$Companion;Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;[Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lapp/revanced/patcher/patch/options/types/array/BooleanArrayPatchOption; +} + +public final class app/revanced/patcher/patch/options/types/array/FloatArrayPatchOption : app/revanced/patcher/patch/options/PatchOption { + public static final field Companion Lapp/revanced/patcher/patch/options/types/array/FloatArrayPatchOption$Companion; + public synthetic fun (Ljava/lang/String;[Ljava/lang/Float;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class app/revanced/patcher/patch/options/types/array/FloatArrayPatchOption$Companion { + public final fun floatArrayPatchOption (Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;[Ljava/lang/Float;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;)Lapp/revanced/patcher/patch/options/types/array/FloatArrayPatchOption; + public static synthetic fun floatArrayPatchOption$default (Lapp/revanced/patcher/patch/options/types/array/FloatArrayPatchOption$Companion;Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;[Ljava/lang/Float;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lapp/revanced/patcher/patch/options/types/array/FloatArrayPatchOption; +} + +public final class app/revanced/patcher/patch/options/types/array/IntArrayPatchOption : app/revanced/patcher/patch/options/PatchOption { + public static final field Companion Lapp/revanced/patcher/patch/options/types/array/IntArrayPatchOption$Companion; + public synthetic fun (Ljava/lang/String;[Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class app/revanced/patcher/patch/options/types/array/IntArrayPatchOption$Companion { + public final fun intArrayPatchOption (Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;[Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;)Lapp/revanced/patcher/patch/options/types/array/IntArrayPatchOption; + public static synthetic fun intArrayPatchOption$default (Lapp/revanced/patcher/patch/options/types/array/IntArrayPatchOption$Companion;Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;[Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lapp/revanced/patcher/patch/options/types/array/IntArrayPatchOption; +} + +public final class app/revanced/patcher/patch/options/types/array/LongArrayPatchOption : app/revanced/patcher/patch/options/PatchOption { + public static final field Companion Lapp/revanced/patcher/patch/options/types/array/LongArrayPatchOption$Companion; + public synthetic fun (Ljava/lang/String;[Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class app/revanced/patcher/patch/options/types/array/LongArrayPatchOption$Companion { + public final fun longArrayPatchOption (Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;[Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;)Lapp/revanced/patcher/patch/options/types/array/LongArrayPatchOption; + public static synthetic fun longArrayPatchOption$default (Lapp/revanced/patcher/patch/options/types/array/LongArrayPatchOption$Companion;Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;[Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lapp/revanced/patcher/patch/options/types/array/LongArrayPatchOption; +} + +public final class app/revanced/patcher/patch/options/types/array/StringArrayPatchOption : app/revanced/patcher/patch/options/PatchOption { + public static final field Companion Lapp/revanced/patcher/patch/options/types/array/StringArrayPatchOption$Companion; + public synthetic fun (Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class app/revanced/patcher/patch/options/types/array/StringArrayPatchOption$Companion { + public final fun stringArrayPatchOption (Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;)Lapp/revanced/patcher/patch/options/types/array/StringArrayPatchOption; + public static synthetic fun stringArrayPatchOption$default (Lapp/revanced/patcher/patch/options/types/array/StringArrayPatchOption$Companion;Lapp/revanced/patcher/patch/Patch;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lapp/revanced/patcher/patch/options/types/array/StringArrayPatchOption; +} + +public final class app/revanced/patcher/util/DomFileEditor : java/io/Closeable { + public fun (Ljava/io/File;)V + public fun close ()V + public final fun getFile ()Lorg/w3c/dom/Document; +} + +public final class app/revanced/patcher/util/ProxyClassList : java/util/Set, kotlin/jvm/internal/markers/KMutableSet { + public final fun add (Lapp/revanced/patcher/util/proxy/ClassProxy;)Z + public fun add (Lcom/android/tools/smali/dexlib2/iface/ClassDef;)Z + public synthetic fun add (Ljava/lang/Object;)Z + public fun addAll (Ljava/util/Collection;)Z + public fun clear ()V + public fun contains (Lcom/android/tools/smali/dexlib2/iface/ClassDef;)Z + public final fun contains (Ljava/lang/Object;)Z + public fun containsAll (Ljava/util/Collection;)Z + public fun getSize ()I + public fun isEmpty ()Z + public fun iterator ()Ljava/util/Iterator; + public fun remove (Lcom/android/tools/smali/dexlib2/iface/ClassDef;)Z + public final fun remove (Ljava/lang/Object;)Z + public fun removeAll (Ljava/util/Collection;)Z + public fun retainAll (Ljava/util/Collection;)Z + public final fun size ()I + public fun toArray ()[Ljava/lang/Object; + public fun toArray ([Ljava/lang/Object;)[Ljava/lang/Object; +} + +public final class app/revanced/patcher/util/method/MethodWalker { + public final fun getMethod ()Lcom/android/tools/smali/dexlib2/iface/Method; + public final fun nextMethod (IZ)Lapp/revanced/patcher/util/method/MethodWalker; + public static synthetic fun nextMethod$default (Lapp/revanced/patcher/util/method/MethodWalker;IZILjava/lang/Object;)Lapp/revanced/patcher/util/method/MethodWalker; +} + +public final class app/revanced/patcher/util/proxy/ClassProxy { + public final fun getImmutableClass ()Lcom/android/tools/smali/dexlib2/iface/ClassDef; + public final fun getMutableClass ()Lapp/revanced/patcher/util/proxy/mutableTypes/MutableClass; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/MutableAnnotation : com/android/tools/smali/dexlib2/base/BaseAnnotation { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/MutableAnnotation$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/Annotation;)V + public fun getElements ()Ljava/util/Set; + public fun getType ()Ljava/lang/String; + public fun getVisibility ()I +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/MutableAnnotation$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/Annotation;)Lapp/revanced/patcher/util/proxy/mutableTypes/MutableAnnotation; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/MutableAnnotationElement : com/android/tools/smali/dexlib2/base/BaseAnnotationElement { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/MutableAnnotationElement$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/AnnotationElement;)V + public fun getName ()Ljava/lang/String; + public fun getValue ()Lcom/android/tools/smali/dexlib2/iface/value/EncodedValue; + public final fun setName (Ljava/lang/String;)V + public final fun setValue (Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue;)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/MutableAnnotationElement$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/AnnotationElement;)Lapp/revanced/patcher/util/proxy/mutableTypes/MutableAnnotationElement; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/MutableClass : com/android/tools/smali/dexlib2/base/reference/BaseTypeReference, com/android/tools/smali/dexlib2/iface/ClassDef { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/MutableClass$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/ClassDef;)V + public final fun charAt (I)C + public fun get (I)C + public fun getAccessFlags ()I + public fun getAnnotations ()Ljava/util/Set; + public synthetic fun getDirectMethods ()Ljava/lang/Iterable; + public fun getDirectMethods ()Ljava/util/Set; + public synthetic fun getFields ()Ljava/lang/Iterable; + public fun getFields ()Ljava/util/Set; + public synthetic fun getInstanceFields ()Ljava/lang/Iterable; + public fun getInstanceFields ()Ljava/util/Set; + public fun getInterfaces ()Ljava/util/List; + public fun getLength ()I + public synthetic fun getMethods ()Ljava/lang/Iterable; + public fun getMethods ()Ljava/util/Set; + public fun getSourceFile ()Ljava/lang/String; + public synthetic fun getStaticFields ()Ljava/lang/Iterable; + public fun getStaticFields ()Ljava/util/Set; + public fun getSuperclass ()Ljava/lang/String; + public fun getType ()Ljava/lang/String; + public synthetic fun getVirtualMethods ()Ljava/lang/Iterable; + public fun getVirtualMethods ()Ljava/util/Set; + public final fun length ()I + public final fun setAccessFlags (I)V + public final fun setSourceFile (Ljava/lang/String;)V + public final fun setSuperClass (Ljava/lang/String;)V + public final fun setType (Ljava/lang/String;)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/MutableClass$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/ClassDef;)Lapp/revanced/patcher/util/proxy/mutableTypes/MutableClass; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/MutableField : com/android/tools/smali/dexlib2/base/reference/BaseFieldReference, com/android/tools/smali/dexlib2/iface/Field { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/MutableField$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/Field;)V + public fun getAccessFlags ()I + public fun getAnnotations ()Ljava/util/Set; + public fun getDefiningClass ()Ljava/lang/String; + public fun getHiddenApiRestrictions ()Ljava/util/Set; + public fun getInitialValue ()Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue; + public synthetic fun getInitialValue ()Lcom/android/tools/smali/dexlib2/iface/value/EncodedValue; + public fun getName ()Ljava/lang/String; + public fun getType ()Ljava/lang/String; + public final fun setAccessFlags (I)V + public final fun setDefiningClass (Ljava/lang/String;)V + public final fun setInitialValue (Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue;)V + public final fun setName (Ljava/lang/String;)V + public final fun setType (Ljava/lang/String;)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/MutableField$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/Field;)Lapp/revanced/patcher/util/proxy/mutableTypes/MutableField; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/MutableMethod : com/android/tools/smali/dexlib2/base/reference/BaseMethodReference, com/android/tools/smali/dexlib2/iface/Method { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/Method;)V + public fun getAccessFlags ()I + public fun getAnnotations ()Ljava/util/Set; + public fun getDefiningClass ()Ljava/lang/String; + public fun getHiddenApiRestrictions ()Ljava/util/Set; + public fun getImplementation ()Lcom/android/tools/smali/dexlib2/builder/MutableMethodImplementation; + public synthetic fun getImplementation ()Lcom/android/tools/smali/dexlib2/iface/MethodImplementation; + public fun getName ()Ljava/lang/String; + public fun getParameterTypes ()Ljava/util/List; + public fun getParameters ()Ljava/util/List; + public fun getReturnType ()Ljava/lang/String; + public final fun setAccessFlags (I)V + public final fun setDefiningClass (Ljava/lang/String;)V + public final fun setName (Ljava/lang/String;)V + public final fun setReturnType (Ljava/lang/String;)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/MutableMethod$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/Method;)Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/MutableMethodParameter : com/android/tools/smali/dexlib2/base/BaseMethodParameter, com/android/tools/smali/dexlib2/iface/MethodParameter { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethodParameter$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/MethodParameter;)V + public final fun charAt (I)C + public fun get (I)C + public fun getAnnotations ()Ljava/util/Set; + public fun getLength ()I + public fun getName ()Ljava/lang/String; + public fun getSignature ()Ljava/lang/String; + public fun getType ()Ljava/lang/String; + public final fun length ()I +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/MutableMethodParameter$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/MethodParameter;)Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethodParameter; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableAnnotationEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseAnnotationEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableAnnotationEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/AnnotationEncodedValue;)V + public fun getElements ()Ljava/util/Set; + public fun getType ()Ljava/lang/String; + public final fun setType (Ljava/lang/String;)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableAnnotationEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/AnnotationEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableAnnotationEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableArrayEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseArrayEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableArrayEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/ArrayEncodedValue;)V + public fun getValue ()Ljava/util/List; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableArrayEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/ArrayEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableArrayEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableBooleanEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseBooleanEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableBooleanEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/BooleanEncodedValue;)V + public fun getValue ()Z + public final fun setValue (Z)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableBooleanEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/BooleanEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableBooleanEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableByteEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseByteEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableByteEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/ByteEncodedValue;)V + public fun getValue ()B + public final fun setValue (B)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableByteEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/ByteEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableByteEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableCharEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseCharEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableCharEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/CharEncodedValue;)V + public fun getValue ()C + public final fun setValue (C)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableCharEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/CharEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableCharEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableDoubleEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseDoubleEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableDoubleEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/DoubleEncodedValue;)V + public fun getValue ()D + public final fun setValue (D)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableDoubleEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/DoubleEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableDoubleEncodedValue; +} + +public abstract interface class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue : com/android/tools/smali/dexlib2/iface/value/EncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue$Companion; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/EncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEnumEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseEnumEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEnumEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/EnumEncodedValue;)V + public fun getValue ()Lcom/android/tools/smali/dexlib2/iface/reference/FieldReference; + public final fun setValue (Lcom/android/tools/smali/dexlib2/iface/reference/FieldReference;)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEnumEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/EnumEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEnumEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableFieldEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseFieldEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableFieldEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/FieldEncodedValue;)V + public fun getValue ()Lcom/android/tools/smali/dexlib2/iface/reference/FieldReference; + public fun getValueType ()I + public final fun setValue (Lcom/android/tools/smali/dexlib2/iface/reference/FieldReference;)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableFieldEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/FieldEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableFieldEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableFloatEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseFloatEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableFloatEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/FloatEncodedValue;)V + public fun getValue ()F + public final fun setValue (F)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableFloatEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/FloatEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableFloatEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableIntEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseIntEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableIntEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/IntEncodedValue;)V + public fun getValue ()I + public final fun setValue (I)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableIntEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/IntEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableIntEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableLongEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseLongEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableLongEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/LongEncodedValue;)V + public fun getValue ()J + public final fun setValue (J)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableLongEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/LongEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableLongEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseMethodEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/MethodEncodedValue;)V + public fun getValue ()Lcom/android/tools/smali/dexlib2/iface/reference/MethodReference; + public final fun setValue (Lcom/android/tools/smali/dexlib2/iface/reference/MethodReference;)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/MethodEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodHandleEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseMethodHandleEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodHandleEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/MethodHandleEncodedValue;)V + public fun getValue ()Lcom/android/tools/smali/dexlib2/iface/reference/MethodHandleReference; + public final fun setValue (Lcom/android/tools/smali/dexlib2/iface/reference/MethodHandleReference;)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodHandleEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/MethodHandleEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodHandleEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodTypeEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseMethodTypeEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodTypeEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/MethodTypeEncodedValue;)V + public fun getValue ()Lcom/android/tools/smali/dexlib2/iface/reference/MethodProtoReference; + public final fun setValue (Lcom/android/tools/smali/dexlib2/iface/reference/MethodProtoReference;)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodTypeEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/MethodTypeEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableMethodTypeEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableNullEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseNullEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableNullEncodedValue$Companion; + public fun ()V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableNullEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/ByteEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableByteEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableShortEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseShortEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableShortEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/ShortEncodedValue;)V + public fun getValue ()S + public final fun setValue (S)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableShortEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/ShortEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableShortEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableStringEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseStringEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableStringEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/StringEncodedValue;)V + public fun getValue ()Ljava/lang/String; + public final fun setValue (Ljava/lang/String;)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableStringEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/ByteEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableByteEncodedValue; +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableTypeEncodedValue : com/android/tools/smali/dexlib2/base/value/BaseTypeEncodedValue, app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableEncodedValue { + public static final field Companion Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableTypeEncodedValue$Companion; + public fun (Lcom/android/tools/smali/dexlib2/iface/value/TypeEncodedValue;)V + public fun getValue ()Ljava/lang/String; + public final fun setValue (Ljava/lang/String;)V +} + +public final class app/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableTypeEncodedValue$Companion { + public final fun toMutable (Lcom/android/tools/smali/dexlib2/iface/value/TypeEncodedValue;)Lapp/revanced/patcher/util/proxy/mutableTypes/encodedValue/MutableTypeEncodedValue; +} + +public final class app/revanced/patcher/util/smali/ExternalLabel { + public fun (Ljava/lang/String;Lcom/android/tools/smali/dexlib2/iface/instruction/Instruction;)V + public final fun copy (Ljava/lang/String;Lcom/android/tools/smali/dexlib2/iface/instruction/Instruction;)Lapp/revanced/patcher/util/smali/ExternalLabel; + public static synthetic fun copy$default (Lapp/revanced/patcher/util/smali/ExternalLabel;Ljava/lang/String;Lcom/android/tools/smali/dexlib2/iface/instruction/Instruction;ILjava/lang/Object;)Lapp/revanced/patcher/util/smali/ExternalLabel; + public fun equals (Ljava/lang/Object;)Z + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class app/revanced/patcher/util/smali/InlineSmaliCompiler { + public static final field Companion Lapp/revanced/patcher/util/smali/InlineSmaliCompiler$Companion; + public fun ()V +} + +public final class app/revanced/patcher/util/smali/InlineSmaliCompiler$Companion { + public final fun compile (Ljava/lang/String;Ljava/lang/String;IZ)Ljava/util/List; +} + +public final class app/revanced/patcher/util/smali/InlineSmaliCompilerKt { + public static final fun toInstruction (Ljava/lang/String;Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;)Lcom/android/tools/smali/dexlib2/builder/BuilderInstruction; + public static synthetic fun toInstruction$default (Ljava/lang/String;Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;ILjava/lang/Object;)Lcom/android/tools/smali/dexlib2/builder/BuilderInstruction; + public static final fun toInstructions (Ljava/lang/String;Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;)Ljava/util/List; + public static synthetic fun toInstructions$default (Ljava/lang/String;Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;ILjava/lang/Object;)Ljava/util/List; +} + diff --git a/build.gradle.kts b/build.gradle.kts index 49603fd..5160dc5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,8 +16,7 @@ subprojects { apply(plugin = "java") apply(plugin ="kotlin") - group = "app.revanced" - version = publicationVersion + version = pulicationVersion repositories { mavenCentral() diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f10c02f..bec7eff 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,12 +6,8 @@ kotlin-test = "1.8.20-RC" kotlinx-coroutines-core = "1.7.3" multidexlib2 = "3.0.3.r3" smali = "3.0.3" -symbol-processing-api = "1.9.10-1.0.13" xpp3 = "1.1.4c" binary-compatibility-validator = "0.13.2" -kotlin-compile-testing-ksp = "1.5.0" -kotlinpoet-ksp = "1.14.2" -ksp = "1.9.0-1.0.11" [libraries] android = { module = "com.google.android:android", version.ref = "android" } @@ -21,11 +17,7 @@ kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotl kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines-core" } multidexlib2 = { module = "app.revanced:multidexlib2", version.ref = "multidexlib2" } smali = { module = "com.android.tools.smali:smali", version.ref = "smali" } -symbol-processing-api = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "symbol-processing-api" } xpp3 = { module = "xpp3:xpp3", version.ref = "xpp3" } -kotlin-compile-testing = { module = "com.github.tschuchortdev:kotlin-compile-testing-ksp", version.ref = "kotlin-compile-testing-ksp" } -kotlinpoet-ksp = { module = "com.squareup:kotlinpoet-ksp", version.ref = "kotlinpoet-ksp" } [plugins] binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binary-compatibility-validator" } -ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } \ No newline at end of file diff --git a/revanced-patch-annotation-processor/api/revanced-patch-annotation-processor.api b/revanced-patch-annotation-processor/api/revanced-patch-annotation-processor.api deleted file mode 100644 index c1536a9..0000000 --- a/revanced-patch-annotation-processor/api/revanced-patch-annotation-processor.api +++ /dev/null @@ -1,24 +0,0 @@ -public abstract interface annotation class app/revanced/patcher/patch/annotation/CompatiblePackage : java/lang/annotation/Annotation { - public abstract fun name ()Ljava/lang/String; - public abstract fun versions ()[Ljava/lang/String; -} - -public abstract interface annotation class app/revanced/patcher/patch/annotation/Patch : java/lang/annotation/Annotation { - public abstract fun compatiblePackages ()[Lapp/revanced/patcher/patch/annotation/CompatiblePackage; - public abstract fun dependencies ()[Ljava/lang/Class; - public abstract fun description ()Ljava/lang/String; - public abstract fun name ()Ljava/lang/String; - public abstract fun requiresIntegrations ()Z - public abstract fun use ()Z -} - -public final class app/revanced/patcher/patch/annotation/processor/PatchProcessor : com/google/devtools/ksp/processing/SymbolProcessor { - public fun process (Lcom/google/devtools/ksp/processing/Resolver;)Ljava/util/List; -} - -public final class app/revanced/patcher/patch/annotation/processor/PatchProcessorProvider : com/google/devtools/ksp/processing/SymbolProcessorProvider { - public fun ()V - public fun create (Lcom/google/devtools/ksp/processing/SymbolProcessorEnvironment;)Lapp/revanced/patcher/patch/annotation/processor/PatchProcessor; - public synthetic fun create (Lcom/google/devtools/ksp/processing/SymbolProcessorEnvironment;)Lcom/google/devtools/ksp/processing/SymbolProcessor; -} - diff --git a/revanced-patch-annotation-processor/build.gradle.kts b/revanced-patch-annotation-processor/build.gradle.kts deleted file mode 100644 index 5dafe1d..0000000 --- a/revanced-patch-annotation-processor/build.gradle.kts +++ /dev/null @@ -1,45 +0,0 @@ -plugins { - alias(libs.plugins.ksp) -} - -dependencies { - implementation(libs.symbol.processing.api) - implementation(libs.kotlinpoet.ksp) - implementation(project(":revanced-patcher")) - - testImplementation(libs.kotlin.test) - testImplementation(libs.kotlin.compile.testing) -} - -publishing { - publications { - create("revanced-patch-annotation-processor-publication") { - from(components["java"]) - - pom { - name = "ReVanced patch annotation processor" - description = "Annotation processor for patches." - url = "https://revanced.app" - - licenses { - license { - name = "GNU General Public License v3.0" - url = "https://www.gnu.org/licenses/gpl-3.0.en.html" - } - } - developers { - developer { - id = "ReVanced" - name = "ReVanced" - email = "contact@revanced.app" - } - } - scm { - connection = "scm:git:git://github.com/revanced/revanced-patcher.git" - developerConnection = "scm:git:git@github.com:revanced/revanced-patcher.git" - url = "https://github.com/revanced/revanced-patcher" - } - } - } - } -} \ No newline at end of file diff --git a/revanced-patch-annotation-processor/settings.gradle.kts b/revanced-patch-annotation-processor/settings.gradle.kts deleted file mode 100644 index f1d8160..0000000 --- a/revanced-patch-annotation-processor/settings.gradle.kts +++ /dev/null @@ -1,2 +0,0 @@ -rootProject.name = "revanced-patch-annotation-processor" - diff --git a/revanced-patch-annotation-processor/src/main/kotlin/app/revanced/patcher/patch/annotation/processor/PatchProcessor.kt b/revanced-patch-annotation-processor/src/main/kotlin/app/revanced/patcher/patch/annotation/processor/PatchProcessor.kt deleted file mode 100644 index 325d005..0000000 --- a/revanced-patch-annotation-processor/src/main/kotlin/app/revanced/patcher/patch/annotation/processor/PatchProcessor.kt +++ /dev/null @@ -1,207 +0,0 @@ -package app.revanced.patcher.patch.annotation.processor - -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.Patch -import com.google.devtools.ksp.processing.CodeGenerator -import com.google.devtools.ksp.processing.Dependencies -import com.google.devtools.ksp.processing.Resolver -import com.google.devtools.ksp.processing.SymbolProcessor -import com.google.devtools.ksp.symbol.KSAnnotated -import com.google.devtools.ksp.symbol.KSAnnotation -import com.google.devtools.ksp.symbol.KSClassDeclaration -import com.google.devtools.ksp.symbol.KSType -import com.google.devtools.ksp.validate -import com.squareup.kotlinpoet.* -import com.squareup.kotlinpoet.ksp.toClassName -import com.squareup.kotlinpoet.ksp.writeTo -import kotlin.reflect.KClass - -class PatchProcessor internal constructor( - private val codeGenerator: CodeGenerator, -) : SymbolProcessor { - - private fun KSAnnotated.isSubclassOf(cls: KClass<*>): Boolean { - if (this !is KSClassDeclaration) return false - - if (qualifiedName?.asString() == cls.qualifiedName) return true - - return superTypes.any { it.resolve().declaration.isSubclassOf(cls) } - } - - @Suppress("UNCHECKED_CAST") - override fun process(resolver: Resolver): List { - val patches = buildMap { - resolver.getSymbolsWithAnnotation(Patch::class.qualifiedName!!).filter { - // Do not check here if Patch is super of the class, because it is expensive. - // Check it later when processing. - it.validate() && it.isSubclassOf(app.revanced.patcher.patch.Patch::class) - }.map { - it as KSClassDeclaration - }.forEach { patchDeclaration -> - patchDeclaration.annotations.find { - it.annotationType.resolve().declaration.qualifiedName!!.asString() == Patch::class.qualifiedName!! - }?.let { annotation -> - fun KSAnnotation.property(name: String) = - arguments.find { it.name!!.asString() == name }?.value!! - - val name = - annotation.property("name").toString().ifEmpty { null } - - val description = - annotation.property("description").toString().ifEmpty { null } - - val dependencies = - (annotation.property("dependencies") as List).ifEmpty { null } - - val compatiblePackages = - (annotation.property("compatiblePackages") as List).ifEmpty { null } - - val use = - annotation.property("use") as Boolean - - val requiresIntegrations = - annotation.property("requiresIntegrations") as Boolean - - // Data class for KotlinPoet - data class PatchData( - val name: String?, - val description: String?, - val dependencies: List?, - val compatiblePackages: List?, - val use: Boolean, - val requiresIntegrations: Boolean - ) - - this[patchDeclaration] = PatchData( - name, - description, - dependencies?.map { dependency -> dependency.toClassName() }, - compatiblePackages?.map { - val packageName = it.property("name") - val packageVersions = (it.property("versions") as List).ifEmpty { null } - ?.joinToString(", ") { version -> "\"$version\"" } - - CodeBlock.of( - "%T(%S, %L)", - app.revanced.patcher.patch.Patch.CompatiblePackage::class, - packageName, - packageVersions?.let { "setOf($packageVersions)" }, - ) - }, - use, - requiresIntegrations - ) - } - } - } - - // If a patch depends on another, that is annotated, the dependency should be replaced with the generated patch, - // because the generated patch has all the necessary properties to invoke the super constructor with, - // unlike the annotated patch. - val dependencyResolutionMap = buildMap { - patches.values.filter { it.dependencies != null }.flatMap { - it.dependencies!! - }.distinct().forEach { dependency -> - patches.keys.find { it.qualifiedName?.asString() == dependency.toString() } - ?.let { patch -> - this[dependency] = ClassName( - patch.packageName.asString(), - patch.simpleName.asString() + "Generated" - ) - } - } - } - - patches.forEach { (patchDeclaration, patchAnnotation) -> - val isBytecodePatch = patchDeclaration.isSubclassOf(BytecodePatch::class) - - val superClass = if (isBytecodePatch) { - BytecodePatch::class - } else { - ResourcePatch::class - } - - val contextClass = if (isBytecodePatch) { - BytecodeContext::class - } else { - ResourceContext::class - } - - val generatedPatchClassName = ClassName( - patchDeclaration.packageName.asString(), - patchDeclaration.simpleName.asString() + "Generated" - ) - - FileSpec.builder(generatedPatchClassName) - .addType( - TypeSpec.objectBuilder(generatedPatchClassName) - .superclass(superClass).apply { - patchAnnotation.name?.let { name -> - addSuperclassConstructorParameter("name = %S", name) - } - - patchAnnotation.description?.let { description -> - addSuperclassConstructorParameter("description = %S", description) - } - - patchAnnotation.compatiblePackages?.let { compatiblePackages -> - addSuperclassConstructorParameter( - "compatiblePackages = setOf(%L)", - compatiblePackages.joinToString(", ") - ) - } - - // The generated patch always depends on the source patch. - addSuperclassConstructorParameter( - "dependencies = setOf(%L)", - buildList { - patchAnnotation.dependencies?.forEach { dependency -> - add("${(dependencyResolutionMap[dependency] ?: dependency)}::class") - } - - add("${patchDeclaration.toClassName()}::class") - }.joinToString(", "), - ) - - addSuperclassConstructorParameter( - "use = %L", patchAnnotation.use - ) - - addSuperclassConstructorParameter( - "requiresIntegrations = %L", - patchAnnotation.requiresIntegrations - ) - } - .addFunction( - FunSpec.builder("execute") - .addModifiers(KModifier.OVERRIDE) - .addParameter("context", contextClass) - .build() - ) - .addInitializerBlock( - CodeBlock.builder() - .add( - "%T.options.forEach { (_, option) ->", - patchDeclaration.toClassName() - ) - .addStatement( - "options.register(option)" - ) - .add( - "}" - ) - .build() - ) - .build() - ).build().writeTo( - codeGenerator, - Dependencies(false, patchDeclaration.containingFile!!) - ) - } - - return emptyList() - } -} \ No newline at end of file diff --git a/revanced-patch-annotation-processor/src/main/kotlin/app/revanced/patcher/patch/annotation/processor/PatchProcessorProvider.kt b/revanced-patch-annotation-processor/src/main/kotlin/app/revanced/patcher/patch/annotation/processor/PatchProcessorProvider.kt deleted file mode 100644 index 9e3cc63..0000000 --- a/revanced-patch-annotation-processor/src/main/kotlin/app/revanced/patcher/patch/annotation/processor/PatchProcessorProvider.kt +++ /dev/null @@ -1,9 +0,0 @@ -package app.revanced.patcher.patch.annotation.processor - -import com.google.devtools.ksp.processing.SymbolProcessorEnvironment -import com.google.devtools.ksp.processing.SymbolProcessorProvider - -class PatchProcessorProvider : SymbolProcessorProvider { - override fun create(environment: SymbolProcessorEnvironment) = - PatchProcessor(environment.codeGenerator) -} \ No newline at end of file diff --git a/revanced-patch-annotation-processor/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider b/revanced-patch-annotation-processor/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider deleted file mode 100644 index 52884f4..0000000 --- a/revanced-patch-annotation-processor/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider +++ /dev/null @@ -1 +0,0 @@ -app.revanced.patcher.patch.annotation.processor.PatchProcessorProvider \ No newline at end of file diff --git a/revanced-patch-annotation-processor/src/test/kotlin/app/revanced/patcher/patch/annotation/processor/TestPatchAnnotationProcessor.kt b/revanced-patch-annotation-processor/src/test/kotlin/app/revanced/patcher/patch/annotation/processor/TestPatchAnnotationProcessor.kt deleted file mode 100644 index f3e2e43..0000000 --- a/revanced-patch-annotation-processor/src/test/kotlin/app/revanced/patcher/patch/annotation/processor/TestPatchAnnotationProcessor.kt +++ /dev/null @@ -1,147 +0,0 @@ -package app.revanced.patcher.patch.annotation.processor - -import app.revanced.patcher.patch.Patch -import com.tschuchort.compiletesting.KotlinCompilation -import com.tschuchort.compiletesting.SourceFile -import com.tschuchort.compiletesting.kspWithCompilation -import com.tschuchort.compiletesting.symbolProcessorProviders -import kotlin.test.Test -import kotlin.test.assertEquals -import kotlin.test.assertNull - -class TestPatchAnnotationProcessor { - // region Processing - - @Test - fun testProcessing() = assertEquals( - "Processable patch", compile( - getSourceFile( - "processing", "ProcessablePatch" - ) - ).loadPatch("$SAMPLE_PACKAGE.processing.ProcessablePatchGenerated").name - ) - - @Test - fun generateNullProperties() = compile( - getSourceFile( - "null", "NullPropertiesPatch" - ) - ).loadPatch("$SAMPLE_PACKAGE.null.NullPropertiesPatchGenerated").let { - assertNull(it.description) // Because no description was provided. - assertNull(it.compatiblePackages!!.first().versions) // Because no versions were provided. - } - - // endregion - - // region Dependencies - - @Test - fun testDependencies() { - compile( - getSourceFile( - "dependencies", "DependentPatch" - ), getSourceFile( - "dependencies", "DependencyPatch" - ) - ).let { result -> - result.loadPatch("$SAMPLE_PACKAGE.dependencies.DependentPatchGenerated").let { - // Dependency as well as the source class of the generated class. - assertEquals( - 2, - it.dependencies!!.size - ) - - // The last dependency is always the source class of the generated class to respect - // order of dependencies. - assertEquals( - result.loadPatch("$SAMPLE_PACKAGE.dependencies.DependentPatch")::class, - it.dependencies!!.last() - ) - } - } - } - - // endregion - - // region Options - - @Test - fun testOptions() { - val patch = compile( - getSourceFile( - "options", "OptionsPatch" - ) - ).loadPatch("$SAMPLE_PACKAGE.options.OptionsPatchGenerated") - - assert(patch.options.isNotEmpty()) - assertEquals(patch.options["print"].title, "Print message") - } - - // endregion - - // region Limitations - - @Test - fun failingManualDependency() = assertEquals( - 1, // Generated patch is always dependent on source class. - compile( - getSourceFile( - "limitations/manualdependency", "DependentPatch" - ), getSourceFile( - "limitations/manualdependency", "DependencyPatch" - ) - ).loadPatch("$SAMPLE_PACKAGE.limitations.manualdependency.DependentPatchGenerated").dependencies!!.size - ) - - // endregion - - private companion object Utils { - const val SAMPLE_PACKAGE = "app.revanced.patcher.patch.annotation.processor.samples" - - /** - * Get a source file from the given sample and class name. - * - * @param sample The sample to get the source file from. - * @param className The name of the class to get the source file from. - * @return The source file. - */ - fun getSourceFile(sample: String, className: String): SourceFile { - val resourceName = "app/revanced/patcher/patch/annotation/processor/samples/$sample/$className.kt" - return SourceFile.kotlin( - "$className.kt", - TestPatchAnnotationProcessor::class.java.classLoader.getResourceAsStream(resourceName) - ?.readAllBytes() - ?.toString(Charsets.UTF_8) - ?: error("Could not find resource $resourceName") - ) - } - - /** - * Compile the given source files and return the result. - * - * @param sourceFiles The source files to compile. - * @return The result of the compilation. - */ - fun compile(vararg sourceFiles: SourceFile) = KotlinCompilation().apply { - sources = sourceFiles.asList() - - symbolProcessorProviders = listOf(PatchProcessorProvider()) - - // Required until https://github.com/tschuchortdev/kotlin-compile-testing/issues/312 closed. - kspWithCompilation = true - - inheritClassPath = true - messageOutputStream = System.out - }.compile().also { result -> - assertEquals(KotlinCompilation.ExitCode.OK, result.exitCode) - } - - // region Class loading - - fun KotlinCompilation.Result.loadPatch(name: String) = classLoader.loadClass(name).loadPatch() - - fun Class<*>.loadPatch() = this.getField("INSTANCE").get(null) as Patch<*> - - // endregion - } -} \ No newline at end of file diff --git a/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/dependencies/DependencyPatch.kt b/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/dependencies/DependencyPatch.kt deleted file mode 100644 index 2230274..0000000 --- a/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/dependencies/DependencyPatch.kt +++ /dev/null @@ -1,10 +0,0 @@ -package app.revanced.patcher.patch.annotation.processor.samples.dependencies - -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.Patch - -@Patch(name = "Dependency patch") -object DependencyPatch : ResourcePatch() { - override fun execute(context: ResourceContext) {} -} \ No newline at end of file diff --git a/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/dependencies/DependentPatch.kt b/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/dependencies/DependentPatch.kt deleted file mode 100644 index d20dc51..0000000 --- a/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/dependencies/DependentPatch.kt +++ /dev/null @@ -1,12 +0,0 @@ -package app.revanced.patcher.patch.annotation.processor.samples.dependencies -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.annotation.Patch - -@Patch( - name = "Dependent patch", - dependencies = [DependencyPatch::class], -) -object DependentPatch : BytecodePatch() { - override fun execute(context: BytecodeContext) {} -} \ No newline at end of file diff --git a/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/limitations/manualdependency/DependencyPatch.kt b/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/limitations/manualdependency/DependencyPatch.kt deleted file mode 100644 index c373c34..0000000 --- a/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/limitations/manualdependency/DependencyPatch.kt +++ /dev/null @@ -1,10 +0,0 @@ -package app.revanced.patcher.patch.annotation.processor.samples.limitations.manualdependency - -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.Patch - -@Patch(name = "Dependency patch") -object DependencyPatch : ResourcePatch() { - override fun execute(context: ResourceContext) { } -} \ No newline at end of file diff --git a/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/limitations/manualdependency/DependentPatch.kt b/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/limitations/manualdependency/DependentPatch.kt deleted file mode 100644 index 5bc396c..0000000 --- a/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/limitations/manualdependency/DependentPatch.kt +++ /dev/null @@ -1,17 +0,0 @@ -package app.revanced.patcher.patch.annotation.processor.samples.limitations.manualdependency -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.annotation.Patch - -@Patch(name = "Dependent patch") -object DependentPatch : BytecodePatch( - // Dependency will not be executed correctly if it is manually specified. - // The reason for this is that the dependency patch is annotated too, - // so the processor will generate a new patch class for it embedding the annotated information. - // Because the dependency is manually specified, - // the processor will not be able to change this dependency to the generated class, - // which means that the dependency will lose the annotated information. - dependencies = setOf(DependencyPatch::class) -) { - override fun execute(context: BytecodeContext) {} -} \ No newline at end of file diff --git a/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/null/NullPropertiesPatch.kt b/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/null/NullPropertiesPatch.kt deleted file mode 100644 index a013dba..0000000 --- a/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/null/NullPropertiesPatch.kt +++ /dev/null @@ -1,14 +0,0 @@ -package app.revanced.patcher.patch.annotation.processor.samples.`null` - -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.annotation.CompatiblePackage -import app.revanced.patcher.patch.annotation.Patch - -@Patch( - "Patch with null properties", - compatiblePackages = [CompatiblePackage("com.google.android.youtube")], -) -object NullPropertiesPatch : BytecodePatch() { - override fun execute(context: BytecodeContext) {} -} \ No newline at end of file diff --git a/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/options/OptionsPatch.kt b/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/options/OptionsPatch.kt deleted file mode 100644 index 6bc1027..0000000 --- a/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/options/OptionsPatch.kt +++ /dev/null @@ -1,19 +0,0 @@ -package app.revanced.patcher.patch.annotation.processor.samples.options - -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patcher.patch.options.types.StringPatchOption.Companion.stringPatchOption - -@Patch(name = "Options patch") -object OptionsPatch : ResourcePatch() { - override fun execute(context: ResourceContext) {} - - @Suppress("unused") - private val printOption by stringPatchOption( - "print", - null, - "Print message", - "The message to print." - ) -} \ No newline at end of file diff --git a/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/processing/ProcessablePatch.kt b/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/processing/ProcessablePatch.kt deleted file mode 100644 index 86767db..0000000 --- a/revanced-patch-annotation-processor/src/test/resources/app/revanced/patcher/patch/annotation/processor/samples/processing/ProcessablePatch.kt +++ /dev/null @@ -1,10 +0,0 @@ -package app.revanced.patcher.patch.annotation.processor.samples.processing - -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.annotation.Patch - -@Patch("Processable patch") -object ProcessablePatch : BytecodePatch() { - override fun execute(context: BytecodeContext) {} -} \ No newline at end of file diff --git a/revanced-patcher/build.gradle.kts b/revanced-patcher/build.gradle.kts index ff913b9..832f981 100644 --- a/revanced-patcher/build.gradle.kts +++ b/revanced-patcher/build.gradle.kts @@ -8,7 +8,6 @@ dependencies { compileOnly(libs.android) - testImplementation(project(":revanced-patch-annotation-processor")) testImplementation(libs.kotlin.test) } diff --git a/revanced-patcher/src/main/kotlin/app/revanced/patcher/patch/BytecodePatch.kt b/revanced-patcher/src/main/kotlin/app/revanced/patcher/patch/BytecodePatch.kt index 7c15481..fe918e6 100644 --- a/revanced-patcher/src/main/kotlin/app/revanced/patcher/patch/BytecodePatch.kt +++ b/revanced-patcher/src/main/kotlin/app/revanced/patcher/patch/BytecodePatch.kt @@ -1,6 +1,5 @@ package app.revanced.patcher.patch -import app.revanced.patcher.PatchClass import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint @@ -8,20 +7,7 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint * A ReVanced [Patch] that works on [BytecodeContext]. * * @param fingerprints A list of [MethodFingerprint]s which will be resolved before the patch is executed. - * @param name The name of the patch. - * @param description The description of the patch. - * @param compatiblePackages The packages the patch is compatible with. - * @param dependencies The names of patches this patch depends on. - * @param use Weather or not the patch should be used. - * @param requiresIntegrations Weather or not the patch requires integrations. */ abstract class BytecodePatch( - internal val fingerprints: Set = emptySet(), - name: String? = null, - description: String? = null, - compatiblePackages: Set? = null, - dependencies: Set? = null, - use: Boolean = true, - // TODO: Remove this property, once integrations are coupled with patches. - requiresIntegrations: Boolean = false, -) : Patch(name, description, compatiblePackages, dependencies, use, requiresIntegrations) \ No newline at end of file + internal val fingerprints : Set = emptySet(), +) : Patch() \ No newline at end of file diff --git a/revanced-patcher/src/main/kotlin/app/revanced/patcher/patch/Patch.kt b/revanced-patcher/src/main/kotlin/app/revanced/patcher/patch/Patch.kt index 2f56807..c48939c 100644 --- a/revanced-patcher/src/main/kotlin/app/revanced/patcher/patch/Patch.kt +++ b/revanced-patcher/src/main/kotlin/app/revanced/patcher/patch/Patch.kt @@ -7,35 +7,71 @@ import app.revanced.patcher.Patcher import app.revanced.patcher.data.Context import app.revanced.patcher.patch.options.PatchOptions import java.io.Closeable +import kotlin.reflect.full.findAnnotation /** * A ReVanced patch. - * * If an implementation of [Patch] also implements [Closeable] * it will be closed in reverse execution order of patches executed by ReVanced [Patcher]. * - * @param name The name of the patch. - * @param description The description of the patch. - * @param compatiblePackages The packages the patch is compatible with. - * @param dependencies The names of patches this patch depends on. - * @param use Weather or not the patch should be used. - * @param requiresIntegrations Weather or not the patch requires integrations. * @param T The [Context] type this patch will work on. */ -sealed class Patch>( - val name: String? = null, - val description: String? = null, - val compatiblePackages: Set? = null, - val dependencies: Set? = null, - val use: Boolean = true, +sealed class Patch> { + /** + * The name of the patch. + */ + var name: String? = null + private set + + /** + * The description of the patch. + */ + var description: String? = null + private set + + /** + * The packages the patch is compatible with. + */ + var compatiblePackages: Set? = null + private set + + /** + * Other patches this patch depends on. + */ + var dependencies: Set? = null + private set + + /** + * Weather or not the patch should be used. + */ + var use = true + private set + + // TODO: Remove this property, once integrations are coupled with patches. - val requiresIntegrations: Boolean = false, -) { + /** + * Weather or not the patch requires integrations. + */ + var requiresIntegrations = false + private set + /** * The options of the patch associated by the options key. */ val options = PatchOptions() + init { + this::class.findAnnotation()?.let { annotation -> + name = annotation.name.ifEmpty { null } + description = annotation.description.ifEmpty { null } + compatiblePackages = annotation.compatiblePackages + .map { CompatiblePackage(it.name, it.versions.toSet()) }.toSet() + dependencies = annotation.dependencies.toSet().ifEmpty { null } + use = annotation.use + requiresIntegrations = annotation.requiresIntegrations + } + } + /** * The execution function of the patch. * @@ -67,5 +103,4 @@ sealed class Patch>( val name: String, val versions: Set? = null, ) -} - +} \ No newline at end of file diff --git a/revanced-patcher/src/main/kotlin/app/revanced/patcher/patch/ResourcePatch.kt b/revanced-patcher/src/main/kotlin/app/revanced/patcher/patch/ResourcePatch.kt index b5d4229..368bbb8 100644 --- a/revanced-patcher/src/main/kotlin/app/revanced/patcher/patch/ResourcePatch.kt +++ b/revanced-patcher/src/main/kotlin/app/revanced/patcher/patch/ResourcePatch.kt @@ -1,24 +1,8 @@ package app.revanced.patcher.patch -import app.revanced.patcher.PatchClass import app.revanced.patcher.data.ResourceContext /** * A ReVanced [Patch] that works on [ResourceContext]. - * - * @param name The name of the patch. - * @param description The description of the patch. - * @param compatiblePackages The packages the patch is compatible with. - * @param dependencies The names of patches this patch depends on. - * @param use Weather or not the patch should be used. - * @param requiresIntegrations Weather or not the patch requires integrations. */ -abstract class ResourcePatch( - name: String? = null, - description: String? = null, - compatiblePackages: Set? = null, - dependencies: Set? = null, - use: Boolean = true, - // TODO: Remove this property, once integrations are coupled with patches. - requiresIntegrations: Boolean = false, -) : Patch(name, description, compatiblePackages, dependencies, use, requiresIntegrations) \ No newline at end of file +abstract class ResourcePatch : Patch() \ No newline at end of file diff --git a/revanced-patch-annotation-processor/src/main/kotlin/app/revanced/patcher/patch/annotation/PatchAnnotations.kt b/revanced-patcher/src/main/kotlin/app/revanced/patcher/patch/annotation/PatchAnnotations.kt similarity index 97% rename from revanced-patch-annotation-processor/src/main/kotlin/app/revanced/patcher/patch/annotation/PatchAnnotations.kt rename to revanced-patcher/src/main/kotlin/app/revanced/patcher/patch/annotation/PatchAnnotations.kt index c6919bc..f003e45 100644 --- a/revanced-patch-annotation-processor/src/main/kotlin/app/revanced/patcher/patch/annotation/PatchAnnotations.kt +++ b/revanced-patcher/src/main/kotlin/app/revanced/patcher/patch/annotation/PatchAnnotations.kt @@ -13,7 +13,6 @@ import kotlin.reflect.KClass * @param use Whether this patch should be used. * @param requiresIntegrations Whether this patch requires integrations. */ -@Retention(AnnotationRetention.SOURCE) @Target(AnnotationTarget.CLASS) @Inherited annotation class Patch( diff --git a/settings.gradle.kts b/settings.gradle.kts index 23a5a77..5c99423 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1 @@ -include("revanced-patch-annotation-processor", "revanced-patcher") \ No newline at end of file +include("revanced-patcher")