Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude/skills/component-authoring/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/` 下。

安全类:

Expand Down Expand Up @@ -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 里写清楚和哪个组件共用了哪些包。
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions:
jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 20
timeout-minutes: 45
env:
GH_TOKEN: ${{ github.token }}
steps:
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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 (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

Expand Down
5 changes: 4 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 会先让你装好依赖,依赖也不能在它之前卸载。

Expand All @@ -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 偏移(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)。

## 怎么运作

Expand Down
1 change: 1 addition & 0 deletions docs/recipe.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` 里每个底座各打一份,用户装的是和自己工具包匹配的那份。工具包更新后组件显示"需要重装"。
Expand Down
20 changes: 16 additions & 4 deletions docs/wanted.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | 内容 | 要先弄清的 |
Expand All @@ -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,要钉版本和完整性哈希 |

Expand Down Expand Up @@ -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 |
Expand All @@ -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 |

Expand Down
51 changes: 51 additions & 0 deletions recipes/gis-lite/bin/gis-lite-selftest
Original file line number Diff line number Diff line change
@@ -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"
7 changes: 7 additions & 0 deletions recipes/gis-lite/bin/spatialite
Original file line number Diff line number Diff line change
@@ -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" "$@"
Loading
Loading