diff --git a/patches/src/main/kotlin/app/revanced/patches/crunchyroll/ads/HideAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/crunchyroll/ads/HideAdsPatch.kt index 718d9fdc6e..3a697c3b75 100644 --- a/patches/src/main/kotlin/app/revanced/patches/crunchyroll/ads/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/crunchyroll/ads/HideAdsPatch.kt @@ -18,11 +18,11 @@ val hideAdsPatch = bytecodePatch("Hide ads") { apply { // Get obfuscated "enableAds" field from toString method. - val enableAdsField = videoUrlReadyToStringMethodMatch.method.apply { + val enableAdsField = videoUrlReadyToStringMethodMatch.method.let { val stringIndex = videoUrlReadyToStringMethodMatch[-1] - val fieldIndex = indexOfFirstInstruction(stringIndex, Opcode.IGET_BOOLEAN) + val fieldIndex = it.indexOfFirstInstruction(stringIndex, Opcode.IGET_BOOLEAN) - getInstruction(fieldIndex).getReference()!! + it.getInstruction(fieldIndex).getReference()!! } // Remove final access flag on field.