mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-07 01:51:27 +01:00
feat(Instagram): Add Enable developer menu patch (#6043)
This commit is contained in:
@@ -280,6 +280,10 @@ public final class app/revanced/patches/instagram/hide/stories/HideStoriesKt {
|
||||
public static final fun getHideStoriesPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/instagram/misc/devmenu/EnableDeveloperMenuPatchKt {
|
||||
public static final fun getEnableDeveloperMenuPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/instagram/misc/extension/SharedExtensionPatchKt {
|
||||
public static final fun getSharedExtensionPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package app.revanced.patches.instagram.misc.devmenu
|
||||
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.util.Utils.trimIndentMultiline
|
||||
import app.revanced.util.getReference
|
||||
import app.revanced.util.indexOfFirstInstructionReversedOrThrow
|
||||
import app.revanced.util.returnEarly
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
|
||||
@Suppress("unused")
|
||||
val enableDeveloperMenuPatch = bytecodePatch(
|
||||
name = "Enable developer menu",
|
||||
description = """
|
||||
Enables the developer menu, which can be found at the bottom of settings menu with name 'Internal Settings'.
|
||||
|
||||
It is recommended to use this patch with an alpha/beta Instagram release. Patching a stable release works, but the developer menu shows the developer flags as numbers and does not show a human readable description.
|
||||
""".trimIndentMultiline(),
|
||||
use = false
|
||||
) {
|
||||
compatibleWith("com.instagram.android")
|
||||
|
||||
execute {
|
||||
with(clearNotificationReceiverFingerprint.method) {
|
||||
indexOfFirstInstructionReversedOrThrow(clearNotificationReceiverFingerprint.stringMatches!!.first().index) {
|
||||
val reference = getReference<MethodReference>()
|
||||
Opcode.INVOKE_STATIC == opcode &&
|
||||
reference?.parameterTypes?.size == 1 &&
|
||||
reference.parameterTypes.first() == "Lcom/instagram/common/session/UserSession;" &&
|
||||
reference.returnType == "Z"
|
||||
}.let { index ->
|
||||
navigate(this).to(index).stop().returnEarly(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
package app.revanced.patches.instagram.misc.devmenu
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
|
||||
internal val clearNotificationReceiverFingerprint = fingerprint {
|
||||
custom { method, classDef ->
|
||||
method.name == "onReceive" &&
|
||||
classDef.type == "Lcom/instagram/notifications/push/ClearNotificationReceiver;"
|
||||
}
|
||||
strings("NOTIFICATION_DISMISSED")
|
||||
}
|
||||
Reference in New Issue
Block a user