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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ third_party/sparkle/

website/.next/
website/out/

android/.gradle/
android/.idea/
android/local.properties
android/**/build/
android/captures/
android/.kotlin/
15 changes: 10 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ This file gives Codex project-specific context for working in Dao Browser.

Dao Browser is a Chromium-based browser with an Arc-style vertical sidebar, currently targeting macOS arm64. The full Chromium checkout and build output live under `engine/`, which is gitignored and very large. This repository tracks Dao-owned code and patch files, not the whole Chromium tree.

Read `docs/features.md` first when asked what Dao Browser does, when locating the owner of a behavior, or before adding a feature that may overlap with existing work.
Read `docs/features.md` first for desktop Chromium behavior and
`docs/features-android.md` first for Android GeckoView behavior when asked what
Dao Browser does, when locating the owner of a behavior, or before adding a
feature that may overlap with existing work.

## Feature Documentation

- When adding or materially changing a Dao Browser feature, update `docs/features.md` in the same change to keep the feature catalog current.
- When adding or materially changing a Dao Browser feature, update `docs/feature-checklist.md` in the same change so Chromium upgrade and regression checks cover the new behavior.
- If a feature change does not require updates to either document, explicitly mention why in the final response.
- When adding or materially changing a desktop Chromium feature, update `docs/features.md` in the same change.
- When adding or materially changing an Android feature, update `docs/features-android.md` in the same change.
- When adding or materially changing a feature on either platform, update `docs/feature-checklist.md` so upgrade and regression checks cover the behavior.
- If a feature change does not require updates to its platform feature inventory or the shared checklist, explicitly mention why in the final response.

## Source Of Truth

Expand Down Expand Up @@ -128,8 +132,9 @@ Never hardcode user-facing copy in Dao-owned UI. All user-visible text must have
- C++ Views strings go in `src/dao/browser/strings/dao_strings.grd` and are read with `l10n_util::GetStringUTF16` or `GetStringFUTF16`.
- Sidebar WebUI strings go in `src/dao/browser/strings/dao_strings.grd`, are registered on the sidebar `WebUIDataSource` with `AddLocalizedString` / `UseStringsJs`, and are read from TypeScript through `loadTimeData.getString(...)`.
- Agent WebUI strings go in `src/dao/browser/ui/webui/resources/agent/i18n/locales/en.ts` and are read with `t('key', { var: 'x' })`.
- Android strings use `android/app/src/main/res/values/strings.xml` as the English source and qualified `values-*/strings.xml` files for translations. Android follows the system locale and falls back to English.
- `zh-CN` is hand-authored and treated as the tone reference.
- Other locales are generated manually by the user via `OPENAI_API_KEY=... sh ./i18n.sh`; do not run it automatically.
- Other desktop and Android locales are generated manually by the user via `OPENAI_API_KEY=... sh ./i18n.sh`; do not run it automatically. The root command dispatches independent platform translators, and `--only desktop` or `--only android` limits the run.

## Native Toast Feedback

Expand Down
40 changes: 40 additions & 0 deletions android/NOTICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Third-party Notices

Dao Browser Android consumes Mozilla Android Components and GeckoView under the Mozilla Public License 2.0.

- Mozilla Public License 2.0: https://www.mozilla.org/MPL/2.0/
- Android Components source: https://searchfox.org/firefox-main/source/mobile/android/android-components
- GeckoView source: https://searchfox.org/firefox-main/source/mobile/android/geckoview

The release packaging task must generate the complete transitive dependency notice set before public distribution.

## uBlock Origin

Dao Browser Android bundles a GeckoView compatibility variant of the Firefox
extension from uBlock Origin 1.72.2 under the GNU General Public License 3.0.
The variant removes only the GeckoView-unsupported `menus` permission and
`commands` manifest entry; blocking code and filter assets are unchanged.

- Source: https://github.com/gorhill/uBlock
- Release: https://github.com/gorhill/uBlock/releases/tag/1.72.2
- Artifact: `uBlock0_1.72.2.firefox.signed.xpi`
- SHA-256: `40c315b0da7871868155ecfae7a50a58dfa0920aebd865e008214986f1b7c578`
- License text: `third_party/ublock_origin/LICENSE.txt`

The corresponding source is available from the source and release links above.
Release packaging must preserve this notice, license text, and source access.

## KISS Translator

Dao Browser Android bundles the unmodified public Firefox extension KISS
Translator 2.0.29 under the GNU General Public License v3.0 only.

