jadx-mcp-multisession AGENTS.md

jadx-mcp-multisession AGENTS.md is an instructions file for Codex, OpenCode from NitrogenT7/jadx-mcp-multisession. It costs 2,209 tokens per session, scanned A, original, Apache-2.0.

Project instructions for a bridge between an AI client and jadx-gui, an application used to inspect Android apps. They document multi-window sessions, plugin compatibility, and how analysis requests are routed.

In plain words
What is it for?
Use them when modifying or debugging the jadx-mcp-multisession bridge, especially session handling, port setup, request routing, or plugin support.
Why use it?
They help an agent understand the project's design before changing code, avoiding port conflicts and compatibility problems between plugin versions.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/nitrogent7/jadx-mcp-multisession/agents-md
Clone the repo
git clone --depth 1 https://github.com/NitrogenT7/jadx-mcp-multisession

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for jadx-mcp-multisession AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/nitrogent7/jadx-mcp-multisession/agents-md.svg)](https://agentmods.dev/instructions/nitrogent7/jadx-mcp-multisession/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/nitrogent7/jadx-mcp-multisession/agents-md"><img src="https://agentmods.dev/badge/instructions/nitrogent7/jadx-mcp-multisession/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,209 This file is loaded in full into every session.
When invoked 2,209 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02209 $0.02209
Opus 5 $0.01104 $0.01104
Sonnet 5 $0.00442 $0.00442
Haiku 4.5 $0.00221 $0.00221

Measured 4d ago against content hash 14c792ca93db, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

jadx-mcp-multisession AGENTS.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

# 集成测试(HTTP 模式,curl 可调)
AGENTS.md · 139 lines

How it starts

The opening of the file, as written. The whole thing — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md — jadx-mcp-multisession 项目文档

给后来者(人 or AI)的速览:先读本文,再动手。完整功能说明见 README.md, 多会话改造与实测问题修复的详细记录见 MULTI_SESSION.md


1. 项目是什么

Kimi Code / 任意 MCP 客户端与 jadx-gui 之间的桥接 server。上游是 zinja-coder/jadx-mcp-server v3.3.5,本项目在其上做了三件事:

  1. 多会话管理:AI 可自主启动/切换/关闭多个 jadx-gui 窗口(对齐 IDA-MCP)
  2. 插件版本兼容:jadx-ai-mcp 插件 3.3.x 与 6.x 参数名/端点差异自动适配
  3. 错误降级main-activitystrings 在上游插件失败时的 server 侧兜底

架构一句话:每个 jadx-gui 窗口 = 一个独立 HTTP 服务(插件端口)+ 独立 JADX_CONFIG_DIR/user.home;server 维护会话注册表,所有分析工具请求 路由到 active 会话。

2. 关键设计决策(改代码前必读)

2.1 多实例端口隔离 — FilePrefsFactory

jadx-ai-mcp 插件把端口存在 Java Preferences(Windows 注册表),所有实例 共享且无运行时改端口 API。解法:session-prefs-factory(Java)把 Preferences 落到文件。Windows JDK 没有 FileSystemPreferencesFactory,必须用这个自定义 实现(已实测 ClassNotFoundException)。

⚠️ 双节点预写:插件版本不同,Preferences 节点路径不同:

  • 3.3.x → 包 jadx.gui.plugins → 文件 <prefs>/jadx/gui/plugins.properties
  • 6.x → 包 com.zin.jadxaimcp → 文件 <prefs>/com/zin/jadxaimcp.properties

session_manager.open_session 必须两个都写,漏一个会导致对应版本插件 读默认 8650 → 多实例端口冲突 → 启动失败(已踩坑,勿回退)。

2.2 路由 — 单一改造点

所有分析工具最终都走 src/server/config.pyget_from_jadx()

  • current_base() 返回 active 会话 URL,无会话时回退旧 JADX_HTTP_BASE
  • set_active_session() 切换会话时必须重置参数风格缓存_PARAM_STYLE=None
  • 新工具若直接构造 URL 而不走 get_from_jadx,将不跟随会话切换(已踩坑)

2.3 参数风格自适应

插件参数名矩阵(实测确认):

端点 3.3.x 6.3.0 6.4.0
class-source / methods-of-class 等 class class_name class_name
search-method method method_name method_name
get-resource-file name file_name file_name
  • _detect_param_style():向 /class-source?class_name=x.Y 发探测请求,400 且 报 "Missing 'class'" → legacy(3.3.x),否则 new
  • _adapt_params():legacy 时按 _LEGACY_RENAME 映射(class_name→class 等)
  • dropins 插件默认选版本号最高的 jar_find_plugin_jar 用 max 版本解析), 3.3.x 缺 search-classes-by-keyword / xrefs-* / rename-package / debug 端点

2.4 会话生命周期

  • 注册表:<sessions-dir>/sessions.json(含 active 指针),全部经 _mutate_registry 加锁读-改-写
  • 启动:建目录 → 双节点预写端口 → 复制插件 jar 到 config/plugins/dropins/ (jadx 无条件加载机制,无需 plugins.json)→ jre/bin/java.exe-Djava.util.prefs.PreferencesFactory / -Dfile.prefs.root / -Duser.home → 等 /health(150s)→ 等 /all-classes total>0(180s,大 APK 首次反编译) → 能力探测 probe_plugin() → 注册
  • 关闭:taskkill /F /T /PID → 删注册 → active 自动转移 → 清理目录

Read the full file on GitHub · 139 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 139 lines · 2,209 tokens per session scan A 14c792ca93db

Subscribe to this mod's changes

jadx-mcp-multisession AGENTS.md is an instructions file published in the GitHub repository NitrogenT7/jadx-mcp-multisession (1 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 2,209 tokens to every session, about $0.0110 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.