refactor: Migrate to new extension methods for String.toInstruction(...) and String.toInstructions(...) (#45)
This commit is contained in:
+2
-2
@@ -148,11 +148,11 @@ class GeneralBytecodeAdsPatch : BytecodePatch(
|
||||
mutableClass!!.findMutableMethodOf(method)
|
||||
|
||||
// TODO: dynamically get registers
|
||||
mutableMethod!!.implementation!!.addInstructions(
|
||||
mutableMethod!!.addInstructions(
|
||||
insertIndex, """
|
||||
const/16 v1, 0x8
|
||||
invoke-virtual {v0,v1}, Landroid/widget/FrameLayout;->setVisibility(I)V
|
||||
""".trimIndent().toInstructions()
|
||||
"""
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ 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.smali.toInstructions
|
||||
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
||||
import app.revanced.patches.youtube.ad.video.signatures.ShowVideoAdsConstructorSignature
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
@@ -41,11 +40,11 @@ class VideoAdsPatch : BytecodePatch(
|
||||
) {}) ?: return PatchResultError("Required parent method could not be found.")
|
||||
|
||||
// Override the parameter by calling shouldShowAds and setting the parameter to the result
|
||||
result.method.implementation!!.addInstructions(
|
||||
result.method.addInstructions(
|
||||
0, """
|
||||
invoke-static { }, Lfi/vanced/libraries/youtube/whitelisting/Whitelist;->shouldShowAds()Z
|
||||
move-result v1
|
||||
""".trimIndent().toInstructions()
|
||||
"""
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
|
||||
Reference in New Issue
Block a user