Skip to content

About

Unofficial Zalo Linux port (x86_64) — every native module ported: file-utils, file-utilities, zwalker, zfile, v8-profiles, mp4thumb, zimage, zjxl, zcall wire bridge + live call recon

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

152 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zalo Linux Native

Development checkpoint (2026-09-11): outgoing/incoming call owners use one Electron call window with remote video, local camera preview and acknowledged mic/camera controls. Incoming Từ chối now sends the authenticated desktop cancel request for voice/video before local teardown. Snapshot 8d7a0d0 is installed and running from the verified user-local copy; 25 call-control suites and all 21 aggregate regression commands pass under Electron 22's embedded Node. Real Electron zimage, single-instance, call-control and native H.264 localhost encode/decode/canvas fixtures also pass. It includes the corrected NV21 camera path, contact name/avatar presentation, normalized remote decline/end, and a cold-start incoming path that no longer creates a competing 401 call. Current two-account confirmation remains a release gate. This is not a finished release. See current evidence and remaining gates.

Independent project: this repository is RuriMeiko/zalo-linux-native, a public standalone GitHub repository (fork: false, default branch main). Development builds on realdtn2/zalo-linux-2026, not a from-scratch implementation. See credits and provenance, current status and publication checklist. Native outgoing voice was confirmed audible in both directions in one user-assisted test, and the user later reported two-way video on a previous trial. Those observations do not validate every control in the current build. No binary release is claimed yet.

For native voice/video startup with user-local runtime and device settings, see NATIVE-LAUNCH.md. This development launcher does not run the inherited upstream updater.

⚠️ Tình trạng tính năng Gọi thoại & Video (Call Status)

  • Cuộc gọi đi (Outgoing Call - Phía mình gọi cho người ta): ✅ Hoạt động tốt (Working) — Phía mình gọi cho người khác nghe nói 2 chiều và camera hoạt động bình thường trên Linux.
  • Cuộc gọi đến (Incoming Call - Người khác gọi tới mình): 🚧 Đang phát triển, hiện CHƯA nghe / cúp máy được (WIP - Cannot answer/end yet) — Khi người khác gọi đến máy tính, luồng xử lý tín hiệu và giao diện nghe/cúp máy vẫn đang được khắc phục và hoàn thiện.

⚠️ Work in Progress - This project is under active development. A Linux port of Zalo, bringing the popular Vietnamese messaging application to the Linux platform. image

How It Works

This is an unofficial port of the Zalo macOS desktop client to Linux — not a web wrapper. The experimental native call path is documented in native/android-zrtc. It runs the existing ZRTC engine in a Linux/Bionic worker and connects it to PulseAudio, V4L2 and the desktop signaling/UI; it does not use Wine or an Android emulator.

The port was created by:

  1. Extracting the .dmg from the macOS version
  2. Locating app.asar at /Applications/Zalo.app/Contents/Resources/
  3. Extracting it with asar extract app.asar app
  4. Running the extracted app with Electron 22.3.27 (electron .)

Note: Newer versions of Electron cause errors — v22.3.27 is required.

📦 Hướng dẫn cài đặt & Sử dụng (Installation & Usage)

🤖 Cài đặt tự động bằng AI Agent (Claude Code, Cursor, Aider, Codex, ChatGPT,...)

Bạn chỉ cần copy link tài liệu chuẩn LLM dưới đây và đưa cho AI Agent của bạn để nó tự động thiết lập từ A đến Z:

Link cho AI Agent:
https://raw.githubusercontent.com/RuriMeiko/zalo-linux-native/main/llms.txt

Câu lệnh mẫu (Prompt):

"Hãy đọc hướng dẫn tại https://raw.githubusercontent.com/RuriMeiko/zalo-linux-native/main/llms.txt và tiến hành kiểm tra môi trường, tải Electron 22.3.27, tạo cấu hình và cài đặt Zalo Linux Native trên máy của tôi."


1. Yêu cầu hệ thống (Prerequisites)

  • Hệ điều hành: Linux x86_64 (Ubuntu, Debian, Fedora, Arch Linux,...).
  • Node.js: Phiên bản 18 đến 22 (khuyến nghị v20 hoặc v22).
  • Electron: Bắt buộc phiên bản v22.3.27 (các bản Electron mới hơn sẽ phát sinh lỗi).
  • Âm thanh: PulseAudio hoặc PipeWire (với gói pipewire-pulse).
  • Camera (tùy chọn cho video call): Thiết bị V4L2 (mặc định /dev/video0).
  • ZRTC Runtime: Runtime native engine chuẩn bị sẵn (xem hướng dẫn tại native/android-zrtc/README.md).

2. Thiết lập cấu hình launch.json

Zalo Linux Native sử dụng file cấu hình launch.json để quản lý đường dẫn và thiết bị phần cứng.

