[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-93251":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":28,"discoverSource":29},93251,"mimic","littledivy\u002Fmimic","littledivy","Intercept any app, then call it from Python like a library","",null,"Python",1186,77,2,0,314,806,29,83.68,"MIT License",false,"main",true,[],"2026-07-22 04:02:08","# mimic\n\nIntercept any app, then call it from Python like a library.\n\n```python\nfrom hinge_client import Hinge\n\nacc = Hinge()                 # reuses your captured session\nrecs = acc.get_recommendations()\nacc.like(subject_id, comment=\"hi lol\")\n```\n\nYou don't write `hinge_client.py`. mimic captures your own app traffic and an AI\ngenerates the client from it.\n\n## How it works\n\nMost apps authenticate every request with the same bundle of values: a bearer\ntoken, some device ids, a session id, cookies. They're stable across calls.\nCapture them once from a real request you made, and you can replay them on new\nrequests to the same API.\n\n```\ncapture traffic   ->   extract auth   ->   generate client\n  (mitmproxy)         (mimic.Session)      (claude reads the\n                                            captured endpoints)\n```\n\nThe generated client is plain Python on top of `mimic.App`, and you edit it like\nany other file. It gives you named methods, body templates, and the multi-step\ncall chaining mobile APIs tend to need (fetch a token in one call, spend it in\nthe next).\n\n## Install\n\n```bash\nsh install.sh\n```\n\nInstalls [`uv`](https:\u002F\u002Fastral.sh\u002Fuv) if you don't have it, then mimic in an\nisolated tool env. mitmproxy isn't a separate install; mimic launches it via\n`uvx` on first `record`. (Manual: `uv tool install mimic-client`.)\n\n```bash\nmimic doctor                    # confirm proxy + claude are ready\n```\n\n## Use it (iPhone)\n\n```bash\nmimic record                    # starts the proxy, prints the iPhone steps\n```\n\n`record` fills in your Mac's LAN IP and walks you through it:\n\n1. iPhone -> Wi-Fi -> Configure Proxy -> Manual -> `\u003Cyour-mac-ip>:8080`\n2. Safari -> `http:\u002F\u002Fmitm.it` -> install the Apple profile\n3. Settings -> General -> About -> Certificate Trust Settings -> turn on full\n   trust for mitmproxy. This step is easy to miss and nothing works without it.\n4. open the app, use it normally\n\nThen:\n\n```bash\nmimic hosts                     # list captured hosts; pick your API host\nmimic learn  prod-api.hingeaws.net    # see the endpoints mimic saw\nmimic gen    prod-api.hingeaws.net    # generate hinge_client.py\n```\n\nThen `from hinge_client import Hinge; Hinge().get_recommendations()`.\n\n## The library\n\nThree ways to build a session by hand, if you don't want codegen:\n\n```python\nfrom mimic import Session\n\nSession.from_mitm(\"prod-api.hingeaws.net\")        # pull auth from mitmweb\nSession.from_curl(open(\"copied.txt\").read())      # paste \"Copy as cURL\" from devtools\nSession(base_url=\"https:\u002F\u002Fx.com\", headers={...})  # explicit\n```\n\n`.get(path)`, `.post(path, json=...)`, and the other common HTTP verb helpers\nreturn parsed JSON and raise `requests.HTTPError` for failed responses. If your\ntoken rotates, a `401` on an idempotent request triggers one re-pull from\nmitmweb and a retry. Non-idempotent requests are not retried unless you explicitly\npass `refresh=True`.\n\n## Capture backends\n\n- **mitmproxy** for iOS apps (the default). mimic reads its JSON flow API and\n  runs it via `uvx`, so there's nothing extra to install.\n- **cURL \u002F paste** for anything with a web version. `Copy as cURL` in devtools,\n  then `Session.from_curl(text)`. No proxy, no cert.\n\n## Limitations\n\nTwo auth schemes get in the way, for different reasons:\n\n- **Certificate pinning** (banking, Instagram). The app rejects the mitmproxy\n  cert, so the proxy sees no traffic and nothing shows up in `mimic hosts`. This\n  blocks *capture*, not replay — get past the pin and the rest works normally.\n  `mimic unpin \u003Cipa|bundle-id>` sets up a Frida-based bypass; see\n  [docs\u002Fpinning.md](docs\u002Fpinning.md).\n- **DPoP \u002F sender-constrained tokens.** Each request carries a fresh proof\n  signed by a private key that never leaves the device, so captured requests\n  don't replay. This defeats the core model, not just capture; there's no clean\n  workaround. See [docs\u002Fdpop.md](docs\u002Fdpop.md).\n\nIf `mimic hosts` shows the app's API host, you're good.\n\n## Ethics\n\nUse it on your own accounts and data. It replays your session; it is not a tool\nfor accessing anyone else's. Respect each app's terms of service.\n\n## License\n\nMIT, see [LICENSE](LICENSE). Provided as-is, no warranty. Use on your own\naccounts and data; you are responsible for complying with each app's terms.\n","mimic 是一个用于将任意移动应用（如社交、电商类 App）的网络请求自动化封装为 Python 客户端库的工具。它通过 MITM 代理捕获真实 App 的 HTTPS 流量，提取认证凭据（Bearer Token、设备 ID、Cookies 等），并借助 AI（Claude）自动生成结构清晰、支持链式调用的 Python 客户端代码；也支持手动构建 Session。生成的客户端基于标准 HTTP 封装，具备自动重试（401 时刷新凭证）、JSON 解析与错误抛出等能力。适用于需要快速对接封闭 API（如未公开文档的 iOS\u002FAndroid 应用后端）的场景，例如自动化测试、数据采集或轻量级集成开发。","2026-07-14 02:30:07","CREATED_QUERY"]