refactor: remove all parameter names

also fixed some warnings.
This commit is contained in:
Lucaskyy 2022-04-14 18:45:34 +02:00
parent f55d917db4
commit 8034fee8ea
No known key found for this signature in database
GPG key ID: 1530BFF96D1EEB89
8 changed files with 177 additions and 168 deletions

View file

@ -1,8 +1,8 @@
package app.revanced.patches.ad package app.revanced.patches.ad
import app.revanced.patcher.PatcherData import app.revanced.patcher.PatcherData
import app.revanced.patcher.extensions.or
import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.or
import app.revanced.patcher.patch.* import app.revanced.patcher.patch.*
import app.revanced.patcher.signature.MethodMetadata import app.revanced.patcher.signature.MethodMetadata
import app.revanced.patcher.signature.MethodSignature import app.revanced.patcher.signature.MethodSignature
@ -15,32 +15,32 @@ import org.jf.dexlib2.Opcode
private val compatiblePackages = listOf("com.google.android.youtube") private val compatiblePackages = listOf("com.google.android.youtube")
class VideoAdsPatch : Patch( class VideoAdsPatch : Patch(
metadata = PatchMetadata( PatchMetadata(
shortName = "video-ads", "video-ads",
name = "YouTube Video Ads Patch", "YouTube Video Ads Patch",
description = "Patch to remove ads in the YouTube video player.", "Patch to remove ads in the YouTube video player.",
compatiblePackages = compatiblePackages, compatiblePackages,
version = "0.0.1" "0.0.1"
), ),
signatures = listOf( listOf(
MethodSignature( MethodSignature(
methodSignatureMetadata = MethodSignatureMetadata( MethodSignatureMetadata(
name = "show-video-ads-constructor", "show-video-ads-constructor",
methodMetadata = MethodMetadata( MethodMetadata(
definingClass = "zai", "zai",
name = "<init>", "<init>",
), ),
patternScanMethod = PatternScanMethod.Fuzzy(2),// FIXME: Test this threshold and find the best value. PatternScanMethod.Fuzzy(2),// FIXME: Test this threshold and find the best value.
compatiblePackages = compatiblePackages, compatiblePackages,
description = """Signature for the constructor of some class. """Signature for the constructor of some class.
This signature is being used to find another method in the parent class This signature is being used to find another method in the parent class
and was discovered in the YouTube version v17.03.38""".trimIndent(), and was discovered in the YouTube version v17.03.38""".trimIndent(),
version = "0.0.1" "0.0.1"
), ),
returnType = "V", "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
methodParameters = listOf("L", "L", "L"), listOf("L", "L", "L"),
opcodes = listOf( listOf(
Opcode.INVOKE_DIRECT, Opcode.INVOKE_DIRECT,
Opcode.NEW_INSTANCE, Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT, Opcode.INVOKE_DIRECT,
@ -62,30 +62,30 @@ class VideoAdsPatch : Patch(
) )
) { ) {
override fun execute(patcherData: PatcherData): PatchResult { override fun execute(patcherData: PatcherData): PatchResult {
var result = signatures.first().result!! val result = signatures.first().result!!
val responsibleMethodSignature = MethodSignature( val responsibleMethodSignature = MethodSignature(
methodSignatureMetadata = MethodSignatureMetadata( MethodSignatureMetadata(
name = "show-video-ads-method", "show-video-ads-method",
methodMetadata = MethodMetadata( MethodMetadata(
definingClass = "zai", "zai",
name = null // unknown null // unknown
), ),
patternScanMethod = PatternScanMethod.Direct(), PatternScanMethod.Direct(),
compatiblePackages = compatiblePackages, compatiblePackages,
description = "Signature to find the method, which is responsible for showing the video ads", "Signature to find the method, which is responsible for showing the video ads",
version = "0.0.1" "0.0.1"
), ),
returnType = "V", "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, AccessFlags.PUBLIC or AccessFlags.FINAL,
methodParameters = listOf("Z"), listOf("Z"),
opcodes = null null
) )
result = result.findParentMethod( result.findParentMethod(
responsibleMethodSignature responsibleMethodSignature
) ?: return PatchResultError( ) ?: return PatchResultError(
"Could not find parent method with signature ${responsibleMethodSignature.methodSignatureMetadata.name}" "Could not find parent method with signature ${responsibleMethodSignature.metadata.name}"
) )
// Override the parameter by calling shouldShowAds and setting the parameter to the result // Override the parameter by calling shouldShowAds and setting the parameter to the result

View file

@ -1,8 +1,8 @@
package app.revanced.patches.interaction package app.revanced.patches.interaction
import app.revanced.patcher.PatcherData import app.revanced.patcher.PatcherData
import app.revanced.patcher.extensions.or
import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.or
import app.revanced.patcher.patch.Patch import app.revanced.patcher.patch.Patch
import app.revanced.patcher.patch.PatchMetadata import app.revanced.patcher.patch.PatchMetadata
import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResult
@ -21,27 +21,27 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction11n
private val compatiblePackages = listOf("com.google.android.youtube") private val compatiblePackages = listOf("com.google.android.youtube")
class EnableSeekbarTappingPatch : Patch( class EnableSeekbarTappingPatch : Patch(
metadata = PatchMetadata( PatchMetadata(
"seekbar-tapping", "seekbar-tapping",
"Enable seekbar tapping patch", "Enable seekbar tapping patch",
"Enable tapping on the seekbar of the YouTube player.", "Enable tapping on the seekbar of the YouTube player.",
compatiblePackages, compatiblePackages,
"1.0.0" "1.0.0"
), ),
signatures = listOf( listOf(
MethodSignature( MethodSignature(
methodSignatureMetadata = MethodSignatureMetadata( MethodSignatureMetadata(
name = "enable-seekbar-tapping-parent-signature", "enable-seekbar-tapping-parent-signature",
methodMetadata = MethodMetadata(null, null), // unknown MethodMetadata(null, null), // unknown
patternScanMethod = PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
compatiblePackages = compatiblePackages, compatiblePackages,
description = "Signature for a parent method, which is needed to find the actual method required to be patched.", "Signature for a parent method, which is needed to find the actual method required to be patched.",
version = "0.0.1" "0.0.1"
), ),
returnType = "L", "L",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, AccessFlags.PUBLIC or AccessFlags.FINAL,
methodParameters = listOf(), listOf(),
opcodes = listOf( listOf(
Opcode.INVOKE_VIRTUAL, Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT, Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_VIRTUAL, Opcode.INVOKE_VIRTUAL,
@ -75,18 +75,18 @@ class EnableSeekbarTappingPatch : Patch(
) )
), ),
MethodSignature( MethodSignature(
methodSignatureMetadata = MethodSignatureMetadata( MethodSignatureMetadata(
name = "enable-seekbar-tapping-signature", "enable-seekbar-tapping-signature",
methodMetadata = MethodMetadata(null, null), // unknown MethodMetadata(null, null), // unknown
patternScanMethod = PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
compatiblePackages = compatiblePackages, compatiblePackages,
description = "Signature for the method required to be patched.", "Signature for the method required to be patched.",
version = "0.0.1" "0.0.1"
), ),
returnType = "Z", "Z",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, AccessFlags.PUBLIC or AccessFlags.FINAL,
methodParameters = listOf("L"), listOf("L"),
opcodes = listOf( listOf(
Opcode.CMPG_DOUBLE, Opcode.CMPG_DOUBLE,
Opcode.IF_GTZ, Opcode.IF_GTZ,
Opcode.GOTO, Opcode.GOTO,
@ -124,7 +124,7 @@ class EnableSeekbarTappingPatch : Patch(
) )
) { ) {
override fun execute(patcherData: PatcherData): PatchResult { override fun execute(patcherData: PatcherData): PatchResult {
var result = signatures.first().result!! val result = signatures.first().result!!
val tapSeekMethods = mutableMapOf<String, Method>() val tapSeekMethods = mutableMapOf<String, Method>()
@ -149,7 +149,7 @@ class EnableSeekbarTappingPatch : Patch(
} }
// replace map because we dont need the upper one anymore // replace map because we dont need the upper one anymore
result = signatures.last().result!! signatures.last().result!!
val implementation = result.method.implementation!! val implementation = result.method.implementation!!

View file

@ -17,27 +17,27 @@ import org.jf.dexlib2.Opcode
private val compatiblePackages = listOf("com.google.android.youtube") private val compatiblePackages = listOf("com.google.android.youtube")
class CreateButtonRemoverPatch : Patch( class CreateButtonRemoverPatch : Patch(
metadata = PatchMetadata( PatchMetadata(
"create-button", "create-button",
"Create button patch", "Create button patch",
"Disable the create button.", "Disable the create button.",
compatiblePackages, compatiblePackages,
"1.0.0" "1.0.0"
), ),
signatures = listOf( listOf(
MethodSignature( MethodSignature(
methodSignatureMetadata = MethodSignatureMetadata( MethodSignatureMetadata(
name = "create-button-method", "create-button-method",
methodMetadata = MethodMetadata(null, null), // unknown MethodMetadata(null, null), // unknown
patternScanMethod = PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
compatiblePackages = compatiblePackages, compatiblePackages,
description = "Signature for the method required to be patched.", "Signature for the method required to be patched.",
version = "0.0.1" "0.0.1"
), ),
returnType = "V", "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, AccessFlags.PUBLIC or AccessFlags.FINAL,
methodParameters = listOf("Z"), listOf("Z"),
opcodes = listOf( listOf(
Opcode.IGET, Opcode.IGET,
Opcode.INVOKE_STATIC, Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT, Opcode.MOVE_RESULT_OBJECT,

View file

@ -17,26 +17,26 @@ import org.jf.dexlib2.Opcode
private val compatiblePackages = listOf("com.google.android.youtube") private val compatiblePackages = listOf("com.google.android.youtube")
class HideReelsPatch : Patch( class HideReelsPatch : Patch(
metadata = PatchMetadata( PatchMetadata(
"hide-reels", "hide-reels",
"Hide reels patch", "Hide reels patch",
"Hide reels on the page.", "Hide reels on the page.",
compatiblePackages, compatiblePackages,
"1.0.0" "1.0.0"
), ),
signatures = listOf( listOf(
MethodSignature( MethodSignature(
methodSignatureMetadata = MethodSignatureMetadata( MethodSignatureMetadata(
name = "hide-reels-signature", "hide-reels-signature",
methodMetadata = MethodMetadata(null, null), // unknown MethodMetadata(null, null), // unknown
patternScanMethod = PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
compatiblePackages = compatiblePackages, compatiblePackages,
description = "Signature for the method required to be patched.", "Signature for the method required to be patched.",
version = "0.0.1" "0.0.1"
), ),
returnType = "V", "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
methodParameters = listOf( listOf(
"L", "L",
"L", "L",
"L", "L",
@ -55,7 +55,7 @@ class HideReelsPatch : Patch(
"[B", "[B",
"[B" "[B"
), ),
opcodes = listOf( listOf(
Opcode.MOVE_OBJECT, Opcode.MOVE_OBJECT,
Opcode.MOVE_OBJECT, Opcode.MOVE_OBJECT,
Opcode.INVOKE_DIRECT, Opcode.INVOKE_DIRECT,

View file

@ -2,7 +2,10 @@ package app.revanced.patches.layout
import app.revanced.patcher.PatcherData import app.revanced.patcher.PatcherData
import app.revanced.patcher.extensions.or import app.revanced.patcher.extensions.or
import app.revanced.patcher.patch.* import app.revanced.patcher.patch.Patch
import app.revanced.patcher.patch.PatchMetadata
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.signature.MethodMetadata import app.revanced.patcher.signature.MethodMetadata
import app.revanced.patcher.signature.MethodSignature import app.revanced.patcher.signature.MethodSignature
import app.revanced.patcher.signature.MethodSignatureMetadata import app.revanced.patcher.signature.MethodSignatureMetadata
@ -13,27 +16,27 @@ import org.jf.dexlib2.Opcode
private val compatiblePackages = listOf("com.google.android.youtube") private val compatiblePackages = listOf("com.google.android.youtube")
class HideSuggestionsPatch : Patch( class HideSuggestionsPatch : Patch(
metadata = PatchMetadata( PatchMetadata(
"hide-suggestions", "hide-suggestions",
"Hide suggestions patch", "Hide suggestions patch",
"Hide suggested videos.", "Hide suggested videos.",
compatiblePackages, compatiblePackages,
"1.0.0" "1.0.0"
), ),
signatures = listOf( listOf(
MethodSignature( MethodSignature(
methodSignatureMetadata = MethodSignatureMetadata( MethodSignatureMetadata(
name = "hide-suggestions-parent-method", "hide-suggestions-parent-method",
methodMetadata = MethodMetadata(null, null), // unknown MethodMetadata(null, null), // unknown
patternScanMethod = PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
compatiblePackages = compatiblePackages, compatiblePackages,
description = "Signature for a parent method, which is needed to find the actual method required to be patched.", "Signature for a parent method, which is needed to find the actual method required to be patched.",
version = "0.0.1" "0.0.1"
), ),
returnType = "V", "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
methodParameters = listOf("L", "Z"), listOf("L", "Z"),
opcodes = listOf( listOf(
Opcode.INVOKE_VIRTUAL, Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT, Opcode.MOVE_RESULT_OBJECT,
Opcode.CHECK_CAST, Opcode.CHECK_CAST,
@ -67,16 +70,16 @@ class HideSuggestionsPatch : Patch(
/* /*
val result = signatures.first().result!!.findParentMethod( val result = signatures.first().result!!.findParentMethod(
MethodSignature( MethodSignature(
methodSignatureMetadata = MethodSignatureMetadata( MethodSignatureMetadata(
name = "hide-suggestions-method", "hide-suggestions-method",
methodMetadata = MethodMetadata(null, null), // unknown MethodMetadata(null, null), // unknown
patternScanMethod = PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
compatiblePackages = compatiblePackages, compatiblePackages,
description = "Signature for the method, which is required to be patched.", "Signature for the method, which is required to be patched.",
version = "0.0.1" "0.0.1"
), ),
returnType = "V", "V",
accessFlags = AccessFlags.FINAL or AccessFlags.PUBLIC, AccessFlags.FINAL or AccessFlags.PUBLIC,
listOf("Z"), listOf("Z"),
listOf( listOf(
Opcode.IPUT_BOOLEAN, Opcode.IPUT_BOOLEAN,

View file

@ -1,9 +1,12 @@
package app.revanced.patches.layout package app.revanced.patches.layout
import app.revanced.patcher.PatcherData import app.revanced.patcher.PatcherData
import app.revanced.patcher.extensions.or
import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.* import app.revanced.patcher.extensions.or
import app.revanced.patcher.patch.Patch
import app.revanced.patcher.patch.PatchMetadata
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.signature.MethodMetadata import app.revanced.patcher.signature.MethodMetadata
import app.revanced.patcher.signature.MethodSignature import app.revanced.patcher.signature.MethodSignature
import app.revanced.patcher.signature.MethodSignatureMetadata import app.revanced.patcher.signature.MethodSignatureMetadata
@ -15,27 +18,27 @@ import org.jf.dexlib2.Opcode
private val compatiblePackages = listOf("com.google.android.youtube") private val compatiblePackages = listOf("com.google.android.youtube")
class MinimizedPlaybackPatch : Patch( class MinimizedPlaybackPatch : Patch(
metadata = PatchMetadata( PatchMetadata(
"minimized-playback", "minimized-playback",
"Minimized Playback Patch", "Minimized Playback Patch",
"Enable minimized and background playback.", "Enable minimized and background playback.",
compatiblePackages, compatiblePackages,
"1.0.0" "1.0.0"
), ),
signatures = listOf( listOf(
MethodSignature( MethodSignature(
methodSignatureMetadata = MethodSignatureMetadata( MethodSignatureMetadata(
name = "minimized-playback-manager", "minimized-playback-manager",
methodMetadata = MethodMetadata(null, null), // unknown MethodMetadata(null, null), // unknown
patternScanMethod = PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
compatiblePackages = compatiblePackages, compatiblePackages,
description = "Signature for the method required to be patched.", "Signature for the method required to be patched.",
version = "0.0.1" "0.0.1"
), ),
returnType = "Z", "Z",
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC, AccessFlags.PUBLIC or AccessFlags.STATIC,
methodParameters = listOf("L"), listOf("L"),
opcodes = listOf( listOf(
Opcode.CONST_4, Opcode.CONST_4,
Opcode.IF_EQZ, Opcode.IF_EQZ,
Opcode.IGET, Opcode.IGET,

View file

@ -1,8 +1,8 @@
package app.revanced.patches.layout package app.revanced.patches.layout
import app.revanced.patcher.PatcherData import app.revanced.patcher.PatcherData
import app.revanced.patcher.extensions.or
import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.or
import app.revanced.patcher.patch.* import app.revanced.patcher.patch.*
import app.revanced.patcher.signature.MethodMetadata import app.revanced.patcher.signature.MethodMetadata
import app.revanced.patcher.signature.MethodSignature import app.revanced.patcher.signature.MethodSignature
@ -16,27 +16,27 @@ import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
private val compatiblePackages = listOf("com.google.android.youtube") private val compatiblePackages = listOf("com.google.android.youtube")
class OldQualityLayoutPatch : Patch( class OldQualityLayoutPatch : Patch(
metadata = PatchMetadata( PatchMetadata(
"old-quality-layout", "old-quality-layout",
"Old Quality Layout Patch", "Old Quality Layout Patch",
"Enable the original quality flyout menu", "Enable the original quality flyout menu",
compatiblePackages, compatiblePackages,
"1.0.0" "1.0.0"
), ),
signatures = listOf( listOf(
MethodSignature( MethodSignature(
methodSignatureMetadata = MethodSignatureMetadata( MethodSignatureMetadata(
name = "old-quality-parent-method-signature", "old-quality-parent-method-signature",
methodMetadata = MethodMetadata(null, null), // unknown MethodMetadata(null, null), // unknown
patternScanMethod = PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
compatiblePackages = compatiblePackages, compatiblePackages,
description = "Signature to find a parent method required by the Old Quality Layout patch.", "Signature to find a parent method required by the Old Quality Layout patch.",
version = "0.0.1" "0.0.1"
), ),
returnType = "V", "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
methodParameters = listOf("L", "L", "L", "L", "L", "L", "L"), listOf("L", "L", "L", "L", "L", "L", "L"),
opcodes = listOf( listOf(
Opcode.IPUT_OBJECT, Opcode.IPUT_OBJECT,
Opcode.CONST, Opcode.CONST,
Opcode.CONST, Opcode.CONST,
@ -72,20 +72,20 @@ class OldQualityLayoutPatch : Patch(
) )
) { ) {
override fun execute(patcherData: PatcherData): PatchResult { override fun execute(patcherData: PatcherData): PatchResult {
var result = signatures.first().result!! val result = signatures.first().result!!
result = result.findParentMethod( result.findParentMethod(
MethodSignature( MethodSignature(
methodSignatureMetadata = MethodSignatureMetadata( MethodSignatureMetadata(
name = "old-quality-method-signature", "old-quality-method-signature",
methodMetadata = MethodMetadata(null, null), // unknown MethodMetadata(null, null), // unknown
patternScanMethod = PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
compatiblePackages = compatiblePackages, compatiblePackages,
description = "Signature to find the method required by the Old Quality Layout patch", "Signature to find the method required by the Old Quality Layout patch",
version = "0.0.1" "0.0.1"
), ),
returnType = "L", "L",
accessFlags = AccessFlags.FINAL or AccessFlags.PUBLIC, AccessFlags.FINAL or AccessFlags.PUBLIC,
emptyList(), emptyList(),
listOf( listOf(
Opcode.IGET, Opcode.IGET,

View file

@ -1,9 +1,12 @@
package app.revanced.patches.misc package app.revanced.patches.misc
import app.revanced.patcher.PatcherData import app.revanced.patcher.PatcherData
import app.revanced.patcher.extensions.or
import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.patch.* import app.revanced.patcher.extensions.or
import app.revanced.patcher.patch.Patch
import app.revanced.patcher.patch.PatchMetadata
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.proxy.mutableTypes.MutableMethod.Companion.toMutable import app.revanced.patcher.proxy.mutableTypes.MutableMethod.Companion.toMutable
import app.revanced.patcher.signature.MethodMetadata import app.revanced.patcher.signature.MethodMetadata
import app.revanced.patcher.signature.MethodSignature import app.revanced.patcher.signature.MethodSignature
@ -18,27 +21,27 @@ import org.jf.dexlib2.immutable.ImmutableMethodImplementation
private val compatiblePackages = listOf("com.google.android.youtube") private val compatiblePackages = listOf("com.google.android.youtube")
class IntegrationsPatch : Patch( class IntegrationsPatch : Patch(
metadata = PatchMetadata( PatchMetadata(
"integrations", "integrations",
"Inject integrations Patch", "Inject integrations Patch",
"Applies mandatory patches to implement the ReVanced integrations into the application.", "Applies mandatory patches to implement the ReVanced integrations into the application.",
compatiblePackages, compatiblePackages,
"1.0.0" "1.0.0"
), ),
signatures = listOf( listOf(
MethodSignature( MethodSignature(
methodSignatureMetadata = MethodSignatureMetadata( MethodSignatureMetadata(
name = "integrations-patch", "integrations-patch",
methodMetadata = MethodMetadata(null, null), // unknown MethodMetadata(null, null), // unknown
patternScanMethod = PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
compatiblePackages = compatiblePackages, compatiblePackages,
description = "Inject the integrations into the application with the method of this signature", "Inject the integrations into the application with the method of this signature",
version = "0.0.1" "0.0.1"
), ),
returnType = "V", "V",
accessFlags = AccessFlags.PUBLIC.value, AccessFlags.PUBLIC.value,
methodParameters = listOf(), listOf(),
opcodes = listOf( listOf(
Opcode.SGET_OBJECT, Opcode.SGET_OBJECT,
Opcode.NEW_INSTANCE, Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT, Opcode.INVOKE_DIRECT,