mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-22 02:13:58 +00:00
refactor(syncforreddit): DisableSyncForLemmyBottomSheetPatch
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user