Tạo file launch.json (ví dụ đặt tại thư mục dự án hoặc ~/.config/zalo-native-linux/launch.json):

{
  "appDir": "/đường_dẫn_tuyệt_đối_đến/zalo-linux-native",
  "electron": "/đường_dẫn_tuyệt_đối_đến/electron-v22.3.27/electron",
  "runtime": "/đường_dẫn_tuyệt_đối_đến/runtime",
  "source": "tên_microphone_từ_pactl",
  "sink": "tên_loa_từ_pactl",
  "noSandbox": true,
  "experimentalVideo": true,
  "videoDevice": "/dev/video0",
  "experimentalIncoming": true,
  "log": true
}

Cách lấy tên Microphone (source) và Loa (sink):

Mở terminal và chạy lệnh:

# Lấy danh sách microphone (chọn tên thiết bị, không chọn dòng có đuôi .monitor):
pactl list sources short

# Lấy danh sách loa / tai nghe:
pactl list sinks short

Lưu ý: Tất cả đường dẫn trong launch.json phải là đường dẫn tuyệt đối (bắt đầu bằng /home/...), không dùng ký hiệu ~ hoặc biến môi trường $HOME.


3. Khởi chạy ứng dụng

Cách 1: Chạy trực tiếp từ thư mục mã nguồn

# Clone mã nguồn:
git clone https://github.com/RuriMeiko/zalo-linux-native.git
cd zalo-linux-native

# Kiểm tra tính toàn vẹn và thiết bị phần cứng trước khi chạy:
bash start.sh launch.json --check

# Khởi chạy Zalo:
bash start.sh launch.json

Cách 2: Cài đặt tự động vào máy

Script cài đặt sẽ tự nhận diện thiết bị, tải đúng Electron 22.3.27 khi cần, build bản có manifest, thay bản cũ bằng một bản backup có thể phục hồi và đăng ký đúng một mục menu tên Zalo với icon Zalo:

git clone https://github.com/RuriMeiko/zalo-linux-native.git
cd zalo-linux-native
bash install.sh

Cài nhanh bằng một dòng lệnh (Linux x86_64, cần git, node 18–22, curl, unzip):

git clone --depth 1 https://github.com/RuriMeiko/zalo-linux-native.git ~/zalo-linux-native && bash ~/zalo-linux-native/install.sh

Giữ thư mục ~/zalo-linux-native sau khi cài, vì bản cài dùng runtime trong đó cho đến lần cập nhật đầu tiên.

Cập nhật

node ~/.local/share/zalo/scripts/update-native.mjs --check          # có bản mới không
node ~/.local/share/zalo/scripts/update-native.mjs                  # cập nhật (đóng Zalo trước)
node ~/.local/share/zalo/scripts/update-native.mjs --rollback       # quay về bản trước
node ~/.local/share/zalo/scripts/update-native.mjs --install-timer  # tự kiểm tra mỗi 6 giờ

Bản mới được tải vào thư mục riêng, kiểm hash rồi mới thay; nếu bản mới không qua bước kiểm tra thì tự quay về bản cũ. Cấu hình thiết bị trong launch.json được giữ nguyên.

Khi cập nhật, thoát Zalo từ tray rồi chạy lại bash install.sh. Bản cũ được chuyển vào ~/zalo-native-recovery/, không đụng tới hồ sơ đăng nhập.


4. Đăng ký menu thủ công (Tùy chọn)

install.sh đã làm bước này. Nếu dùng installer cấp thấp, có thể đăng ký lại:

node scripts/register-desktop.mjs ~/.local/share/zalo

Nó tạo duy nhất ~/.local/share/applications/zalo.desktop, tên hiển thị Zalo, và dùng pc-dist/zalo.png trong bản cài.


5. Kiểm tra phiên bản mới từ repo

bash update.sh --check

6. Xem nhật ký log chẩn đoán cuộc gọi

Khi đặt "log": true trong launch.json, toàn bộ log kết nối cuộc gọi được lưu tại:

tail -f ~/.config/ZaloData/zcall-agent.log

Features

zcall (Audio & Video Calling)

Status: Experimental native voice/video with incoming/outgoing UI is deployed; voice was confirmed audible both ways and one video trial displayed both peers. Current-build two-account controls/rejection and packaging remain release gates.

Description:
A massive proprietary VoIP and WebRTC stack built around custom ZRTP-based encryption. Implemented through zcall_mac.node and responsible for all voice and video calling functionality. zcall_mac.node is a Mach-O binary and cannot run on Linux. The native path replaces it with a Linux helper plus a bounded Bionic worker around the pinned Android x86_64 ZRTC engine. The helper owns authenticated desktop signaling, PulseAudio PCM, Logitech/V4L2 camera capture, H.264 frame transport and the dedicated call window. Architecture, evidence and remaining limitations are in CALL-LINUX.md, PORT-CHECKLIST.md and INTEGRATION-STATUS.md.


