To start working on the project, clone the repository from GitHub and navigate to the project directory:
git clone https://github.com/Faeq-F/whatsappPortable.git
cd whatsappPortableBefore building or running the application, ensure the following tools are installed:
- Flutter SDK
- Since this is a Windows desktop application, Flutter requires Visual Studio for compilation:
- Install Visual Studio 2022 (Community edition is sufficient).
- During installation, select the Desktop development with C++ workload.
- Ensure the following components are checked:
- MSVC v143 build tools (or latest)
- Windows 10 SDK (or 11)
- CMake tools for Windows
- Run
flutter doctorin your terminal to verify that Flutter is correctly installed and all requirements are met.
- Since this is a Windows desktop application, Flutter requires Visual Studio for compilation:
The WebView2 Runtime is required (preinstalled onto all Windows 11 devices and eligible Windows 10 devices).
All Flutter code is contained in the WhatsApp subfolder.
Navigate to the WhatsApp folder and fetch the package dependencies:
cd WhatsApp
flutter pub getTo launch the app with hot reload enabled for debugging:
flutter run -d windowsTo compile a fully optimized release build:
flutter build windowsThe application implements a customized bridge to interface with WhatsApp Web. If you are developing or refactoring WebView behavior, keep the following structure in mind:
Scripts injected into the WebView2 instance are organized into modular domain files to keep the main code clean:
- theme.dart: Implements custom dark/light theme CSS injections.
- notification.dart: Injects listeners to intercept web notifications and forward them to the native Windows system.
- translation.dart: Implements page-wide DOM-scanning translations, the hover translate button, and translation bubble renderer. Excludes
contenteditablenodes to prevent cursor resets while typing.
All message data sent across WebView JavaScript Channels are serialized as JSON and parsed into structured Dart models at the boundary:
- webview_payload.dart: Implements
JsTranslationPayloadandJsNotificationPayloadwith validation checks. - webview_bridge_manager.dart: Encapsulates controller creation, channel registrations (
TranslationChannel,NotificationChannel), permission grants, and request routing.
- localization.dart: Manages network calls to the Google Translate API endpoint. Translation maps for UI strings are persisted in
translations_cache.json.
The release build is generated in the following directory:
WhatsApp/build/windows/x64/runner/Release/
All user settings and active sessions are stored locally in the application folder:
- Settings: Saved to
settings.jsonin the current working directory. - Translations Cache: Saved to
translations_cache.jsonin the current working directory. - WebView2 User Profiles: Saved to
data/webview/EBWebView/WV2Profile_<accountId>in the current working directory.
This allows the application folder to be moved (e.g., to a USB drive) while fully preserving the user's logged-in accounts and configuration.
To give the portable application folder its customized WhatsApp icon, a desktop.ini configuration is used:
- Ensure a copy of the
desktop.inifile is placed directly in your release distribution folder. - Open a terminal and assign the system attribute to the
desktop.inifile:attrib +s desktop.ini - Assign the system attribute to the release folder itself. This is critical because Windows ignores
desktop.iniinside directories unless the directory itself is marked as a system folder:attrib +s "path\to\your\release_folder"
Before releasing a new version, complete the following steps:
- Update Version Numbers:
- In the root folder: Update the version string in the Version file.
- In
WhatsApp/pubspec.yaml: Update theversionproperty. - In
WhatsApp/lib/constants.dart: Update theappVersionconstant.
- Documentation:
- Check this file and the README.md file for any updates to add.
- Update the CHANGELOG.md file with the new release notes.
- Update any screenshots in the documentation.
To ensure Windows preserves the system attribute of both the desktop.ini file and the release folder, do not use the built-in Windows compression utility, as it strips these attributes.
- Use a utility like 7-Zip or PeaZip to compress the release folder.
- Package the contents into an archive named
WhatsApp.zip.
- Create the new release, adding the portable archive in the release assets.