diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/home/annotation/PromotionsCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/home/annotation/PromotionsCompatibility.kt deleted file mode 100644 index ca6021f35..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/home/annotation/PromotionsCompatibility.kt +++ /dev/null @@ -1,14 +0,0 @@ -package app.revanced.patches.youtube.ad.home.annotation - -import app.revanced.patcher.annotation.Compatibility -import app.revanced.patcher.annotation.Package - -@Compatibility( - [Package( - "com.google.android.youtube", arrayOf("17.03.38", "17.14.35", "17.17.34", "17.19.36") - )] -) -@Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.RUNTIME) -internal annotation class PromotionsCompatibility - diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/home/patch/HomeAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/home/patch/HomeAdsPatch.kt deleted file mode 100644 index bd4d5a156..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/home/patch/HomeAdsPatch.kt +++ /dev/null @@ -1,1710 +0,0 @@ -/** -package app.revanced.patches.youtube.ad - -import app.revanced.extensions.injectHideCall -import app.revanced.patcher.annotations.Compatibility -import app.revanced.patcher.annotations.Package -import app.revanced.patcher.data.implementation.BytecodeData -import app.revanced.patcher.extensions.or -import app.revanced.patcher.patch.implementation.BytecodePatch -import app.revanced.patcher.patch.implementation.metadata.PackageMetadata -import app.revanced.patcher.patch.implementation.metadata.PatchMetadata -import app.revanced.patcher.patch.implementation.misc.PatchResult -import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess -import app.revanced.patcher.signature.MethodMetadata -import app.revanced.patcher.signature.MethodSignature -import app.revanced.patcher.signature.MethodSignatureMetadata -import app.revanced.patcher.signature.PatternScanMethod -import org.jf.dexlib2.AccessFlags -import org.jf.dexlib2.Opcode -import org.jf.dexlib2.iface.instruction.formats.Instruction11x - - -private val packageMetadata = listOf( -PackageMetadata( -"com.google.android.youtube", -listOf("17.03.38") -), -) - -private val patchMetadata = PatchMetadata( -"home-ads", -"Home Ads Patch", -"Patch to remove ads in YouTube", -packageMetadata, -"0.0.1" -) - -private val signatureDescription = "Required signature for ${patchMetadata.name}. Discovered in version 17.03.38." - -class HomeAdsPatch : BytecodePatch( -patchMetadata, -listOf( -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-1", -MethodMetadata( -"Ljke;", -"k", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"Z", -AccessFlags.PRIVATE or AccessFlags.FINAL, -listOf("L"), -listOf( -Opcode.INVOKE_DIRECT, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.GOTO, -Opcode.IGET_OBJECT, -Opcode.IF_EQ, -Opcode.CONST, -Opcode.GOTO, -Opcode.CONST, -Opcode.INVOKE_DIRECT, -Opcode.MOVE_RESULT_OBJECT, -Opcode.INVOKE_DIRECT, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.INVOKE_STATIC, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.INVOKE_STATIC, -Opcode.IGET_OBJECT, -Opcode.GOTO, -Opcode.IGET_OBJECT, -Opcode.INVOKE_STATIC, -Opcode.MOVE_RESULT, -Opcode.IF_EQZ, -Opcode.IGET_OBJECT, -Opcode.IF_EQ, -) -), -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-2", -MethodMetadata( -"Ljsi;", -"", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"V", -AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, -listOf( -"L", -"I" -), -listOf( -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.INVOKE_DIRECT, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CONST, -Opcode.CONST_4, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT, -Opcode.IPUT_BOOLEAN, -) -), -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-3", -MethodMetadata( -"Ljrh;", -"", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"V", -AccessFlags.PROTECTED or AccessFlags.CONSTRUCTOR, -listOf( -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"[B", -"[B", -"[B", -"[B" -), -listOf( -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST_16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST_4, -Opcode.INVOKE_DIRECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST_16, -Opcode.INVOKE_DIRECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT, -Opcode.CONST_4, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST_16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT_RANGE, -Opcode.MOVE_OBJECT_FROM16 -) -), -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-4", -MethodMetadata( -"Ljrk;", -"", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"V", -AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, -listOf("L", "I"), -listOf( -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IPUT_OBJECT, -) -), -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-5", -MethodMetadata( -"Ljrn;", -"", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"V", -AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, -listOf("L", "I"), -listOf( -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IPUT_OBJECT, -) -), -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-6", -MethodMetadata( -"Ljrq;", -"", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"V", -AccessFlags.PROTECTED or AccessFlags.CONSTRUCTOR, -listOf( -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"[B", -"[B", -"[B", -"[B" -), -listOf( -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -) -), -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-7", -MethodMetadata( -"Ljrr;", -"", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"V", -AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, -listOf( -"L", -"I", -"[B" -), -listOf( -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -) -), -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-8", -MethodMetadata( -"Ljrt;", -"", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"V", -AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, -listOf( -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"[B", -"[B", -"[B", -"[B" -), -listOf( -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -) -), -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-9", -MethodMetadata( -"Ljru;", -"", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"V", -AccessFlags.PROTECTED or AccessFlags.CONSTRUCTOR, -listOf( -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"[B", -"[B", -"[B", -"[B" -), -listOf( -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.INVOKE_DIRECT, -Opcode.IPUT_OBJECT, -) -), -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-10", -MethodMetadata( -"Ljrv;", -"", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"V", -AccessFlags.PROTECTED or AccessFlags.CONSTRUCTOR, -listOf( -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"[B", -"[B", -"[B", -"[B" -), -listOf( -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST_16, -Opcode.INVOKE_DIRECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -) -), -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-11", -MethodMetadata( -"Ljpm;", -"lX", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"V", -AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.BRIDGE or AccessFlags.SYNTHETIC, -listOf("L", "L"), -listOf( -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.INVOKE_STATIC, -) -), -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-12", -MethodMetadata( -"Ljpr;", -"b", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"V", -AccessFlags.PRIVATE or AccessFlags.FINAL, -listOf(), -listOf( -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.IGET_OBJECT, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.INVOKE_DIRECT, -Opcode.IPUT_OBJECT, -Opcode.CONST_4, -Opcode.INVOKE_VIRTUAL, -Opcode.CONST_4, -Opcode.INVOKE_VIRTUAL, -Opcode.RETURN_VOID -) -), -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-13", -MethodMetadata( -"Ljqk;", -"", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"V", -AccessFlags.PROTECTED or AccessFlags.CONSTRUCTOR, -listOf( -"L", -"L", -"L", -"L", -"L", -"[B", -"[B" -), -listOf( -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST_4, -Opcode.INVOKE_STATIC, -) -), -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-14", -MethodMetadata( -"Ljqa;", -"b", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"V", -AccessFlags.PRIVATE or AccessFlags.FINAL, -listOf(), -listOf( -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.RETURN_VOID -) -), -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-15", -MethodMetadata( -"Ljra;", -"", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"V", -AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, -listOf("L", "I"), -listOf( -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST_4, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST_4, -Opcode.INVOKE_DIRECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST_4, -Opcode.INVOKE_DIRECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT, -Opcode.CONST_16, -Opcode.INVOKE_DIRECT_RANGE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.IGET_OBJECT, -Opcode.IGET_OBJECT, -Opcode.IGET_OBJECT, -Opcode.IGET_OBJECT, -Opcode.IGET_OBJECT, -Opcode.IGET_OBJECT, -Opcode.CONST_4, -Opcode.CONST_4, -Opcode.CONST_16, -Opcode.CONST_16, -Opcode.CONST_16, -Opcode.MOVE_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.INVOKE_DIRECT_RANGE, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.CONST, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.NEW_INSTANCE, -Opcode.CONST_4, -Opcode.INVOKE_DIRECT, -Opcode.INVOKE_DIRECT, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT, -Opcode.IPUT_OBJECT, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.CONST_4, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.RETURN_VOID -) -), -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-16", -MethodMetadata( -"Ljrd;", -"", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"V", -AccessFlags.PROTECTED or AccessFlags.CONSTRUCTOR, -listOf( -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"[B", -"[B", -"[B", -"[B" -), -listOf( -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST_4, -Opcode.INVOKE_DIRECT, -Opcode.CONST_4, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST_4, -Opcode.INVOKE_DIRECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST_4, -Opcode.INVOKE_DIRECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT, -Opcode.CONST_16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT_RANGE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.CONST_16, -Opcode.CONST_16, -Opcode.CONST_16, -Opcode.CONST_16, -Opcode.CONST_16, -Opcode.MOVE_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT_RANGE, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.CONST_4, -Opcode.CONST_4, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT_RANGE, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.CONST, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.NEW_INSTANCE, -Opcode.CONST_4, -Opcode.INVOKE_DIRECT, -Opcode.INVOKE_DIRECT, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT, -Opcode.IPUT_OBJECT, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.RETURN_VOID -) -), -MethodSignature( -MethodSignatureMetadata( -"home-ads-method-17", -MethodMetadata( -"Ljre;", -"", -), -PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value. -packageMetadata, -signatureDescription, -"0.0.1" -), -"V", -AccessFlags.PROTECTED or AccessFlags.CONSTRUCTOR, -listOf( -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"L", -"[B", -"[B", -"[B", -"[B" -), -listOf( -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.CHECK_CAST, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.INVOKE_DIRECT, -Opcode.IPUT_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.NEW_INSTANCE, -Opcode.IF_NEZ, -Opcode.MOVE_OBJECT_FROM16, -Opcode.GOTO, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST_4, -Opcode.INVOKE_DIRECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.CONST_16, -Opcode.INVOKE_DIRECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT, -Opcode.CONST_16, -Opcode.CONST_16, -Opcode.CONST_16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT_RANGE, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.CONST_4, -Opcode.CONST_4, -Opcode.CONST_4, -Opcode.CONST_16, -Opcode.MOVE_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT, -Opcode.MOVE_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT_RANGE, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.CONST, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_RESULT_OBJECT, -Opcode.CHECK_CAST, -Opcode.NEW_INSTANCE, -Opcode.CONST_16, -Opcode.INVOKE_DIRECT, -Opcode.INVOKE_DIRECT, -Opcode.IPUT_OBJECT, -Opcode.NEW_INSTANCE, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_DIRECT, -Opcode.IPUT_OBJECT, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.SGET_OBJECT, -Opcode.MOVE_OBJECT_FROM16, -Opcode.INVOKE_VIRTUAL, -Opcode.MOVE_OBJECT_FROM16, -Opcode.IF_EQZ, -Opcode.SGET_OBJECT, -Opcode.INVOKE_VIRTUAL, -Opcode.RETURN_VOID -) -) -) -) { -override fun execute(data: BytecodeData): PatchResult { -for (i in 0 until signatures.count()) { -val signature = signatures.elementAt(i) -val result = signature.result!! -val implementation = result.method.implementation!! -val index = result.scanResult.startIndex -val instructions = implementation.instructions - -val register = (instructions[index + (if (i < 2) -1 else 1)] as Instruction11x).registerA -implementation.injectHideCall(index + 2, register) -} - -return PatchResultSuccess() -} -} - **/ \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/home/patch/PromotionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/home/patch/PromotionsPatch.kt deleted file mode 100644 index 78856f6d8..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/home/patch/PromotionsPatch.kt +++ /dev/null @@ -1,65 +0,0 @@ -package app.revanced.patches.youtube.ad.home.patch - -import app.revanced.extensions.injectHideCall -import app.revanced.patcher.annotation.Description -import app.revanced.patcher.annotation.Name -import app.revanced.patcher.annotation.Version -import app.revanced.patcher.data.implementation.BytecodeData -import app.revanced.patcher.data.implementation.toMethodWalker -import app.revanced.patcher.extensions.PatchExtensions.patchName -import app.revanced.patcher.extensions.or -import app.revanced.patcher.patch.implementation.BytecodePatch -import app.revanced.patcher.patch.implementation.misc.PatchResult -import app.revanced.patcher.patch.implementation.misc.PatchResultError -import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess -import app.revanced.patcher.signature.implementation.method.MethodSignature -import app.revanced.patcher.signature.implementation.method.annotation.DirectPatternScanMethod -import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod -import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod -import app.revanced.patches.youtube.ad.home.annotation.PromotionsCompatibility -import app.revanced.patches.youtube.ad.home.signatures.PromotedDiscoveryActionParentSignature -import app.revanced.patches.youtube.ad.home.signatures.PromotedDiscoveryAppParentSignature -import org.jf.dexlib2.AccessFlags -import org.jf.dexlib2.Opcode -import org.jf.dexlib2.iface.instruction.formats.Instruction11x - -//@Patch(dependencies = [IntegrationsPatch::class]) -@Name("home-promo-ads") -@Description("Patch to remove promoted ads in YouTube.") -@PromotionsCompatibility -@Version("0.0.1") -class PromotionsPatch : BytecodePatch( - listOf( - PromotedDiscoveryAppParentSignature, PromotedDiscoveryActionParentSignature - ) -) { - override fun execute(data: BytecodeData): PatchResult { - for (signature in signatures) { - val result = signature.result!! - - val requiredMethod = - result.findParentMethod(@Name("promotion-ads-signature") @MatchingMethod(name = "d") @DirectPatternScanMethod @PromotionsCompatibility @Version( - "0.0.1" - ) object : MethodSignature( - "V", AccessFlags.PRIVATE or AccessFlags.FINAL, listOf("Z", "Z"), null - ) {}) ?: return PatchResultError("Required parent method could not be found.") - - val toBePatchedInvokeOffset = - requiredMethod.immutableMethod.implementation!!.instructions.indexOfFirst { it.opcode == Opcode.INVOKE_DIRECT } - val toBePatchedMethod = - data.toMethodWalker(requiredMethod.immutableMethod).nextMethod(toBePatchedInvokeOffset, true) - .getMethod() as MutableMethod - - val implementation = toBePatchedMethod.implementation!! - val invokeVirtualOffset = implementation.instructions.indexOfFirst { it.opcode == Opcode.INVOKE_VIRTUAL } - - val moveResultInstruction = implementation.instructions[invokeVirtualOffset + 1] - if (moveResultInstruction.opcode != Opcode.MOVE_RESULT_OBJECT) return PatchResultError("The toBePatchedInvokeOffset offset was wrong in ${this.javaClass.patchName}") - - val register = (moveResultInstruction as Instruction11x).registerA - implementation.injectHideCall(invokeVirtualOffset + 2, register) - } - - return PatchResultSuccess() - } -} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/home/signatures/PromotedDiscoveryActionParentSignature.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/home/signatures/PromotedDiscoveryActionParentSignature.kt deleted file mode 100644 index 87647362a..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/home/signatures/PromotedDiscoveryActionParentSignature.kt +++ /dev/null @@ -1,58 +0,0 @@ -package app.revanced.patches.youtube.ad.home.signatures - -import app.revanced.patcher.annotation.Name -import app.revanced.patcher.annotation.Version -import app.revanced.patcher.extensions.or -import app.revanced.patcher.signature.implementation.method.MethodSignature -import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod -import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod -import app.revanced.patches.youtube.ad.home.annotation.PromotionsCompatibility -import org.jf.dexlib2.AccessFlags -import org.jf.dexlib2.Opcode - -@Name("promoted-discovery-app-parent-signature") -@MatchingMethod( - "Ljqb;", "lG" -) -@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value. -@PromotionsCompatibility -@Version("0.0.1") -object PromotedDiscoveryActionParentSignature : MethodSignature( - "V", - AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.BRIDGE or AccessFlags.SYNTHETIC, - listOf("L", "L"), - listOf( - Opcode.MOVE_OBJECT_FROM16, - Opcode.MOVE_OBJECT_FROM16, - Opcode.MOVE_OBJECT_FROM16, - Opcode.CHECK_CAST, - Opcode.INVOKE_VIRTUAL_RANGE, - Opcode.INVOKE_VIRTUAL, - Opcode.IGET_OBJECT, - Opcode.INVOKE_VIRTUAL, - Opcode.IGET_OBJECT, - Opcode.IGET_BOOLEAN, - Opcode.CONST_4, - Opcode.XOR_INT_2ADDR, - Opcode.IGET_BOOLEAN, - Opcode.INVOKE_DIRECT, - Opcode.IGET_BOOLEAN, - Opcode.INVOKE_VIRTUAL, - Opcode.IGET_OBJECT, - Opcode.IGET_OBJECT, - Opcode.IF_NEZ, - Opcode.IGET_OBJECT, - Opcode.IGET_OBJECT, - Opcode.IF_NEZ, - Opcode.SGET_OBJECT, - Opcode.IPUT_OBJECT, - Opcode.IGET_OBJECT, - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT_OBJECT, - Opcode.IGET_OBJECT, - Opcode.CONST_4, - Opcode.IF_NEZ, - Opcode.IGET_OBJECT, - Opcode.IGET_OBJECT - ) -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/home/signatures/PromotedDiscoveryAppParentSignature.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/home/signatures/PromotedDiscoveryAppParentSignature.kt deleted file mode 100644 index 9d4b9a084..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/home/signatures/PromotedDiscoveryAppParentSignature.kt +++ /dev/null @@ -1,61 +0,0 @@ -package app.revanced.patches.youtube.ad.home.signatures - -import app.revanced.patcher.annotation.Name -import app.revanced.patcher.annotation.Version -import app.revanced.patcher.extensions.or -import app.revanced.patcher.signature.implementation.method.MethodSignature -import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod -import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod -import app.revanced.patches.youtube.ad.home.annotation.PromotionsCompatibility -import org.jf.dexlib2.AccessFlags -import org.jf.dexlib2.Opcode - -@Name("promoted-discovery-action-parent-signature") -@MatchingMethod( - "Ljqj;", - "lG" -) -@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value. -@PromotionsCompatibility -@Version("0.0.1") - -object PromotedDiscoveryAppParentSignature : MethodSignature( - "V", - AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.BRIDGE or AccessFlags.SYNTHETIC, - listOf("L", "L"), - listOf( - Opcode.INVOKE_DIRECT, - Opcode.IGET_BOOLEAN, - Opcode.INVOKE_VIRTUAL, - Opcode.IGET_OBJECT, - Opcode.IGET_OBJECT, - Opcode.IF_NEZ, - Opcode.IGET_OBJECT, - Opcode.IGET_OBJECT, - Opcode.IF_NEZ, - Opcode.SGET_OBJECT, - Opcode.IPUT_OBJECT, - Opcode.IGET_OBJECT, - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT_OBJECT, - Opcode.IGET_OBJECT, - Opcode.IF_NEZ, - Opcode.IGET_OBJECT, - Opcode.IGET_OBJECT, - Opcode.INVOKE_INTERFACE, - Opcode.MOVE_RESULT, - Opcode.NEW_ARRAY, - Opcode.IPUT_OBJECT, - Opcode.CONST_4, - Opcode.INVOKE_INTERFACE, - Opcode.MOVE_RESULT, - Opcode.IF_GE, - Opcode.IGET_OBJECT, - Opcode.INVOKE_INTERFACE, - Opcode.MOVE_RESULT_OBJECT, - Opcode.CHECK_CAST, - Opcode.APUT_OBJECT, - Opcode.ADD_INT_LIT8, - Opcode.GOTO - ) -) \ No newline at end of file