This guide provides comprehensive instructions for building and distributing the TunnelMax VPN application for Windows and Android platforms.
- Prerequisites
- Project Setup
- Building for Android
- Building for Windows
- Creating Application Icons
- Distribution
- Troubleshooting
- Continuous Integration
- Flutter SDK: Version 3.8.1 or higher
- Dart SDK: Included with Flutter
- Git: For version control
- Code Editor: VS Code, Android Studio, or IntelliJ IDEA
- Android Studio: Latest stable version
- Android SDK: API level 21 (Android 5.0) or higher
- Java Development Kit (JDK): Version 11 or higher
- Android NDK: Version 27.0.12077973 (for native code)
- Visual Studio 2022: Community, Professional, or Enterprise
- Windows 10 SDK: Latest version
- CMake: Version 3.14 or higher
- NSIS (optional): For creating installers
- Java keytool: For Android keystore generation
- 7-Zip (optional): For creating portable packages
- Python 3 (optional): For icon generation scripts
git clone https://github.com/Ashrafty/tunnel-max
cd tunnel_maxflutter pub getflutter doctorEnsure all required components are installed and configured properly.
Use the automated build script:
# Windows Command Prompt
scripts\build_android.bat
# PowerShell
scripts\build_android.ps1flutter clean
flutter pub getflutter packages pub run flutter_launcher_icons:main# Debug APK
flutter build apk --debug
# Release APK
flutter build apk --release
# Android App Bundle (for Play Store)
flutter build appbundle --releaseRun the keystore generation script:
# Windows
android\keystore\generate_keystore.bat
# Linux/macOS
android/keystore/generate_keystore.shOr manually create a keystore:
keytool -genkey -v -keystore android/keystore/release.keystore -alias tunnelmax -keyalg RSA -keysize 2048 -validity 10000Set the following environment variables or add them to gradle.properties:
ANDROID_KEYSTORE_PATH=path/to/keystore/release.keystore
ANDROID_KEYSTORE_PASSWORD=your_keystore_password
ANDROID_KEY_ALIAS=tunnelmax
ANDROID_KEY_PASSWORD=your_key_passwordflutter build apk --release- Debug APK:
build/app/outputs/flutter-apk/app-debug.apk - Release APK:
build/app/outputs/flutter-apk/app-release.apk - App Bundle:
build/app/outputs/bundle/release/app-release.aab
Use the automated build script:
# Windows Command Prompt
scripts\build_windows.bat
# PowerShell
scripts\build_windows.ps1flutter clean
flutter pub getflutter packages pub run flutter_launcher_icons:mainflutter build windows --releaseDownload and install NSIS from https://nsis.sourceforge.io/
cd windows/installer
makensis tunnelmax_installer.nsi- Executable:
build/windows/x64/runner/Release/tunnel_max.exe - Portable Package:
TunnelMax_VPN_Windows_Portable/ - Installer:
TunnelMax_VPN_Setup_1.0.0.exe
-
Install Python and Pillow:
pip install Pillow
-
Generate placeholder icons:
python scripts/generate_placeholder_icons.py
-
Create the following icon files in
assets/icons/:app_icon.png(1024x1024px) - Main application iconapp_icon_foreground.png(432x432px) - Android adaptive icon foregroundapp_icon.ico- Windows icon file
-
Generate Flutter launcher icons:
flutter packages pub run flutter_launcher_icons:main
- Format: PNG with transparency (ICO for Windows)
- Main Icon: 1024x1024 pixels minimum
- Android Adaptive: 432x432 pixels (within 108dp safe zone)
- Windows ICO: Multiple sizes (16x16, 32x32, 48x48, 256x256)
-
Build signed App Bundle:
flutter build appbundle --release
-
Upload
app-release.aabto Google Play Console -
Follow Google Play Store guidelines for VPN applications
-
Build signed APK:
flutter build apk --release
-
Distribute
app-release.apkthrough your website or other channels -
Users must enable "Install from Unknown Sources"
-
Package the application using MSIX:
flutter build windows --release # Additional MSIX packaging steps required -
Submit to Microsoft Store
- Installer: Distribute
TunnelMax_VPN_Setup_1.0.0.exe - Portable: Distribute
TunnelMax_VPN_Windows_v1.0.0_Portable.zip
- Obtain a code signing certificate
- Sign the executable:
signtool sign /f certificate.p12 /p password /t http://timestamp.digicert.com tunnel_max.exe
- Use the release keystore for APK signing
- Google Play App Signing is recommended for Play Store distribution
# Clear Flutter cache
flutter clean
flutter pub get
# Update Flutter
flutter upgrade-
Gradle Build Failed:
- Check Android SDK installation
- Verify NDK version compatibility
- Clear Gradle cache:
./gradlew clean
-
Signing Issues:
- Verify keystore path and passwords
- Check environment variables
- Ensure keystore file exists
-
CMake Errors:
- Install Visual Studio Build Tools
- Verify Windows SDK installation
- Check CMake version compatibility
-
Missing Dependencies:
- Install Visual C++ Redistributable
- Verify all required Windows components
# Build with split APKs
flutter build apk --split-per-abi
# Enable ProGuard/R8 (already configured)
flutter build apk --release --obfuscate --split-debug-info=debug-symbols- Use release build configuration
- Remove debug symbols
- Consider UPX compression for executable
Create .github/workflows/build.yml:
name: Build and Release
on:
push:
tags:
- "v*"
jobs:
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "11"
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.8.1"
- run: flutter pub get
- run: flutter build apk --release
- uses: actions/upload-artifact@v3
with:
name: android-apk
path: build/app/outputs/flutter-apk/app-release.apk
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.8.1"
- run: flutter pub get
- run: flutter build windows --release
- uses: actions/upload-artifact@v3
with:
name: windows-exe
path: build/windows/x64/runner/Release/The provided build scripts can be integrated into CI/CD pipelines:
scripts/build_android.bat/scripts/build_android.ps1scripts/build_windows.bat/scripts/build_windows.ps1
- Obfuscation: Enable code obfuscation for release builds
- Debug Symbols: Remove debug symbols from production builds
- API Keys: Store sensitive keys in secure environment variables
- Certificate Security: Protect signing certificates and keystores
- HTTPS: Always distribute over secure connections
- Checksums: Provide SHA-256 checksums for downloads
- Code Signing: Sign all distributed executables
- Update Mechanism: Implement secure auto-update functionality
-
Update
pubspec.yaml:version: 1.0.1+2
-
Update platform-specific version files as needed
-
Tag the release:
git tag v1.0.1 git push origin v1.0.1
Maintain CHANGELOG.md with version history and changes.
- Flutter Documentation: https://flutter.dev/docs
- Android Developer Guide: https://developer.android.com/
- Windows App Development: https://docs.microsoft.com/en-us/windows/apps/
- NSIS Documentation: https://nsis.sourceforge.io/Docs/
For additional support, please refer to the project documentation or create an issue in the repository.
This guide covers the deployment and distribution strategies for TunnelMax VPN across different platforms and channels.
- Deployment Overview
- Android Deployment
- Windows Deployment
- Release Management
- Distribution Channels
- Security and Compliance
- Monitoring and Analytics
TunnelMax VPN supports multiple deployment strategies to reach users across different platforms and distribution preferences.
- Android: API level 21+ (Android 5.0+)
- Windows: Windows 10/11 (x64)
- Official App Stores: Google Play Store, Microsoft Store
- Direct Distribution: Website downloads, enterprise distribution
- Sideloading: APK installation, portable executables
- Google Play Console Account: Developer account with $25 registration fee
- App Signing: Configure Google Play App Signing (recommended)
- Content Rating: Complete content rating questionnaire
- Privacy Policy: Required for VPN applications
-
Prepare Release Build:
flutter build appbundle --release
-
Upload to Play Console:
- Navigate to Google Play Console
- Create new application or select existing
- Upload
app-release.aabfile - Complete store listing information
-
Configure Release:
- Set up release tracks (internal, alpha, beta, production)
- Configure rollout percentage
- Add release notes
-
Review and Publish:
- Submit for review
- Monitor review status
- Publish when approved
- VPN Policy Compliance: Must comply with Google Play VPN policy
- Privacy Policy: Detailed privacy policy required
- Data Safety: Complete Data Safety section
- Target Audience: Appropriate age rating
- Restricted Content: May require additional verification
-
Generate Release Keystore (one-time setup):
keytool -genkey -v -keystore release.keystore -alias tunnelmax -keyalg RSA -keysize 2048 -validity 10000
-
Build Signed APK:
flutter build apk --release
-
Verify APK Signature:
jarsigner -verify -verbose -certs app-release.apk
- Website Hosting: Secure HTTPS hosting required
- Download Security: Provide SHA-256 checksums
- Installation Instructions: Guide users through sideloading process
- Update Mechanism: Implement in-app update notifications
- Managed Google Play: Upload private app to managed Google Play
- EMM Integration: Work with Enterprise Mobility Management providers
- App Wrapping: Consider MAM (Mobile Application Management) wrapping
- Internal App Sharing: Use Google Play Console for internal testing
- Firebase App Distribution: Beta testing and internal distribution
- Custom MDM: Integration with Mobile Device Management solutions
- Microsoft Partner Center Account: Developer account required
- App Certification: Pass Windows App Certification Kit
- MSIX Packaging: Package app in MSIX format
- Code Signing: Valid code signing certificate
-
Create MSIX Package:
# Additional tooling required for MSIX packaging # This is beyond the current Flutter Windows support
-
Submit to Store:
- Upload MSIX package to Partner Center
- Complete store listing
- Submit for certification
- Windows 10/11 Compatibility: Target appropriate Windows versions
- Security Compliance: Pass security and privacy requirements
- Accessibility: Meet accessibility standards
- Performance: Meet performance benchmarks
-
Build Windows Installer:
scripts\build_windows.bat -
Code Signing (recommended):
signtool sign /f certificate.p12 /p password /t http://timestamp.digicert.com TunnelMax_VPN_Setup_1.0.0.exe
-
Distribution:
- Host installer on secure website
- Provide installation instructions
- Include system requirements
-
Create Portable Package:
- Build release executable
- Package with dependencies
- Create ZIP archive
-
Distribution Benefits:
- No installation required
- Suitable for restricted environments
- Easy to deploy in enterprise settings
- Update Server: Host update manifests and files
- Version Checking: Implement version comparison logic
- Download and Install: Secure update download and installation
- Rollback Capability: Ability to rollback failed updates
Follow semantic versioning (SemVer):
- Major.Minor.Patch (e.g., 1.2.3)
- Build Number: Increment for each build
- Internal Testing: Internal team testing
- Alpha: Limited external testing
- Beta: Broader testing group
- Production: Public release
- Development: Internal builds
- Beta: Public beta testing
- Stable: Production release
- LTS: Long-term support versions
- Code Freeze: Stop feature development
- Testing: Comprehensive testing phase
- Release Candidate: Create RC builds
- Final Testing: Last-minute verification
- Release: Deploy to production
- Post-Release: Monitor and hotfix if needed
- Staged Rollout: Gradual release to percentage of users
- Monitoring: Real-time crash and performance monitoring
- Quick Rollback: Ability to quickly revert problematic releases
- Hotfix Process: Fast-track critical bug fixes
- Official Website: Primary download location
- App Stores: Google Play, Microsoft Store
- GitHub Releases: Open source distribution
- Enterprise Portals: B2B distribution
- Third-Party Stores: F-Droid (Android), Chocolatey (Windows)
- Package Managers: Winget, Scoop (Windows)
- Enterprise App Catalogs: Corporate distribution
- OEM Partnerships: Pre-installation agreements
- Review Process: 1-3 days typical review time
- Policy Compliance: Strict VPN policy requirements
- Revenue Sharing: 30% platform fee (15% for first $1M)
- Global Reach: Available in 190+ countries
- Certification: Automated and manual testing
- Distribution: Global availability
- Revenue Sharing: 30% platform fee
- Enterprise: Business store integration
- Full Control: Complete control over distribution
- No Platform Fees: Keep 100% of revenue
- Marketing Responsibility: Handle all marketing and discovery
- Support Burden: Direct customer support responsibility
- Release Keystore: Secure storage of signing keys
- Key Rotation: Plan for key rotation if compromised
- Google Play App Signing: Let Google manage signing keys
- Certificate Authority: Obtain certificate from trusted CA
- Timestamping: Include timestamp for long-term validity
- Hardware Security Module: Consider HSM for key protection
- GDPR: European Union privacy regulation
- CCPA: California Consumer Privacy Act
- COPPA: Children's Online Privacy Protection Act
- Country Restrictions: Some countries restrict VPN usage
- Data Retention: Comply with local data retention laws
- Encryption Standards: Meet required encryption standards
- Secure Distribution: HTTPS for all downloads
- Integrity Verification: Provide checksums and signatures
- Update Security: Secure update mechanisms
- Vulnerability Management: Regular security assessments
- Download Statistics: Track download numbers and sources
- Installation Success: Monitor installation completion rates
- Update Adoption: Track update installation rates
- Geographic Distribution: Understand user distribution
- Crash Reporting: Firebase Crashlytics, Sentry
- Performance Metrics: App startup time, memory usage
- Network Performance: Connection success rates, speed tests
- User Engagement: Feature usage, session duration
- Firebase Analytics: Comprehensive mobile analytics
- Google Analytics: Web and app analytics
- Mixpanel: Event-based analytics
- Application Insights: Microsoft's analytics platform
- Custom Analytics: Build custom analytics solution
- Telemetry: Windows telemetry integration
- Data Minimization: Collect only necessary data
- User Consent: Obtain proper consent for data collection
- Anonymization: Anonymize personal data
- Opt-Out Options: Provide analytics opt-out mechanisms
name: Deploy Release
on:
push:
tags:
- "v*"
jobs:
deploy-android:
runs-on: ubuntu-latest
steps:
- name: Deploy to Play Store
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}
packageName: com.tunnelmax.vpnclient
releaseFiles: build/app/outputs/bundle/release/app-release.aab
track: production
deploy-windows:
runs-on: windows-latest
steps:
- name: Build and Deploy
run: |
scripts/build_windows.ps1
# Upload to distribution server- Unit Tests: Automated unit test execution
- Integration Tests: End-to-end testing
- UI Tests: Automated UI testing
- Performance Tests: Automated performance benchmarks
- Smoke Tests: Basic functionality verification
- Health Checks: Service availability monitoring
- Rollback Triggers: Automated rollback conditions
- Success Metrics: Define deployment success criteria
- Play Console Rejection: Review policy violations
- APK Upload Errors: Check file format and signing
- Version Conflicts: Ensure version code increments
- Permission Issues: Review permission declarations
- Code Signing Errors: Verify certificate validity
- Installer Issues: Test on clean Windows installations
- Antivirus False Positives: Submit to antivirus vendors
- Compatibility Issues: Test on different Windows versions
- Documentation: Maintain troubleshooting guides
- Support Channels: Provide multiple support options
- Community Forums: Enable community support
- Escalation Process: Clear escalation procedures
- Announcement: Coordinate launch announcements
- Press Release: Prepare media communications
- Social Media: Social media campaign
- Documentation: Update user documentation
- Regular Updates: Schedule regular feature updates
- Security Patches: Rapid security update deployment
- Performance Optimization: Continuous performance improvements
- User Feedback: Collect and act on user feedback
- KPIs: Define key performance indicators
- User Satisfaction: Monitor user ratings and reviews
- Market Share: Track competitive position
- Revenue Metrics: Monitor financial performance
This deployment guide should be regularly updated as the application evolves and new deployment strategies are adopted.