- Source: https://github.com/fishjar/kiss-translator
- Release: https://github.com/fishjar/kiss-translator/releases/tag/v2.0.29
- Listing: https://addons.mozilla.org/firefox/addon/kiss-translator/
- Artifact: `kiss_translator-2.0.29.xpi`
- SHA-256: `0316f026b1b0c3d171262b3f4f369e34013abdf1d1bbe9d348290c3db53f4092`
- License text: `app/src/main/assets/notices/kiss_translator_license.txt`

Translation is performed through the service selected inside KISS Translator.
Release packaging must preserve this notice, license text, and source access.
110 changes: 110 additions & 0 deletions android/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Dao Browser Android

Dao Browser Android is a Kotlin application built with Mozilla Android Components and GeckoView.

## Requirements

- macOS on the existing development Mac
- JDK 17
- Android SDK 36
- An Android API 26+ emulator or physical device

Set the local SDK location before running Gradle, for example:

```bash
export ANDROID_HOME="$HOME/Library/Android/sdk"
```

All commands run locally on the development Mac; they do not require a cloud build service or paid device hardware.

## Verify

```bash
cd android
./gradlew :app:verifyBundledUBlockOrigin
./gradlew :app:verifyBundledKissTranslator
./gradlew :app:testDebugUnitTest :app:lintDebug :app:assembleDebug
```

The APK bundles a GeckoView-compatible uBlock Origin 1.72.2 package and the
unmodified KISS Translator 2.0.29 Firefox package. Both are
requested as built-in extensions before creating the first browser session and
update with the APK without a first-run download. KISS Translator supplies
paragraph-by-paragraph bilingual page translation, input and selected-text
translation, and subtitle translation through the service selected inside the
extension.

The Extensions screen reads installed extensions from Gecko and can toggle
them. Its Store is native Compose UI: a blank query loads AMO recommendations,
submitted queries search AMO, and catalog requests are limited to Android
extensions compatible with the running Gecko major version. The catalog accepts
only public HTTPS `.xpi` packages and installs the selected AMO package directly
through Gecko's `RTAMO` path. Opening, searching, or installing from the Store
does not change the selected browser tab.

Before either Store or local installation completes, Dao presents Gecko's
requested browser permissions, site access, and data-collection permissions for
explicit approval; cancellation declines the install. The system document picker
remains available for local `.xpi` files without a storage permission. That
package is staged for Gecko's `FROM_FILE` path until the installation reaches a
terminal result. User-installed extensions persist across restarts and can be
disabled or uninstalled. Release GeckoView enforces Mozilla signatures,
compatibility, and blocklists for both install paths, so Dao does not bypass
unsigned, incompatible, corrupt, or blocklisted-package rejection. Catalog
failures show a Retry action. Remote installation failures use the localized
extension-install status; after the user dismisses the result with Done, the
add-on's Install action is available again. A dedicated Dao ad-blocking
preference is not implemented.

## Localization

Android uses English as its unqualified source catalog and follows the system
locale through standard Android resource resolution. Simplified Chinese is
hand-authored under `values-zh-rCN`; unsupported locales fall back to English.
Desktop and Android localization files remain independent.

From the repository root, preview translation work without making API calls or
writing files:

```bash
sh ./i18n.sh --dry-run
sh ./i18n.sh --only android --langs zh-CN,ja --dry-run
```

Run the desktop and Android translators with OpenAI GPT-5.5:

```bash
OPENAI_API_KEY=sk-... sh ./i18n.sh
```

Use `--only desktop` or `--only android` to run one platform, and use
`OPENAI_TRANSLATE_MODEL` or `--model` to override the default model. A live run
uses the OpenAI API and may incur charges; build and test commands never invoke
it automatically.

## Install

```bash
cd android
./gradlew :app:installDebug
```

## Device smoke test

```bash
cd android
./gradlew :app:connectedDebugAndroidTest
```

The application uses Mozilla Android Components `BrowserStore` and
`EngineMiddleware` for multiple Gecko tabs. Its full-screen tab grid supports
live tab counts, switching, close and swipe-right-to-close, new tabs, and real
page thumbnails. Android Components `SessionStorage` restores regular tab order,
selection, URLs, and navigation history after process death; private tabs and
their thumbnails are never persisted.

It also supports address-or-search navigation, persistent
history/bookmarks/folders, Android system downloads, persistent engine
preferences, default-private startup, signed extension installation and
management, and CameraX QR scanning. An in-session private-mode switch,
passwords, sync, Agent, and MCP are not yet implemented.
Loading
Loading