db-cross-v4 (Backup Decryption Engine)

Status: ✅ Ported

Description:
Replaces the original macOS Mach-O binary. Intercepts backup restoration calls to decompress and decrypt proprietary ZDB4.0 backup containers using AES-256-CBC and LZMA2, enabling full chat history recovery.

State:
Fully reverse-engineered and reimplemented in C++. The Linux replacement is complete and currently active.


zjxl (JPEG-XL Codec Support)

Status: ✅ Ported

Description:
Replaces the macOS binary with a Linux x64 NAPI addon (build/linux_x64/jxl.node) built against libjxl 0.11. All runtime dependencies (libjxl, brotli, highway, libjpeg, lcms2) are bundled next to the addon with $ORIGIN RUNPATH, so no system packages are required. Full API parity: decodeToJpeg, bitmapToJxl, getJxlInfo, resizeJxl, resizeJxlLimit, jxlDecompressMulti, moduleReady.


zimage (Advanced Image Processing)

Status: ✅ Ported

Description:
Pure-JS port of the thumbnail pipeline: prefers Electron nativeImage (zero dependencies, always available in the main process), falls back to sharp if the app ever bundles it, then to the system vips thumbnail CLI. Matches the macOS semantics consumers use (Image.thumbnail / resizeQA, fit-inside, JPEG quality, alpha flattened onto white).


mp4thumb (Video Thumbnail Generation)

Status: ✅ Ported

Description:
Spawns ffmpeg (ZALO_FFMPEG override → Electron's bundled ffmpeg → PATH) to extract one scaled frame, mirroring the static-FFmpeg macOS wrapper. When no ffmpeg binary exists the port rejects with the same { error: 'LIB_ERR' } shape the loader fallback already produced, so callers are unaffected.


file-utilities (Fast Directory Sizing)

Status: ✅ Ported

Description:
Rust NAPI-RS module rebuilt for Linux x64 (linux-x64/file-utilities.node, sources under native/). Exposes the full surface: getDirectorySize(Async|Sync), detectHardlinks(Async|Sync), detectFilesystem(Async|Sync), getDirectorySizeByGlob(Async|Sync).


zwalker (Recursive Directory Scanner)

Status: ✅ Ported

Description:
Pure-JS reimplementation of the napi-rs crawler: scanDirectory, updateReferenceMessageId, deleteHomelessFiles (conservative/aggressive), statUnmarkedFiles, deleteEmptyFolders. Parity-tested against the macOS binary's observed semantics (.zwalker.json marker format, atime buckets, homeless math, error codes 1016/1017).


file-utils (Low-Level File System Utilities)

Status: ✅ Ported

Description:
Pure-JS port: moveFileToTrash (FreeDesktop.org Trash spec — files/info layout, collision renaming, .trashinfo), copyFileSync, ensureDirSync, isFileExecutable. No "not support" fallback on Linux anymore.


v8-profiles (CPU Profiling)

Status: ✅ Ported

Description:
Pure-JS shim over Node's core inspector module (V8 Profiler.start/stop/setSamplingInterval). Provides the same profiles map, startProfiling/stopProfiling/setSamplingInterval/deleteAllProfiles surface as the macOS profiler addon.


zfile (Disk Information)

Status: ✅ Ported

Description:
Pure-JS port: stat/statFolder (size, fileCount, mtime), diskInfo() keyed by mount point (statvfs/df), copyFolder/cancelCopy (cancellable recursive copy), canRead/canWrite/canReadAndWrite.

sqlite3 (Local Database Engine)

Status: ✅ Supported

Description:
The native database engine used to access local message shard databases (.db files).

State:
The original macOS binary has been replaced with a Linux ELF build (node_sqlite3.node) bundled within the application. Functionality is fully operational.


zaloLogger (IPC Logging)

Status: ✅ Supported

Description:
Custom logging infrastructure utilizing an IPC transport layer.

State:
Implemented entirely in cross-platform JavaScript and requires no platform-specific porting work.

Contributing

This is an active work-in-progress project. Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -m 'Add your feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Open a Pull Request

Disclaimer

⚠️ This is a community port and is not officially affiliated with Zalo or VNG Corporation.

Support

For issues, questions, or suggestions, please open an issue on the independent project's GitHub Issues page. The predecessor repository remains credited above and in CREDITS.md.

About

Unofficial Zalo Linux port (x86_64) — every native module ported: file-utils, file-utilities, zwalker, zfile, v8-profiles, mp4thumb, zimage, zjxl, zcall wire bridge + live call recon

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages