{"id":31288963,"url":"https://github.com/TermonyHQ/Termony","last_synced_at":"2025-09-24T13:03:20.841Z","repository":{"id":297819354,"uuid":"997973728","full_name":"TermonyHQ/Termony","owner":"TermonyHQ","description":"Termux for HarmonyOS Computer. Working in Progress.","archived":false,"fork":false,"pushed_at":"2025-09-21T09:16:17.000Z","size":4250,"stargazers_count":276,"open_issues_count":24,"forks_count":20,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-09-21T11:27:05.657Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TermonyHQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-07T15:45:42.000Z","updated_at":"2025-09-21T09:16:21.000Z","dependencies_parsed_at":"2025-07-05T19:06:09.888Z","dependency_job_id":"c18c42bb-341f-42e8-9c32-f5da416464b2","html_url":"https://github.com/TermonyHQ/Termony","commit_stats":null,"previous_names":["jiegec/termony","termonyhq/termony"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TermonyHQ/Termony","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TermonyHQ%2FTermony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TermonyHQ%2FTermony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TermonyHQ%2FTermony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TermonyHQ%2FTermony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TermonyHQ","download_url":"https://codeload.github.com/TermonyHQ/Termony/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TermonyHQ%2FTermony/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276754055,"owners_count":25698832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-24T02:00:09.776Z","response_time":97,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-24T13:01:53.668Z","updated_at":"2025-09-24T13:03:20.836Z","avatar_url":"https://github.com/TermonyHQ.png","language":"C++","funding_links":[],"categories":["C++","Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# Termony\n\n[GitHub](https://github.com/jiegec/Termony) [Gitee](https://gitee.com/jiegec/Termony) - [中文](README_CN.md)\n\nTermux for HarmonyOS Computer. Working in Progress.\n\nIt can run some basic commands on Huawei MateBook Pro now:\n\n![](./screenshot.jpg)\n\nAlso compile and run C/C++ programs on HarmonyOS Computer:\n\n![](./screenshot_gcc.jpg)\n\n## Overview\n\nBundled packages:\n\n||||||\n| --- | --- | --- | --- | --- |\n| aria2 | bash | binutils | busybox | c-ares |\n| coremark | curl | elf-loader | expat | fastfetch |\n| fish | gcc | gdb | gettext | git |\n| glib | gmp | hdc | htop | kbd |\n|lib{archive|event|ffi|idn2|unistring}|\n| lz4 | make | mpc | mpfr | ncnn |\n|ncurses|openssh|openssl|pcre2|proot|\n|python|qemu|qemu-vroot|readline|sl|\n|strace|stream|talloc|tar|tmux|\n|tree|vim|vkpeak|xxhash|xz|\n|yyjson|zstd|\n\n- [elf-loader](https://github.com/MikhailProg/elf): you can run executable without executable permission! e.g. `cp /data/app/bin/bash ~/ \u0026\u0026 loader ~/bash`\n- qemu{,vroot}: you can run executable without executable permission! e.g. `cp /data/app/bin/bash ~/ \u0026\u0026 qemu-aarch64 ~/bash`\n- qemu-system-{aarch64,x86_64}: you can start a system emulator with qemu-system.\n\nPro tip: you can use these utilities in the builtin Terminal app under `/data/service/hnp`:\n\n![](./screenshot_hishell.jpg)\n\nAlthough some paths might get wrong due to prefix set to `/data/app/base.org/base_1.0` (thanks to @duskmoon314). You can override them like:\n\n```shell\nLD_LIBRARY_PATH=/data/service/hnp/base.org/base_1.0/lib TERMINFO=/data/service/hnp/base.org/base_1.0/share/terminfo fish\n```\n\nYou can persist them to `~/.bashrc`, and run bash before executing other commands from Termony:\n\n```shell\nif [ -d \"/data/service/hnp/base.org/base_1.0\" ]; then\n  export LD_LIBRARY_PATH=/data/service/hnp/base.org/base_1.0/lib\n  export TERMINFO=/data/service/hnp/base.org/base_1.0/share/terminfo\n  export VIM=/data/service/hnp/base.org/base_1.0/share/vim\n  export TMUX_TMPDIR=/data/storage/el2/base/cache\nfi\n```\n\nHowever, now whatever debug mode app has access to `mprotect(anon_page, R_X, ...)`, so you can use elf loader in HiShell.\nThe HNP folder does not get updated if you upgrade Termony. You need to re-install Termony to get the latest version available.\n\nTerminal features:\n\n- Basic escape sequence support\n- Paste via context menu (right-click to activate)\n- Copy/paste in command line via pbcopy/pbpaste using OSC52 escape sequence\n\n### Run in a new root file-system\n\n`qemu-vroot-aarch64` is a user mode qemu modified to to mimic proot behavior. It allows user to run linux binary (even for another CPU architecture) and switch to a new root-filesystem like chroot or proot.\n\n#### Alpine Linux\n\nFor example, you can run into a alpine root-filesystem by following steps:\n\n- Download alpine minimal root filesystem from https://alpinelinux.org/downloads/ (aarch64 or x64)\n- Extract downloaded rootfs tar.gz file, for better compatibility, `/data/storage/el2/base/files/alpine_rootfs` is recommended.\n```shell\nmkdir -p /data/storage/el2/base/files/alpine_rootfs\ntar xvf alpine-minirootfs-3.22.0-aarch64.tar.gz -C /data/storage/el2/base/files/alpine_rootfs\n```\n- Run `qemu-vroot-aarch64` to load busybox shell with root-filesystem and environment variables (for root-filesystem on x86_64, use `qemu-vroot-x86_64`)\n```shell\ncd /data/storage/el2/base/files/alpine_rootfs\nqemu-vroot-aarch64 -E PATH=/bin:/usr/bin:/sbin -E HOME=/root -L ./ ./bin/busybox sh -c 'cd \u0026\u0026 sh'\n```\n- run `ls /`, the root has changed!\n```shell\nls /\nbin    dev    etc    home   lib    media  mnt    opt    proc   root   run    sbin   srv    sys    tmp    usr    var\n```\n- run `apk update`, the alpine package manager works fine, you can install packages by `apk`\n\n#### Ubuntu\n\nYou can also use ubuntu root-filesystem by following steps:\n\n- Download ubuntu base root filesystem from [Ubuntu Base 24.04](https://cdimage.ubuntu.com/ubuntu-base/releases/24.04/release/) (ubuntu-base-24.04.3-base-arm64.tar.gz)\n- Extract downloaded rootfs tar.gz file, for better compatibility, `/data/storage/el2/base/files/ubuntu_rootfs` is recommended.\n```shell\nmkdir -p /data/storage/el2/base/files/ubuntu_rootfs\ntar xvf ubuntu-base-24.04.3-base-arm64.tar.gz -C /data/storage/el2/base/files/ubuntu_rootfs\n```\n- append `APT::Sandbox::User \"root\";` to `/etc/apt/apt.conf.d/01-vendor-ubuntu` file in ubuntu root filesyste\n```shell\ncd /data/storage/el2/base/files/ubuntu_rootfs\necho 'APT::Sandbox::User \"root\";' \u003e\u003e etc/apt/apt.conf.d/01-vendor-ubuntu\n```\n- Run `qemu-vroot-aarch64` to run bash shell in root-filesystem\n```shell\ncd /data/storage/el2/base/files/ubuntu_rootfs\nqemu-vroot-aarch64 -E PATH=/bin:/usr/bin:/sbin -E HOME=/root -L ./ ./bin/bash -c 'cd \u0026\u0026 bash'\n```\n- run `apt update`, the apt package manager works fine, you can install packages by `apt`\n\n## Usage (if you are a Mac user):\n\n1. Connect your MateBook Pro to Mac, and do the following steps on Mac\n2. Clone this repo recursively, and cd into this repo\n3. Setup code signing in DevEco-Studio, ignore warnings if any\n4. Install `wget`, `coreutils`, `make`, `gsed`, `gettext`, `automake`, `cmake`, `pkg-config` and `ncurses` from Homebrew or Nix\n5. (M-series User) `export PATH=\"/opt/homebrew/opt/coreutils/libexec/gnubin:/opt/homebrew/opt/gnu-sed/libexec/gnubin:/opt/homebrew/opt/make/libexec/gnubin:$PATH\"`\n6. Run `./create-hnp.sh` to create hnp packages\n7. Run `./build-macos.sh`\n8. Run `./push.sh ./entry/build/default/outputs/default/entry-default-signed.hap`\n9. Try Termony on you HarmonyOS Computer\n\n## Usage (if you are a Linux user):\n\n1. Connect your MateBook Pro to a Linux machine, and do the following steps\n2. Clone this repo recursively, and cd into this repo\n3. Setup code signing in DevEco-Studio, ignore warnings if any\n4. Setup DevEco Command Line Tools, and make sure `$TOOL_HOME` env var is a correct directory to SDK\n5. Run `./build-linux.sh -b` to create hnp packages\n6. Run `./build-linux.sh -s` to sign the hap file\n7. Run `./build-linux.sh -p` to push and install Termony on your device\n8. Try Termony on you HarmonyOS Computer\n\n## Usage (if you are a Windows user):\n\n1. Connect your MateBook Pro to a Windows machine, and do the following steps\n2. Install WSL (Ubuntu recomended), and build hap with following steps, like Linux\n3. Clone this repo recursively, and cd into this repo\n4. Setup code signing in DevEco-Studio, ignore warnings if any\n5. Setup DevEco Command Line Tools in WSL, and make sure `$TOOL_HOME` env var is a correct directory to SDK\n6. In WSL, run `./build-linux.sh -b` to create hnp packages\n7. In WSL, run `./build-linux.sh -s` to sign the hap file\n8. In Windows terminal, use `hdc` on Windows to send and install hap file, like `hdc_push` in `build-linux.sh`\n9. Try Termony on you HarmonyOS Computer\n\n## How does it work\n\nBy examining CodeArts IDE, we found that it utilizes HNP packages for native programs. You need to package `.hnp` files into the `.hap`, and add them to `module.json5` like:\n\n```json5\n{\n  \"module\": {\n    \"hnpPackages\": [\n      {\n        \"package\": \"busybox.hnp\",\n        \"type\": \"private\"\n      }\n    ]\n  }\n}\n```\n\nThen, you need to add the `.hnp` files to `.hap` and sign the `.hap` manually. You can refer to `sign.py` to see how it is done. The `.hnp` packages are unpacked under `/data/app` automatically and symlinks are created under `/data/app/bin`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTermonyHQ%2FTermony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTermonyHQ%2FTermony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTermonyHQ%2FTermony/lists"}