# pctools **Repository Path**: 963149408.com/pctools ## Basic Information - **Project Name**: pctools - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-11-02 - **Last Updated**: 2026-11-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # PCTools API Android App 的后端工具服务,基于 **FastAPI** 的模块化设计。当前已实现三大功能:文件管理、命令执行、文件传输(后端 socket 推送到 Android)。 ## 快速开始 ```bash # 1. 安装依赖 python -m pip install -r requirements.txt # 2. 配置(复制样例并按需修改,尤其是 API_TOKEN) copy .env.example .env # 3. 启动 python run.py # 或:python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 ``` 启动后访问交互式文档: ## 功能 | 功能 | 路由前缀 | 说明 | | ---- | --------------- | --------------------------- | | 文件管理 | `/api/files` | 浏览/增删改/读写/上传/下载 | | 命令执行 | `/api/command` | 同步与后台两种模式,超时与输出保护 | | 文件传输 | `/api/transfer` | 后端连接 Android socket 服务端(IPv6)推送文件 | > 文件下载(`/api/files/download`)要求 Android 端先上报自身 **IPv6 地址**,没有则返回"无法下载:没有 IPv6 地址";校验通过后复用传输模块连接该 IPv6 推送文件。 ## 鉴权 请求头携带 `Authorization: Bearer `,令牌在 `.env` 配置。 ## 文档 - [架构设计](doc/architecture.md) - [接口文档](doc/api.md) - [文件传输协议与 Android 接入指南](doc/transfer-protocol.md) ## 本地联调文件传输 ```bash python tests/mock_android_server.py 9527 ::1 # 模拟 Android socket 服务端(默认监听 IPv6 ::1) python run.py # 启动后端 # 另开终端调用 /api/files/download(body 带 "ipv6":"::1"),接收文件落在 tests/received/ ```