尧图网站建设 尧图网络
  • 首页
  • 关于我们
  • 服务项目
  • 案例展示
  • 建站流程
  • 资讯中心
  • 联系我们
首页/资讯中心/详情

android app network monitor with mitmweb

android app network monitor with mitmweb
📅 发布时间:2026/6/19 16:37:17

android app network monitor with mitmweb

2025-11-13 18:08  蜡笔小旧  阅读(0)  评论(0)    收藏  举报
 

1.  Install root Mitm CA  cert

  - Installing the mitmproxy CA as a user certificate (via http://mitm.it)

   - In your AVD, go to Settings → Security → Advanced → Encryption & credentials → Trusted credentials. Find your certificate (default name is mitmproxy) in the list.

REF: https://docs.mitmproxy.org/stable/howto/install-system-trusted-ca-android/

 

NOTE: you will see chrome can proxy by mitmweb, but other apps don't. cause other apps don't use system certs.  so you should update app network security config.

 

2.  rebuild app with network_security_config.xml

<?xml version="1.0" encoding="utf-8"?>
<network-security-config><base-config><trust-anchors><certificates src="system" /><certificates src="user" overridePins="true" /></trust-anchors></base-config>
</network-security-config>

  REF: 

            - https://httptoolkit.com/docs/guides/android/ 

            - https://developer.android.com/privacy-and-security/security-config

 

3.  add latency for app

import asyncio
from mitmproxy import ctx, http# --- Configuration ---------------------------------------------------------
# Exact hostnames to match
HOST_LIST = {"meshstage.lessen.com"
}# Default delays (seconds)
DEFAULT_REQUEST_DELAY = 5   # delay before forwarding request to upstream
DEFAULT_RESPONSE_DELAY = 601  # delay before sending response back to client# Optional per-host overrides (host -> (request_delay, response_delay))
# If a host is not listed here, defaults are used.
HOST_DELAY_MAP = {# "api.example.com": (0.05, 0.05),# "example.com": (0.5, 0.5),
}# Whether to match by exact host OR by regex patterns
USE_REGEX_MATCHING = False
# ---------------------------------------------------------------------------def _match_host(host: str) -> bool:"""Return True if the host matches our lists or regexes."""if not host:return Falseif host in HOST_LIST:return Truereturn Falsedef _get_delays_for_host(host: str):"""Return (request_delay, response_delay) for host."""if host in HOST_DELAY_MAP:return HOST_DELAY_MAP[host]return DEFAULT_REQUEST_DELAY, DEFAULT_RESPONSE_DELAYclass ThrottleLatency:def __init__(self):ctx.log.info("throttle_latency addon loaded")ctx.log.info(f"Hosts exact: {sorted(HOST_LIST)}")async def request(self, flow: http.HTTPFlow) -> None:"""
        Called when a client request has been received.We add delay BEFORE the request is forwarded to upstream."""
        host = flow.request.host or flow.request.headers.get("host", "")if _match_host(host):req_delay, _ = _get_delays_for_host(host)if req_delay and req_delay > 0:ctx.log.info(f"Delaying request to {host} by {req_delay}s")await asyncio.sleep(req_delay)async def response(self, flow: http.HTTPFlow) -> None:"""
        Called when a response has been received from upstream.We add delay BEFORE the response is sent back to the client."""
        host = flow.request.host or flow.request.headers.get("host", "")if _match_host(host):_, resp_delay = _get_delays_for_host(host)if resp_delay and resp_delay > 0:ctx.log.info(f"Delaying response from {host} by {resp_delay}s")await asyncio.sleep(resp_delay)addons = [ThrottleLatency()]

./mitmweb -s ./throttle_latency.py

 

相关新闻

  • 详细介绍:Uniapp微信小程序开发:onPullDownRefresh
  • 2025年市场技术好的ERP管理系统口碑推荐榜,优秀的ERP服务商赋能企业生产效率提升与成本优化
  • 2025年汉口水泥砖厂家质量排行榜发布,水泥砖哪家专业鑫俊熙诚信务实提供高性价比服务

最新新闻

  • 2026 赣州防水补漏靠谱服务商盘点:屋面 / 厨卫 / 外墙 / 地下室渗水维修详解,适配赣南多雨山区高湿防水甄选指南 - 宅安选房屋修缮
  • 紧急收藏!2026台州戒网瘾学校TOP5揭晓,纽特心理,军事化管理帮孩子戒网逆袭 - 辛云教育资讯
  • Fluent二维刚体平移运动UDF:基于质心运动宏的动网格控制源码包
  • 吴恩达《深度学习》之看懂 YOLO 目标检测的“鹰眼”直觉
  • 精选10所|2026南京市十大叛逆青少年戒网瘾封闭式管教学校名单,解家长焦虑,助少年归正 - 辛云教育资讯
  • 梯度裁剪:G-Crop革新小样本图像分类

日新闻

  • 5分钟掌握Python进化算法:Geatpy高性能优化工具完全指南
  • Microchip 24AA044 EEPROM选型与应用全指南:从参数解析到实战编程
  • 华为的鸿蒙到底有多牛?为什么称作遥遥领先?

周新闻

  • 3步解锁iOS设备:applera1n激活锁绕过完全指南
  • 39 2026 人工智能证书终极盘点,普通人选 AI 证书可以从这些方向入手
  • Redis 暴露公网有多危险?从端口检查到补救步骤

月新闻

  • 【总结】入门篇:50句话让你记住架构核心概念
  • WeChatMsg技术方案解析:实现Mac微信数据自主管理的完整解决方案
  • WeChatMsg:革新性微信数据备份方案,打造你的专属数字记忆库

关于尧图

  • 公司简介
  • 团队介绍
  • 企业文化
  • 荣誉资质

服务项目

  • 定制开发
  • 电商建站
  • UI 设计
  • 运维服务

快速链接

  • 案例展示
  • 建站流程
  • 常见问题
  • 资讯中心

联系方式

  • 📍北京市朝阳区互联网产业园 A 座 10 层
  • 📞400-888-8888
  • ✉️contact@rkmt.cn
  • 🕐周一至周日 9:00-21:00

© 2024 北京尧图网络科技有限公司 版权所有 | 京 ICP 备 XXXXXXXX 号