Loading MyCode...
+ + From 8b9cd7df1d0a25e63b52a7077a1060bba68e987f Mon Sep 17 00:00:00 2001 From: bhawan-kawinda / <223249222+bhawan-kavinda@users.noreply.github.com> Date: Sun, 27 Sep 2026 01:06:17 +0530 Subject: [PATCH 2/8] Add files via upload --- .github/workflows/build-apk.yaml | 52 ++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/build-apk.yaml diff --git a/.github/workflows/build-apk.yaml b/.github/workflows/build-apk.yaml new file mode 100644 index 000000000000..3e0271b82195 --- /dev/null +++ b/.github/workflows/build-apk.yaml @@ -0,0 +1,52 @@ +name: Build MyCode APK + +# Manual trigger - Actions tab එකෙන් "Run workflow" click කරන්න +on: + workflow_dispatch: + +jobs: + build-apk: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Setup Java (Gradle/Android build සඳහා) + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + - name: Setup Android SDK + uses: android-actions/setup-android@v3 + + # Capacitor project එක repo root එකේ මේ files තියෙනවා + # (capacitor.config.ts, www/index.html) කියලා assume කරනවා + - name: Install Capacitor dependencies + run: | + npm install @capacitor/core @capacitor/cli @capacitor/android + + - name: Add Android platform + run: npx cap add android + + - name: Sync Capacitor + run: npx cap sync android + + - name: Grant execute permission for gradlew + run: chmod +x android/gradlew + + - name: Build debug APK + run: | + cd android + ./gradlew assembleDebug + + - name: Upload APK artifact + uses: actions/upload-artifact@v4 + with: + name: mycode-debug-apk + path: android/app/build/outputs/apk/debug/app-debug.apk From 017587fda69c355573bcef88dbfb96ea4568eb7f Mon Sep 17 00:00:00 2001 From: bhawan-kawinda / <223249222+bhawan-kavinda@users.noreply.github.com> Date: Sun, 27 Sep 2026 01:09:31 +0530 Subject: [PATCH 3/8] Simplify workflow names and comments in build-apk.yaml --- .github/workflows/build-apk.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build-apk.yaml b/.github/workflows/build-apk.yaml index 3e0271b82195..c30711819f66 100644 --- a/.github/workflows/build-apk.yaml +++ b/.github/workflows/build-apk.yaml @@ -1,6 +1,5 @@ name: Build MyCode APK -# Manual trigger - Actions tab එකෙන් "Run workflow" click කරන්න on: workflow_dispatch: @@ -16,7 +15,7 @@ jobs: with: node-version: '20' - - name: Setup Java (Gradle/Android build සඳහා) + - name: Setup Java uses: actions/setup-java@v4 with: distribution: 'temurin' @@ -25,8 +24,6 @@ jobs: - name: Setup Android SDK uses: android-actions/setup-android@v3 - # Capacitor project එක repo root එකේ මේ files තියෙනවා - # (capacitor.config.ts, www/index.html) කියලා assume කරනවා - name: Install Capacitor dependencies run: | npm install @capacitor/core @capacitor/cli @capacitor/android From ece5928c8808fcd1004b6718523637549a80006b Mon Sep 17 00:00:00 2001 From: bhawan-kawinda / <223249222+bhawan-kavinda@users.noreply.github.com> Date: Sun, 27 Sep 2026 01:24:38 +0530 Subject: [PATCH 4/8] Delete .github/workflows/build-apk.yaml --- .github/workflows/build-apk.yaml | 49 -------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 .github/workflows/build-apk.yaml diff --git a/.github/workflows/build-apk.yaml b/.github/workflows/build-apk.yaml deleted file mode 100644 index c30711819f66..000000000000 --- a/.github/workflows/build-apk.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: Build MyCode APK - -on: - workflow_dispatch: - -jobs: - build-apk: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - - name: Setup Android SDK - uses: android-actions/setup-android@v3 - - - name: Install Capacitor dependencies - run: | - npm install @capacitor/core @capacitor/cli @capacitor/android - - - name: Add Android platform - run: npx cap add android - - - name: Sync Capacitor - run: npx cap sync android - - - name: Grant execute permission for gradlew - run: chmod +x android/gradlew - - - name: Build debug APK - run: | - cd android - ./gradlew assembleDebug - - - name: Upload APK artifact - uses: actions/upload-artifact@v4 - with: - name: mycode-debug-apk - path: android/app/build/outputs/apk/debug/app-debug.apk From 359de751a579f0ed1599ec4d75e4a8ac1025d2e5 Mon Sep 17 00:00:00 2001 From: bhawan-kawinda / <223249222+bhawan-kavinda@users.noreply.github.com> Date: Sun, 27 Sep 2026 01:25:01 +0530 Subject: [PATCH 5/8] Add files via upload --- .github/workflows/build-apk.yaml | 58 ++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/build-apk.yaml diff --git a/.github/workflows/build-apk.yaml b/.github/workflows/build-apk.yaml new file mode 100644 index 000000000000..adca2201280e --- /dev/null +++ b/.github/workflows/build-apk.yaml @@ -0,0 +1,58 @@ +name: Build MyCode APK + +# Manual trigger - Actions tab එකෙන් "Run workflow" click කරන්න +on: + workflow_dispatch: + +jobs: + build-apk: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Setup Java (Gradle/Android build සඳහා) + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + # ubuntu-latest runner එකේ Android SDK දැනටමත් install වෙලා තියෙනවා, + # ඒ නිසා android-actions/setup-android එක ඕන නෑ (ඒක 'tools' කියන + # ඉවත් කරපු legacy package එකක් හොයන්න try කරලා fail වුනා). + # SDK path එක export කරනවා විතරයි. + - name: Set Android SDK env + run: | + echo "ANDROID_SDK_ROOT=$ANDROID_HOME" >> $GITHUB_ENV + echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV + + # Capacitor project එක repo root එකේ මේ files තියෙනවා + # (capacitor.config.ts, www/index.html) කියලා assume කරනවා + - name: Install Capacitor dependencies + run: | + npm install @capacitor/core @capacitor/cli @capacitor/android + + - name: Add Android platform + run: npx cap add android + + - name: Sync Capacitor + run: npx cap sync android + + - name: Grant execute permission for gradlew + run: chmod +x android/gradlew + + - name: Build debug APK + run: | + cd android + ./gradlew assembleDebug + + - name: Upload APK artifact + uses: actions/upload-artifact@v4 + with: + name: mycode-debug-apk + path: android/app/build/outputs/apk/debug/app-debug.apk From 6da84b139f9416291a7aa21af822d76be44aca2b Mon Sep 17 00:00:00 2001 From: bhawan-kawinda / <223249222+bhawan-kavinda@users.noreply.github.com> Date: Sun, 27 Sep 2026 01:32:40 +0530 Subject: [PATCH 6/8] Delete .github/workflows/build-apk.yaml --- .github/workflows/build-apk.yaml | 58 -------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 .github/workflows/build-apk.yaml diff --git a/.github/workflows/build-apk.yaml b/.github/workflows/build-apk.yaml deleted file mode 100644 index adca2201280e..000000000000 --- a/.github/workflows/build-apk.yaml +++ /dev/null @@ -1,58 +0,0 @@ -name: Build MyCode APK - -# Manual trigger - Actions tab එකෙන් "Run workflow" click කරන්න -on: - workflow_dispatch: - -jobs: - build-apk: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Setup Java (Gradle/Android build සඳහා) - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - # ubuntu-latest runner එකේ Android SDK දැනටමත් install වෙලා තියෙනවා, - # ඒ නිසා android-actions/setup-android එක ඕන නෑ (ඒක 'tools' කියන - # ඉවත් කරපු legacy package එකක් හොයන්න try කරලා fail වුනා). - # SDK path එක export කරනවා විතරයි. - - name: Set Android SDK env - run: | - echo "ANDROID_SDK_ROOT=$ANDROID_HOME" >> $GITHUB_ENV - echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV - - # Capacitor project එක repo root එකේ මේ files තියෙනවා - # (capacitor.config.ts, www/index.html) කියලා assume කරනවා - - name: Install Capacitor dependencies - run: | - npm install @capacitor/core @capacitor/cli @capacitor/android - - - name: Add Android platform - run: npx cap add android - - - name: Sync Capacitor - run: npx cap sync android - - - name: Grant execute permission for gradlew - run: chmod +x android/gradlew - - - name: Build debug APK - run: | - cd android - ./gradlew assembleDebug - - - name: Upload APK artifact - uses: actions/upload-artifact@v4 - with: - name: mycode-debug-apk - path: android/app/build/outputs/apk/debug/app-debug.apk From 6a7321f220133ad19b83dfe13cf4c2b9c62ab92c Mon Sep 17 00:00:00 2001 From: bhawan-kawinda / <223249222+bhawan-kavinda@users.noreply.github.com> Date: Sun, 27 Sep 2026 01:33:00 +0530 Subject: [PATCH 7/8] Add files via upload --- .github/workflows/build-apk.yaml | 58 ++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/build-apk.yaml diff --git a/.github/workflows/build-apk.yaml b/.github/workflows/build-apk.yaml new file mode 100644 index 000000000000..bceb7159e8cb --- /dev/null +++ b/.github/workflows/build-apk.yaml @@ -0,0 +1,58 @@ +name: Build MyCode APK + +# Manual trigger - Actions tab එකෙන් "Run workflow" click කරන්න +on: + workflow_dispatch: + +jobs: + build-apk: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Setup Java (Gradle/Android build සඳහා) + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + # ubuntu-latest runner එකේ Android SDK දැනටමත් install වෙලා තියෙනවා, + # ඒ නිසා android-actions/setup-android එක ඕන නෑ (ඒක 'tools' කියන + # ඉවත් කරපු legacy package එකක් හොයන්න try කරලා fail වුනා). + # SDK path එක export කරනවා විතරයි. + - name: Set Android SDK env + run: | + echo "ANDROID_SDK_ROOT=$ANDROID_HOME" >> $GITHUB_ENV + echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV + + # Capacitor project එක repo root එකේ මේ files තියෙනවා + # (capacitor.config.ts, www/index.html) කියලා assume කරනවා + - name: Install Capacitor dependencies + run: | + npm install @capacitor/core @capacitor/cli @capacitor/android typescript + + - name: Add Android platform + run: npx cap add android + + - name: Sync Capacitor + run: npx cap sync android + + - name: Grant execute permission for gradlew + run: chmod +x android/gradlew + + - name: Build debug APK + run: | + cd android + ./gradlew assembleDebug + + - name: Upload APK artifact + uses: actions/upload-artifact@v4 + with: + name: mycode-debug-apk + path: android/app/build/outputs/apk/debug/app-debug.apk From 844ea280bec7a85ee0bb3e8f6f15a30512cea821 Mon Sep 17 00:00:00 2001 From: podda2006 <223249222+bhawan-kavinda@users.noreply.github.com> Date: Sun, 11 Oct 2026 02:28:20 +0530 Subject: [PATCH 8/8] Move Android WebView app to ci/android --- .github/workflows/android-webview.yaml | 65 ++++++++ .github/workflows/build-apk.yaml | 58 ------- .../AndroidManifest-changes.xml | 20 --- capacitor.config.ts | 16 -- ci/android/.gitignore | 3 + ci/android/README.md | 28 ++++ ci/android/capacitor.config.ts | 19 +++ ci/android/package.json | 19 +++ ci/android/www/index.html | 16 ++ docs/android-webview.md | 27 +++ package.json | 154 +++++++++++++++++- www/index.html | 17 -- 12 files changed, 322 insertions(+), 120 deletions(-) create mode 100644 .github/workflows/android-webview.yaml delete mode 100644 .github/workflows/build-apk.yaml delete mode 100644 android-manifest-ref/AndroidManifest-changes.xml delete mode 100644 capacitor.config.ts create mode 100644 ci/android/.gitignore create mode 100644 ci/android/README.md create mode 100644 ci/android/capacitor.config.ts create mode 100644 ci/android/package.json create mode 100644 ci/android/www/index.html create mode 100644 docs/android-webview.md delete mode 100644 www/index.html diff --git a/.github/workflows/android-webview.yaml b/.github/workflows/android-webview.yaml new file mode 100644 index 000000000000..ff10cdece271 --- /dev/null +++ b/.github/workflows/android-webview.yaml @@ -0,0 +1,65 @@ +name: Build Android WebView APK + +on: + workflow_dispatch: + pull_request: + paths: + - "ci/android/**" + - ".github/workflows/android-webview.yaml" + +permissions: + contents: read + +jobs: + build-apk: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ci/android + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6 + with: + node-version-file: .node-version + # TODO: pin these two actions to commit SHAs like the rest of this repo. + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: "17" + + # The Android SDK is preinstalled on ubuntu-latest runners. + - name: Set Android SDK env + run: | + echo "ANDROID_SDK_ROOT=$ANDROID_HOME" >> "$GITHUB_ENV" + + - name: Install dependencies + run: npm install + + - name: Add Android platform + run: npx cap add android + + - name: Sync Capacitor + run: npx cap sync android + + # Cleartext traffic is needed because code-server is served over plain + # HTTP on localhost. Capacitor may already set this from + # `server.cleartext`; only patch the manifest if it did not. + - name: Ensure cleartext traffic and INTERNET permission + run: | + manifest=android/app/src/main/AndroidManifest.xml + grep -q 'usesCleartextTraffic' "$manifest" || \ + sed -i 's/Loading code-server...
+ + diff --git a/docs/android-webview.md b/docs/android-webview.md new file mode 100644 index 000000000000..4f321eea900b --- /dev/null +++ b/docs/android-webview.md @@ -0,0 +1,27 @@ +# Android WebView app + +A small Android app that opens a locally running code-server in a WebView, so +you get a full-screen app instead of a browser tab. + +The app does **not** bundle code-server or Node.js (it does not use Node.js +Mobile). You run code-server on the device yourself, normally in +[Termux](./termux.md), where terminals, language servers, and sockets work as +on any Linux system. The app only displays `http://127.0.0.1:8080`. + +## Usage + +1. Install code-server in Termux by following the [Termux guide](./termux.md). + code-server requires Node.js 24; check with `node -v`. +2. Set a password in `~/.config/code-server/config.yaml` and keep + `auth: password`. Any app on the device can reach `127.0.0.1:8080`, so do not + disable authentication. +3. Start code-server in Termux: `code-server`. +4. Open the app. It loads `http://127.0.0.1:8080`. + +If you change the port in `bind-addr`, rebuild the app with the matching +`server.url` in [`ci/android/capacitor.config.ts`](../ci/android/capacitor.config.ts). + +## Building + +See [`ci/android/README.md`](../ci/android/README.md). The `Build Android +WebView APK` workflow builds a debug APK and uploads it as an artifact. diff --git a/package.json b/package.json index 8c017c204aa5..ad493780f36e 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,152 @@ { - "name": "mycode-app", - "version": "1.0.0", - "description": "code-server backend එකට connect වෙන WebView APK", + "name": "code-server", + "license": "MIT", + "version": "0.0.0", + "description": "Run VS Code on a remote server.", + "homepage": "https://github.com/coder/code-server", + "bugs": { + "url": "https://github.com/coder/code-server/issues" + }, + "repository": "https://github.com/coder/code-server", "scripts": { - "sync": "npx cap sync android", - "open": "npx cap open android" + "clean": "./ci/build/clean.sh", + "build": "./ci/build/build-code-server.sh", + "build:vscode": "./ci/build/build-vscode.sh", + "doctoc": "./ci/dev/doctoc.sh", + "release": "./ci/build/build-release.sh", + "release:prep": "./ci/build/release-prep.sh", + "test:e2e": "VSCODE_IPC_HOOK_CLI= ./ci/dev/test-e2e.sh", + "test:e2e:proxy": "USE_PROXY=1 ./ci/dev/test-e2e.sh", + "test:unit": "./ci/dev/test-unit.sh --forceExit --detectOpenHandles", + "test:integration": "./ci/dev/test-integration.sh", + "test:native": "./ci/dev/test-native.sh", + "test:scripts": "./ci/dev/test-scripts.sh", + "package": "./ci/build/build-packages.sh", + "prettier": "prettier --write --log-level=warn --cache .", + "preinstall": "node ./ci/dev/preinstall.js", + "postinstall": "./ci/dev/postinstall.sh", + "publish:npm": "./ci/steps/publish-npm.sh", + "publish:docker": "./ci/steps/docker-buildx-push.sh", + "fmt": "npm run prettier && ./ci/dev/doctoc.sh", + "lint:scripts": "./ci/dev/lint-scripts.sh", + "lint:ts": "eslint --max-warnings=0 --fix $(git ls-files '*.ts' '*.js' | grep -v 'lib/vscode')", + "test": "echo 'Run npm run test:unit or npm run test:e2e' && exit 1", + "watch": "VSCODE_DEV=1 VSCODE_IPC_HOOK_CLI= NODE_OPTIONS='--max_old_space_size=32384 --trace-warnings' ts-node ./ci/dev/watch.ts", + "icons": "./ci/dev/gen_icons.sh" + }, + "main": "out/node/entry.js", + "devDependencies": { + "@eslint/compat": "^1.2.0", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "^9.12.0", + "@types/compression": "^1.7.3", + "@types/cookie-parser": "^1.4.4", + "@types/eslint__js": "^8.42.3", + "@types/express": "^5.0.0", + "@types/http-proxy": "1.17.7", + "@types/js-yaml": "^4.0.6", + "@types/node": "24.x", + "@types/pem": "^1.14.1", + "@types/proxy-from-env": "^1.0.1", + "@types/safe-compare": "^1.1.0", + "@types/semver": "^7.5.2", + "@types/trusted-types": "^2.0.4", + "@types/ws": "^8.5.5", + "doctoc": "^2.2.1", + "eslint": "^9.12.0", + "eslint-config-prettier": "^10.1.8", + "eslint-import-resolver-typescript": "^4.4.4", + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-prettier": "^5.0.0", + "globals": "^17.6.0", + "prettier": "3.9.4", + "prettier-plugin-sh": "^0.20.2", + "ts-node": "^10.9.1", + "typescript": "^5.6.2", + "typescript-eslint": "^8.8.0" }, "dependencies": { - "@capacitor/core": "^6.0.0", - "@capacitor/android": "^6.0.0" + "@coder/logger": "^3.0.1", + "argon2": "^0.44.0", + "compression": "^1.7.4", + "cookie": "^1.1.1", + "cookie-parser": "^1.4.6", + "env-paths": "^2.2.1", + "express": "^5.0.1", + "http-proxy": "^1.18.1", + "httpolyglot": "^0.1.2", + "i18next": "^26.3.1", + "js-yaml": "^5.2.3", + "limiter": "^4.1.0", + "pem": "^1.14.8", + "proxy-agent": "^6.3.1", + "qs": "^6.15.0", + "rotating-file-stream": "^3.1.1", + "safe-compare": "^1.1.4", + "semver": "^7.5.4", + "ws": "^8.14.2", + "xdg-basedir": "^4.0.0" }, - "devDependencies": { - "@capacitor/cli": "^6.0.0" + "resolutions": { + "@types/node": "24.x" + }, + "bin": { + "code-server": "out/node/entry.js" + }, + "keywords": [ + "vscode", + "development", + "ide", + "coder", + "vscode-remote", + "browser-ide", + "remote-development" + ], + "engines": { + "node": "24" + }, + "jest": { + "transform": { + "^.+\\.ts$": "Loading MyCode...
- -