From d88f83730bb5d5e4246fc7336f7f4358f0fd7b6b Mon Sep 17 00:00:00 2001 From: greyoak111 Date: Sun, 22 Nov 2026 21:43:12 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20gis-lite=20/=20kiwix?= =?UTF-8?q?=20/=20gis=20=E4=B8=89=E4=B8=AA=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - gis-lite (#90):PROJ 9.9.0 + GEOS 3.15.0 + SpatiaLite 5.1.0-3,带 spatialite 入口 - kiwix (#84):kiwix-tools 3.8.2,带默认只监听 127.0.0.1 的 kiwix-serve-local - gis (#85):GDAL 3.13.3-2(新底座 libicu 79.1 已解除阻塞) 三个 selftest 已在 HONOR Magic V6 / Android 17 / devkit-2026.11.21.2 上 按组件包解包后的真实前缀跑通。docs/wanted.md 与 README 同步收录。 Co-Authored-By: Claude Code --- README.md | 7 ++- README.zh-CN.md | 5 +- docs/wanted.md | 20 ++++-- recipes/gis-lite/bin/gis-lite-selftest | 51 +++++++++++++++ recipes/gis-lite/bin/spatialite | 7 +++ recipes/gis-lite/recipe.json | 27 ++++++++ recipes/gis-lite/skill/SKILL.md | 87 ++++++++++++++++++++++++++ recipes/gis/bin/gis-selftest | 64 +++++++++++++++++++ recipes/gis/recipe.json | 26 ++++++++ recipes/gis/skill/SKILL.md | 83 ++++++++++++++++++++++++ recipes/kiwix/bin/kiwix-selftest | 36 +++++++++++ recipes/kiwix/bin/kiwix-serve-local | 9 +++ recipes/kiwix/recipe.json | 27 ++++++++ recipes/kiwix/skill/SKILL.md | 74 ++++++++++++++++++++++ 14 files changed, 516 insertions(+), 7 deletions(-) create mode 100644 recipes/gis-lite/bin/gis-lite-selftest create mode 100644 recipes/gis-lite/bin/spatialite create mode 100644 recipes/gis-lite/recipe.json create mode 100644 recipes/gis-lite/skill/SKILL.md create mode 100644 recipes/gis/bin/gis-selftest create mode 100644 recipes/gis/recipe.json create mode 100644 recipes/gis/skill/SKILL.md create mode 100644 recipes/kiwix/bin/kiwix-selftest create mode 100644 recipes/kiwix/bin/kiwix-serve-local create mode 100644 recipes/kiwix/recipe.json create mode 100644 recipes/kiwix/skill/SKILL.md diff --git a/README.md b/README.md index e05d445..72e7c34 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ cccodroid reads this repository since 0.1.10. Preset components such as the brow | `rclone` | rclone: sync and back up local folders, WebDAV, S3, Google Drive and more | Net | | MIT | | `snowluma` | QQ bot (native SnowLuma): OneBot v11 + allow-list bridge, same mechanism as `qq-bot` | Net | Downloads SnowLuma at setup from archive mirrors | Apache-2.0 (scripts); SnowLuma source-available non-commercial (runtime) | -Every published component has been verified on a real device with the current toolchain (devkit-2026.10.28). Some were tested directly; others inherited a verification from an earlier toolchain (see "Device verification" below). The records are in [`verified.json`](verified.json). +Every published component has been verified against the current toolchain (devkit-2026.11.21.2): some on a real device, some by inheriting an earlier device record, and some by the arm64 container running its selftest (see "Device verification" below). The records are in [`verified.json`](verified.json). The app won't offer "Snapdragon only" components on devices with other chips. For components with dependencies, the app asks you to install those first and won't let you remove them while something still depends on them. @@ -76,7 +76,10 @@ Also published and verified for the current toolchain. Read the description befo - `apk-tools` (Dev): apktool decode/rebuild and dex2jar, for inspecting your own or authorized APKs. jadx is not included. - `ml-tflite` (AI): TensorFlow Lite 2.21 CPU inference with its own numpy; bring your own model. - `minecraft-server` (Other): a native Paper 1.21.11 server; Java 21 comes from the base. The first start downloads the vanilla server from Mojang (about 54 MB) and patches it, which took almost 9 minutes in testing. You must read and accept the [Minecraft EULA](https://aka.ms/MinecraftEULA) yourself. Listens locally by default; LAN play has to be turned on explicitly. -- `qq-bot` (Net): runs Linux QQ + NapCat natively as a OneBot bot that only answers allow-listed conversations and always replies as an AI. The first `setup` downloads from Tencent and NapCat's GitHub Release after you agree — about 307 MB, about 1.1 GB installed. **Disclaimer: this is a community component, not affiliated with or endorsed by Tencent, QQ or NapCat. It drives the QQ client through an unofficial framework, which may breach Tencent's terms; the QQ account you log in with may be restricted, frozen or banned, at your own risk — use a spare account. Replies are AI-generated and you are responsible for everything the bot sends, including following the law, platform rules and group rules. Do not use it for mass registration, account farming, spam, marketing blasts or impersonating people. NapCat is licensed for non-commercial use only. Provided "as is", without warranty of any kind.** +- `qq-bot` (Net): runs Linux QQ + NapCat natively as an OneBot bot that only answers allow-listed conversations and always replies as an AI. The first `setup` downloads from Tencent and NapCat's GitHub Release after you agree — about 307 MB, about 1.1 GB installed. **Disclaimer: this is a community component, not affiliated with or endorsed by Tencent, QQ or NapCat. It drives the QQ client through an unofficial framework, which may breach Tencent's terms; the QQ account you log in with may be restricted, frozen or banned, at your own risk — use a spare account. Replies are AI-generated and you are responsible for everything the bot sends, including following the law, platform rules and group rules. Do not use it for mass registration, account farming, spam, marketing blasts or impersonating people. NapCat is licensed for non-commercial use only. Provided "as is", without warranty of any kind.** +- `gis-lite` (Science): PROJ coordinate transforms/projections + GEOS geometry operations (geosop) + SQLite's SpatiaLite extension, auto-loaded by the `spatialite` entry point. About 39.5 MB; does not handle mainland China's GCJ-02 offset. +- `gis` (Science): GDAL 3.13 command line for raster/vector format conversion and coordinate transforms (gdalinfo, gdal_translate, gdalwarp, ogr2ogr and more). About 121 MB; needs devkit-2026.11.21 or newer (libicu 79.1), and shares PROJ / GEOS / SpatiaLite packages with `gis-lite`. +- `kiwix` (Other): offline ZIM knowledge bases (kiwix-serve / kiwix-manage / kiwix-search); `kiwix-serve-local` listens on 127.0.0.1 only. About 18.2 MB; bring your own ZIM files and use devkit-2026.11.21 or newer. ## How it works diff --git a/README.zh-CN.md b/README.zh-CN.md index 63f880f..9eb01bc 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -52,7 +52,7 @@ cccodroid 从 0.1.10 起读这个仓库。浏览器(Chromium)这类预置组 | `rclone` | rclone:本地目录、WebDAV、S3、Google Drive 等云存储的同步与备份 | 网络 | | MIT | | `snowluma` | QQ 机器人(原生 SnowLuma):OneBot v11 + 白名单桥,与 `qq-bot` 同款机制 | 网络 | 首次 setup 从档案镜像下载 SnowLuma | Apache-2.0(脚本);SnowLuma 源码可用非商业许可(运行时) | -所有已上架的组件都在当前工具包(devkit-2026.10.28)上真机验证过:有的直接验,有的从旧工具包上的验证记录自动继承(见下面「真机验证」)。具体记录在 [`verified.json`](verified.json)。 +所有已上架的组件都在当前工具包(devkit-2026.11.21.2)上验证过:有的真机直接验,有的从旧工具包上的真机记录自动继承,有的由 arm64 容器自动跑过 selftest(见下面「真机验证」)。具体记录在 [`verified.json`](verified.json)。 「仅骁龙」的组件,App 在别家芯片的设备上不给装。有依赖的组件,App 会先让你装好依赖,依赖也不能在它之前卸载。 @@ -77,6 +77,9 @@ cccodroid 从 0.1.10 起读这个仓库。浏览器(Chromium)这类预置组 - `ml-tflite`(AI):TensorFlow Lite 2.21 CPU 推理,自带 numpy;模型自备。 - `minecraft-server`(其他):原生跑 Paper 1.21.11 服务端,Java 21 由底座提供。第一次启动会从 Mojang 官方下载原版服务端(约 54 MB)并打补丁,实测近 9 分钟;要你自己读并同意 [Minecraft EULA](https://aka.ms/MinecraftEULA)。默认只听本机,局域网联机要显式打开。 - `qq-bot`(网络):在手机上原生跑 Linux 版 QQ + NapCat 的 OneBot 机器人,只回复白名单里的会话,明确以 AI 身份回复。第一次 `setup` 经你同意后从腾讯官方和 NapCat 的 GitHub Release 下载,共约 307 MB、装后约 1.1 GB。**免责声明:本组件是社区作品,与腾讯、QQ、NapCat 均无关联,未获官方授权或认可;它通过非官方框架接管 QQ 客户端,可能违反腾讯的服务协议,登录的 QQ 号可能被限制、冻结或封禁,风险与损失由使用者自行承担,建议用小号。机器人的回复由 AI 生成,使用者对它发出的全部内容负责,须遵守法律法规、平台规则和群规;不得用于批量注册、养号、刷屏、营销群发或冒充真人。NapCat 限非商业使用。组件按「现状」提供,不作任何担保。** +- `gis-lite`(科学计算):PROJ 坐标转换/投影 + GEOS 几何运算(geosop)+ SQLite 空间扩展 SpatiaLite,`spatialite` 入口自动加载 mod_spatialite。约 39.5 MB;不处理国内地图的 GCJ-02 偏移。 +- `gis`(科学计算):GDAL 3.13 命令行,栅格/矢量格式转换与坐标转换(gdalinfo、gdal_translate、gdalwarp、ogr2ogr 等)。约 121 MB;需要工具包 devkit-2026.11.21 或更新(libicu 79.1),和 `gis-lite` 共用 PROJ / GEOS / SpatiaLite 的包。 +- `kiwix`(其他):离线 ZIM 知识库(kiwix-serve / kiwix-manage / kiwix-search),`kiwix-serve-local` 默认只监听 127.0.0.1。约 18.2 MB;ZIM 文件由你自己下载,需要 devkit-2026.11.21 或更新。 ## 怎么运作 diff --git a/docs/wanted.md b/docs/wanted.md index d1fddaf..1231f17 100644 --- a/docs/wanted.md +++ b/docs/wanted.md @@ -32,6 +32,14 @@ 能跑:qemu-system-x86-64-headless 11.1.2 + Alpine virt ISO,串口登录、端口转发、SSH 都通。但装后 409 MB + 66 MB ISO,启动约 37 秒,速度约本机的 1/4。维护者判断不值得,真有需要的人可以接手。 +### 已收录为组件 + +下面这些原来在清单里,2026-11 已经做成组件(配方在本仓库,装后自带 skill): + +- `gis-lite`(#90):PROJ + GEOS + SpatiaLite。坐标转换/投影、几何运算、SQLite 空间扩展;不依赖 libicu。 +- `gis`(#85):GDAL 3.13。栅格/矢量格式转换、坐标转换;需要工具包 devkit-2026.11.21 或更新(libicu 79.1)。 +- `kiwix`(#84):kiwix-tools 3.8.2。离线 ZIM 知识库服务与检索;需要 devkit-2026.11.21 或更新。 + ### 只有设想、没实测的 | id | 内容 | 要先弄清的 | @@ -41,13 +49,11 @@ | `databases` | PostgreSQL + Valkey 本机服务 | 同上的常驻进程问题;数据目录放 `~/.cccodroid/databases/` | | `photo-tools` | libvips、exiftool、libraw、potrace、G'MIC | 和底座 ImageMagick 的分工;分享前去 GPS | | `math` | Maxima、PARI/GP、gnuplot、Z3 + SymPy(配方 `pip`) | gnuplot 中文标题 | -| `gis` | GDAL + PROJ | GCJ-02 偏移 PROJ 不管,要写明 | | `backup` | restic,后端借 `rclone` 组件 | 密码只让用户自己输 | | `ml-onnx` | onnxruntime + OpenCV 端上推理 | 先量体积;模型许可证要能再分发 | | `video-edit` | MLT(melt)无头剪辑 | 比直接写 ffmpeg 好在哪;体积 | | `dotnet` | .NET SDK(`linux-arm64`) | **Termux `main`/`glibc` 仓库里目前没有 `dotnet`(`pkg install` 不可用)**;若做成组件需走 `kind: "glibc"` + `fetch`(`extract`)拉取微软官方 `linux-arm64` 归档,先评估解包体积、ICU 依赖与 `DOTNET_SYSTEM_GLOBALIZATION_INVARIANT` / 许可证 | | `docsearch` | 在 PDF 等文档里全文搜索:pdfgrep + ripgrep-all(rga) | rga 是 AGPL-3.0-or-later;和已有的 `pdf-tools`(已含 poppler、qpdf)怎么分工,别重复打包 | -| `kiwix` | kiwix-tools:本机开离线知识库(维基百科等 ZIM 文件)服务 | 自检需要一个能再分发的小 ZIM;ZIM 本体由用户自己下 | | `recoll` | Recoll 全文索引,中文走 CJK n-gram | Termux 包只有 `recollindex`,没有查询命令,要用 recoll-python 写一个查询包装脚本 | | `tiddlywiki` | TiddlyWiki 个人笔记维基(npm,约 37 MB) | 配方走 npm,要钉版本和完整性哈希 | @@ -96,6 +102,14 @@ Tested 2026-10-19 (Gradle 9.8.1 / JDK 21 / AGP 9.4.1 / compileSdk 36): It works: qemu-system-x86-64-headless 11.1.2 with the Alpine virt ISO; serial login, port forwarding and SSH all tested. But it's 409 MB installed plus a 66 MB ISO, boots in about 37 s and runs at about a quarter of native speed. The maintainer decided it isn't worth it; take it on if you need it. +### Now components + +These were on the list and became components in 2026-11 (recipes live in this repo; each ships a skill): + +- `gis-lite` (#90): PROJ + GEOS + SpatiaLite — coordinate transforms/projections, geometry operations and SQLite's spatial extension. Does not need libicu. +- `gis` (#85): GDAL 3.13 — raster/vector format conversion and coordinate transforms. Needs devkit-2026.11.21 or newer (libicu 79.1). +- `kiwix` (#84): kiwix-tools 3.8.2 — offline ZIM knowledge bases and search. Needs devkit-2026.11.21 or newer. + ### Ideas, not yet tested | id | What | Find out first | @@ -105,13 +119,11 @@ It works: qemu-system-x86-64-headless 11.1.2 with the Alpine virt ISO; serial lo | `databases` | Local PostgreSQL + Valkey | The same long-running-process question; data under `~/.cccodroid/databases/` | | `photo-tools` | libvips, exiftool, libraw, potrace, G'MIC | Division of labour with ImageMagick in the base; strip GPS before sharing | | `math` | Maxima, PARI/GP, gnuplot, Z3 + SymPy (recipe `pip`) | Chinese titles in gnuplot | -| `gis` | GDAL + PROJ | PROJ doesn't handle the GCJ-02 offset; say so | | `backup` | restic, with the `rclone` component as a backend | Only the user types passwords | | `ml-onnx` | onnxruntime + OpenCV on-device inference | Measure the size first; model licenses must allow redistribution | | `video-edit` | MLT (melt) headless editing | What it does better than plain ffmpeg; size | | `dotnet` | .NET SDK (`linux-arm64`) | **Not available in Termux `main`/`glibc` (`pkg install dotnet` does not exist)**; a component would need `kind: "glibc"` + `fetch` (`extract`) of Microsoft's official `linux-arm64` tarball — evaluate unpacked size, ICU dependency, and license first | | `docsearch` | Full-text search inside PDFs and other documents: pdfgrep + ripgrep-all (rga) | rga is AGPL-3.0-or-later; split the work with the existing `pdf-tools` (which already has poppler and qpdf) instead of packaging them twice | -| `kiwix` | kiwix-tools: serve offline knowledge bases (Wikipedia etc. as ZIM files) locally | The self-test needs a small redistributable ZIM; users download the real ZIMs themselves | | `recoll` | Recoll full-text indexing, with CJK n-grams for Chinese | The Termux package only has `recollindex`, no query command; a query wrapper has to be written with recoll-python | | `tiddlywiki` | TiddlyWiki personal notes wiki (npm, about 37 MB) | npm recipe; pin the version and integrity hash | diff --git a/recipes/gis-lite/bin/gis-lite-selftest b/recipes/gis-lite/bin/gis-lite-selftest new file mode 100644 index 0000000..42ef969 --- /dev/null +++ b/recipes/gis-lite/bin/gis-lite-selftest @@ -0,0 +1,51 @@ +#!{{PREFIX}}/bin/sh +# gis-lite 自检:PROJ 坐标转换、GEOS 几何运算、SpatiaLite 空间 SQL。 +# 不联网、不写用户文件;临时文件在 $TMPDIR,结束即删。 +set -u +PREFIX="{{PREFIX}}" +tmp="${TMPDIR:-$PREFIX/tmp}/gis-lite-selftest.$$" +mkdir -p "$tmp" || { echo "✗ 建不了临时目录 $tmp"; exit 1; } +trap 'rm -rf "$tmp"' EXIT HUP INT TERM +fail=0 +bad() { printf '✗ %s\n' "$*"; fail=1; } + +# 1) PROJ:WGS84 经纬度 → UTM 50N。传统 GIS 顺序:经度在前。 +out=$(printf '116.4 39.9\n' | "$PREFIX/bin/proj" +proj=utm +zone=50 +datum=WGS84 2>"$tmp/proj.err") +if [ $? -ne 0 ] || [ -z "$out" ]; then + bad "proj 转换失败:$(cat "$tmp/proj.err" 2>/dev/null)" +else + x=$(printf '%s\n' "$out" | awk '{print $1}') + y=$(printf '%s\n' "$out" | awk '{print $2}') + # 北京 116.4E 39.9N 在 UTM 50N 约为 44.8 万 / 441.8 万(留 2 万米余量) + if awk -v x="$x" -v y="$y" 'BEGIN{exit !(x>430000 && x<465000 && y>4380000 && y<4450000)}'; then + echo "PROJ: OK (116.4,39.9) -> UTM 50N ($x, $y)" + else + bad "proj 结果不像 UTM 50N:$out" + fi +fi + +# 2) GEOS:2×2 正方形面积应为 4。 +area=$("$PREFIX/bin/geosop" -a "POLYGON((0 0,0 2,2 2,2 0,0 0))" area 2>"$tmp/geos.err") +if [ $? -eq 0 ] && [ "$area" = "4" ]; then + echo "GEOS: OK (2x2 polygon area=$area)" +else + bad "geosop 面积计算失败(得到 '$area'):$(cat "$tmp/geos.err" 2>/dev/null)" +fi + +# 3) SpatiaLite:经 sqlite3 加载 mod_spatialite,做一次真实的空间运算。 +sv=$("$PREFIX/bin/spatialite" :memory: \ + "SELECT spatialite_version(); SELECT ROUND(ST_Area(ST_Buffer(ST_Point(0,0), 1)), 2);" 2>"$tmp/spatialite.err") +rc=$? +ver=$(printf '%s\n' "$sv" | sed -n 1p) +bufarea=$(printf '%s\n' "$sv" | sed -n 2p) +if [ $rc -eq 0 ] && [ -n "$ver" ] && [ "$bufarea" = "3.14" ]; then + echo "SpatiaLite: OK (version=$ver, buffer area=$bufarea)" +else + bad "mod_spatialite 加载或空间运算失败(rc=$rc,输出 '$(printf '%s' "$sv" | tr '\n' ' ')'):$(cat "$tmp/spatialite.err" 2>/dev/null)" +fi + +if [ "$fail" -ne 0 ]; then + echo "===== 总结 ===== gis-lite FAIL" + exit 1 +fi +echo "===== 总结 ===== PROJ=OK GEOS=OK SpatiaLite=$ver" diff --git a/recipes/gis-lite/bin/spatialite b/recipes/gis-lite/bin/spatialite new file mode 100644 index 0000000..6e2a2d3 --- /dev/null +++ b/recipes/gis-lite/bin/spatialite @@ -0,0 +1,7 @@ +#!{{PREFIX}}/bin/sh +# 用底座自带的 sqlite3 打开数据库,并预先加载本组件的 mod_spatialite。 +# 其余参数原样交给 sqlite3(数据库路径、SQL、-readonly、-cmd 等): +# spatialite my.db "SELECT spatialite_version();" +# spatialite -readonly my.db "SELECT COUNT(*) FROM spatial_ref_sys;" +# spatialite :memory: "SELECT ST_Area(ST_Buffer(ST_Point(0,0), 1));" +exec "{{PREFIX}}/bin/sqlite3" -cmd ".load {{PREFIX}}/lib/mod_spatialite.so" "$@" diff --git a/recipes/gis-lite/recipe.json b/recipes/gis-lite/recipe.json new file mode 100644 index 0000000..9195f5e --- /dev/null +++ b/recipes/gis-lite/recipe.json @@ -0,0 +1,27 @@ +{ + "schema": 1, + "id": "gis-lite", + "kind": "termux", + "revision": 1, + "name": { + "zh": "地理信息基础(PROJ + GEOS + SpatiaLite)", + "en": "GIS essentials (PROJ + GEOS + SpatiaLite)" + }, + "desc": { + "zh": "坐标转换与投影(proj、cs2cs、cct、gie、projinfo)、几何运算(geosop、libgeos),以及 SQLite 空间扩展 mod_spatialite(spatialite 入口自动加载)。不含 GDAL 的栅格/矢量格式工具;国内地图的 GCJ-02 偏移不处理。", + "en": "Coordinate transforms and projections (proj, cs2cs, cct, gie, projinfo), geometry operations (geosop, libgeos), and SQLite's spatial extension mod_spatialite (auto-loaded by the spatialite entry point). No GDAL raster/vector format tools; mainland China's GCJ-02 offset is not handled." + }, + "roots": ["proj", "libgeos", "libspatialite"], + "bin": ["proj", "cs2cs", "cct", "gie", "projinfo", "geosop", "spatialite"], + "selftest": "gis-lite-selftest", + "needs": { "shizuku": false, "display": false, "gpu": false }, + "category": "science", + "license": "MIT AND LGPL-2.1 AND GPL-2.0", + "homepage": "https://proj.org", + "maintainers": ["greyoak111"], + "files": { + "usr/bin/spatialite": { "src": "bin/spatialite", "mode": "755" }, + "usr/bin/gis-lite-selftest": { "src": "bin/gis-lite-selftest", "mode": "755" } + }, + "notes": "proj 9.9.0 + libgeos 3.15.0 + libspatialite 5.1.0-3(Termux main)。不依赖 libicu,旧底座也能跑;本地只在 devkit-2026.11.21.2 上验证过。闭包 6.6 MB 下载 / 39.5 MB 解包(devkit-2026.11.21.2,底座之外的 6 个包:proj、libgeos、libspatialite、libfreexl、librttopo、libminizip);组件包 11.5 MB(gz)。spatialite 是把底座自带的 sqlite3 用 -cmd .load 打开 mod_spatialite;selftest 做一次 WGS84→UTM 50N 转换、一次 geosop 面积计算、一次 mod_spatialite 的 ST_Buffer/ST_Area,不联网、不写用户文件。" +} diff --git a/recipes/gis-lite/skill/SKILL.md b/recipes/gis-lite/skill/SKILL.md new file mode 100644 index 0000000..4f9bf5b --- /dev/null +++ b/recipes/gis-lite/skill/SKILL.md @@ -0,0 +1,87 @@ +--- +name: gis-lite +description: 坐标转换/投影(PROJ)、几何运算(GEOS/geosop)、SQLite 空间扩展 SpatiaLite(cccodroid 组件 gis-lite):用户要在设备上做 EPSG 坐标转换、经纬度投影、几何面积/距离/相交,或在 SQLite 里用 ST_* 空间函数时使用。不含 GDAL,也不处理国内地图的 GCJ-02 偏移。 +--- + +# 地理信息基础:PROJ + GEOS + SpatiaLite + +本机装了 Termux 官方仓库的 `proj 9.9.0`、`libgeos 3.15.0`、`libspatialite 5.1.0-3`, +并带一个把底座 `sqlite3` 与 `mod_spatialite` 接起来的入口 `spatialite`。 + +**这不是 GDAL**:没有 `gdalinfo`、`gdalwarp`、`ogr2ogr`,不能读 GeoTIFF / Shapefile / GeoJSON 全家桶。 +需要这些时用 `gis` 组件(如果已装)。 + +## 先自检 + +```sh +gis-lite-selftest +``` + +最后一行应为 `===== 总结 ===== PROJ=OK GEOS=OK SpatiaLite=5.1.0`,约 1 秒。 +它做一次 WGS84→UTM 50N 转换、一次 `geosop` 面积计算、一次 `mod_spatialite` 的 `ST_Buffer`/`ST_Area`; +不联网、不写用户文件(临时文件在 `$TMPDIR`,结束即删)。 + +## 运行链路 + +``` +proj / cs2cs / cct / gie / projinfo + └─ $PREFIX/bin/<命令> 本组件(Termux main 的 proj 9.9.0,前缀已等长改写成应用路径) + ├─ libproj.so 本组件 $PREFIX/lib + ├─ proj.db 等数据 本组件 $PREFIX/share/proj(编译进去的路径就是这里) + └─ libsqlite3 / libtiff / libcurl 底座(devkit 基础模块) + +geosop + ├─ $PREFIX/bin/geosop 本组件(libgeos 3.15.0) + └─ libgeos.so / libc++_shared.so 本组件 + 底座 + +spatialite(本组件的包装脚本) + ├─ $PREFIX/bin/spatialite 本组件 → exec 底座的 $PREFIX/bin/sqlite3 -cmd ".load …/lib/mod_spatialite.so" + ├─ mod_spatialite.so 本组件(libspatialite) + └─ libgeos_c / libproj / libfreexl / libxml2 / librttopo 本组件或底座 +``` + +| 这一环 | 由谁提供 | 缺了会怎样 | +|---|---|---| +| `proj` / `cs2cs` / `cct` / `gie` / `projinfo` | 本组件(Termux main) | 命令不存在 | +| `geosop` 与 `libgeos` | 本组件 | 命令不存在或 `CANNOT LINK EXECUTABLE` | +| `sqlite3` | **底座**(本组件不带) | `spatialite` 明确报找不到 `$PREFIX/bin/sqlite3` | +| `mod_spatialite.so` | 本组件 | `spatialite` 的 `.load` 报 `no such file` / `cannot open shared object` | +| PROJ 数据(`proj.db`) | 本组件 `share/proj` | 转换报 `Cannot find proj.db` | + +没有静默降级:库或数据缺了就是明确报错,不会退回低精度算法。 + +## 常用 + +```sh +# 坐标转换:传统 GIS 顺序(经度 纬度) +echo "116.4 39.9" | proj +proj=utm +zone=50 +datum=WGS84 +echo "116.4 39.9" | cs2cs +proj=longlat +datum=WGS84 +to +proj=utm +zone=50 +datum=WGS84 + +# EPSG 代码(注意 PROJ 按 CRS 定义的轴序输出;拿不准就加 -f "%.8f" 先看两列再判断) +echo "39.9 116.4" | cs2cs EPSG:4326 EPSG:3857 + +# 几何运算 +geosop -a "POLYGON((0 0,0 2,2 2,2 0,0 0))" area +geosop -a "POINT(0 0)" -b "POINT(3 4)" distance +geosop -a "POLYGON((0 0,0 2,2 2,2 0,0 0))" -b "POLYGON((1 1,1 3,3 3,3 1,1 1))" intersection + +# SQLite 空间扩展(自动加载 mod_spatialite) +spatialite :memory: "SELECT spatialite_version();" +spatialite my.db "SELECT COUNT(*) FROM spatial_ref_sys;" +spatialite -readonly my.db "SELECT ST_AsText(ST_Point(116.4, 39.9));" +``` + +- `spatialite` 就是底座 `sqlite3` 加一句 `.load mod_spatialite`,参数完全照 sqlite3 用(`-readonly`、`-cmd`、`.tables` 都可以)。 +- 新建空间库时按 SpatiaLite 的流程:`SELECT InitSpatialMetaData();` → 建带几何列的表 → `AddGeometryColumn(...)`。 +- `cct` 适合跑 PROJ 管线(`+proj=pipeline …`);`gie` 跑 PROJ 自带的测试;`projinfo` 查 EPSG 定义。 + +## 常见坑 + +- **GCJ-02 / BD-09 不归 PROJ 管**:火星坐标是国内地图厂商的加密偏移,PROJ 只有官方基准(WGS84/CGCS2000 等)。 + 拿本组件做国内地图配准会差几百米;不要声称能“纠正火星坐标”。 +- **经纬度顺序**:`proj` 的传统接口按「经度 纬度」;`cs2cs EPSG:4326 EPSG:3857` 按 CRS 轴序(EPSG:4326 是纬度在前)。 + 结果不对时先检查是不是两列写反了。 +- **数据目录**:PROJ 数据在 `$PREFIX/share/proj`,不要改;用户自己的数据放用户指定路径,别写进组件目录。 +- **只读优先**:只查询时给 `spatialite` 加 `-readonly`;要写库先确认路径属于用户,别覆盖已有文件。 +- **没有服务端口**:本组件全是命令行工具,不起任何网络服务。 +- **装的两个组件共用包**:`gis`(GDAL)也带 proj / libgeos / libspatialite 同一批包;两个都装时是同一版本,可共存。 diff --git a/recipes/gis/bin/gis-selftest b/recipes/gis/bin/gis-selftest new file mode 100644 index 0000000..35877ce --- /dev/null +++ b/recipes/gis/bin/gis-selftest @@ -0,0 +1,64 @@ +#!{{PREFIX}}/bin/sh +# gis(GDAL)自检:栅格读转、坐标转换、矢量读取各走一遍。 +# 不联网、不写用户文件;临时文件在 $TMPDIR,结束即删。 +set -u +PREFIX="{{PREFIX}}" +tmp="${TMPDIR:-$PREFIX/tmp}/gis-selftest.$$" +mkdir -p "$tmp" || { echo "✗ 建不了临时目录 $tmp"; exit 1; } +trap 'rm -rf "$tmp"' EXIT HUP INT TERM +fail=0 +bad() { printf '✗ %s\n' "$*"; fail=1; } + +# 1) 版本 +ver=$("$PREFIX/bin/gdalinfo" --version 2>&1) +case "$ver" in + GDAL\ 3.*) echo "GDAL: OK ($ver)" ;; + *) bad "gdalinfo --version 失败:$(printf '%s' "$ver" | head -2)" ;; +esac + +# 2) 栅格:写一个 3×2 的 ASCII 栅格,转成 GeoTIFF 再读回来 +cat > "$tmp/in.asc" <<'EOF' +ncols 3 +nrows 2 +xllcorner 116.0 +yllcorner 39.0 +cellsize 0.01 +NODATA_value -9999 +1 2 3 +4 5 6 +EOF +if "$PREFIX/bin/gdal_translate" -q -a_srs EPSG:4326 -of GTiff "$tmp/in.asc" "$tmp/out.tif" 2>"$tmp/gt.err" \ + && "$PREFIX/bin/gdalinfo" "$tmp/out.tif" 2>"$tmp/gi.err" | grep -q "Size is 3, 2"; then + echo "GDAL raster: OK (ASCII grid -> GeoTIFF, size 3x2)" +else + bad "栅格读写失败:$(cat "$tmp/gt.err" "$tmp/gi.err" 2>/dev/null | head -3)" +fi + +# 3) 坐标转换:WGS84 经纬度 → Web Mercator +tr=$("$PREFIX/bin/gdaltransform" -s_srs EPSG:4326 -t_srs EPSG:3857 2>"$tmp/tr.err" <<'EOF' +116.4 39.9 +EOF +) +tx=$(printf '%s\n' "$tr" | awk 'NR==1{print $1}') +ty=$(printf '%s\n' "$tr" | awk 'NR==1{print $2}') +if awk -v x="$tx" -v y="$ty" 'BEGIN{exit !(x>12900000 && x<13000000 && y>4800000 && y<4900000)}'; then + echo "GDAL transform: OK (EPSG:4326 -> 3857: $tx $ty)" +else + bad "gdaltransform 结果不对:'$tr':$(cat "$tmp/tr.err" 2>/dev/null | head -2)" +fi + +# 4) 矢量:读一个 GeoJSON +cat > "$tmp/pt.geojson" <<'EOF' +{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"name":"beijing"},"geometry":{"type":"Point","coordinates":[116.4,39.9]}}]} +EOF +if "$PREFIX/bin/ogrinfo" -so -al "$tmp/pt.geojson" 2>"$tmp/og.err" | grep -q "Feature Count: 1"; then + echo "GDAL vector: OK (GeoJSON, Feature Count: 1)" +else + bad "ogrinfo 读取 GeoJSON 失败:$(cat "$tmp/og.err" 2>/dev/null | head -3)" +fi + +if [ "$fail" -ne 0 ]; then + echo "===== 总结 ===== gis FAIL" + exit 1 +fi +echo "===== 总结 ===== $(printf '%s' "$ver" | awk '{print $1" "$2}' | tr -d ,) raster=PASS transform=PASS vector=PASS" diff --git a/recipes/gis/recipe.json b/recipes/gis/recipe.json new file mode 100644 index 0000000..74fe56d --- /dev/null +++ b/recipes/gis/recipe.json @@ -0,0 +1,26 @@ +{ + "schema": 1, + "id": "gis", + "kind": "termux", + "revision": 1, + "name": { + "zh": "GIS(GDAL)", + "en": "GIS (GDAL)" + }, + "desc": { + "zh": "GDAL 3.13 命令行:gdalinfo / gdal_translate / gdalwarp / gdaltransform / gdalsrsinfo 处理栅格,ogrinfo / ogr2ogr 处理矢量,含 GeoTIFF、GeoJSON、Shapefile、PostGIS 等格式驱动。坐标转换由 PROJ 完成;国内地图的 GCJ-02 偏移不处理。", + "en": "GDAL 3.13 command line: gdalinfo / gdal_translate / gdalwarp / gdaltransform / gdalsrsinfo for rasters, ogrinfo / ogr2ogr for vectors, with drivers for GeoTIFF, GeoJSON, Shapefile, PostGIS and more. Coordinate transforms use PROJ; mainland China's GCJ-02 offset is not handled." + }, + "roots": ["gdal"], + "bin": ["gdalinfo", "gdal_translate", "gdalwarp", "gdaltransform", "gdalsrsinfo", "ogrinfo", "ogr2ogr"], + "selftest": "gis-selftest", + "needs": { "shizuku": false, "display": false, "gpu": false }, + "category": "science", + "license": "MIT", + "homepage": "https://gdal.org", + "maintainers": ["greyoak111"], + "files": { + "usr/bin/gis-selftest": { "src": "bin/gis-selftest", "mode": "755" } + }, + "notes": "gdal 3.13.3-2(Termux main)。闭包里有 xerces-c / postgresql(libpq),两者都要底座 devkit-2026.11.21 起的 libicu 79.1;旧底座(78.3)会报 libicuuc.so.79 not found。和 gis-lite 共用 proj / libgeos / libspatialite 同一批包(同版本,可共存)。闭包 24.0 MB 下载 / 121.2 MB 解包(devkit-2026.11.21.2,底座之外的 13 个包;libicu 由底座提供);组件包 38.3 MB(gz)。selftest 在 $TMPDIR 写一个 3×2 的 ASCII 栅格,gdal_translate 转 GTiff 再 gdalinfo,gdaltransform 做 EPSG:4326→3857,ogrinfo 读一个 GeoJSON;不联网、不写用户文件。" +} diff --git a/recipes/gis/skill/SKILL.md b/recipes/gis/skill/SKILL.md new file mode 100644 index 0000000..4125bad --- /dev/null +++ b/recipes/gis/skill/SKILL.md @@ -0,0 +1,83 @@ +--- +name: gis +description: GDAL 地理数据命令行(cccodroid 组件):栅格/矢量格式转换、坐标系转换、裁剪重投影、读写 GeoTIFF / GeoJSON / Shapefile / PostGIS。用户要处理地理数据、看栅格元数据、做 gdalwarp / ogr2ogr 时使用。不含 GCJ-02 火星坐标纠正。 +--- + +# GIS:GDAL 3.13 + +本机装了 Termux 官方仓库的 GDAL 3.13.3 命令行:`gdalinfo`、`gdal_translate`、`gdalwarp`、 +`gdaltransform`、`gdalsrsinfo`、`ogrinfo`、`ogr2ogr`,以及各格式驱动和 PROJ 数据。 + +**它要底座 devkit-2026.11.21 或更新的工具包**(libicu 79.1)。旧底座的组件不匹配,升级 cccodroid 后再装。 + +如果只需要坐标转换、几何运算、SQLite 空间扩展,装更轻的 `gis-lite` 就够;两边共用 proj / GEOS / SpatiaLite 的包。 + +## 先自检 + +```sh +gis-selftest +``` + +最后一行应为 `===== 总结 ===== GDAL 3.13.3 raster=PASS transform=PASS vector=PASS`,约 2 秒。 +它在 `$TMPDIR` 写一个 3×2 的 ASCII 栅格,`gdal_translate` 转 GeoTIFF 再 `gdalinfo`;`gdaltransform` 做 +EPSG:4326→3857;`ogrinfo` 读一个 GeoJSON。不联网、不写用户文件。 + +## 运行链路 + +``` +gdalinfo / gdal_translate / gdalwarp / gdaltransform / gdalsrsinfo / ogrinfo / ogr2ogr + └─ $PREFIX/bin/<命令> 本组件(Termux main 的 gdal 3.13.3-2,前缀已等长改写) + ├─ libgdal.so 本组件 + ├─ 格式驱动 + share/gdal 本组件(GDAL_DATA 编译进去的路径) + ├─ PROJ(libproj + proj.db) 本组件(gdal 依赖 proj) + ├─ xerces-c → libicu*.so.79 **底座**(devkit-2026.11.21+) + ├─ postgresql/libpq → libicu*.so.79 **底座** + └─ libcurl / libsqlite / libpng / libtiff / libjpeg… 本组件或底座 + +输入输出数据由用户提供,组件不碰用户目录。 +``` + +| 这一环 | 由谁提供 | 缺了会怎样 | +|---|---|---| +| `libgdal` 与格式驱动 | 本组件 | `CANNOT LINK EXECUTABLE` 或驱动列表缺项 | +| `libicu 79.1` | **底座** devkit-2026.11.21+ | 旧底座报 `libicuuc.so.79 not found`,**明确失败,不会降级** | +| PROJ 数据(`proj.db`) | 本组件 | 坐标转换报 `Cannot find proj.db` | +| GDAL 数据(`share/gdal`) | 本组件 | 部分驱动/坐标系警告,通常不致命 | +| 输入/输出文件 | 用户 | 命令报打不开文件 | + +## 常用 + +```sh +# 看元数据 +gdalinfo dem.tif +gdalsrsinfo -o proj4 dem.tif + +# 格式转换 / 重投影 / 裁剪 +gdal_translate -of COG in.tif out.tif +gdalwarp -t_srs EPSG:3857 in.tif out_mercator.tif +gdalwarp -te 116.0 39.5 116.8 40.2 in.tif clipped.tif + +# 矢量 +ogrinfo -so -al data.geojson +ogr2ogr -f GeoJSON out.geojson in.shp +ogr2ogr -t_srs EPSG:3857 out.gpkg in.geojson + +# 坐标点转换(stdin:经度 纬度) +echo "116.4 39.9" | gdaltransform -s_srs EPSG:4326 -t_srs EPSG:3857 +``` + +- 中间文件和输出写到用户指定的目录(例如 `$HOME` 或工作区),不要写进 `$PREFIX`。 +- 大栅格先 `gdalinfo` 看尺寸,再用 `-te` / `-tr` 控制输出大小,避免把手机存储写满。 +- 写文件前先确认目标路径不存在或用户同意覆盖。 + +## 常见坑 + +- **GCJ-02 / BD-09 不归 GDAL 管**:火星坐标是国内地图厂商的加密偏移,PROJ/GDAL 只有官方基准。 + 用它做国内地图配准会差几百米;不要声称能“纠正火星坐标”。 +- **旧底座不能跑**:组件依赖底座里的 libicu 79.1。`CANNOT LINK EXECUTABLE … libicuuc.so.79` 就是工具包太旧, + 让用户升级 cccodroid 后重装,不要去软链 78。 +- **`-t_srs` 与 `-s_srs` 不要混**:输入没有坐标系时 `gdalwarp` 会报错;先 `gdalsrsinfo` 或 `gdalinfo` 看有没有 CRS, + 没有就用 `gdal_translate -a_srs` / `gdalwarp -s_srs` 明确指定。 +- **Shapefile 是多个文件**:`.shp` / `.shx` / `.dbf` / `.prj` 要一起拿;只给 `.shp` 会缺属性或坐标系。 +- **PostGIS 驱动存在但没有服务器**:本组件只带 `libpq`,不会在本机起 PostgreSQL;连接串里的服务器要用户自己提供。 +- **内存**:大栅格 `gdalwarp` 可能吃满内存;用 `-wm 256` 限制缓存,或分块处理。 diff --git a/recipes/kiwix/bin/kiwix-selftest b/recipes/kiwix/bin/kiwix-selftest new file mode 100644 index 0000000..82572d9 --- /dev/null +++ b/recipes/kiwix/bin/kiwix-selftest @@ -0,0 +1,36 @@ +#!{{PREFIX}}/bin/sh +# kiwix 自检:三个命令都能启动,且 libkiwix / libzim / libicu 79 能正常加载。 +# 没有可再分发的小 ZIM,所以不打开真实知识库;只验证本组件和它的库链。 +set -u +PREFIX="{{PREFIX}}" +fail=0 +bad() { printf '✗ %s\n' "$*"; fail=1; } + +v1=$("$PREFIX/bin/kiwix-serve" --version 2>&1) +if [ $? -eq 0 ] && [ -n "$v1" ]; then + echo "kiwix-serve: OK ($(printf '%s' "$v1" | head -1))" +else + bad "kiwix-serve --version 失败:$(printf '%s' "$v1" | head -3)" +fi + +v2=$("$PREFIX/bin/kiwix-manage" --version 2>&1) +if [ $? -eq 0 ] && [ -n "$v2" ]; then + echo "kiwix-manage: OK ($(printf '%s' "$v2" | head -1))" +else + bad "kiwix-manage --version 失败:$(printf '%s' "$v2" | head -3)" +fi + +# kiwix-search 没有 --version;不带参数时应打印用法并正常加载库(缺库会 CANNOT LINK EXECUTABLE) +v3=$("$PREFIX/bin/kiwix-search" 2>&1) +case "$v3" in + *CANNOT\ LINK*|*cannot\ locate*) bad "kiwix-search 加载失败:$(printf '%s' "$v3" | head -2)" ;; + *) echo "kiwix-search: OK (usage printed)" ;; +esac + +[ -x "$PREFIX/bin/kiwix-serve-local" ] || bad "kiwix-serve-local 不可执行" + +if [ "$fail" -ne 0 ]; then + echo "===== 总结 ===== kiwix FAIL" + exit 1 +fi +echo "===== 总结 ===== kiwix-serve=$(printf '%s' "$v1" | head -1 | awk '{print $NF}') kiwix-manage=$(printf '%s' "$v2" | head -1 | awk '{print $NF}') kiwix-search=OK" diff --git a/recipes/kiwix/bin/kiwix-serve-local b/recipes/kiwix/bin/kiwix-serve-local new file mode 100644 index 0000000..a6cc389 --- /dev/null +++ b/recipes/kiwix/bin/kiwix-serve-local @@ -0,0 +1,9 @@ +#!{{PREFIX}}/bin/sh +# 与 kiwix-serve 相同,但默认只监听 127.0.0.1(上游默认是 --address=all,会监听 0.0.0.0)。 +# 用户自己显式写了 -i / --address 时照用户的来。 +for a in "$@"; do + case "$a" in + --address|--address=*|-i|-i?*) exec "{{PREFIX}}/bin/kiwix-serve" "$@" ;; + esac +done +exec "{{PREFIX}}/bin/kiwix-serve" --address=127.0.0.1 "$@" diff --git a/recipes/kiwix/recipe.json b/recipes/kiwix/recipe.json new file mode 100644 index 0000000..7bb6c34 --- /dev/null +++ b/recipes/kiwix/recipe.json @@ -0,0 +1,27 @@ +{ + "schema": 1, + "id": "kiwix", + "kind": "termux", + "revision": 1, + "name": { + "zh": "Kiwix(离线 ZIM 知识库)", + "en": "Kiwix (offline ZIM knowledge bases)" + }, + "desc": { + "zh": "离线 ZIM 知识库工具:kiwix-serve 在设备上提供阅读服务,kiwix-manage 管理库文件,kiwix-search 做全文检索;另带一个默认只监听 127.0.0.1 的 kiwix-serve-local。ZIM 文件由用户自己下载。", + "en": "Tools for offline ZIM knowledge bases: kiwix-serve serves them on the device, kiwix-manage manages the library and kiwix-search does full-text search, plus kiwix-serve-local which listens on 127.0.0.1 by default. ZIM files are downloaded by the user." + }, + "roots": ["kiwix-tools"], + "bin": ["kiwix-serve", "kiwix-serve-local", "kiwix-manage", "kiwix-search"], + "selftest": "kiwix-selftest", + "needs": { "shizuku": false, "display": false, "gpu": false }, + "category": "other", + "license": "GPL-3.0", + "homepage": "https://github.com/kiwix/kiwix-tools", + "maintainers": ["greyoak111"], + "files": { + "usr/bin/kiwix-serve-local": { "src": "bin/kiwix-serve-local", "mode": "755" }, + "usr/bin/kiwix-selftest": { "src": "bin/kiwix-selftest", "mode": "755" } + }, + "notes": "kiwix-tools 3.8.2(Termux main),依赖 libkiwix 14.2.1 / libzim 9.8.2,两者都需要底座 devkit-2026.11.21 起的 libicu 79.1(旧底座的 78.3 会报 libicuuc.so.79 not found)。闭包 4.0 MB 下载 / 18.2 MB 解包(devkit-2026.11.21.2,底座之外的 14 个包;libicu 由底座提供);组件包 5.8 MB(gz)。上游 kiwix-serve 默认 --address=all(0.0.0.0),所以加一个 kiwix-serve-local 包装默认改绑 127.0.0.1。selftest 只验证三个命令能加载(libkiwix/libzim/ICU),没有可再分发的小 ZIM,不硬造。" +} diff --git a/recipes/kiwix/skill/SKILL.md b/recipes/kiwix/skill/SKILL.md new file mode 100644 index 0000000..bcd0899 --- /dev/null +++ b/recipes/kiwix/skill/SKILL.md @@ -0,0 +1,74 @@ +--- +name: kiwix +description: Kiwix 离线 ZIM 知识库(cccodroid 组件):用 kiwix-serve 在设备上开一个只读的离线维基/文档阅读页,kiwix-manage 管理库,kiwix-search 全文检索。用户要把维基百科等 ZIM 放到手机上离线浏览时使用。 +--- + +# Kiwix:离线 ZIM 知识库 + +本机装了 Termux 官方仓库的 `kiwix-tools 3.8.2`:`kiwix-serve`、`kiwix-manage`、`kiwix-search`, +另带 `kiwix-serve-local`——和 `kiwix-serve` 一样,但默认只监听 `127.0.0.1`。**ZIM 本体不在组件里**,要用户自己下载。 + +## 先自检 + +```sh +kiwix-selftest +``` + +最后一行应为 `===== 总结 ===== kiwix-serve=3.8.2 kiwix-manage=3.8.2 kiwix-search=OK`,约 1 秒。 +它只验证三个命令能启动、libkiwix / libzim / libicu 79 能加载——没有可再分发的小 ZIM,所以不打开真实知识库。 + +## 运行链路 + +``` +kiwix-serve / kiwix-manage / kiwix-search + └─ $PREFIX/bin/<命令> 本组件(Termux main 的 kiwix-tools 3.8.2,前缀已等长改写) + ├─ libkiwix.so.14 本组件 + ├─ libzim.so.9 本组件 + └─ libicu*.so.79 **底座**(devkit-2026.11.21 起;旧底座是 78.3) + 其余 libcurl / libmicrohttpd / libxapian / libpugixml / liblzma / libzstd + 本组件或底座 + +kiwix-serve-local + └─ 本组件的包装脚本 → exec kiwix-serve --address=127.0.0.1 "$@" + ZIM 文件 用户自己下载/放到手机上,组件不带 +``` + +| 这一环 | 由谁提供 | 缺了会怎样 | +|---|---|---| +| 三个 kiwix 命令 | 本组件 | 命令不存在 | +| `libkiwix` / `libzim` | 本组件 | `CANNOT LINK EXECUTABLE` | +| `libicu 79.1` | **底座** devkit-2026.11.21+ | 旧底座(如 2026.10.28 的 78.3)报 `libicuuc.so.79 not found`,**明确失败,不会降级** | +| ZIM 知识库 | 用户自备 | 命令能起,但 `kiwix-serve` 没有内容可服务;不是组件的问题 | + +**版本要求**:本组件必须配 devkit-2026.11.21 或更新的工具包。App 按底座匹配构建,正常安装即可; +如果用户从很旧的工具包升级上来,先升级 cccodroid 再装/重装本组件。 + +## 常用 + +```sh +# 起一个只监听本机的阅读服务(默认 80 端口,普通用户改 8080) +kiwix-serve-local --port=8080 wikipedia_zh_all_maxi.zim +# 浏览器打开 http://127.0.0.1:8080/ + +# 多个 ZIM 用 library 管理 +kiwix-manage ~/.cccodroid/kiwix/library.xml add wikipedia_zh_all_maxi.zim wiktionary_zh_all.zim +kiwix-serve-local --port=8080 --library ~/.cccodroid/kiwix/library.xml + +# 命令行全文检索 +kiwix-search wikipedia_zh_all_maxi.zim "空间站" +``` + +- **始终用 `kiwix-serve-local`**,或自己写 `--address=127.0.0.1`。上游 `kiwix-serve` 默认 `--address=all`,会把无认证的阅读页暴露到局域网。 +- 端口用 `--port`,不要用 80(可能没有权限);不要做端口转发、反代或内网穿透。 +- ZIM 下载:用浏览器或 `curl -O https://download.kiwix.org/zim/…`,文件很大(中文维基全量几十 GB,mini/maxi 版本小一些), + **先告诉用户大小、放哪个目录,得到同意再下**。下载要核对官方索引里的 sha256。 +- 库文件默认建议放 `~/.cccodroid/kiwix/`,和用户数据分开。 + +## 常见坑 + +- **不要用 `kiwix-serve` 裸命令**:默认监听所有网卡。`kiwix-serve-local` 只是补默认值,用户显式传 `-i` / `--address` 时仍按用户的来。 +- **后台进程不保证常驻**:`kiwix-serve` 是前台服务,Claude 这一轮结束后可能被杀。要长时间阅读就让用户在自己的终端里起,或用 `nohup … &` 后告诉用户它随时可能停。 +- **ZIM 有版权**:分发的 ZIM 各自带许可证;只下载官方 kiwix.org 上的包,不要把 ZIM 打进组件或再分发。 +- **`--library` 和直接给 ZIM 二选一**:混用会让人以为库里的文件都生效了;用库时先 `kiwix-manage … add`。 +- **搜索语言**:`kiwix-search` 用的是 ZIM 里的 Xapian 索引;纯文本查询即可,别传正则。 +- **不是在线百科**:没有网络抓取、没有自动更新 ZIM;要更新就让用户重新下载。 From 0e1264bb8038c05959f457f4e2fd065384e0ae0a Mon Sep 17 00:00:00 2001 From: greyoak111 Date: Sun, 22 Nov 2026 21:44:56 +0800 Subject: [PATCH 2/7] =?UTF-8?q?kiwix=20selftest=EF=BC=9A=E7=94=A8=20kiwix-?= =?UTF-8?q?search=20--help=20=E9=AA=8C=E8=AF=81=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 不带参数时 docopt 返回 255,容易被误判成崩溃;--help 正常退出 0,同样能证明 libkiwix / libzim / libicu 加载成功。 Co-Authored-By: Claude Code --- recipes/kiwix/bin/kiwix-selftest | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/recipes/kiwix/bin/kiwix-selftest b/recipes/kiwix/bin/kiwix-selftest index 82572d9..c9b7fa0 100644 --- a/recipes/kiwix/bin/kiwix-selftest +++ b/recipes/kiwix/bin/kiwix-selftest @@ -20,11 +20,12 @@ else bad "kiwix-manage --version 失败:$(printf '%s' "$v2" | head -3)" fi -# kiwix-search 没有 --version;不带参数时应打印用法并正常加载库(缺库会 CANNOT LINK EXECUTABLE) -v3=$("$PREFIX/bin/kiwix-search" 2>&1) +# kiwix-search 没有 --version;--help 会打印用法并退出 0(缺库会 CANNOT LINK EXECUTABLE) +v3=$("$PREFIX/bin/kiwix-search" --help 2>&1) +rc3=$? case "$v3" in - *CANNOT\ LINK*|*cannot\ locate*) bad "kiwix-search 加载失败:$(printf '%s' "$v3" | head -2)" ;; - *) echo "kiwix-search: OK (usage printed)" ;; + *CANNOT\ LINK*|*cannot\ locate*|"") bad "kiwix-search 加载失败(rc=$rc3):$(printf '%s' "$v3" | head -2)" ;; + *) [ "$rc3" -eq 0 ] && echo "kiwix-search: OK (help printed)" || bad "kiwix-search --help 返回 $rc3:$(printf '%s' "$v3" | head -2)" ;; esac [ -x "$PREFIX/bin/kiwix-serve-local" ] || bad "kiwix-serve-local 不可执行" From a1e15726a4bf87ff33acdaa066e5a3a368fddd18 Mon Sep 17 00:00:00 2001 From: greyoak111 Date: Sun, 22 Nov 2026 21:47:14 +0800 Subject: [PATCH 3/7] =?UTF-8?q?gis=EF=BC=9Aexclude=20postgresql=E3=80=81?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E7=94=A8=20libpq=EF=BC=8C=E5=B0=91=E5=B8=A6?= =?UTF-8?q?=E7=BA=A6=2030=20MB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gdal 包的 Depends 写的是整个 postgresql 服务器,但 libgdal 只链 libpq。 把 libpq 列进 roots、exclude postgresql:闭包 18.0 MB / 91.1 MB 解包, 组件包 28.8 MB(原来 38.3 MB),selftest 重跑通过。 Co-Authored-By: Claude Code --- README.md | 2 +- README.zh-CN.md | 2 +- recipes/gis/recipe.json | 5 +++-- recipes/gis/skill/SKILL.md | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 72e7c34..172cbc6 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Also published and verified for the current toolchain. Read the description befo - `minecraft-server` (Other): a native Paper 1.21.11 server; Java 21 comes from the base. The first start downloads the vanilla server from Mojang (about 54 MB) and patches it, which took almost 9 minutes in testing. You must read and accept the [Minecraft EULA](https://aka.ms/MinecraftEULA) yourself. Listens locally by default; LAN play has to be turned on explicitly. - `qq-bot` (Net): runs Linux QQ + NapCat natively as an OneBot bot that only answers allow-listed conversations and always replies as an AI. The first `setup` downloads from Tencent and NapCat's GitHub Release after you agree — about 307 MB, about 1.1 GB installed. **Disclaimer: this is a community component, not affiliated with or endorsed by Tencent, QQ or NapCat. It drives the QQ client through an unofficial framework, which may breach Tencent's terms; the QQ account you log in with may be restricted, frozen or banned, at your own risk — use a spare account. Replies are AI-generated and you are responsible for everything the bot sends, including following the law, platform rules and group rules. Do not use it for mass registration, account farming, spam, marketing blasts or impersonating people. NapCat is licensed for non-commercial use only. Provided "as is", without warranty of any kind.** - `gis-lite` (Science): PROJ coordinate transforms/projections + GEOS geometry operations (geosop) + SQLite's SpatiaLite extension, auto-loaded by the `spatialite` entry point. About 39.5 MB; does not handle mainland China's GCJ-02 offset. -- `gis` (Science): GDAL 3.13 command line for raster/vector format conversion and coordinate transforms (gdalinfo, gdal_translate, gdalwarp, ogr2ogr and more). About 121 MB; needs devkit-2026.11.21 or newer (libicu 79.1), and shares PROJ / GEOS / SpatiaLite packages with `gis-lite`. +- `gis` (Science): GDAL 3.13 command line for raster/vector format conversion and coordinate transforms (gdalinfo, gdal_translate, gdalwarp, ogr2ogr and more). About 91 MB; needs devkit-2026.11.21 or newer (libicu 79.1), and shares PROJ / GEOS / SpatiaLite packages with `gis-lite`. - `kiwix` (Other): offline ZIM knowledge bases (kiwix-serve / kiwix-manage / kiwix-search); `kiwix-serve-local` listens on 127.0.0.1 only. About 18.2 MB; bring your own ZIM files and use devkit-2026.11.21 or newer. ## How it works diff --git a/README.zh-CN.md b/README.zh-CN.md index 9eb01bc..d467986 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -78,7 +78,7 @@ cccodroid 从 0.1.10 起读这个仓库。浏览器(Chromium)这类预置组 - `minecraft-server`(其他):原生跑 Paper 1.21.11 服务端,Java 21 由底座提供。第一次启动会从 Mojang 官方下载原版服务端(约 54 MB)并打补丁,实测近 9 分钟;要你自己读并同意 [Minecraft EULA](https://aka.ms/MinecraftEULA)。默认只听本机,局域网联机要显式打开。 - `qq-bot`(网络):在手机上原生跑 Linux 版 QQ + NapCat 的 OneBot 机器人,只回复白名单里的会话,明确以 AI 身份回复。第一次 `setup` 经你同意后从腾讯官方和 NapCat 的 GitHub Release 下载,共约 307 MB、装后约 1.1 GB。**免责声明:本组件是社区作品,与腾讯、QQ、NapCat 均无关联,未获官方授权或认可;它通过非官方框架接管 QQ 客户端,可能违反腾讯的服务协议,登录的 QQ 号可能被限制、冻结或封禁,风险与损失由使用者自行承担,建议用小号。机器人的回复由 AI 生成,使用者对它发出的全部内容负责,须遵守法律法规、平台规则和群规;不得用于批量注册、养号、刷屏、营销群发或冒充真人。NapCat 限非商业使用。组件按「现状」提供,不作任何担保。** - `gis-lite`(科学计算):PROJ 坐标转换/投影 + GEOS 几何运算(geosop)+ SQLite 空间扩展 SpatiaLite,`spatialite` 入口自动加载 mod_spatialite。约 39.5 MB;不处理国内地图的 GCJ-02 偏移。 -- `gis`(科学计算):GDAL 3.13 命令行,栅格/矢量格式转换与坐标转换(gdalinfo、gdal_translate、gdalwarp、ogr2ogr 等)。约 121 MB;需要工具包 devkit-2026.11.21 或更新(libicu 79.1),和 `gis-lite` 共用 PROJ / GEOS / SpatiaLite 的包。 +- `gis`(科学计算):GDAL 3.13 命令行,栅格/矢量格式转换与坐标转换(gdalinfo、gdal_translate、gdalwarp、ogr2ogr 等)。约 91 MB;需要工具包 devkit-2026.11.21 或更新(libicu 79.1),和 `gis-lite` 共用 PROJ / GEOS / SpatiaLite 的包。 - `kiwix`(其他):离线 ZIM 知识库(kiwix-serve / kiwix-manage / kiwix-search),`kiwix-serve-local` 默认只监听 127.0.0.1。约 18.2 MB;ZIM 文件由你自己下载,需要 devkit-2026.11.21 或更新。 ## 怎么运作 diff --git a/recipes/gis/recipe.json b/recipes/gis/recipe.json index 74fe56d..3cbaf44 100644 --- a/recipes/gis/recipe.json +++ b/recipes/gis/recipe.json @@ -11,7 +11,8 @@ "zh": "GDAL 3.13 命令行:gdalinfo / gdal_translate / gdalwarp / gdaltransform / gdalsrsinfo 处理栅格,ogrinfo / ogr2ogr 处理矢量,含 GeoTIFF、GeoJSON、Shapefile、PostGIS 等格式驱动。坐标转换由 PROJ 完成;国内地图的 GCJ-02 偏移不处理。", "en": "GDAL 3.13 command line: gdalinfo / gdal_translate / gdalwarp / gdaltransform / gdalsrsinfo for rasters, ogrinfo / ogr2ogr for vectors, with drivers for GeoTIFF, GeoJSON, Shapefile, PostGIS and more. Coordinate transforms use PROJ; mainland China's GCJ-02 offset is not handled." }, - "roots": ["gdal"], + "roots": ["gdal", "libpq"], + "exclude": ["postgresql"], "bin": ["gdalinfo", "gdal_translate", "gdalwarp", "gdaltransform", "gdalsrsinfo", "ogrinfo", "ogr2ogr"], "selftest": "gis-selftest", "needs": { "shizuku": false, "display": false, "gpu": false }, @@ -22,5 +23,5 @@ "files": { "usr/bin/gis-selftest": { "src": "bin/gis-selftest", "mode": "755" } }, - "notes": "gdal 3.13.3-2(Termux main)。闭包里有 xerces-c / postgresql(libpq),两者都要底座 devkit-2026.11.21 起的 libicu 79.1;旧底座(78.3)会报 libicuuc.so.79 not found。和 gis-lite 共用 proj / libgeos / libspatialite 同一批包(同版本,可共存)。闭包 24.0 MB 下载 / 121.2 MB 解包(devkit-2026.11.21.2,底座之外的 13 个包;libicu 由底座提供);组件包 38.3 MB(gz)。selftest 在 $TMPDIR 写一个 3×2 的 ASCII 栅格,gdal_translate 转 GTiff 再 gdalinfo,gdaltransform 做 EPSG:4326→3857,ogrinfo 读一个 GeoJSON;不联网、不写用户文件。" + "notes": "gdal 3.13.3-2(Termux main)。gdal 包的 Depends 写的是 postgresql(整个服务器),但 libgdal 只链 libpq;这里 exclude 掉 postgresql、把 libpq 直接列进 roots,少带约 30 MB 用不到的服务器和 initdb。xerces-c 仍要底座 devkit-2026.11.21 起的 libicu 79.1;旧底座(78.3)会报 libicuuc.so.79 not found。和 gis-lite 共用 proj / libgeos / libspatialite 同一批包(同版本,可共存)。闭包 18.0 MB 下载 / 91.1 MB 解包(devkit-2026.11.21.2,底座之外的 11 个包);组件包 28.8 MB(gz)。selftest 在 $TMPDIR 写一个 3×2 的 ASCII 栅格,gdal_translate 转 GTiff 再 gdalinfo,gdaltransform 做 EPSG:4326→3857,ogrinfo 读一个 GeoJSON;不联网、不写用户文件。" } diff --git a/recipes/gis/skill/SKILL.md b/recipes/gis/skill/SKILL.md index 4125bad..c594549 100644 --- a/recipes/gis/skill/SKILL.md +++ b/recipes/gis/skill/SKILL.md @@ -31,7 +31,7 @@ gdalinfo / gdal_translate / gdalwarp / gdaltransform / gdalsrsinfo / ogrinfo / o ├─ 格式驱动 + share/gdal 本组件(GDAL_DATA 编译进去的路径) ├─ PROJ(libproj + proj.db) 本组件(gdal 依赖 proj) ├─ xerces-c → libicu*.so.79 **底座**(devkit-2026.11.21+) - ├─ postgresql/libpq → libicu*.so.79 **底座** + ├─ libpq(PostGIS 驱动用,不含服务器) 本组件 └─ libcurl / libsqlite / libpng / libtiff / libjpeg… 本组件或底座 输入输出数据由用户提供,组件不碰用户目录。 From b7cc525b383365d4936770f47f4b2637811708bf Mon Sep 17 00:00:00 2001 From: greyoak111 Date: Sun, 22 Nov 2026 21:54:58 +0800 Subject: [PATCH 4/7] =?UTF-8?q?audit=EF=BC=9A=E8=A7=A3=E6=9E=90=E7=BB=9D?= =?UTF-8?q?=E5=AF=B9=E8=B7=AF=E5=BE=84=E7=9A=84=20DT=5FNEEDED?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Termux 的 libproj.so 把 sqlite 的 NEEDED 写成绝对路径: /data/data/com.termux/files/usr/lib/libsqlite3.so(devkit 改写前缀后是 /data/data/cc.codroid/files/usr/lib/libsqlite3.so)。审计原来只按裸文件名 在 RUNPATH / usr/lib 里找,导致把它判成「链接的库哪里都找不到」,gis-lite 和 gis 的审计因此标 ❌(真机上底座有 libsqlite3.so,实际能跑)。 绝对路径先 rel() 成 usr/… 再查;不在应用前缀里的绝对路径照旧报。 本地按底座 11.21.2 的包文件清单重跑:gis-lite / kiwix / gis 0 错 0 警告。 Co-Authored-By: Claude Code --- tools/audit.mjs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tools/audit.mjs b/tools/audit.mjs index 19ff753..b8b539b 100644 --- a/tools/audit.mjs +++ b/tools/audit.mjs @@ -231,12 +231,22 @@ for (const id of ids) { glibc ? "usr/glibc/lib" : "usr/lib", dirOf(e.name)].map((p) => path.posix.normalize(p.replace(/^\//, ""))); const node = { exe: !!info.interp, deps: [] }; elfGraph.set(e.name, node); - for (const n of info.needed) { - if (!glibc && ANDROID_LIBS.has(n)) continue; - const hit = dirs.find((d) => has(d + "/" + n)); - if (hit) { if (b.names.has(hit + "/" + n)) node.deps.push(hit + "/" + n); continue; } - if (!glibc && VENDOR_LIBS.has(n)) { vendor.set(n, [...(vendor.get(n) || []), e.name]); continue; } - (anywhere.has(n) ? offPath : missing).set(n, [...((anywhere.has(n) ? offPath : missing).get(n) || []), e.name]); + for (const n0 of info.needed) { + // Termux 的 proj 等包会把 DT_NEEDED 写成绝对路径(/data/data/com.termux/files/usr/lib/libsqlite3.so, + // 改写前缀后是 /data/data/cc.codroid/files/usr/lib/libsqlite3.so):先换算成 usr/… 再查, + // 别把它当成"哪里都找不到"。绝对路径不在应用前缀里的照旧按原样报。 + const abs = n0.startsWith("/"); + const n = abs ? rel(n0) : n0; + const bn = path.posix.basename(n); + if (!glibc && (ANDROID_LIBS.has(n) || (abs && ANDROID_LIBS.has(bn)))) continue; + if (abs) { + if (has(n)) { if (b.names.has(n)) node.deps.push(n); continue; } + } else { + const hit = dirs.find((d) => has(d + "/" + n)); + if (hit) { if (b.names.has(hit + "/" + n)) node.deps.push(hit + "/" + n); continue; } + } + if (!glibc && (VENDOR_LIBS.has(n) || (abs && VENDOR_LIBS.has(bn)))) { vendor.set(n, [...(vendor.get(n) || []), e.name]); continue; } + (anywhere.has(bn) ? offPath : missing).set(n, [...((anywhere.has(bn) ? offPath : missing).get(n) || []), e.name]); } } else if (head[0] === 0x23 && head[1] === 0x21 && e.mode & 0o111) { const interp = head.toString("latin1", 2, 200).split("\n")[0].trim().split(/\s+/)[0]; From 761d3116b4d65d8961ac3b3e74776f1031cb179a Mon Sep 17 00:00:00 2001 From: greyoak111 Date: Tue, 24 Nov 2026 01:18:00 +0800 Subject: [PATCH 5/7] fix(recipes,tools): add minBase gating for gis/kiwix and polish kiwix/audit/docs --- .claude/skills/component-authoring/SKILL.md | 4 ++-- README.md | 6 +++--- README.zh-CN.md | 6 +++--- docs/recipe.md | 1 + recipes/gis-lite/skill/SKILL.md | 2 +- recipes/gis/recipe.json | 3 ++- recipes/kiwix/bin/kiwix-selftest | 10 +++++++++- recipes/kiwix/bin/kiwix-serve-local | 6 ++++-- recipes/kiwix/recipe.json | 1 + tools/audit.mjs | 6 ++++-- tools/build-index.mjs | 6 +++++- tools/check-recipes.mjs | 12 ++++++++++-- tools/ci-build.mjs | 3 ++- tools/lib.mjs | 2 ++ 14 files changed, 49 insertions(+), 19 deletions(-) diff --git a/.claude/skills/component-authoring/SKILL.md b/.claude/skills/component-authoring/SKILL.md index 9a00320..193ee97 100644 --- a/.claude/skills/component-authoring/SKILL.md +++ b/.claude/skills/component-authoring/SKILL.md @@ -25,7 +25,7 @@ description: 给 cccodroid 组件市场写新组件或改已有组件(recipes/ ## CI 会拦的(`tools/check-recipes.mjs`) -格式类:`schema`、`id` 与目录名一致、`revision`、`name`/`desc` 中英都有、`roots`/`bin`/`selftest`/`license` 必填、不认识的字段、`files`/`fetch` 只能落在 `usr/` 下。 +格式类:`schema`、`id` 与目录名一致、`revision`、`name`/`desc` 中英都有、`roots`/`bin`/`selftest`/`license` 必填、`minBase`(若依赖新底座才有的共享库 SONAME 如 `libicu 79` 时声明,格式 `devkit-YYYY.MM.DD`)、不认识的字段、`files`/`fetch` 只能落在 `usr/` 下。 安全类: @@ -73,7 +73,7 @@ skill 里要写明「多大、从哪下」,并且**让 Claude 先告诉用户 ### 别重复带包 -- 底座里已有的包 CI 会自动跳过,不用管。 +- 底座里已有的包 CI 会自动跳过,不用管。如果 Termux 上游包硬链了**仅新底座才有的共享库 SONAME**(如 `libicu 79` 而老底座是 `78`),务必在 `recipe.json` 写 `"minBase": "devkit-2026.11.21"`,CI 会自动跳过更老的底座、避免把缺库坏包发进索引。 - **两个组件带同一批包**会出问题:版本不同时(例:浏览器带 Mesa 26.2.4、`gpu-driver` 带 26.2.5)只有先装的那版生效。 App 已经能保证卸掉一个不弄坏另一个,但能避免就避免。 - 非带不可的(例如都需要 Mesa),PR 里写清楚和哪个组件共用了哪些包。 diff --git a/README.md b/README.md index 172cbc6..f102260 100644 --- a/README.md +++ b/README.md @@ -77,9 +77,9 @@ Also published and verified for the current toolchain. Read the description befo - `ml-tflite` (AI): TensorFlow Lite 2.21 CPU inference with its own numpy; bring your own model. - `minecraft-server` (Other): a native Paper 1.21.11 server; Java 21 comes from the base. The first start downloads the vanilla server from Mojang (about 54 MB) and patches it, which took almost 9 minutes in testing. You must read and accept the [Minecraft EULA](https://aka.ms/MinecraftEULA) yourself. Listens locally by default; LAN play has to be turned on explicitly. - `qq-bot` (Net): runs Linux QQ + NapCat natively as an OneBot bot that only answers allow-listed conversations and always replies as an AI. The first `setup` downloads from Tencent and NapCat's GitHub Release after you agree — about 307 MB, about 1.1 GB installed. **Disclaimer: this is a community component, not affiliated with or endorsed by Tencent, QQ or NapCat. It drives the QQ client through an unofficial framework, which may breach Tencent's terms; the QQ account you log in with may be restricted, frozen or banned, at your own risk — use a spare account. Replies are AI-generated and you are responsible for everything the bot sends, including following the law, platform rules and group rules. Do not use it for mass registration, account farming, spam, marketing blasts or impersonating people. NapCat is licensed for non-commercial use only. Provided "as is", without warranty of any kind.** -- `gis-lite` (Science): PROJ coordinate transforms/projections + GEOS geometry operations (geosop) + SQLite's SpatiaLite extension, auto-loaded by the `spatialite` entry point. About 39.5 MB; does not handle mainland China's GCJ-02 offset. -- `gis` (Science): GDAL 3.13 command line for raster/vector format conversion and coordinate transforms (gdalinfo, gdal_translate, gdalwarp, ogr2ogr and more). About 91 MB; needs devkit-2026.11.21 or newer (libicu 79.1), and shares PROJ / GEOS / SpatiaLite packages with `gis-lite`. -- `kiwix` (Other): offline ZIM knowledge bases (kiwix-serve / kiwix-manage / kiwix-search); `kiwix-serve-local` listens on 127.0.0.1 only. About 18.2 MB; bring your own ZIM files and use devkit-2026.11.21 or newer. +- `gis-lite` (Science): PROJ coordinate transforms/projections + GEOS geometry operations (geosop) + SQLite's SpatiaLite extension, auto-loaded by the `spatialite` entry point. About 39.5 MB; does not handle mainland China's GCJ-02 offset (MIT / LGPL-2.1 / GPL-2.0). +- `gis` (Science): GDAL 3.13 command line for raster/vector format conversion and coordinate transforms (gdalinfo, gdal_translate, gdalwarp, ogr2ogr and more). About 91 MB; needs devkit-2026.11.21 or newer (libicu 79.1), and shares PROJ / GEOS / SpatiaLite packages with `gis-lite` (MIT / LGPL-2.1 / GPL-2.0 / Apache-2.0 / BSD-3-Clause / Zlib / PostgreSQL). +- `kiwix` (Other): offline ZIM knowledge bases (kiwix-serve / kiwix-manage / kiwix-search); `kiwix-serve-local` listens on 127.0.0.1 only. About 18.2 MB; bring your own ZIM files and use devkit-2026.11.21 or newer (GPL-3.0). ## How it works diff --git a/README.zh-CN.md b/README.zh-CN.md index d467986..3d1fc67 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -77,9 +77,9 @@ cccodroid 从 0.1.10 起读这个仓库。浏览器(Chromium)这类预置组 - `ml-tflite`(AI):TensorFlow Lite 2.21 CPU 推理,自带 numpy;模型自备。 - `minecraft-server`(其他):原生跑 Paper 1.21.11 服务端,Java 21 由底座提供。第一次启动会从 Mojang 官方下载原版服务端(约 54 MB)并打补丁,实测近 9 分钟;要你自己读并同意 [Minecraft EULA](https://aka.ms/MinecraftEULA)。默认只听本机,局域网联机要显式打开。 - `qq-bot`(网络):在手机上原生跑 Linux 版 QQ + NapCat 的 OneBot 机器人,只回复白名单里的会话,明确以 AI 身份回复。第一次 `setup` 经你同意后从腾讯官方和 NapCat 的 GitHub Release 下载,共约 307 MB、装后约 1.1 GB。**免责声明:本组件是社区作品,与腾讯、QQ、NapCat 均无关联,未获官方授权或认可;它通过非官方框架接管 QQ 客户端,可能违反腾讯的服务协议,登录的 QQ 号可能被限制、冻结或封禁,风险与损失由使用者自行承担,建议用小号。机器人的回复由 AI 生成,使用者对它发出的全部内容负责,须遵守法律法规、平台规则和群规;不得用于批量注册、养号、刷屏、营销群发或冒充真人。NapCat 限非商业使用。组件按「现状」提供,不作任何担保。** -- `gis-lite`(科学计算):PROJ 坐标转换/投影 + GEOS 几何运算(geosop)+ SQLite 空间扩展 SpatiaLite,`spatialite` 入口自动加载 mod_spatialite。约 39.5 MB;不处理国内地图的 GCJ-02 偏移。 -- `gis`(科学计算):GDAL 3.13 命令行,栅格/矢量格式转换与坐标转换(gdalinfo、gdal_translate、gdalwarp、ogr2ogr 等)。约 91 MB;需要工具包 devkit-2026.11.21 或更新(libicu 79.1),和 `gis-lite` 共用 PROJ / GEOS / SpatiaLite 的包。 -- `kiwix`(其他):离线 ZIM 知识库(kiwix-serve / kiwix-manage / kiwix-search),`kiwix-serve-local` 默认只监听 127.0.0.1。约 18.2 MB;ZIM 文件由你自己下载,需要 devkit-2026.11.21 或更新。 +- `gis-lite`(科学计算):PROJ 坐标转换/投影 + GEOS 几何运算(geosop)+ SQLite 空间扩展 SpatiaLite,`spatialite` 入口自动加载 mod_spatialite。约 39.5 MB;不处理国内地图的 GCJ-02 偏移(MIT / LGPL-2.1 / GPL-2.0)。 +- `gis`(科学计算):GDAL 3.13 命令行,栅格/矢量格式转换与坐标转换(gdalinfo、gdal_translate、gdalwarp、ogr2ogr 等)。约 91 MB;需要工具包 devkit-2026.11.21 或更新(libicu 79.1),和 `gis-lite` 共用 PROJ / GEOS / SpatiaLite 的包(MIT / LGPL-2.1 / GPL-2.0 / Apache-2.0 / BSD-3-Clause / Zlib / PostgreSQL)。 +- `kiwix`(其他):离线 ZIM 知识库(kiwix-serve / kiwix-manage / kiwix-search),`kiwix-serve-local` 默认只监听 127.0.0.1。约 18.2 MB;ZIM 文件由你自己下载,需要 devkit-2026.11.21 或更新(GPL-3.0)。 ## 怎么运作 diff --git a/docs/recipe.md b/docs/recipe.md index 5b25f08..d395173 100644 --- a/docs/recipe.md +++ b/docs/recipe.md @@ -45,6 +45,7 @@ SHA256,CI 下载核对后打进包里。规则见下面「`fetch`:仓库外 | `maintainers` | | 维护这个配方的 GitHub 用户名 | | `notes` | | 给维护者看的备注 | | `skipBuild` | | 临时跳过 CI 打包:写一句原因。已有构建照旧留在索引里,只是不再为新底座打包;修好后删掉这个字段(别当成长期的例外) | +| `minBase` | | 最低底座版本(如 `"devkit-2026.11.21"`)。当上游 Termux 包硬链了新底座才有的共享库 SONAME(如 `libicu 79`)时填写,CI 打包与出索引都会自动跳过更老的底座 | 底座(cccodroid 工具包)里已有的包不会重复打进组件。所以组件**绑定底座版本**: `bases.json` 里每个底座各打一份,用户装的是和自己工具包匹配的那份。工具包更新后组件显示"需要重装"。 diff --git a/recipes/gis-lite/skill/SKILL.md b/recipes/gis-lite/skill/SKILL.md index 4f9bf5b..49c86e2 100644 --- a/recipes/gis-lite/skill/SKILL.md +++ b/recipes/gis-lite/skill/SKILL.md @@ -28,7 +28,7 @@ proj / cs2cs / cct / gie / projinfo └─ $PREFIX/bin/<命令> 本组件(Termux main 的 proj 9.9.0,前缀已等长改写成应用路径) ├─ libproj.so 本组件 $PREFIX/lib ├─ proj.db 等数据 本组件 $PREFIX/share/proj(编译进去的路径就是这里) - └─ libsqlite3 / libtiff / libcurl 底座(devkit 基础模块) + └─ libsqlite3 / libtiff / libcurl 底座(base / cli / media 等模块) geosop ├─ $PREFIX/bin/geosop 本组件(libgeos 3.15.0) diff --git a/recipes/gis/recipe.json b/recipes/gis/recipe.json index 3cbaf44..8410f08 100644 --- a/recipes/gis/recipe.json +++ b/recipes/gis/recipe.json @@ -16,8 +16,9 @@ "bin": ["gdalinfo", "gdal_translate", "gdalwarp", "gdaltransform", "gdalsrsinfo", "ogrinfo", "ogr2ogr"], "selftest": "gis-selftest", "needs": { "shizuku": false, "display": false, "gpu": false }, + "minBase": "devkit-2026.11.21", "category": "science", - "license": "MIT", + "license": "MIT AND LGPL-2.1 AND GPL-2.0 AND Apache-2.0 AND BSD-3-Clause AND Zlib AND PostgreSQL", "homepage": "https://gdal.org", "maintainers": ["greyoak111"], "files": { diff --git a/recipes/kiwix/bin/kiwix-selftest b/recipes/kiwix/bin/kiwix-selftest index c9b7fa0..b40bb2e 100644 --- a/recipes/kiwix/bin/kiwix-selftest +++ b/recipes/kiwix/bin/kiwix-selftest @@ -28,7 +28,15 @@ case "$v3" in *) [ "$rc3" -eq 0 ] && echo "kiwix-search: OK (help printed)" || bad "kiwix-search --help 返回 $rc3:$(printf '%s' "$v3" | head -2)" ;; esac -[ -x "$PREFIX/bin/kiwix-serve-local" ] || bad "kiwix-serve-local 不可执行" +v4=$("$PREFIX/bin/kiwix-serve-local" --version 2>&1) +rc4=$? +"$PREFIX/bin/kiwix-serve-local" --help >/dev/null 2>&1 +rc4h=$? +if [ "$rc4" -eq 0 ] && [ -n "$v4" ] && [ "$rc4h" -eq 0 ]; then + echo "kiwix-serve-local: OK (--version / --help)" +else + bad "kiwix-serve-local --version/--help 失败(version rc=$rc4, help rc=$rc4h):$(printf '%s' "$v4" | head -2)" +fi if [ "$fail" -ne 0 ]; then echo "===== 总结 ===== kiwix FAIL" diff --git a/recipes/kiwix/bin/kiwix-serve-local b/recipes/kiwix/bin/kiwix-serve-local index a6cc389..4815295 100644 --- a/recipes/kiwix/bin/kiwix-serve-local +++ b/recipes/kiwix/bin/kiwix-serve-local @@ -1,9 +1,11 @@ #!{{PREFIX}}/bin/sh # 与 kiwix-serve 相同,但默认只监听 127.0.0.1(上游默认是 --address=all,会监听 0.0.0.0)。 -# 用户自己显式写了 -i / --address 时照用户的来。 +# 用户自己显式写了 -i / --address、或无参/仅查帮助版本时直接原样透传(docopt 不接受在 -h/-V 前加选项)。 +[ $# -eq 0 ] && exec "{{PREFIX}}/bin/kiwix-serve" for a in "$@"; do case "$a" in - --address|--address=*|-i|-i?*) exec "{{PREFIX}}/bin/kiwix-serve" "$@" ;; + --) break ;; + --address|--address=*|-i|-i?*|-h|--help|-V|--version) exec "{{PREFIX}}/bin/kiwix-serve" "$@" ;; esac done exec "{{PREFIX}}/bin/kiwix-serve" --address=127.0.0.1 "$@" diff --git a/recipes/kiwix/recipe.json b/recipes/kiwix/recipe.json index 7bb6c34..b59d77b 100644 --- a/recipes/kiwix/recipe.json +++ b/recipes/kiwix/recipe.json @@ -15,6 +15,7 @@ "bin": ["kiwix-serve", "kiwix-serve-local", "kiwix-manage", "kiwix-search"], "selftest": "kiwix-selftest", "needs": { "shizuku": false, "display": false, "gpu": false }, + "minBase": "devkit-2026.11.21", "category": "other", "license": "GPL-3.0", "homepage": "https://github.com/kiwix/kiwix-tools", diff --git a/tools/audit.mjs b/tools/audit.mjs index b8b539b..107359b 100644 --- a/tools/audit.mjs +++ b/tools/audit.mjs @@ -115,6 +115,8 @@ const ANDROID_LIBS = new Set(["libc.so", "libm.so", "libdl.so", "liblog.so", "li "libGLESv2.so", "libGLESv3.so", "libvulkan.so", "libOpenSLES.so", "libjnigraphics.so", "libmediandk.so", "libcamera2ndk.so", "libnativewindow.so", "libsync.so", "libneuralnetworks.so", "libOpenMAXAL.so", "libstdc++.so", "libaaudio.so", "libamidi.so", "libbinder_ndk.so", "libicu.so", "libvndksupport.so"]); +// 安卓系统库仅限系统/APEX 标准库目录,避免任意绝对路径同名误放行 +const ANDROID_SYS_DIR = /^\/(?:system|apex\/com\.android\.(?:runtime|art))\/lib(?:64)?\//; // 厂商库:只在部分设备的 /vendor 里有(骁龙的 OpenCL 等),链了它的东西只能在那些设备上用 —— 提醒,不拦 const VENDOR_LIBS = new Set(["libOpenCL.so", "libcdsprpc.so", "libQnnHtp.so", "libQnnSystem.so"]); const SHELL_BUILTINS = new Set(["cd", "echo", "test", "[", "true", "false", "printf", "export", "env", "sh", "bash", "command", "exec", "set"]); @@ -236,9 +238,9 @@ for (const id of ids) { // 改写前缀后是 /data/data/cc.codroid/files/usr/lib/libsqlite3.so):先换算成 usr/… 再查, // 别把它当成"哪里都找不到"。绝对路径不在应用前缀里的照旧按原样报。 const abs = n0.startsWith("/"); - const n = abs ? rel(n0) : n0; + const n = path.posix.normalize(abs ? rel(n0) : n0); const bn = path.posix.basename(n); - if (!glibc && (ANDROID_LIBS.has(n) || (abs && ANDROID_LIBS.has(bn)))) continue; + if (!glibc && ((!abs && ANDROID_LIBS.has(n)) || (abs && ANDROID_SYS_DIR.test(n0) && ANDROID_LIBS.has(bn)))) continue; if (abs) { if (has(n)) { if (b.names.has(n)) node.deps.push(n); continue; } } else { diff --git a/tools/build-index.mjs b/tools/build-index.mjs index e4aee72..268bfb2 100644 --- a/tools/build-index.mjs +++ b/tools/build-index.mjs @@ -21,7 +21,7 @@ import fs from "node:fs"; import path from "node:path"; import crypto from "node:crypto"; import { fileURLToPath } from "node:url"; -import { ROOT, REPO, APP_REPO, recipes, run, asset, modelsOf } from "./lib.mjs"; +import { ROOT, REPO, APP_REPO, recipes, run, asset, modelsOf, baseAtLeast } from "./lib.mjs"; // 兜底 ABI 策略(若通过 --devkit 指向了 cccodroid/devkit,会直接读取那里的 abi-policy.json) const FALLBACK_ABI_POLICY = { @@ -209,6 +209,10 @@ function main() { const m = JSON.parse(fs.readFileSync(path.join(dl, f), "utf8")); const name = asset(m.id, m.version, m.base.gz); if (m.id !== r.id || !names.has(name + ".tar.gz")) continue; // 包没传完的不收 + if (r.minBase && m.base?.tag && !baseAtLeast(m.base.tag, r.minBase)) { + console.log(`· ${r.id}: 索引跳过旧底座清单 ${m.base.tag}(需 ≥ ${r.minBase})`); + continue; + } all.push(m); const cur = byBase.get(m.base.gz); if (!cur || vcmp(m.version, cur.version) > 0) byBase.set(m.base.gz, { ...m, asset: name + ".tar.gz" }); diff --git a/tools/check-recipes.mjs b/tools/check-recipes.mjs index 5dfdf18..bf78f91 100644 --- a/tools/check-recipes.mjs +++ b/tools/check-recipes.mjs @@ -1,10 +1,10 @@ // 检查配方格式(PR 时 CI 跑;本地也可以跑):node tools/check-recipes.mjs import fs from "node:fs"; import path from "node:path"; -import { recipes, modelsOf } from "./lib.mjs"; +import { recipes, modelsOf, bases, baseAtLeast } from "./lib.mjs"; const KNOWN = new Set(["schema", "id", "kind", "revision", "version", "name", "desc", "repos", "roots", "exclude", "files", - "fetch", "npm", "pip", "requires", "bin", "selftest", "needs", "license", "homepage", "maintainers", "notes", "category", "mcp", "skipBuild"]); + "fetch", "npm", "pip", "requires", "bin", "selftest", "needs", "license", "homepage", "maintainers", "notes", "category", "mcp", "skipBuild", "minBase"]); // 分类(App 扩展页的分类索引条按它分):只认这几个,界面上有对应的译名 const CATEGORIES = new Set(["dev", "office", "media", "science", "eda", "cad", "ai", "gpu", "net", "mcp", "other"]); const KINDS = new Set(["termux", "glibc"]); @@ -31,6 +31,7 @@ const walk = (d) => fs.readdirSync(d, { withFileTypes: true }).flatMap((e) => (e let bad = 0; const err = (r, m) => { console.log(`✗ ${r}: ${m}`); bad++; }; const ids = new Set(), wanted = [], adreno = new Map(); // wanted:[被依赖, 依赖者];adreno:id → 是否写了 needs.gpu: "adreno" +const allBases = bases(); for (const r of recipes()) { const n = path.basename(r.dir); if (r.schema !== 1) err(n, "schema 必须是 1"); @@ -50,6 +51,13 @@ for (const r of recipes()) { if (!CATEGORIES.has(r.category)) err(n, `category 必填,只能是 ${[...CATEGORIES].join(" / ")}`); for (const k of Object.keys(r)) if (k !== "dir" && !KNOWN.has(k)) err(n, "不认识的字段: " + k); if (r.skipBuild !== undefined && (typeof r.skipBuild !== "string" || !r.skipBuild.trim())) err(n, "skipBuild 要写一句跳过原因(非空字符串)"); + if (r.minBase !== undefined) { + if (typeof r.minBase !== "string" || !/^devkit-\d{4}\.\d{2}\.\d{2}(?:\.\d+)?$/.test(r.minBase)) { + err(n, `minBase 格式不对(应为 devkit-YYYY.MM.DD 或 devkit-YYYY.MM.DD.N): ${r.minBase}`); + } else if (!allBases.some((b) => baseAtLeast(b.tag, r.minBase))) { + err(n, `bases.json 里没有任何底座满足 minBase >= ${r.minBase}(防拼写错误导致全底座跳过)`); + } + } // mcp:装好后 App 自动用 claude mcp add 注册的 stdio 服务(卸载时注销)。bin 必须是本组件 bin 里的一个入口 if (r.mcp !== undefined) { const m = r.mcp; diff --git a/tools/ci-build.mjs b/tools/ci-build.mjs index 30dac24..89f62be 100644 --- a/tools/ci-build.mjs +++ b/tools/ci-build.mjs @@ -7,7 +7,7 @@ // 「已发布」以资产在不在为准,所以重跑 CI 是安全的;要重打就把 revision 加一。 import fs from "node:fs"; import path from "node:path"; -import { ROOT, REPO, APP_REPO, recipes, bases, run, asset } from "./lib.mjs"; +import { ROOT, REPO, APP_REPO, recipes, bases, run, asset, baseAtLeast } from "./lib.mjs"; const args = process.argv.slice(2); const opt = (k) => { const i = args.indexOf("--" + k); return i >= 0 ? args[i + 1] : undefined; }; @@ -30,6 +30,7 @@ for (const b of bases()) { for (const r of recipes()) { if (opt("only") && r.id !== opt("only")) continue; if (r.skipBuild) { console.log(`· ${r.id}: 跳过构建(${r.skipBuild})`); continue; } + if (r.minBase && !baseAtLeast(b.tag, r.minBase)) { console.log(`· ${r.id}: 跳过旧底座 ${b.tag}(需 ≥ ${r.minBase})`); continue; } const dk = (extra) => run("node", [path.join(DEVKIT, "devkit.mjs"), "component", "--recipe", r.dir, "--target", lock.target, "--base", lockFile, ...extra], { stdio: ["ignore", "pipe", "inherit"] }); let version; try { version = /COMPONENT_VERSION=(\S+)/.exec(dk(["--dry"]))[1]; } diff --git a/tools/lib.mjs b/tools/lib.mjs index 78f81d3..bf5cba6 100644 --- a/tools/lib.mjs +++ b/tools/lib.mjs @@ -16,6 +16,8 @@ export const bases = () => JSON.parse(fs.readFileSync(path.join(ROOT, "bases.jso export const run = (cmd, args, opts = {}) => execFileSync(cmd, args, { encoding: "utf8", maxBuffer: 1 << 28, ...opts }); // 版本号里的 : ~ + 之类 GitHub 资产名会改掉,统一换成 _ export const asset = (id, version, baseSha) => `${id}-${String(version).replace(/[^A-Za-z0-9._-]/g, "_")}-for-${baseSha.slice(0, 12)}`; +// 底座 tag 版本比较(devkit-2026.10.28 < devkit-2026.11.21 <= devkit-2026.11.21.2) +export const baseAtLeast = (tag, minTag) => String(tag).localeCompare(String(minTag), "en", { numeric: true }) >= 0; // 组件附带的模型目录(目前只有 llama-cpp 用):recipes//models.json,进签名索引,App 的「下载模型」按它列。 // 索引签了名,sha256 就可信;repo / file 严格限字符,App 拿它们拼下载地址(魔搭 / HF / hf-mirror),不许塞路径或别的站。 export const MODEL_TAGS = new Set(["think", "code"]); From 7ba56b97e5ba447ee49051eb7a0c30a1622be882 Mon Sep 17 00:00:00 2001 From: greyoak111 Date: Tue, 24 Nov 2026 01:45:15 +0800 Subject: [PATCH 6/7] fix(audit): skip recipes with skipBuild or newer minBase during full audit --- tools/audit.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/audit.mjs b/tools/audit.mjs index 107359b..178b2fe 100644 --- a/tools/audit.mjs +++ b/tools/audit.mjs @@ -11,7 +11,7 @@ import fs from "node:fs"; import path from "node:path"; import { execFileSync, spawnSync } from "node:child_process"; -import { ROOT, REPO, APP_REPO, recipes, bases, run } from "./lib.mjs"; +import { ROOT, REPO, APP_REPO, recipes, bases, run, baseAtLeast } from "./lib.mjs"; const args = process.argv.slice(2); const opt = (k) => { const i = args.indexOf("--" + k); return i >= 0 ? args[i + 1] : undefined; }; @@ -183,6 +183,8 @@ const report = [`## 组件审计报告`, ``, `底座 \`${base.tag}\`(${base12} for (const id of ids) { const r = byId.get(id); if (!r) { report.push(`### ❌ ${id}`, "", "仓库里没有这个配方", ""); fails++; continue; } + if (r.skipBuild) { report.push(`### ⏭ ${id}`, "", `跳过审计(${r.skipBuild})`, ""); continue; } + if (r.minBase && !baseAtLeast(base.tag, r.minBase)) { report.push(`### ⏭ ${id}`, "", `跳过底座 \`${base.tag}\`(需 ≥ \`${r.minBase}\`)`, ""); continue; } console.log(`\n══ ${id}`); const b = build(id); if (b.error) { report.push(`### ❌ ${id}`, "", "打包失败:", "```", b.error, "```", ""); fails++; continue; } From 75b5a33fe7c7b6fe08577db0cd04fc136407a5ec Mon Sep 17 00:00:00 2001 From: greyoak111 Date: Tue, 24 Nov 2026 02:40:10 +0800 Subject: [PATCH 7/7] ci(check,ci-build): cache release asset lookups across bases and raise check timeout to 45m --- .github/workflows/check.yml | 2 +- tools/ci-build.mjs | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 3acc84b..d36ad3b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -7,7 +7,7 @@ permissions: jobs: check: runs-on: ubuntu-latest - timeout-minutes: 20 + timeout-minutes: 45 env: GH_TOKEN: ${{ github.token }} steps: diff --git a/tools/ci-build.mjs b/tools/ci-build.mjs index 89f62be..f505028 100644 --- a/tools/ci-build.mjs +++ b/tools/ci-build.mjs @@ -17,7 +17,14 @@ const WORK = path.resolve(process.env.WORK || path.join(ROOT, "work")); if (!fs.existsSync(path.join(DEVKIT, "devkit.mjs"))) { console.error("找不到 devkit.mjs: " + DEVKIT); process.exit(1); } const gh = (...a) => run("gh", a); -const assetsOf = (tag) => { try { return JSON.parse(run("gh", ["release", "view", tag, "-R", REPO, "--json", "assets"], { stdio: ["ignore", "pipe", "ignore"] })).assets.map((a) => a.name); } catch { return null; } }; +const assetsCache = new Map(); +const assetsOf = (tag) => { + if (assetsCache.has(tag)) return assetsCache.get(tag); + let res = null; + try { res = JSON.parse(run("gh", ["release", "view", tag, "-R", REPO, "--json", "assets"], { stdio: ["ignore", "pipe", "ignore"] })).assets.map((a) => a.name); } catch {} + assetsCache.set(tag, res); + return res; +}; let built = 0, failed = 0; for (const b of bases()) { @@ -58,6 +65,7 @@ for (const b of bases()) { // 先传包再传清单:build-index 只认有清单的构建,半截上传不会进索引 gh("release", "upload", r.id, "-R", REPO, gz, "--clobber"); gh("release", "upload", r.id, "-R", REPO, js, "--clobber"); + assetsCache.set(r.id, [...(have || []), path.basename(gz), path.basename(js)]); fs.rmSync(gz); console.log(` ↑ 已上传`); }