diff --git a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/annoyances/startup/DisableSyncForLemmyBottomSheetPatch.kt b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/annoyances/startup/DisableSyncForLemmyBottomSheetPatch.kt index 865af827d..a3ebe101a 100644 --- a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/annoyances/startup/DisableSyncForLemmyBottomSheetPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/annoyances/startup/DisableSyncForLemmyBottomSheetPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.reddit.customclients.sync.syncforreddit.annoyances.startup import app.revanced.patcher.extensions.removeInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch -@Suppress("unused") -val disableSyncForLemmyBottomSheetPatch = bytecodePatch( - name = "Disable Sync for Lemmy bottom sheet", +@Suppress("unused", "ObjectPropertyName") +val `Disable Sync for Lemmy bottom sheet` = creatingBytecodePatch( description = "Disables the bottom sheet at the startup that asks you to signup to \"Sync for Lemmy\".", ) { compatibleWith( @@ -15,7 +14,7 @@ val disableSyncForLemmyBottomSheetPatch = bytecodePatch( ) apply { - mainActivityOnCreateFingerprint.method.apply { + mainActivityOnCreateMethod.apply { val showBottomSheetIndex = implementation!!.instructions.lastIndex - 1 removeInstruction(showBottomSheetIndex) diff --git a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/annoyances/startup/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/annoyances/startup/Fingerprints.kt index 21c788a89..91d6e12c9 100644 --- a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/annoyances/startup/Fingerprints.kt +++ b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/annoyances/startup/Fingerprints.kt @@ -1,9 +1,11 @@ package app.revanced.patches.reddit.customclients.sync.syncforreddit.annoyances.startup -import app.revanced.patcher.fingerprint +import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively +import app.revanced.patcher.definingClass +import app.revanced.patcher.name +import app.revanced.patcher.patch.BytecodePatchContext -internal val mainActivityOnCreateFingerprint = fingerprint { - custom { method, classDef -> - classDef.endsWith("MainActivity;") && method.name == "onCreate" - } +internal val BytecodePatchContext.mainActivityOnCreateMethod by gettingFirstMutableMethodDeclaratively { + definingClass("MainActivity;") + name("onCreate") }