File tree Expand file tree Collapse file tree 3 files changed +53
-0
lines changed
src/main/kotlin/app/revanced/patches/instagram/misc/devmenu Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -280,6 +280,10 @@ public final class app/revanced/patches/instagram/hide/stories/HideStoriesKt {
280280 public static final fun getHideStoriesPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
281281}
282282
283+ public final class app/revanced/patches/instagram/misc/devmenu/EnableDeveloperMenuPatchKt {
284+ public static final fun getEnableDeveloperMenuPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
285+ }
286+
283287public final class app/revanced/patches/instagram/misc/extension/SharedExtensionPatchKt {
284288 public static final fun getSharedExtensionPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
285289}
Original file line number Diff line number Diff line change 1+ package app.revanced.patches.instagram.misc.devmenu
2+
3+ import app.revanced.patcher.patch.bytecodePatch
4+ import app.revanced.util.Utils.trimIndentMultiline
5+ import app.revanced.util.getReference
6+ import app.revanced.util.indexOfFirstInstructionReversedOrThrow
7+ import app.revanced.util.returnEarly
8+ import com.android.tools.smali.dexlib2.Opcode
9+ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
10+
11+ @Suppress(" unused" )
12+ val enableDeveloperMenuPatch = bytecodePatch(
13+ name = " Enable developer menu" ,
14+ description = """
15+ Enables the developer menu, which can be found at the bottom of settings menu with name 'Internal Settings'.
16+
17+ 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.
18+ """ .trimIndentMultiline(),
19+ use = false
20+ ) {
21+ compatibleWith(" com.instagram.android" )
22+
23+ execute {
24+ with (clearNotificationReceiverFingerprint.method) {
25+ indexOfFirstInstructionReversedOrThrow(clearNotificationReceiverFingerprint.stringMatches!! .first().index) {
26+ val reference = getReference<MethodReference >()
27+ Opcode .INVOKE_STATIC == opcode &&
28+ reference?.parameterTypes?.size == 1 &&
29+ reference.parameterTypes.first() == " Lcom/instagram/common/session/UserSession;" &&
30+ reference.returnType == " Z"
31+ }.let { index ->
32+ navigate(this ).to(index).stop().returnEarly(true )
33+ }
34+ }
35+ }
36+ }
37+
Original file line number Diff line number Diff line change 1+
2+ package app.revanced.patches.instagram.misc.devmenu
3+
4+ import app.revanced.patcher.fingerprint
5+
6+ internal val clearNotificationReceiverFingerprint = fingerprint {
7+ custom { method, classDef ->
8+ method.name == " onReceive" &&
9+ classDef.type == " Lcom/instagram/notifications/push/ClearNotificationReceiver;"
10+ }
11+ strings(" NOTIFICATION_DISMISSED" )
12+ }
You can’t perform that action at this time.
0 commit comments