This repository contains the Rust re-implement source code from C decompile code with Ghidar and build orchestrator to compile and package the native Node.js addons for the Zalo for Linux client.
- ✅
db-cross-v4: working, C++ addon, thanks for realdtn2's RE db-cross-v4 (realdtn2/zalo-linux-2026) - ✅
file-utilities: working (need to refresh in Storage Management Settings after patch) - ✅
file-utils: working - ✅
logger: working (native support, pure JS module) - ✅
mp4thumb: working, testing - ✅
sqlite3: working (add native Linux libs to Zalo's nativelibs) - ❌
v8-profiles: Not planned or later - ❌
zcall: Not planned or later (requires ZaloCall from the Qt ZaloHelper Process) - ❌
zfile: Not needed (Only Windows needs this nativelib) - ✅
zimage: working - ✅
zjxl: working - ❌
zwalker: Planned
# Install core build tools, nodejs & rust
sudo apt update
sudo apt install -y build-essential python3 pkg-config rustc cargo nodejs npm
# Install library development headers
sudo apt install -y \
libssl-dev \
liblzma-dev \
libbz2-dev \
zlib1g-dev \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
libavutil-dev# Install core build tools, nodejs & rust
sudo dnf groupinstall -y "Development Tools"
sudo dnf install -y python3 pkgconf-pkg-config rust cargo nodejs npm
# Install library development headers
sudo dnf install -y \
openssl-devel \
xz-devel \
bzip2-devel \
zlib-devel \
ffmpeg-free-devel# Install core build tools, nodejs & rust
sudo pacman -Syu --needed base-devel python rust nodejs npm
# Install library dependencies
sudo pacman -S --needed \
openssl \
xz \
bzip2 \
zlib \
ffmpegDo not perform steps 2, 3, and 4 if skipping the js patch (Add Linux support to the original loader js)
Deletes all build/, target/, and node_modules/ folders, as well as temporary .node and generated test files in all subdirectories:
npm run clean7z x Zalo_*.dmg -o temp/Zalo_macOScp -r temp/Zalo_macOS/Zalo.app/Contents/Resources/app.asar.unpacked/native/nativelibs nativelibs-macOSInstalls dependencies for the build script and orchestrates compiling and packing of all submodules:
npm install
npm run buildWith skipping js patch, run npm run build:skip-patch instead of npm run build.
Once the process completes, the structured distribution-ready native addons will be located in the destination folder.
The default destination folder is nativelibs, the custom destination folder path can be set with DEST_DIR environment.
With clean rebuild, run npm run build:clean (This is equivalent to running npm run clean and node run build sequentially) or run npm run build:clean:skip-patch with skipping js patch
The orchestration script performs the following automated steps upon running npm run build:
- Compilation:
- Runs
cargo build --releaseto build Rust modules.
- Runs
- Live JS Wrapper Patching:
patch-js-helper.jsreads the original macOS JS wrappers from thenativelibs-macOSfolder.- Modifies them in-memory to inject
process.platform === 'linux'switches and correct relative.nodepaths before saving them to the destination. This eliminates the need to maintain static pre-patched wrapper files.