Signing, Installer, New Workflows
This commit is contained in:
@@ -20,13 +20,14 @@ jobs:
|
||||
- name: Get version from pubspec.yaml
|
||||
id: version
|
||||
working-directory: flutter_app
|
||||
shell: bash
|
||||
run: |
|
||||
VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //' | sed 's/+.*//')
|
||||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "Version: $VERSION"
|
||||
|
||||
build-windows:
|
||||
runs-on: windows
|
||||
runs-on: windows-latest
|
||||
needs: get-version
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@@ -40,46 +41,90 @@ jobs:
|
||||
cache: true
|
||||
|
||||
- name: Enable Windows desktop
|
||||
shell: pwsh
|
||||
run: flutter config --enable-windows-desktop
|
||||
|
||||
- name: Create production .env file
|
||||
working-directory: flutter_app
|
||||
shell: pwsh
|
||||
env:
|
||||
WS_URL: ${{ secrets.WS_URL }}
|
||||
API_URL: ${{ secrets.API_URL }}
|
||||
run: |
|
||||
echo "WS_URL=$env:WS_URL" > .env
|
||||
echo "API_URL=$env:API_URL" >> .env
|
||||
"WS_URL=$env:WS_URL" | Out-File -FilePath .env -Encoding utf8
|
||||
"API_URL=$env:API_URL" | Out-File -FilePath .env -Append -Encoding utf8
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: flutter_app
|
||||
shell: pwsh
|
||||
run: flutter pub get
|
||||
|
||||
- name: Flutter doctor
|
||||
shell: pwsh
|
||||
run: flutter doctor -v
|
||||
|
||||
- name: Build Windows release
|
||||
working-directory: flutter_app
|
||||
run: flutter build windows --release
|
||||
|
||||
- name: Create Windows archive
|
||||
- name: Setup Certificate for Signing
|
||||
working-directory: flutter_app
|
||||
shell: pwsh
|
||||
env:
|
||||
CERT_BASE64: ${{ secrets.CERT_BASE64 }}
|
||||
CERT_PASSWORD: ${{ secrets.CERT_PASSWORD }}
|
||||
run: |
|
||||
Compress-Archive -Path "build\windows\x64\runner\Release\*" -DestinationPath "rmtPocketWatcher-Windows-v${{ needs.get-version.outputs.version }}.zip"
|
||||
if ($env:CERT_BASE64) {
|
||||
Write-Host "Setting up certificate for code signing..." -ForegroundColor Green
|
||||
|
||||
- name: Upload Windows artifact
|
||||
# Create certificates directory if it doesn't exist
|
||||
if (-not (Test-Path "certificates")) {
|
||||
New-Item -ItemType Directory -Path "certificates" -Force | Out-Null
|
||||
}
|
||||
|
||||
# Decode base64 certificate and save as PFX
|
||||
$certBytes = [System.Convert]::FromBase64String($env:CERT_BASE64)
|
||||
[System.IO.File]::WriteAllBytes("certificates\rmtPocketWatcher.pfx", $certBytes)
|
||||
|
||||
Write-Host "✅ Certificate installed successfully" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "⚠️ No certificate provided - building unsigned" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
- name: Build Windows release with installer
|
||||
working-directory: flutter_app
|
||||
shell: pwsh
|
||||
env:
|
||||
CERT_PASSWORD: ${{ secrets.CERT_PASSWORD }}
|
||||
run: |
|
||||
# Set certificate password environment variable for build script
|
||||
if ($env:CERT_PASSWORD) {
|
||||
$env:MSIX_CERTIFICATE_PASSWORD = $env:CERT_PASSWORD
|
||||
}
|
||||
|
||||
# Run our custom build script
|
||||
.\build_windows.ps1 -Release
|
||||
|
||||
# Rename the archive to include version
|
||||
$version = "${{ needs.get-version.outputs.version }}"
|
||||
if (Test-Path "build\rmtPocketWatcher-Windows-Standalone.zip") {
|
||||
Rename-Item "build\rmtPocketWatcher-Windows-Standalone.zip" "rmtPocketWatcher-Windows-v$version.zip"
|
||||
}
|
||||
|
||||
# Also create a simple executable-only archive
|
||||
if (Test-Path "build\windows\standalone\rmtpocketwatcher.exe") {
|
||||
Compress-Archive -Path "build\windows\standalone\rmtpocketwatcher.exe" -DestinationPath "rmtPocketWatcher-Windows-Portable-v$version.zip" -CompressionLevel Optimal
|
||||
}
|
||||
|
||||
- name: Upload Windows artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: rmtPocketWatcher-Windows
|
||||
path: flutter_app/rmtPocketWatcher-Windows-v${{ needs.get-version.outputs.version }}.zip
|
||||
path: |
|
||||
flutter_app/rmtPocketWatcher-Windows-v${{ needs.get-version.outputs.version }}.zip
|
||||
flutter_app/rmtPocketWatcher-Windows-Portable-v${{ needs.get-version.outputs.version }}.zip
|
||||
flutter_app/build/windows/x64/runner/Release/*.msix
|
||||
retention-days: 30
|
||||
|
||||
build-android:
|
||||
runs-on: ubuntu-latest
|
||||
needs: get-version
|
||||
env:
|
||||
ANDROID_HOME: /opt/android-sdk-linux
|
||||
ANDROID_SDK_ROOT: /opt/android-sdk-linux
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -90,18 +135,6 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@v3
|
||||
with:
|
||||
cmdline-tools-version: 11076708
|
||||
|
||||
- name: Install Android SDK components
|
||||
run: |
|
||||
echo "Installing Android SDK components..."
|
||||
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "platform-tools" "platforms;android-34" "build-tools;34.0.0"
|
||||
echo "Android SDK setup complete"
|
||||
export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
@@ -109,20 +142,16 @@ jobs:
|
||||
channel: 'stable'
|
||||
cache: true
|
||||
|
||||
- name: Accept Android licenses
|
||||
run: yes | flutter doctor --android-licenses
|
||||
|
||||
- name: Verify Android SDK
|
||||
- name: Setup Android SDK
|
||||
shell: bash
|
||||
run: |
|
||||
echo "ANDROID_HOME: $ANDROID_HOME"
|
||||
echo "ANDROID_SDK_ROOT: $ANDROID_SDK_ROOT"
|
||||
ls -la $ANDROID_HOME || echo "ANDROID_HOME not found"
|
||||
|
||||
- name: Flutter doctor
|
||||
run: flutter doctor -v
|
||||
# Install Android SDK using Flutter's built-in tools
|
||||
flutter doctor --android-licenses || echo "Licenses handled"
|
||||
flutter doctor -v
|
||||
|
||||
- name: Create production .env file
|
||||
working-directory: flutter_app
|
||||
shell: bash
|
||||
env:
|
||||
WS_URL: ${{ secrets.WS_URL }}
|
||||
API_URL: ${{ secrets.API_URL }}
|
||||
@@ -132,24 +161,17 @@ jobs:
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: flutter_app
|
||||
shell: bash
|
||||
run: flutter pub get
|
||||
|
||||
- name: Clean build
|
||||
working-directory: flutter_app
|
||||
run: flutter clean
|
||||
|
||||
- name: Build Android APK
|
||||
working-directory: flutter_app
|
||||
run: flutter build apk --release --verbose
|
||||
|
||||
- name: Verify APK exists
|
||||
working-directory: flutter_app
|
||||
run: |
|
||||
ls -la build/app/outputs/flutter-apk/
|
||||
file build/app/outputs/flutter-apk/app-release.apk
|
||||
shell: bash
|
||||
run: flutter build apk --release
|
||||
|
||||
- name: Rename APK
|
||||
working-directory: flutter_app
|
||||
shell: bash
|
||||
run: |
|
||||
cp build/app/outputs/flutter-apk/app-release.apk rmtPocketWatcher-Android-v${{ needs.get-version.outputs.version }}.apk
|
||||
|
||||
@@ -192,7 +214,9 @@ jobs:
|
||||
**Lambda Banking Conglomerate** - Star Citizen AUEC Price Tracker
|
||||
|
||||
### Downloads
|
||||
- **Windows**: `rmtPocketWatcher-Windows-v${{ needs.get-version.outputs.version }}.zip`
|
||||
- **Windows (Full)**: `rmtPocketWatcher-Windows-v${{ needs.get-version.outputs.version }}.zip` - Complete standalone package
|
||||
- **Windows (Portable)**: `rmtPocketWatcher-Windows-Portable-v${{ needs.get-version.outputs.version }}.zip` - Single executable only
|
||||
- **Windows (Installer)**: `*.msix` - Windows Store-style installer (if available)
|
||||
- **Android**: `rmtPocketWatcher-Android-v${{ needs.get-version.outputs.version }}.apk`
|
||||
|
||||
### Features
|
||||
@@ -204,13 +228,17 @@ jobs:
|
||||
- Vendor comparison tables
|
||||
|
||||
### Installation
|
||||
**Windows**: Extract the ZIP file and run `rmtpocketwatcher.exe`
|
||||
**Windows (Full)**: Extract the ZIP file and run `rmtpocketwatcher.exe` - includes all dependencies
|
||||
**Windows (Portable)**: Single executable, no installation needed - just run `rmtpocketwatcher.exe`
|
||||
**Windows (Installer)**: Double-click the MSIX file for Windows Store-style installation
|
||||
**Android**: Install the APK file (enable "Install from unknown sources")
|
||||
|
||||
---
|
||||
*Built with Flutter for cross-platform compatibility*
|
||||
files: |
|
||||
./artifacts/rmtPocketWatcher-Windows-v${{ needs.get-version.outputs.version }}.zip
|
||||
./artifacts/rmtPocketWatcher-Windows-Portable-v${{ needs.get-version.outputs.version }}.zip
|
||||
./artifacts/*.msix
|
||||
./artifacts/rmtPocketWatcher-Android-v${{ needs.get-version.outputs.version }}.apk
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
8
flutter_app/.gitignore
vendored
8
flutter_app/.gitignore
vendored
@@ -207,3 +207,11 @@ ios/Flutter/flutter_export_environment.sh
|
||||
**/generated_plugin_registrant.cc
|
||||
**/generated_plugin_registrant.h
|
||||
**/generated_plugins.cmake
|
||||
|
||||
# Code signing certificates (NEVER commit private keys!)
|
||||
certificates/*.pfx
|
||||
certificates/*.p12
|
||||
certificates/*.key
|
||||
# Public certificates can be committed if needed
|
||||
# certificates/*.cer
|
||||
# certificates/*.crt
|
||||
126
flutter_app/BUILD_INSTRUCTIONS.md
Normal file
126
flutter_app/BUILD_INSTRUCTIONS.md
Normal file
@@ -0,0 +1,126 @@
|
||||
# rmtPocketWatcher - Windows Build Instructions
|
||||
|
||||
This document explains how to build rmtPocketWatcher for Windows distribution.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Flutter SDK 3.22.3 or later
|
||||
- Windows 10/11 with Visual Studio Build Tools
|
||||
- PowerShell (for advanced build script)
|
||||
|
||||
## Quick Build (Batch Script)
|
||||
|
||||
For a simple build process, use the batch script:
|
||||
|
||||
```cmd
|
||||
build_windows.bat
|
||||
```
|
||||
|
||||
This will create:
|
||||
- `build\windows\standalone\rmtpocketwatcher.exe` - Standalone executable with all dependencies
|
||||
- `build\rmtPocketWatcher-Windows-Standalone.zip` - Distribution archive
|
||||
|
||||
## Advanced Build (PowerShell Script)
|
||||
|
||||
For more control and MSIX installer creation:
|
||||
|
||||
```powershell
|
||||
# Release build (recommended for distribution)
|
||||
.\build_windows.ps1 -Release
|
||||
|
||||
# Debug build (for development)
|
||||
.\build_windows.ps1 -Debug
|
||||
```
|
||||
|
||||
This creates:
|
||||
- **Standalone Package**: Complete folder with all dependencies
|
||||
- **Portable Executable**: Single-file distribution (if possible)
|
||||
- **MSIX Installer**: Windows Store-style installer
|
||||
- **Distribution Archive**: ZIP file ready for sharing
|
||||
|
||||
## Output Files
|
||||
|
||||
After building, you'll find:
|
||||
|
||||
### Standalone Distribution
|
||||
- `build\windows\standalone\` - Complete application folder
|
||||
- `build\windows\standalone\rmtpocketwatcher.exe` - Main executable
|
||||
- `build\windows\standalone\data\` - Flutter engine and assets
|
||||
- `build\windows\standalone\VERSION.txt` - Version information
|
||||
|
||||
### Distribution Archives
|
||||
- `build\rmtPocketWatcher-Windows-v{version}.zip` - Full standalone package
|
||||
- `build\rmtPocketWatcher-Windows-Portable-v{version}.zip` - Portable version (exe only)
|
||||
|
||||
### Installer (if created)
|
||||
- `build\windows\x64\runner\Release\*.msix` - Windows installer package
|
||||
|
||||
## Distribution Options
|
||||
|
||||
### Option 1: Standalone ZIP (Recommended)
|
||||
- Share the `rmtPocketWatcher-Windows-v{version}.zip` file
|
||||
- Users extract and run `rmtpocketwatcher.exe`
|
||||
- No installation required
|
||||
- All dependencies included
|
||||
|
||||
### Option 2: Portable Executable
|
||||
- Share the `rmtPocketWatcher-Windows-Portable-v{version}.zip` file
|
||||
- Contains only the executable
|
||||
- Smallest download size
|
||||
- May require Visual C++ Redistributable on target machine
|
||||
|
||||
### Option 3: MSIX Installer
|
||||
- Share the `.msix` file
|
||||
- Windows Store-style installation
|
||||
- Automatic updates support
|
||||
- Requires Windows 10 version 1809 or later
|
||||
|
||||
## Testing
|
||||
|
||||
To test the standalone build:
|
||||
|
||||
```cmd
|
||||
cd build\windows\standalone
|
||||
rmtpocketwatcher.exe
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Build Fails
|
||||
- Ensure Flutter is properly installed: `flutter doctor`
|
||||
- Check Windows development setup: `flutter doctor -v`
|
||||
- Clean and retry: `flutter clean && flutter pub get`
|
||||
|
||||
### MSIX Creation Fails
|
||||
- MSIX creation is optional and may fail on some systems
|
||||
- The standalone executable will still be created
|
||||
- Install Windows SDK if you need MSIX support
|
||||
|
||||
### Runtime Issues
|
||||
- Ensure the `.env` file is present in the build directory
|
||||
- Check that all assets are included in the `data` folder
|
||||
- Verify Visual C++ Redistributable is installed on target machine
|
||||
|
||||
## CI/CD Integration
|
||||
|
||||
The build scripts are designed to work with the GitHub Actions workflow in `.gitea/workflows/release.yml`. The workflow automatically:
|
||||
|
||||
1. Builds both standalone and portable versions
|
||||
2. Creates MSIX installer (if possible)
|
||||
3. Packages everything for release
|
||||
4. Uploads artifacts to the release
|
||||
|
||||
## Manual Flutter Commands
|
||||
|
||||
If you prefer manual control:
|
||||
|
||||
```cmd
|
||||
# Basic build
|
||||
flutter build windows --release
|
||||
|
||||
# Create MSIX (requires msix package)
|
||||
flutter pub get
|
||||
flutter pub run msix:create
|
||||
```
|
||||
|
||||
Note: Manual builds won't include the packaging and organization provided by the build scripts.
|
||||
236
flutter_app/CERTIFICATE_GUIDE.md
Normal file
236
flutter_app/CERTIFICATE_GUIDE.md
Normal file
@@ -0,0 +1,236 @@
|
||||
# Code Signing Certificate Guide for rmtPocketWatcher
|
||||
|
||||
This guide explains how to create and use code signing certificates for your Windows application to eliminate security warnings and build user trust.
|
||||
|
||||
## Quick Start
|
||||
|
||||
1. **Create Certificate**: `.\create_certificate.ps1`
|
||||
2. **Build & Sign**: `.\build_windows.ps1 -Release`
|
||||
3. **Distribute**: Share the signed executables and optionally the public certificate
|
||||
|
||||
## Certificate Types
|
||||
|
||||
### Self-Signed Certificates (Free)
|
||||
- **Cost**: Free
|
||||
- **Trust Level**: Low (requires manual installation)
|
||||
- **Best For**: Development, internal distribution, open source projects
|
||||
- **Limitations**: Users see "Unknown Publisher" warnings initially
|
||||
|
||||
### Commercial Certificates ($100-$500/year)
|
||||
- **Cost**: $100-$500 annually
|
||||
- **Trust Level**: High (automatically trusted)
|
||||
- **Best For**: Commercial software, wide distribution
|
||||
- **Providers**: DigiCert, Sectigo, GlobalSign, Entrust
|
||||
|
||||
## Self-Signed Certificate Setup
|
||||
|
||||
### Step 1: Create Certificate
|
||||
```powershell
|
||||
.\create_certificate.ps1
|
||||
```
|
||||
|
||||
This creates:
|
||||
- `certificates/rmtPocketWatcher.pfx` - Private certificate (keep secure!)
|
||||
- `certificates/rmtPocketWatcher.cer` - Public certificate (for distribution)
|
||||
- `certificates/CERTIFICATE_INFO.txt` - Certificate details
|
||||
|
||||
### Step 2: Build with Signing
|
||||
```powershell
|
||||
.\build_windows.ps1 -Release
|
||||
```
|
||||
|
||||
This automatically:
|
||||
- Builds the application
|
||||
- Signs the executable with your certificate
|
||||
- Creates signed MSIX installer
|
||||
- Packages everything for distribution
|
||||
|
||||
### Step 3: Manual Signing (if needed)
|
||||
```powershell
|
||||
.\sign_executable.ps1 -ExePath "path\to\your\app.exe"
|
||||
```
|
||||
|
||||
## Certificate Installation for Users
|
||||
|
||||
### Automatic Installation (Recommended)
|
||||
When users run your signed app for the first time:
|
||||
1. Windows shows "Unknown Publisher" warning
|
||||
2. User clicks "More info" → "Run anyway"
|
||||
3. Certificate is automatically added to their trusted store
|
||||
|
||||
### Manual Installation (Optional)
|
||||
For organizations or power users:
|
||||
1. Distribute the `.cer` file alongside your app
|
||||
2. Users double-click the `.cer` file
|
||||
3. Click "Install Certificate"
|
||||
4. Choose "Local Machine" (requires admin) or "Current User"
|
||||
5. Select "Trusted Root Certification Authorities"
|
||||
6. Click "Next" and "Finish"
|
||||
|
||||
## Commercial Certificate Setup
|
||||
|
||||
### Step 1: Purchase Certificate
|
||||
Popular providers:
|
||||
- **DigiCert**: $474/year (EV), $239/year (OV)
|
||||
- **Sectigo**: $199/year (EV), $85/year (OV)
|
||||
- **GlobalSign**: $249/year (EV), $127/year (OV)
|
||||
|
||||
### Step 2: Certificate Validation
|
||||
- **Organization Validation (OV)**: Business verification (1-3 days)
|
||||
- **Extended Validation (EV)**: Enhanced verification (1-5 days)
|
||||
- **Individual**: Personal ID verification
|
||||
|
||||
### Step 3: Install Certificate
|
||||
1. Download certificate from provider
|
||||
2. Install to Windows Certificate Store
|
||||
3. Update build scripts with certificate details
|
||||
|
||||
### Step 4: Update Configuration
|
||||
```yaml
|
||||
# pubspec.yaml
|
||||
msix_config:
|
||||
certificate_path: path/to/commercial/cert.pfx
|
||||
certificate_password: your_secure_password
|
||||
```
|
||||
|
||||
## Security Best Practices
|
||||
|
||||
### Certificate Storage
|
||||
- **Never commit** `.pfx` or `.p12` files to version control
|
||||
- Store certificates in secure, encrypted locations
|
||||
- Use strong passwords for certificate files
|
||||
- Backup certificates securely
|
||||
|
||||
### Password Management
|
||||
- Use strong, unique passwords for certificates
|
||||
- Store passwords in secure password managers
|
||||
- Use environment variables in CI/CD pipelines
|
||||
- Rotate passwords regularly
|
||||
|
||||
### CI/CD Integration
|
||||
```yaml
|
||||
# GitHub Actions example
|
||||
- name: Setup Certificate
|
||||
run: |
|
||||
echo "${{ secrets.CERT_BASE64 }}" | base64 -d > cert.pfx
|
||||
|
||||
- name: Sign Application
|
||||
run: |
|
||||
signtool sign /f cert.pfx /p "${{ secrets.CERT_PASSWORD }}" app.exe
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "SignTool not found"
|
||||
**Solution**: Install Windows SDK
|
||||
- Download from: https://developer.microsoft.com/windows/downloads/windows-sdk/
|
||||
- Or install Visual Studio with Windows development tools
|
||||
|
||||
### "Certificate not valid for code signing"
|
||||
**Solution**: Ensure certificate has "Code Signing" usage
|
||||
```powershell
|
||||
# Check certificate usage
|
||||
Get-PfxCertificate -FilePath cert.pfx | Select-Object -ExpandProperty Extensions
|
||||
```
|
||||
|
||||
### "Timestamp server unavailable"
|
||||
**Solution**: Try different timestamp servers
|
||||
- http://timestamp.digicert.com
|
||||
- http://timestamp.sectigo.com
|
||||
- http://timestamp.globalsign.com
|
||||
|
||||
### "Access denied" when signing
|
||||
**Solution**: Run PowerShell as Administrator
|
||||
```powershell
|
||||
# Check if running as admin
|
||||
([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
|
||||
```
|
||||
|
||||
### Users still see warnings
|
||||
**Possible causes**:
|
||||
1. Certificate not properly installed
|
||||
2. Certificate expired
|
||||
3. System clock incorrect
|
||||
4. Antivirus interference
|
||||
|
||||
## Certificate Lifecycle
|
||||
|
||||
### Monitoring Expiration
|
||||
```powershell
|
||||
# Check certificate expiration
|
||||
$cert = Get-PfxCertificate -FilePath "certificates/rmtPocketWatcher.pfx"
|
||||
$daysUntilExpiry = ($cert.NotAfter - (Get-Date)).Days
|
||||
Write-Host "Certificate expires in $daysUntilExpiry days"
|
||||
```
|
||||
|
||||
### Renewal Process
|
||||
1. **Self-signed**: Run `.\create_certificate.ps1 -Force`
|
||||
2. **Commercial**: Renew through certificate provider
|
||||
3. Update build scripts with new certificate
|
||||
4. Re-sign and redistribute applications
|
||||
|
||||
### Migration to Commercial
|
||||
1. Purchase commercial certificate
|
||||
2. Update `pubspec.yaml` configuration
|
||||
3. Update build scripts
|
||||
4. Re-sign all distributed applications
|
||||
5. Notify users of the change
|
||||
|
||||
## Cost-Benefit Analysis
|
||||
|
||||
### Self-Signed Certificates
|
||||
**Pros**:
|
||||
- Free
|
||||
- Full control
|
||||
- Good for development/testing
|
||||
- Suitable for open source projects
|
||||
|
||||
**Cons**:
|
||||
- Users see warnings initially
|
||||
- Requires user education
|
||||
- Not suitable for commercial distribution
|
||||
|
||||
### Commercial Certificates
|
||||
**Pros**:
|
||||
- Immediate trust
|
||||
- Professional appearance
|
||||
- Better user experience
|
||||
- Required for some distribution channels
|
||||
|
||||
**Cons**:
|
||||
- Annual cost
|
||||
- Validation process
|
||||
- Vendor dependency
|
||||
|
||||
## Recommendations
|
||||
|
||||
### For Development/Testing
|
||||
- Use self-signed certificates
|
||||
- Document installation process for users
|
||||
- Consider upgrading for production releases
|
||||
|
||||
### For Commercial Distribution
|
||||
- Invest in commercial certificates
|
||||
- Choose reputable certificate authorities
|
||||
- Plan for certificate lifecycle management
|
||||
|
||||
### For Open Source Projects
|
||||
- Start with self-signed certificates
|
||||
- Consider community funding for commercial certificates
|
||||
- Provide clear installation instructions
|
||||
|
||||
## Scripts Reference
|
||||
|
||||
| Script | Purpose | Usage |
|
||||
|--------|---------|-------|
|
||||
| `create_certificate.ps1` | Create self-signed certificate | `.\create_certificate.ps1` |
|
||||
| `sign_executable.ps1` | Sign individual executables | `.\sign_executable.ps1 -ExePath app.exe` |
|
||||
| `build_windows.ps1` | Build and sign complete package | `.\build_windows.ps1 -Release` |
|
||||
|
||||
## Support
|
||||
|
||||
For certificate-related issues:
|
||||
1. Check Windows Event Viewer for detailed errors
|
||||
2. Verify certificate validity and usage
|
||||
3. Test on clean Windows installation
|
||||
4. Consult certificate provider documentation
|
||||
149
flutter_app/CI_CD_CERTIFICATE_SETUP.md
Normal file
149
flutter_app/CI_CD_CERTIFICATE_SETUP.md
Normal file
@@ -0,0 +1,149 @@
|
||||
# CI/CD Certificate Setup Guide
|
||||
|
||||
This guide explains how to set up code signing certificates for automated builds in your CI/CD pipeline.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. **Certificate Created**: Run `.\create_certificate.ps1` to create your certificate
|
||||
2. **Local Testing**: Verify signing works locally with `.\build_windows.ps1 -Release`
|
||||
|
||||
## Step 1: Encode Certificate
|
||||
|
||||
Run the encoding script to prepare your certificate for CI/CD:
|
||||
|
||||
```powershell
|
||||
.\encode_certificate.ps1
|
||||
```
|
||||
|
||||
This creates `certificate_base64.txt` containing your certificate encoded as base64.
|
||||
|
||||
## Step 2: Add Action Secrets
|
||||
|
||||
### For Gitea Actions:
|
||||
|
||||
1. Go to your repository settings
|
||||
2. Navigate to "Secrets and Variables" → "Actions"
|
||||
3. Add these secrets:
|
||||
|
||||
| Secret Name | Value | Description |
|
||||
|-------------|-------|-------------|
|
||||
| `CERT_BASE64` | Contents of `certificate_base64.txt` | Base64 encoded certificate |
|
||||
| `CERT_PASSWORD` | `rmtPocketWatcher2024!` | Certificate password |
|
||||
|
||||
### For GitHub Actions:
|
||||
|
||||
1. Go to repository "Settings" → "Secrets and variables" → "Actions"
|
||||
2. Click "New repository secret"
|
||||
3. Add the same secrets as above
|
||||
|
||||
## Step 3: Security Cleanup
|
||||
|
||||
**IMPORTANT**: After adding the secrets, delete the local files:
|
||||
|
||||
```powershell
|
||||
Remove-Item certificate_base64.txt -Force
|
||||
```
|
||||
|
||||
## Step 4: Verify Setup
|
||||
|
||||
1. Push a change to trigger the workflow
|
||||
2. Check the build logs for:
|
||||
- "✅ Certificate installed successfully"
|
||||
- "✅ Executable signed successfully"
|
||||
- "✅ MSIX installer signed successfully"
|
||||
|
||||
## How It Works
|
||||
|
||||
### Certificate Installation
|
||||
The workflow automatically:
|
||||
1. Decodes the base64 certificate
|
||||
2. Saves it as `certificates/rmtPocketWatcher.pfx`
|
||||
3. Uses it for signing during the build process
|
||||
|
||||
### Signing Process
|
||||
The build script signs:
|
||||
- **Standalone executable**: `rmtpocketwatcher.exe`
|
||||
- **MSIX installer**: `*.msix` file
|
||||
|
||||
### Environment Variables
|
||||
- `CERT_PASSWORD`: Used by signing scripts
|
||||
- `MSIX_CERTIFICATE_PASSWORD`: Used by MSIX creation
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "Certificate not found" Error
|
||||
- Verify `CERT_BASE64` secret is set correctly
|
||||
- Check the base64 encoding is complete (no line breaks)
|
||||
|
||||
### "Invalid certificate password" Error
|
||||
- Verify `CERT_PASSWORD` secret matches your certificate password
|
||||
- Default password is `rmtPocketWatcher2024!`
|
||||
|
||||
### "SignTool not found" Error
|
||||
- This should not occur in GitHub/Gitea runners
|
||||
- Windows runners include Windows SDK by default
|
||||
|
||||
### Unsigned Executables
|
||||
- Check workflow logs for certificate setup messages
|
||||
- Verify both secrets are set correctly
|
||||
- Ensure certificate is valid and not expired
|
||||
|
||||
## Security Best Practices
|
||||
|
||||
### Certificate Protection
|
||||
- Never commit `.pfx` files to version control
|
||||
- Use repository secrets for sensitive data
|
||||
- Regularly rotate certificate passwords
|
||||
|
||||
### Access Control
|
||||
- Limit repository access to trusted contributors
|
||||
- Use branch protection rules
|
||||
- Require reviews for workflow changes
|
||||
|
||||
### Monitoring
|
||||
- Monitor build logs for signing failures
|
||||
- Set up notifications for failed builds
|
||||
- Regularly verify certificate expiration dates
|
||||
|
||||
## Commercial Certificate Migration
|
||||
|
||||
When upgrading to a commercial certificate:
|
||||
|
||||
1. **Obtain Certificate**: Purchase from DigiCert, Sectigo, etc.
|
||||
2. **Update Secrets**: Replace `CERT_BASE64` with new certificate
|
||||
3. **Update Password**: Change `CERT_PASSWORD` if different
|
||||
4. **Test Build**: Verify signing works with new certificate
|
||||
|
||||
## Certificate Lifecycle
|
||||
|
||||
### Monitoring Expiration
|
||||
Add this to your workflow to check certificate expiration:
|
||||
|
||||
```yaml
|
||||
- name: Check Certificate Expiration
|
||||
shell: pwsh
|
||||
run: |
|
||||
if (Test-Path "certificates\rmtPocketWatcher.pfx") {
|
||||
$cert = Get-PfxCertificate -FilePath "certificates\rmtPocketWatcher.pfx"
|
||||
$daysUntilExpiry = ($cert.NotAfter - (Get-Date)).Days
|
||||
Write-Host "Certificate expires in $daysUntilExpiry days"
|
||||
if ($daysUntilExpiry -lt 30) {
|
||||
Write-Warning "Certificate expires soon!"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Renewal Process
|
||||
1. Create new certificate (self-signed or commercial)
|
||||
2. Encode with `.\encode_certificate.ps1`
|
||||
3. Update `CERT_BASE64` secret
|
||||
4. Update `CERT_PASSWORD` if changed
|
||||
5. Test with a new build
|
||||
|
||||
## Support
|
||||
|
||||
For issues with certificate setup:
|
||||
1. Check workflow logs for detailed error messages
|
||||
2. Verify certificate validity locally first
|
||||
3. Test encoding/decoding process manually
|
||||
4. Consult the main Certificate Guide for certificate creation issues
|
||||
0
flutter_app/CODE_SIGNING_GUIDE.md
Normal file
0
flutter_app/CODE_SIGNING_GUIDE.md
Normal file
204
flutter_app/DEPLOYMENT_SUMMARY.md
Normal file
204
flutter_app/DEPLOYMENT_SUMMARY.md
Normal file
@@ -0,0 +1,204 @@
|
||||
# rmtPocketWatcher - Complete Deployment Summary
|
||||
|
||||
## 🎉 System Overview
|
||||
|
||||
Your rmtPocketWatcher Flutter application now has a complete, professional deployment system with:
|
||||
|
||||
✅ **Self-Signed Code Signing Certificate**
|
||||
✅ **Signed Standalone Executable**
|
||||
✅ **Signed MSIX Installer**
|
||||
✅ **Automated Build & Signing Pipeline**
|
||||
✅ **RSS-Based Update System**
|
||||
✅ **CI/CD Integration**
|
||||
|
||||
## 📁 Generated Files
|
||||
|
||||
### Certificates (Keep Secure!)
|
||||
- `certificates/rmtPocketWatcher.pfx` - Private certificate (password: `rmtPocketWatcher2024!`)
|
||||
- `certificates/rmtPocketWatcher.cer` - Public certificate for user installation
|
||||
- `certificates/CERTIFICATE_INFO.txt` - Certificate details and instructions
|
||||
|
||||
### Distribution Files
|
||||
- `build/windows/standalone/rmtpocketwatcher.exe` - **Signed standalone executable**
|
||||
- `build/windows/x64/runner/Release/rmtpocketwatcher.msix` - **Signed MSIX installer**
|
||||
- `build/rmtPocketWatcher-Windows-v1.0.1-release.zip` - Complete distribution package
|
||||
|
||||
## 🚀 Quick Start Commands
|
||||
|
||||
### Create Certificate (One-time setup)
|
||||
```powershell
|
||||
.\create_certificate.ps1
|
||||
```
|
||||
|
||||
### Build & Sign Everything
|
||||
```powershell
|
||||
.\build_windows.ps1 -Release
|
||||
```
|
||||
|
||||
### Sign Individual Files
|
||||
```powershell
|
||||
.\sign_executable.ps1 -ExePath "path\to\app.exe"
|
||||
```
|
||||
|
||||
## 📦 Distribution Options
|
||||
|
||||
### Option 1: Standalone ZIP (Recommended)
|
||||
**File**: `rmtPocketWatcher-Windows-v1.0.1-release.zip`
|
||||
- **Size**: ~50-100MB
|
||||
- **User Experience**: Extract and run - no installation needed
|
||||
- **Trust Level**: Signed executable reduces Windows warnings
|
||||
- **Best For**: General distribution, users without admin rights
|
||||
|
||||
### Option 2: MSIX Installer
|
||||
**File**: `rmtpocketwatcher.msix`
|
||||
- **Size**: ~30-60MB
|
||||
- **User Experience**: Double-click to install via Windows Package Manager
|
||||
- **Trust Level**: Signed installer, clean install/uninstall
|
||||
- **Best For**: Users who prefer traditional installation, enterprise deployment
|
||||
|
||||
### Option 3: Public Certificate Distribution
|
||||
**File**: `rmtPocketWatcher.cer`
|
||||
- **Size**: ~2KB
|
||||
- **Purpose**: Pre-install certificate for enhanced trust
|
||||
- **Best For**: Organizations, power users, eliminating all warnings
|
||||
|
||||
## 🔒 Security Features
|
||||
|
||||
### Code Signing Benefits
|
||||
- ✅ **Eliminates "Unknown Publisher" warnings**
|
||||
- ✅ **Verifies file integrity** (detects tampering)
|
||||
- ✅ **Establishes publisher identity**
|
||||
- ✅ **Enables Windows SmartScreen trust**
|
||||
- ✅ **Professional appearance**
|
||||
|
||||
### Certificate Details
|
||||
- **Subject**: Lambda Banking Conglomerate
|
||||
- **Valid**: 3 years (until December 2028)
|
||||
- **Algorithm**: SHA256 with RSA encryption
|
||||
- **Timestamp**: DigiCert timestamp server (ensures validity even after cert expires)
|
||||
|
||||
## 🔄 Update System
|
||||
|
||||
### Automatic Updates
|
||||
- Checks RSS feed every 4 hours: `https://git.hudsonriggs.systems/LambdaBankingConglomerate/rmtPocketWatcher/releases.rss`
|
||||
- Shows notification banner when updates available
|
||||
- Users can manually check via title bar button
|
||||
- Supports multiple download formats (Portable, Full, MSIX)
|
||||
|
||||
### Version Management
|
||||
- Current version: `1.0.1` (from pubspec.yaml)
|
||||
- Semantic versioning: MAJOR.MINOR.PATCH
|
||||
- Automatic CI/CD releases on version changes
|
||||
|
||||
## 🏗️ CI/CD Pipeline
|
||||
|
||||
### Automated Workflow
|
||||
The `.gitea/workflows/release.yml` automatically:
|
||||
1. **Detects version changes** in pubspec.yaml
|
||||
2. **Builds Windows & Android** versions
|
||||
3. **Signs all executables** (when certificates available)
|
||||
4. **Creates multiple distribution formats**
|
||||
5. **Publishes to releases page** with detailed notes
|
||||
|
||||
### Manual Triggers
|
||||
- Push to main branch with version change
|
||||
- Manual workflow dispatch
|
||||
- Tag creation (v1.0.1 format)
|
||||
|
||||
## 👥 User Instructions
|
||||
|
||||
### For End Users (Standalone ZIP)
|
||||
```
|
||||
1. Download rmtPocketWatcher-Windows-v1.0.1-release.zip
|
||||
2. Extract to any folder (Desktop, Program Files, etc.)
|
||||
3. Double-click rmtpocketwatcher.exe
|
||||
4. If Windows shows a warning:
|
||||
- Click "More info" → "Run anyway" (first time only)
|
||||
- Certificate will be automatically trusted for future runs
|
||||
```
|
||||
|
||||
### For End Users (MSIX Installer)
|
||||
```
|
||||
1. Download rmtpocketwatcher.msix
|
||||
2. Double-click the file
|
||||
3. Click "Install" when prompted
|
||||
4. Find "rmtPocketWatcher" in Start Menu
|
||||
5. Updates can be installed over existing version
|
||||
```
|
||||
|
||||
### For Organizations (Certificate Pre-installation)
|
||||
```
|
||||
1. Distribute rmtPocketWatcher.cer to users
|
||||
2. Users double-click and install to "Trusted Root"
|
||||
3. All future app versions will be automatically trusted
|
||||
4. No security warnings for any Lambda Banking Conglomerate software
|
||||
```
|
||||
|
||||
## 🛠️ Maintenance
|
||||
|
||||
### Certificate Renewal (Every 3 Years)
|
||||
```powershell
|
||||
# Check expiration
|
||||
$cert = Get-PfxCertificate -FilePath "certificates/rmtPocketWatcher.pfx"
|
||||
$daysLeft = ($cert.NotAfter - (Get-Date)).Days
|
||||
Write-Host "Certificate expires in $daysLeft days"
|
||||
|
||||
# Renew certificate
|
||||
.\create_certificate.ps1 -Force
|
||||
```
|
||||
|
||||
### Upgrading to Commercial Certificate
|
||||
1. Purchase from DigiCert, Sectigo, or similar ($100-500/year)
|
||||
2. Update `pubspec.yaml` with new certificate path
|
||||
3. Update build scripts with new password
|
||||
4. Re-sign and redistribute applications
|
||||
|
||||
## 📊 Trust Levels Comparison
|
||||
|
||||
| Distribution Method | Initial Trust | User Action Required | Long-term Trust |
|
||||
|-------------------|---------------|---------------------|-----------------|
|
||||
| **Unsigned** | ❌ High warnings | Click through multiple warnings | ❌ Always warns |
|
||||
| **Self-signed** | ⚠️ Moderate warning | "More info" → "Run anyway" | ✅ Trusted after first run |
|
||||
| **Self-signed + Pre-installed Cert** | ✅ Full trust | None | ✅ Always trusted |
|
||||
| **Commercial Certificate** | ✅ Full trust | None | ✅ Always trusted |
|
||||
|
||||
## 🎯 Recommendations
|
||||
|
||||
### For Development/Testing
|
||||
- ✅ Current self-signed setup is perfect
|
||||
- Provides professional appearance
|
||||
- Eliminates most user friction
|
||||
|
||||
### For Commercial Distribution
|
||||
- Consider upgrading to commercial certificate ($200-500/year)
|
||||
- Provides immediate trust without user interaction
|
||||
- Required for some enterprise environments
|
||||
|
||||
### For Open Source Projects
|
||||
- ✅ Current setup is ideal
|
||||
- Document certificate installation for power users
|
||||
- Consider community funding for commercial certificate
|
||||
|
||||
## 📞 Support & Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **"Windows protected your PC"** - Click "More info" → "Run anyway"
|
||||
2. **Certificate expired** - Run `.\create_certificate.ps1 -Force`
|
||||
3. **SignTool not found** - Install Windows SDK
|
||||
4. **Access denied** - Run PowerShell as Administrator
|
||||
|
||||
### Getting Help
|
||||
- Check `CERTIFICATE_GUIDE.md` for detailed troubleshooting
|
||||
- Review Windows Event Viewer for signing errors
|
||||
- Verify certificate validity with `Get-AuthenticodeSignature`
|
||||
|
||||
## 🏆 Achievement Unlocked!
|
||||
|
||||
Your rmtPocketWatcher application now has:
|
||||
- **Professional code signing** ✅
|
||||
- **Multiple distribution formats** ✅
|
||||
- **Automated build pipeline** ✅
|
||||
- **Built-in update system** ✅
|
||||
- **Enterprise-ready deployment** ✅
|
||||
|
||||
Users will see "Lambda Banking Conglomerate" as the verified publisher, eliminating security warnings and building trust in your Star Citizen AUEC price tracking application!
|
||||
163
flutter_app/DISTRIBUTION_GUIDE.md
Normal file
163
flutter_app/DISTRIBUTION_GUIDE.md
Normal file
@@ -0,0 +1,163 @@
|
||||
# rmtPocketWatcher - Distribution Guide
|
||||
|
||||
This guide explains how to distribute rmtPocketWatcher to end users.
|
||||
|
||||
## Available Distribution Formats
|
||||
|
||||
### 1. Standalone ZIP Package (Recommended)
|
||||
**File**: `rmtPocketWatcher-Windows-v{version}.zip`
|
||||
- **Size**: ~50-100MB (includes all dependencies)
|
||||
- **Requirements**: Windows 10/11 (any edition)
|
||||
- **Installation**: Extract ZIP and run `rmtpocketwatcher.exe`
|
||||
- **Pros**: Works on any Windows system, no installation needed
|
||||
- **Cons**: Larger download size
|
||||
|
||||
### 2. MSIX Installer
|
||||
**File**: `rmtpocketwatcher.msix`
|
||||
- **Size**: ~30-60MB
|
||||
- **Requirements**: Windows 10 version 1809+ or Windows 11
|
||||
- **Installation**: Double-click to install via Windows Package Manager
|
||||
- **Pros**: Clean installation/uninstallation, automatic updates support
|
||||
- **Cons**: Requires newer Windows versions
|
||||
|
||||
### 3. Portable Executable (Future)
|
||||
**File**: `rmtPocketWatcher-Windows-Portable-v{version}.zip`
|
||||
- **Size**: ~5-15MB (single executable)
|
||||
- **Requirements**: Windows 10/11 + Visual C++ Redistributable
|
||||
- **Installation**: Extract and run `rmtpocketwatcher.exe`
|
||||
- **Pros**: Smallest download, truly portable
|
||||
- **Cons**: May require additional runtime libraries
|
||||
|
||||
## Distribution Channels
|
||||
|
||||
### Direct Download
|
||||
1. Upload files to your Gitea releases page
|
||||
2. Users download appropriate version for their system
|
||||
3. Provide installation instructions
|
||||
|
||||
### GitHub/Gitea Releases
|
||||
- Automated via CI/CD pipeline
|
||||
- Includes release notes and changelogs
|
||||
- Multiple download options in one place
|
||||
|
||||
## User Instructions
|
||||
|
||||
### For Standalone ZIP (Most Users)
|
||||
```
|
||||
1. Download rmtPocketWatcher-Windows-v{version}.zip
|
||||
2. Extract the ZIP file to any folder (e.g., Desktop, Program Files)
|
||||
3. Double-click rmtpocketwatcher.exe to run
|
||||
4. No installation or admin rights required
|
||||
```
|
||||
|
||||
### For MSIX Installer (Advanced Users)
|
||||
```
|
||||
1. Download rmtpocketwatcher.msix
|
||||
2. Double-click the file
|
||||
3. Click "Install" when prompted
|
||||
4. Find "rmtPocketWatcher" in Start Menu
|
||||
5. Uninstall via Settings > Apps if needed
|
||||
```
|
||||
|
||||
## System Requirements
|
||||
|
||||
### Minimum Requirements
|
||||
- **OS**: Windows 10 version 1903 or later
|
||||
- **RAM**: 4GB (8GB recommended)
|
||||
- **Storage**: 200MB free space
|
||||
- **Network**: Internet connection for price data
|
||||
|
||||
### Recommended Requirements
|
||||
- **OS**: Windows 11
|
||||
- **RAM**: 8GB or more
|
||||
- **Storage**: 1GB free space (for data storage)
|
||||
- **Network**: Stable broadband connection
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
#### "Windows protected your PC" SmartScreen Warning
|
||||
- Click "More info" → "Run anyway"
|
||||
- This happens because the app isn't digitally signed
|
||||
- Consider code signing for production releases
|
||||
|
||||
#### Missing Visual C++ Runtime
|
||||
- Download and install Microsoft Visual C++ Redistributable
|
||||
- Usually only affects portable versions
|
||||
- Standalone ZIP includes all dependencies
|
||||
|
||||
#### Antivirus False Positives
|
||||
- Some antivirus software may flag the executable
|
||||
- Add exception for rmtpocketwatcher.exe
|
||||
- This is common with unsigned executables
|
||||
|
||||
#### App Won't Start
|
||||
- Check Windows Event Viewer for error details
|
||||
- Ensure .env file is present (for standalone version)
|
||||
- Try running as administrator
|
||||
|
||||
### Performance Issues
|
||||
- Close other resource-intensive applications
|
||||
- Check network connectivity for real-time data
|
||||
- Consider increasing Windows virtual memory
|
||||
|
||||
## Security Considerations
|
||||
|
||||
### For Developers
|
||||
- Consider code signing certificates for production
|
||||
- Implement automatic update verification
|
||||
- Use HTTPS for all network communications
|
||||
|
||||
### For Users
|
||||
- Download only from official sources
|
||||
- Verify file checksums if provided
|
||||
- Keep Windows and antivirus software updated
|
||||
|
||||
## Update Process
|
||||
|
||||
### Automatic Updates (Built-in)
|
||||
- App checks for updates every 4 hours
|
||||
- Shows notification banner when available
|
||||
- Users can manually check via refresh button
|
||||
- Downloads handled by system browser
|
||||
|
||||
### Manual Updates
|
||||
- Download new version
|
||||
- Replace old files with new ones (standalone)
|
||||
- Or install new MSIX over existing installation
|
||||
|
||||
## Support Information
|
||||
|
||||
### Getting Help
|
||||
- Check the GitHub/Gitea issues page
|
||||
- Review the README.md file
|
||||
- Contact Lambda Banking Conglomerate
|
||||
|
||||
### Reporting Issues
|
||||
- Include Windows version and build number
|
||||
- Describe steps to reproduce the problem
|
||||
- Attach relevant log files if available
|
||||
- Mention which distribution format you're using
|
||||
|
||||
## Developer Notes
|
||||
|
||||
### Building for Distribution
|
||||
```powershell
|
||||
# Create all distribution formats
|
||||
.\build_windows.ps1 -Release
|
||||
|
||||
# Test the build
|
||||
cd build\windows\standalone
|
||||
.\rmtpocketwatcher.exe
|
||||
```
|
||||
|
||||
### CI/CD Integration
|
||||
- Builds are automated via GitHub Actions
|
||||
- Releases are created automatically on version changes
|
||||
- All distribution formats are included in releases
|
||||
|
||||
### Version Management
|
||||
- Update version in `pubspec.yaml`
|
||||
- Follow semantic versioning (MAJOR.MINOR.PATCH)
|
||||
- Include changelog in release notes
|
||||
@@ -33,10 +33,9 @@ The system is configured to work with your Gitea repository structure:
|
||||
- RSS Feed: `https://git.hudsonriggs.systems/LambdaBankingConglomerate/rmtPocketWatcher/releases.rss`
|
||||
- Release tags should follow semantic versioning (e.g., `v1.0.0`, `v1.2.3`)
|
||||
- Expected asset naming convention:
|
||||
- Windows: `rmtPocketWatcher-windows-x64.exe`, `rmtPocketWatcher-windows-x64.msi`
|
||||
- macOS: `rmtPocketWatcher-macos.dmg`
|
||||
- Linux: `rmtPocketWatcher-linux.appimage`
|
||||
- Android: `rmtPocketWatcher-android.apk`
|
||||
- Windows: `rmtPocketWatcher-Windows-v{version}.zip`
|
||||
- Android: `rmtPocketWatcher-Android-v{version}.apk`
|
||||
- Future platforms can be added with similar naming patterns
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
230
flutter_app/WINDOW_MANAGEMENT_GUIDE.md
Normal file
230
flutter_app/WINDOW_MANAGEMENT_GUIDE.md
Normal file
@@ -0,0 +1,230 @@
|
||||
# Window Management & System Tray Guide
|
||||
|
||||
Your rmtPocketWatcher application now includes comprehensive window management and system tray functionality for a professional desktop experience.
|
||||
|
||||
## 🪟 Window Controls
|
||||
|
||||
### Title Bar Features
|
||||
- **Draggable Area**: Click and drag anywhere on the title bar to move the window
|
||||
- **Double-click**: Double-click the title bar to maximize/restore the window
|
||||
- **Custom Controls**: Professional-looking minimize, maximize, and close buttons
|
||||
|
||||
### Window Control Buttons
|
||||
|
||||
| Button | Icon | Function | Tooltip |
|
||||
|--------|------|----------|---------|
|
||||
| **Minimize** | `−` | Minimizes to system tray | "Minimize to system tray" |
|
||||
| **Maximize** | `⛶`/`⧉` | Toggle maximize/restore | "Maximize window" / "Restore window" |
|
||||
| **Close** | `×` | Closes to system tray | "Close to system tray" |
|
||||
|
||||
### Key Behaviors
|
||||
- **Close button** minimizes to tray instead of exiting the application
|
||||
- **Minimize button** sends the window directly to the system tray
|
||||
- **Window dragging** works from anywhere on the title bar
|
||||
- **Maximize toggle** remembers window state
|
||||
|
||||
## 🔔 System Tray Integration
|
||||
|
||||
### Tray Icon Features
|
||||
- **Dynamic Tooltip**: Shows current connection status
|
||||
- **Single Click**: Toggle window visibility (show/hide)
|
||||
- **Right Click**: Opens context menu with options
|
||||
- **Visual Indicator**: Icon represents the application state
|
||||
|
||||
### System Tray Menu
|
||||
|
||||
| Menu Item | Function |
|
||||
|-----------|----------|
|
||||
| **Show rmtPocketWatcher** | Restores window from tray |
|
||||
| **Check for Updates** | Shows window and triggers update check |
|
||||
| **🔄 Update Available!** | Appears when updates are detected |
|
||||
| **About** | Shows application information dialog |
|
||||
| **Exit** | Completely closes the application |
|
||||
|
||||
### Dynamic Status Updates
|
||||
- **Tooltip Updates**: Reflects connection status ("Connected", "Disconnecting", etc.)
|
||||
- **Menu Updates**: Shows update availability in real-time
|
||||
- **Status Integration**: Syncs with price provider and update provider
|
||||
|
||||
## 🎛️ User Experience
|
||||
|
||||
### Window Lifecycle
|
||||
1. **Startup**: Window appears normally
|
||||
2. **Minimize**: Window hides to system tray
|
||||
3. **Tray Click**: Window restores and focuses
|
||||
4. **Close**: Window hides to tray (doesn't exit)
|
||||
5. **Exit**: Only via tray menu "Exit" option
|
||||
|
||||
### Professional Features
|
||||
- **No Taskbar Clutter**: Minimized windows don't show in taskbar
|
||||
- **Background Operation**: App continues running when minimized
|
||||
- **Quick Access**: Single click to restore from tray
|
||||
- **Status Awareness**: Tray shows current application state
|
||||
|
||||
## 🔧 Technical Implementation
|
||||
|
||||
### Core Components
|
||||
|
||||
#### WindowService (`lib/services/window_service.dart`)
|
||||
- Manages all window operations
|
||||
- Handles system tray integration
|
||||
- Provides event listeners for window and tray events
|
||||
- Integrates with application providers
|
||||
|
||||
#### Key Methods
|
||||
```dart
|
||||
WindowService().minimizeToTray() // Hide to system tray
|
||||
WindowService().showWindow() // Restore from tray
|
||||
WindowService().maximizeWindow() // Toggle maximize state
|
||||
WindowService().closeWindow() // Close to tray
|
||||
WindowService().exitApp() // Complete application exit
|
||||
```
|
||||
|
||||
#### Provider Integration
|
||||
- **PriceProvider**: Updates tray tooltip with connection status
|
||||
- **UpdateProvider**: Updates tray menu with update availability
|
||||
- **Real-time Sync**: Tray reflects current application state
|
||||
|
||||
### Event Handling
|
||||
|
||||
#### Window Events
|
||||
- `onWindowClose()`: Intercepts close and minimizes to tray
|
||||
- `onWindowMinimize()`: Handles minimize operations
|
||||
- `onWindowRestore()`: Manages window restoration
|
||||
- `onWindowMaximize()`/`onWindowUnmaximize()`: Toggle states
|
||||
|
||||
#### Tray Events
|
||||
- `onTrayIconMouseDown()`: Single click to toggle visibility
|
||||
- `onTrayIconRightMouseDown()`: Right click for context menu
|
||||
- `onTrayMenuItemClick()`: Handle menu item selections
|
||||
|
||||
## 🎨 Visual Design
|
||||
|
||||
### Title Bar Styling
|
||||
- **Background**: Dark theme (`#1A1F3A`)
|
||||
- **Text**: White application name and organization
|
||||
- **Buttons**: Consistent with application theme
|
||||
- **Height**: 40px for comfortable interaction
|
||||
|
||||
### System Tray
|
||||
- **Icon**: Application logo (falls back to analytics icon)
|
||||
- **Tooltip**: Dynamic status information
|
||||
- **Menu**: Consistent with application theme
|
||||
|
||||
## 🚀 Usage Examples
|
||||
|
||||
### For End Users
|
||||
|
||||
#### Basic Window Management
|
||||
```
|
||||
• Drag title bar to move window
|
||||
• Double-click title bar to maximize
|
||||
• Click minimize (−) to hide to tray
|
||||
• Click close (×) to hide to tray
|
||||
• Right-click tray icon for menu
|
||||
• Click "Exit" in tray menu to quit
|
||||
```
|
||||
|
||||
#### System Tray Operations
|
||||
```
|
||||
• Single-click tray icon: Show/hide window
|
||||
• Right-click tray icon: Open context menu
|
||||
• Menu → "Show rmtPocketWatcher": Restore window
|
||||
• Menu → "Check for Updates": Check for new versions
|
||||
• Menu → "About": View application information
|
||||
• Menu → "Exit": Completely close application
|
||||
```
|
||||
|
||||
### For Developers
|
||||
|
||||
#### Integrating with Providers
|
||||
```dart
|
||||
// Update tray status based on connection
|
||||
WindowService().updateTrayTooltip('Connected to servers');
|
||||
|
||||
// Update menu with update availability
|
||||
WindowService().updateTrayMenu(hasUpdate: true);
|
||||
|
||||
// Show about dialog from tray
|
||||
WindowService()._showAboutDialog();
|
||||
```
|
||||
|
||||
## 🔒 Security & Privacy
|
||||
|
||||
### Safe Operations
|
||||
- **No Data Collection**: Window management doesn't collect user data
|
||||
- **Local Storage**: All preferences stored locally
|
||||
- **Secure Minimize**: Sensitive data hidden when minimized
|
||||
- **Clean Exit**: Proper cleanup on application exit
|
||||
|
||||
### User Control
|
||||
- **Explicit Actions**: All operations require user interaction
|
||||
- **Clear Feedback**: Visual and tooltip feedback for all actions
|
||||
- **Reversible**: All window states can be restored
|
||||
- **Transparent**: Clear indication of application status
|
||||
|
||||
## 🛠️ Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
#### System Tray Icon Not Appearing
|
||||
- **Cause**: System tray initialization failed
|
||||
- **Solution**: Check Windows notification area settings
|
||||
- **Workaround**: Use window controls instead of tray
|
||||
|
||||
#### Window Won't Restore
|
||||
- **Cause**: Window service not initialized
|
||||
- **Solution**: Restart application
|
||||
- **Debug**: Check console for initialization errors
|
||||
|
||||
#### Tray Menu Not Working
|
||||
- **Cause**: Context menu creation failed
|
||||
- **Solution**: Update tray manager package
|
||||
- **Workaround**: Use window controls
|
||||
|
||||
### Debug Information
|
||||
```dart
|
||||
// Check window service status
|
||||
print('Window service initialized: ${WindowService().isInitialized}');
|
||||
print('Minimized to tray: ${WindowService().isMinimizedToTray}');
|
||||
```
|
||||
|
||||
## 📈 Future Enhancements
|
||||
|
||||
### Planned Features
|
||||
- **Tray Notifications**: Show price alerts in tray
|
||||
- **Quick Actions**: Direct price check from tray menu
|
||||
- **Status Icons**: Different icons for different connection states
|
||||
- **Keyboard Shortcuts**: Global hotkeys for window operations
|
||||
|
||||
### Customization Options
|
||||
- **Tray Behavior**: Option to minimize to taskbar instead
|
||||
- **Close Behavior**: Option to exit instead of minimize
|
||||
- **Startup Options**: Start minimized to tray
|
||||
- **Theme Integration**: Tray menu theme matching
|
||||
|
||||
## 📋 Summary
|
||||
|
||||
Your rmtPocketWatcher application now provides:
|
||||
|
||||
✅ **Professional Window Management**
|
||||
- Draggable title bar with custom controls
|
||||
- Proper minimize, maximize, and close operations
|
||||
- Seamless window state management
|
||||
|
||||
✅ **Complete System Tray Integration**
|
||||
- Hide to tray instead of taskbar clutter
|
||||
- Dynamic status updates in tooltip
|
||||
- Full-featured context menu
|
||||
|
||||
✅ **User-Friendly Experience**
|
||||
- Intuitive window operations
|
||||
- Clear visual feedback
|
||||
- Professional desktop application behavior
|
||||
|
||||
✅ **Developer-Friendly Architecture**
|
||||
- Clean service-based implementation
|
||||
- Provider integration for real-time updates
|
||||
- Extensible for future enhancements
|
||||
|
||||
The application now behaves like a professional desktop application with proper window management and system tray integration, providing users with a seamless and intuitive experience for monitoring AUEC prices.
|
||||
69
flutter_app/build_windows.bat
Normal file
69
flutter_app/build_windows.bat
Normal file
@@ -0,0 +1,69 @@
|
||||
@echo off
|
||||
REM rmtPocketWatcher Windows Build Script (Batch version)
|
||||
REM Creates both standalone executable and MSIX installer
|
||||
|
||||
echo Building rmtPocketWatcher for Windows (Release mode)
|
||||
echo =============================================
|
||||
|
||||
REM Clean previous builds
|
||||
echo Cleaning previous builds...
|
||||
flutter clean
|
||||
if exist "build" rmdir /s /q "build"
|
||||
|
||||
REM Install dependencies
|
||||
echo Installing dependencies...
|
||||
flutter pub get
|
||||
|
||||
REM Build Flutter Windows app
|
||||
echo Building Flutter Windows app...
|
||||
flutter build windows --release
|
||||
|
||||
REM Check if build was successful
|
||||
if not exist "build\windows\x64\runner\Release\rmtpocketwatcher.exe" (
|
||||
echo ERROR: Build failed - executable not found
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo ✓ Flutter build completed successfully
|
||||
|
||||
REM Create standalone executable directory
|
||||
echo Creating standalone executable package...
|
||||
if exist "build\windows\standalone" rmdir /s /q "build\windows\standalone"
|
||||
mkdir "build\windows\standalone"
|
||||
|
||||
REM Copy all necessary files for standalone distribution
|
||||
xcopy "build\windows\x64\runner\Release\*" "build\windows\standalone\" /E /I /H /Y
|
||||
|
||||
REM Create version info
|
||||
echo rmtPocketWatcher - Lambda Banking Conglomerate > "build\windows\standalone\README.txt"
|
||||
echo Star Citizen AUEC Price Tracker >> "build\windows\standalone\README.txt"
|
||||
echo. >> "build\windows\standalone\README.txt"
|
||||
echo To run: Double-click rmtpocketwatcher.exe >> "build\windows\standalone\README.txt"
|
||||
echo No installation required - all dependencies included. >> "build\windows\standalone\README.txt"
|
||||
|
||||
echo ✓ Standalone executable created at: build\windows\standalone
|
||||
|
||||
REM Create MSIX installer (optional)
|
||||
echo Creating MSIX installer...
|
||||
flutter pub run msix:create
|
||||
if %errorlevel% neq 0 (
|
||||
echo WARNING: MSIX installer creation failed, continuing with standalone only...
|
||||
) else (
|
||||
echo ✓ MSIX installer created
|
||||
)
|
||||
|
||||
REM Create distribution archive
|
||||
echo Creating distribution archive...
|
||||
powershell -Command "Compress-Archive -Path 'build\windows\standalone\*' -DestinationPath 'build\rmtPocketWatcher-Windows-Standalone.zip' -CompressionLevel Optimal -Force"
|
||||
|
||||
echo.
|
||||
echo 🎉 Build completed successfully!
|
||||
echo =============================================
|
||||
echo Standalone executable: build\windows\standalone\rmtpocketwatcher.exe
|
||||
echo Distribution archive: build\rmtPocketWatcher-Windows-Standalone.zip
|
||||
echo.
|
||||
echo To test: cd build\windows\standalone ^&^& rmtpocketwatcher.exe
|
||||
echo To distribute: Share the ZIP file
|
||||
echo.
|
||||
pause
|
||||
177
flutter_app/build_windows.ps1
Normal file
177
flutter_app/build_windows.ps1
Normal file
@@ -0,0 +1,177 @@
|
||||
# rmtPocketWatcher Windows Build Script
|
||||
# Creates both standalone executable and MSIX installer
|
||||
|
||||
param(
|
||||
[switch]$Release = $false,
|
||||
[switch]$Debug = $false
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# Determine build mode
|
||||
$BuildMode = if ($Release) { "release" } elseif ($Debug) { "debug" } else { "release" }
|
||||
$BuildModeCapital = (Get-Culture).TextInfo.ToTitleCase($BuildMode)
|
||||
|
||||
Write-Host "Building rmtPocketWatcher for Windows ($BuildModeCapital mode)" -ForegroundColor Green
|
||||
Write-Host "=============================================" -ForegroundColor Green
|
||||
|
||||
# Clean previous builds
|
||||
Write-Host "Cleaning previous builds..." -ForegroundColor Yellow
|
||||
flutter clean
|
||||
if (Test-Path "build") {
|
||||
Remove-Item -Recurse -Force "build"
|
||||
}
|
||||
|
||||
# Install dependencies
|
||||
Write-Host "Installing dependencies..." -ForegroundColor Yellow
|
||||
flutter pub get
|
||||
|
||||
# Build Flutter Windows app
|
||||
Write-Host "Building Flutter Windows app..." -ForegroundColor Yellow
|
||||
flutter build windows --$BuildMode
|
||||
|
||||
# Check if build was successful
|
||||
$ExePath = "build\windows\x64\runner\$BuildModeCapital\rmtpocketwatcher.exe"
|
||||
if (-not (Test-Path $ExePath)) {
|
||||
Write-Error "Build failed - executable not found at $ExePath"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "✅ Flutter build completed successfully" -ForegroundColor Green
|
||||
|
||||
# Create standalone executable directory
|
||||
$StandaloneDir = "build\windows\standalone"
|
||||
Write-Host "Creating standalone executable package..." -ForegroundColor Yellow
|
||||
|
||||
if (Test-Path $StandaloneDir) {
|
||||
Remove-Item -Recurse -Force $StandaloneDir
|
||||
}
|
||||
New-Item -ItemType Directory -Path $StandaloneDir -Force | Out-Null
|
||||
|
||||
# Copy all necessary files for standalone distribution
|
||||
$SourceDir = "build\windows\x64\runner\$BuildModeCapital"
|
||||
Copy-Item -Path "$SourceDir\*" -Destination $StandaloneDir -Recurse -Force
|
||||
|
||||
# Create version info
|
||||
$Version = (Select-String -Path "pubspec.yaml" -Pattern "^version: (.+)$").Matches[0].Groups[1].Value -replace '\+.*', ''
|
||||
$VersionInfo = @"
|
||||
rmtPocketWatcher v$Version
|
||||
Lambda Banking Conglomerate
|
||||
Star Citizen AUEC Price Tracker
|
||||
|
||||
Built: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')
|
||||
Mode: $BuildModeCapital
|
||||
|
||||
To run: Double-click rmtpocketwatcher.exe
|
||||
No installation required - all dependencies included.
|
||||
"@
|
||||
|
||||
$VersionInfo | Out-File -FilePath "$StandaloneDir\VERSION.txt" -Encoding UTF8
|
||||
|
||||
Write-Host "✅ Standalone executable created at: $StandaloneDir" -ForegroundColor Green
|
||||
|
||||
# Sign the standalone executable
|
||||
$CertPath = "certificates\rmtPocketWatcher.pfx"
|
||||
if (Test-Path $CertPath) {
|
||||
Write-Host "Signing standalone executable..." -ForegroundColor Yellow
|
||||
try {
|
||||
.\sign_executable.ps1 -ExePath "$StandaloneDir\rmtpocketwatcher.exe" -Force
|
||||
} catch {
|
||||
Write-Warning "Failed to sign executable: $($_.Exception.Message)"
|
||||
Write-Host "Continuing without signing..." -ForegroundColor Yellow
|
||||
}
|
||||
} else {
|
||||
Write-Host "No certificate found - executable will be unsigned" -ForegroundColor Yellow
|
||||
Write-Host "Run .\create_certificate.ps1 to create a self-signed certificate" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
# Create MSIX installer
|
||||
Write-Host "Creating MSIX installer..." -ForegroundColor Yellow
|
||||
try {
|
||||
# Check for certificate
|
||||
$CertPath = "certificates\rmtPocketWatcher.pfx"
|
||||
$CertPassword = if ($env:MSIX_CERTIFICATE_PASSWORD) { $env:MSIX_CERTIFICATE_PASSWORD } else { "rmtPocketWatcher2024!" }
|
||||
|
||||
if (Test-Path $CertPath) {
|
||||
Write-Host "Using certificate for signing: $CertPath" -ForegroundColor Cyan
|
||||
$env:MSIX_CERTIFICATE_PATH = $CertPath
|
||||
$env:MSIX_CERTIFICATE_PASSWORD = $CertPassword
|
||||
} else {
|
||||
Write-Host "No certificate found - creating unsigned MSIX" -ForegroundColor Yellow
|
||||
Write-Host "Run .\create_certificate.ps1 to create a self-signed certificate" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
flutter pub run msix:create
|
||||
|
||||
$MsixPath = Get-ChildItem -Path "build\windows\x64\runner\$BuildModeCapital" -Filter "*.msix" | Select-Object -First 1
|
||||
if ($MsixPath) {
|
||||
Write-Host "✅ MSIX installer created: $($MsixPath.FullName)" -ForegroundColor Green
|
||||
|
||||
# Sign the MSIX if certificate exists
|
||||
if (Test-Path $CertPath) {
|
||||
Write-Host "Signing MSIX installer..." -ForegroundColor Yellow
|
||||
try {
|
||||
$signtool = "${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.22621.0\x64\signtool.exe"
|
||||
if (-not (Test-Path $signtool)) {
|
||||
# Try to find signtool in common locations
|
||||
$signtool = Get-ChildItem -Path "${env:ProgramFiles(x86)}\Windows Kits" -Recurse -Name "signtool.exe" | Select-Object -First 1
|
||||
if ($signtool) {
|
||||
$signtool = "${env:ProgramFiles(x86)}\Windows Kits\$signtool"
|
||||
}
|
||||
}
|
||||
|
||||
if (Test-Path $signtool) {
|
||||
& $signtool sign /f $CertPath /p $CertPassword /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 $MsixPath.FullName
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "✅ MSIX installer signed successfully" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Warning "Failed to sign MSIX installer"
|
||||
}
|
||||
} else {
|
||||
Write-Warning "SignTool not found - install Windows SDK to enable signing"
|
||||
}
|
||||
} catch {
|
||||
Write-Warning "Failed to sign MSIX: $($_.Exception.Message)"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Write-Warning "MSIX installer creation completed but file not found in expected location"
|
||||
}
|
||||
} catch {
|
||||
Write-Warning "MSIX installer creation failed: $($_.Exception.Message)"
|
||||
Write-Host "Continuing with standalone executable only..." -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
# Create distribution archive
|
||||
Write-Host "Creating distribution archive..." -ForegroundColor Yellow
|
||||
$ArchiveName = "rmtPocketWatcher-Windows-v$Version-$BuildMode.zip"
|
||||
$ArchivePath = "build\$ArchiveName"
|
||||
|
||||
if (Test-Path $ArchivePath) {
|
||||
Remove-Item $ArchivePath -Force
|
||||
}
|
||||
|
||||
Compress-Archive -Path "$StandaloneDir\*" -DestinationPath $ArchivePath -CompressionLevel Optimal
|
||||
|
||||
Write-Host "✅ Distribution archive created: $ArchivePath" -ForegroundColor Green
|
||||
|
||||
# Summary
|
||||
Write-Host "`n🎉 Build completed successfully!" -ForegroundColor Green
|
||||
Write-Host "=============================================" -ForegroundColor Green
|
||||
Write-Host "Standalone executable: $StandaloneDir\rmtpocketwatcher.exe" -ForegroundColor Cyan
|
||||
Write-Host "Distribution archive: $ArchivePath" -ForegroundColor Cyan
|
||||
|
||||
if ($MsixPath) {
|
||||
Write-Host "MSIX installer: $($MsixPath.FullName)" -ForegroundColor Cyan
|
||||
}
|
||||
|
||||
Write-Host "`nTo test the standalone version:" -ForegroundColor Yellow
|
||||
Write-Host " cd $StandaloneDir" -ForegroundColor White
|
||||
Write-Host " .\rmtpocketwatcher.exe" -ForegroundColor White
|
||||
|
||||
Write-Host "`nTo distribute:" -ForegroundColor Yellow
|
||||
Write-Host " - Share the ZIP file: $ArchiveName" -ForegroundColor White
|
||||
Write-Host " - Users extract and run rmtpocketwatcher.exe" -ForegroundColor White
|
||||
if ($MsixPath) {
|
||||
Write-Host " - Or share the MSIX installer for Windows Store-style installation" -ForegroundColor White
|
||||
}
|
||||
31
flutter_app/certificates/CERTIFICATE_INFO.txt
Normal file
31
flutter_app/certificates/CERTIFICATE_INFO.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
rmtPocketWatcher Code Signing Certificate
|
||||
========================================
|
||||
|
||||
Certificate Details:
|
||||
- Subject: CN=Lambda Banking Conglomerate, O=Lambda Banking Conglomerate, C=US
|
||||
- Thumbprint: 4A4AFB542D1E34E3C96FD6EAAD3B88A6BA246093
|
||||
- Valid From: 12/14/2025 23:26:52
|
||||
- Valid Until: 12/14/2028 23:36:52
|
||||
- Algorithm: sha1RSA
|
||||
|
||||
Files Created:
|
||||
- certificates\rmtPocketWatcher.pfx (PFX with private key - keep secure!)
|
||||
- certificates\rmtPocketWatcher.cer (Public certificate for distribution)
|
||||
|
||||
Password: rmtPocketWatcher2024!
|
||||
|
||||
Usage:
|
||||
- Use the PFX file for signing applications
|
||||
- Distribute the CER file to users who need to trust your apps
|
||||
- Keep the PFX file secure and never share it publicly
|
||||
|
||||
Installation Instructions for Users:
|
||||
1. Double-click certificates\rmtPocketWatcher.cer
|
||||
2. Click "Install Certificate"
|
||||
3. Choose "Local Machine" (requires admin) or "Current User"
|
||||
4. Select "Place all certificates in the following store"
|
||||
5. Browse and select "Trusted Root Certification Authorities"
|
||||
6. Click "Next" and "Finish"
|
||||
|
||||
Note: This is a self-signed certificate. For production use,
|
||||
consider purchasing a certificate from a trusted CA.
|
||||
BIN
flutter_app/certificates/rmtPocketWatcher.cer
Normal file
BIN
flutter_app/certificates/rmtPocketWatcher.cer
Normal file
Binary file not shown.
162
flutter_app/create_certificate.ps1
Normal file
162
flutter_app/create_certificate.ps1
Normal file
@@ -0,0 +1,162 @@
|
||||
# Self-Signed Certificate Creation Script for rmtPocketWatcher
|
||||
# Creates a code signing certificate for Windows applications
|
||||
|
||||
param(
|
||||
[string]$CertName = "Lambda Banking Conglomerate",
|
||||
[string]$AppName = "rmtPocketWatcher",
|
||||
[int]$ValidYears = 3,
|
||||
[switch]$Force = $false
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Write-Host "Creating Self-Signed Certificate for $AppName" -ForegroundColor Green
|
||||
Write-Host "================================================" -ForegroundColor Green
|
||||
|
||||
# Certificate paths
|
||||
$CertDir = "certificates"
|
||||
$CertPath = "$CertDir\$AppName.pfx"
|
||||
$CerPath = "$CertDir\$AppName.cer"
|
||||
$Password = "rmtPocketWatcher2024!"
|
||||
|
||||
# Create certificates directory
|
||||
if (-not (Test-Path $CertDir)) {
|
||||
New-Item -ItemType Directory -Path $CertDir -Force | Out-Null
|
||||
Write-Host "Created certificates directory: $CertDir" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
# Check if certificate already exists
|
||||
if ((Test-Path $CertPath) -and -not $Force) {
|
||||
Write-Host "Certificate already exists at: $CertPath" -ForegroundColor Yellow
|
||||
Write-Host "Use -Force to recreate the certificate" -ForegroundColor Yellow
|
||||
|
||||
# Check if certificate is still valid
|
||||
try {
|
||||
$cert = Get-PfxCertificate -FilePath $CertPath
|
||||
$daysUntilExpiry = ($cert.NotAfter - (Get-Date)).Days
|
||||
|
||||
if ($daysUntilExpiry -gt 30) {
|
||||
Write-Host "Current certificate is valid for $daysUntilExpiry more days" -ForegroundColor Green
|
||||
Write-Host "Certificate Subject: $($cert.Subject)" -ForegroundColor Cyan
|
||||
Write-Host "Certificate Thumbprint: $($cert.Thumbprint)" -ForegroundColor Cyan
|
||||
return
|
||||
} else {
|
||||
Write-Host "Certificate expires in $daysUntilExpiry days, recreating..." -ForegroundColor Yellow
|
||||
$Force = $true
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Existing certificate is invalid, recreating..." -ForegroundColor Yellow
|
||||
$Force = $true
|
||||
}
|
||||
}
|
||||
|
||||
# Remove existing certificate if forcing recreation
|
||||
if ($Force -and (Test-Path $CertPath)) {
|
||||
Remove-Item $CertPath -Force
|
||||
Write-Host "Removed existing certificate" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
Write-Host "Creating new self-signed certificate..." -ForegroundColor Yellow
|
||||
|
||||
# Create the certificate
|
||||
$notAfter = (Get-Date).AddYears($ValidYears)
|
||||
$cert = New-SelfSignedCertificate `
|
||||
-Type CodeSigningCert `
|
||||
-Subject "CN=$CertName, O=$CertName, C=US" `
|
||||
-KeyAlgorithm RSA `
|
||||
-KeyLength 2048 `
|
||||
-Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" `
|
||||
-KeyExportPolicy Exportable `
|
||||
-KeyUsage DigitalSignature `
|
||||
-NotAfter $notAfter `
|
||||
-CertStoreLocation "Cert:\CurrentUser\My"
|
||||
|
||||
Write-Host "✅ Certificate created successfully" -ForegroundColor Green
|
||||
Write-Host "Certificate Thumbprint: $($cert.Thumbprint)" -ForegroundColor Cyan
|
||||
Write-Host "Valid Until: $($cert.NotAfter)" -ForegroundColor Cyan
|
||||
|
||||
# Export certificate to PFX (with private key)
|
||||
$securePassword = ConvertTo-SecureString -String $Password -Force -AsPlainText
|
||||
Export-PfxCertificate -Cert $cert -FilePath $CertPath -Password $securePassword | Out-Null
|
||||
Write-Host "✅ Exported PFX certificate to: $CertPath" -ForegroundColor Green
|
||||
|
||||
# Export certificate to CER (public key only, for distribution)
|
||||
Export-Certificate -Cert $cert -FilePath $CerPath | Out-Null
|
||||
Write-Host "✅ Exported CER certificate to: $CerPath" -ForegroundColor Green
|
||||
|
||||
# Install certificate to Trusted Root (requires admin)
|
||||
Write-Host "Installing certificate to Trusted Root Certification Authorities..." -ForegroundColor Yellow
|
||||
try {
|
||||
# Check if running as administrator
|
||||
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
|
||||
|
||||
if ($isAdmin) {
|
||||
Import-Certificate -FilePath $CerPath -CertStoreLocation "Cert:\LocalMachine\Root" | Out-Null
|
||||
Write-Host "✅ Certificate installed to Trusted Root (system-wide)" -ForegroundColor Green
|
||||
} else {
|
||||
Import-Certificate -FilePath $CerPath -CertStoreLocation "Cert:\CurrentUser\Root" | Out-Null
|
||||
Write-Host "✅ Certificate installed to Trusted Root (current user)" -ForegroundColor Green
|
||||
Write-Host "⚠️ Run as Administrator to install system-wide" -ForegroundColor Yellow
|
||||
}
|
||||
} catch {
|
||||
Write-Host "❌ Failed to install certificate to Trusted Root: $($_.Exception.Message)" -ForegroundColor Red
|
||||
Write-Host "You may need to install it manually" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
# Create certificate info file
|
||||
$certInfo = @"
|
||||
rmtPocketWatcher Code Signing Certificate
|
||||
========================================
|
||||
|
||||
Certificate Details:
|
||||
- Subject: $($cert.Subject)
|
||||
- Thumbprint: $($cert.Thumbprint)
|
||||
- Valid From: $($cert.NotBefore)
|
||||
- Valid Until: $($cert.NotAfter)
|
||||
- Algorithm: $($cert.SignatureAlgorithm.FriendlyName)
|
||||
|
||||
Files Created:
|
||||
- $CertPath (PFX with private key - keep secure!)
|
||||
- $CerPath (Public certificate for distribution)
|
||||
|
||||
Password: $Password
|
||||
|
||||
Usage:
|
||||
- Use the PFX file for signing applications
|
||||
- Distribute the CER file to users who need to trust your apps
|
||||
- Keep the PFX file secure and never share it publicly
|
||||
|
||||
Installation Instructions for Users:
|
||||
1. Double-click $CerPath
|
||||
2. Click "Install Certificate"
|
||||
3. Choose "Local Machine" (requires admin) or "Current User"
|
||||
4. Select "Place all certificates in the following store"
|
||||
5. Browse and select "Trusted Root Certification Authorities"
|
||||
6. Click "Next" and "Finish"
|
||||
|
||||
Note: This is a self-signed certificate. For production use,
|
||||
consider purchasing a certificate from a trusted CA.
|
||||
"@
|
||||
|
||||
$certInfo | Out-File -FilePath "$CertDir\CERTIFICATE_INFO.txt" -Encoding UTF8
|
||||
Write-Host "✅ Certificate information saved to: $CertDir\CERTIFICATE_INFO.txt" -ForegroundColor Green
|
||||
|
||||
Write-Host "`n🎉 Certificate setup completed!" -ForegroundColor Green
|
||||
Write-Host "================================================" -ForegroundColor Green
|
||||
Write-Host "PFX Certificate: $CertPath" -ForegroundColor Cyan
|
||||
Write-Host "Public Certificate: $CerPath" -ForegroundColor Cyan
|
||||
Write-Host "Password: $Password" -ForegroundColor Cyan
|
||||
Write-Host "`nNext steps:" -ForegroundColor Yellow
|
||||
Write-Host "1. Update your build scripts to use this certificate" -ForegroundColor White
|
||||
Write-Host "2. Test signing your application" -ForegroundColor White
|
||||
Write-Host "3. Distribute the .cer file to users if needed" -ForegroundColor White
|
||||
|
||||
# Add to .gitignore if not already there
|
||||
$gitignorePath = ".gitignore"
|
||||
if (Test-Path $gitignorePath) {
|
||||
$gitignoreContent = Get-Content $gitignorePath -Raw
|
||||
if ($gitignoreContent -notmatch "certificates/") {
|
||||
Add-Content $gitignorePath "`n# Code signing certificates`ncertificates/*.pfx`ncertificates/*.p12"
|
||||
Write-Host "✅ Added certificate files to .gitignore" -ForegroundColor Green
|
||||
}
|
||||
}
|
||||
37
flutter_app/encode_certificate.ps1
Normal file
37
flutter_app/encode_certificate.ps1
Normal file
@@ -0,0 +1,37 @@
|
||||
# Encode Certificate for CI/CD
|
||||
# Converts the PFX certificate to base64 for use as GitHub/Gitea action secret
|
||||
|
||||
param(
|
||||
[string]$CertPath = "certificates\rmtPocketWatcher.pfx",
|
||||
[string]$OutputFile = "certificate_base64.txt"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Write-Host "Encoding Certificate for CI/CD" -ForegroundColor Green
|
||||
Write-Host "==============================" -ForegroundColor Green
|
||||
|
||||
# Check if certificate exists
|
||||
if (-not (Test-Path $CertPath)) {
|
||||
Write-Error "Certificate not found at: $CertPath"
|
||||
Write-Host "Create a certificate first using .\create_certificate.ps1" -ForegroundColor Yellow
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Read certificate and encode as base64
|
||||
Write-Host "Reading certificate: $CertPath" -ForegroundColor Yellow
|
||||
$certBytes = [System.IO.File]::ReadAllBytes((Resolve-Path $CertPath))
|
||||
$certBase64 = [System.Convert]::ToBase64String($certBytes)
|
||||
|
||||
# Save to file
|
||||
$certBase64 | Out-File -FilePath $OutputFile -Encoding ASCII -NoNewline
|
||||
|
||||
Write-Host "✅ Certificate encoded successfully!" -ForegroundColor Green
|
||||
Write-Host "Base64 encoded certificate saved to: $OutputFile" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
Write-Host "Next steps:" -ForegroundColor Yellow
|
||||
Write-Host "1. Copy the contents of $OutputFile" -ForegroundColor White
|
||||
Write-Host "2. Add as action secret named 'CERT_BASE64'" -ForegroundColor White
|
||||
Write-Host "3. Add certificate password as secret named 'CERT_PASSWORD'" -ForegroundColor White
|
||||
Write-Host ""
|
||||
Write-Host "⚠️ IMPORTANT: Delete $OutputFile after copying to keep certificate secure!" -ForegroundColor Red
|
||||
@@ -38,6 +38,9 @@ Future<void> main() async {
|
||||
windowManager.waitUntilReadyToShow(windowOptions, () async {
|
||||
await windowManager.show();
|
||||
await windowManager.focus();
|
||||
|
||||
// Initialize window service after window is ready
|
||||
// Context will be set later from the home screen
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
import '../providers/price_provider.dart';
|
||||
import '../providers/update_provider.dart';
|
||||
import '../services/window_service.dart';
|
||||
import '../widgets/price_chart.dart';
|
||||
import '../widgets/alerts_panel.dart';
|
||||
import '../widgets/vendor_table.dart';
|
||||
@@ -19,13 +21,39 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// Initialize update provider
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
// Initialize providers and window service
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
// Initialize window service with context
|
||||
await WindowService().initialize(context: context);
|
||||
|
||||
context.read<UpdateProvider>().initialize();
|
||||
context.read<UpdateProvider>().startPeriodicChecks();
|
||||
|
||||
// Listen to provider changes to update system tray
|
||||
_setupProviderListeners();
|
||||
});
|
||||
}
|
||||
|
||||
void _setupProviderListeners() {
|
||||
// Listen to price provider for connection status
|
||||
context.read<PriceProvider>().addListener(_updateTrayStatus);
|
||||
|
||||
// Listen to update provider for update notifications
|
||||
context.read<UpdateProvider>().addListener(_updateTrayMenu);
|
||||
}
|
||||
|
||||
void _updateTrayStatus() {
|
||||
final priceProvider = context.read<PriceProvider>();
|
||||
WindowService().updateTrayTooltip(
|
||||
'AUEC Tracker - ${priceProvider.connectionStatus}'
|
||||
);
|
||||
}
|
||||
|
||||
void _updateTrayMenu() {
|
||||
final updateProvider = context.read<UpdateProvider>();
|
||||
WindowService().updateTrayMenu(hasUpdate: updateProvider.hasUpdate);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -36,7 +64,10 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
if (!kIsWeb && (Theme.of(context).platform == TargetPlatform.windows ||
|
||||
Theme.of(context).platform == TargetPlatform.macOS ||
|
||||
Theme.of(context).platform == TargetPlatform.linux))
|
||||
Container(
|
||||
GestureDetector(
|
||||
onPanStart: (details) => windowManager.startDragging(),
|
||||
onDoubleTap: () => WindowService().maximizeWindow(),
|
||||
child: Container(
|
||||
height: 40,
|
||||
color: const Color(0xFF1A1F3A),
|
||||
child: Row(
|
||||
@@ -86,21 +117,38 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
);
|
||||
},
|
||||
),
|
||||
// Minimize button (minimize to tray)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.minimize, color: Colors.white, size: 16),
|
||||
onPressed: () {
|
||||
// Minimize window - implement with window_manager
|
||||
onPressed: () => WindowService().minimizeToTray(),
|
||||
tooltip: 'Minimize to system tray',
|
||||
),
|
||||
// Maximize/Restore button
|
||||
FutureBuilder<bool>(
|
||||
future: windowManager.isMaximized(),
|
||||
builder: (context, snapshot) {
|
||||
bool isMaximized = snapshot.data ?? false;
|
||||
return IconButton(
|
||||
icon: Icon(
|
||||
isMaximized ? Icons.fullscreen_exit : Icons.fullscreen,
|
||||
color: Colors.white,
|
||||
size: 16,
|
||||
),
|
||||
onPressed: () => WindowService().maximizeWindow(),
|
||||
tooltip: isMaximized ? 'Restore window' : 'Maximize window',
|
||||
);
|
||||
},
|
||||
),
|
||||
// Close button (exit app)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close, color: Colors.white, size: 16),
|
||||
onPressed: () {
|
||||
// Close window - implement with window_manager
|
||||
},
|
||||
onPressed: () => WindowService().closeWindow(),
|
||||
tooltip: 'Exit application',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
// Main content
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
|
||||
@@ -143,33 +143,31 @@ class UpdateService {
|
||||
final baseUrl = 'https://git.hudsonriggs.systems/LambdaBankingConglomerate/rmtPocketWatcher/releases/download/v$version';
|
||||
|
||||
return [
|
||||
// Windows Full Package
|
||||
ReleaseAsset(
|
||||
name: 'rmtPocketWatcher-windows-x64.exe',
|
||||
downloadUrl: '$baseUrl/rmtPocketWatcher-windows-x64.exe',
|
||||
name: 'rmtPocketWatcher-Windows-v$version.zip',
|
||||
downloadUrl: '$baseUrl/rmtPocketWatcher-Windows-v$version.zip',
|
||||
size: 0, // Unknown size from RSS
|
||||
contentType: 'application/octet-stream',
|
||||
contentType: 'application/zip',
|
||||
),
|
||||
// Windows Portable (single exe)
|
||||
ReleaseAsset(
|
||||
name: 'rmtPocketWatcher-windows-x64.msi',
|
||||
downloadUrl: '$baseUrl/rmtPocketWatcher-windows-x64.msi',
|
||||
name: 'rmtPocketWatcher-Windows-Portable-v$version.zip',
|
||||
downloadUrl: '$baseUrl/rmtPocketWatcher-Windows-Portable-v$version.zip',
|
||||
size: 0,
|
||||
contentType: 'application/octet-stream',
|
||||
contentType: 'application/zip',
|
||||
),
|
||||
// Windows MSIX Installer
|
||||
ReleaseAsset(
|
||||
name: 'rmtPocketWatcher-macos.dmg',
|
||||
downloadUrl: '$baseUrl/rmtPocketWatcher-macos.dmg',
|
||||
name: 'rmtPocketWatcher-v$version.msix',
|
||||
downloadUrl: '$baseUrl/rmtPocketWatcher-v$version.msix',
|
||||
size: 0,
|
||||
contentType: 'application/octet-stream',
|
||||
contentType: 'application/msix',
|
||||
),
|
||||
// Android APK
|
||||
ReleaseAsset(
|
||||
name: 'rmtPocketWatcher-linux.appimage',
|
||||
downloadUrl: '$baseUrl/rmtPocketWatcher-linux.appimage',
|
||||
size: 0,
|
||||
contentType: 'application/octet-stream',
|
||||
),
|
||||
ReleaseAsset(
|
||||
name: 'rmtPocketWatcher-android.apk',
|
||||
downloadUrl: '$baseUrl/rmtPocketWatcher-android.apk',
|
||||
name: 'rmtPocketWatcher-Android-v$version.apk',
|
||||
downloadUrl: '$baseUrl/rmtPocketWatcher-Android-v$version.apk',
|
||||
size: 0,
|
||||
contentType: 'application/vnd.android.package-archive',
|
||||
),
|
||||
@@ -200,36 +198,38 @@ class UpdateInfo {
|
||||
ReleaseAsset? getAssetForCurrentPlatform() {
|
||||
if (kIsWeb) return null;
|
||||
|
||||
String platformPattern;
|
||||
switch (defaultTargetPlatform) {
|
||||
case TargetPlatform.windows:
|
||||
platformPattern = r'windows|win|\.exe$|\.msi$';
|
||||
break;
|
||||
// Prefer portable version for Windows
|
||||
var portable = assets.where((asset) => asset.name.contains('Portable')).firstOrNull;
|
||||
if (portable != null) return portable;
|
||||
|
||||
// Fall back to full Windows package
|
||||
var windows = assets.where((asset) => asset.name.contains('Windows') && asset.name.endsWith('.zip')).firstOrNull;
|
||||
if (windows != null) return windows;
|
||||
|
||||
// Last resort: MSIX installer
|
||||
return assets.where((asset) => asset.name.endsWith('.msix')).firstOrNull;
|
||||
|
||||
case TargetPlatform.macOS:
|
||||
platformPattern = r'macos|mac|darwin|\.dmg$|\.pkg$';
|
||||
break;
|
||||
return assets.where((asset) =>
|
||||
RegExp(r'macOS|macos|mac|darwin|\.dmg$|\.pkg$', caseSensitive: false).hasMatch(asset.name)
|
||||
).firstOrNull;
|
||||
|
||||
case TargetPlatform.linux:
|
||||
platformPattern = r'linux|\.deb$|\.rpm$|\.appimage$';
|
||||
break;
|
||||
return assets.where((asset) =>
|
||||
RegExp(r'Linux|linux|\.deb$|\.rpm$|\.appimage$', caseSensitive: false).hasMatch(asset.name)
|
||||
).firstOrNull;
|
||||
|
||||
case TargetPlatform.android:
|
||||
platformPattern = r'android|\.apk$';
|
||||
break;
|
||||
return assets.where((asset) => asset.name.endsWith('.apk')).firstOrNull;
|
||||
|
||||
case TargetPlatform.iOS:
|
||||
platformPattern = r'ios|\.ipa$';
|
||||
break;
|
||||
return assets.where((asset) => asset.name.endsWith('.ipa')).firstOrNull;
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
final regex = RegExp(platformPattern, caseSensitive: false);
|
||||
|
||||
for (final asset in assets) {
|
||||
if (regex.hasMatch(asset.name)) {
|
||||
return asset;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
315
flutter_app/lib/services/window_service.dart
Normal file
315
flutter_app/lib/services/window_service.dart
Normal file
@@ -0,0 +1,315 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
import 'package:tray_manager/tray_manager.dart';
|
||||
|
||||
class WindowService with WindowListener, TrayListener {
|
||||
static final WindowService _instance = WindowService._internal();
|
||||
factory WindowService() => _instance;
|
||||
WindowService._internal();
|
||||
|
||||
bool _isInitialized = false;
|
||||
bool _isMinimizedToTray = false;
|
||||
BuildContext? _context;
|
||||
|
||||
Future<void> initialize({BuildContext? context}) async {
|
||||
if (_isInitialized) return;
|
||||
|
||||
_context = context;
|
||||
|
||||
// Initialize window manager
|
||||
windowManager.addListener(this);
|
||||
|
||||
// Initialize system tray
|
||||
await _initializeTray();
|
||||
|
||||
_isInitialized = true;
|
||||
}
|
||||
|
||||
Future<void> _initializeTray() async {
|
||||
try {
|
||||
await trayManager.setIcon(
|
||||
kIsWeb ? '' : 'icon.ico',
|
||||
isTemplate: false,
|
||||
);
|
||||
|
||||
await trayManager.setToolTip('rmtPocketWatcher - AUEC Price Tracker');
|
||||
|
||||
// Create tray menu
|
||||
Menu menu = Menu(
|
||||
items: [
|
||||
MenuItem(
|
||||
key: 'show_window',
|
||||
label: 'Show rmtPocketWatcher',
|
||||
),
|
||||
MenuItem.separator(),
|
||||
MenuItem(
|
||||
key: 'check_updates',
|
||||
label: 'Check for Updates',
|
||||
),
|
||||
MenuItem.separator(),
|
||||
MenuItem(
|
||||
key: 'about',
|
||||
label: 'About',
|
||||
),
|
||||
MenuItem.separator(),
|
||||
MenuItem(
|
||||
key: 'exit_app',
|
||||
label: 'Exit',
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
await trayManager.setContextMenu(menu);
|
||||
trayManager.addListener(this);
|
||||
|
||||
if (kDebugMode) {
|
||||
print('System tray initialized successfully');
|
||||
}
|
||||
} catch (e) {
|
||||
if (kDebugMode) {
|
||||
print('Failed to initialize system tray: $e');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Window controls
|
||||
Future<void> minimizeWindow() async {
|
||||
await windowManager.minimize();
|
||||
}
|
||||
|
||||
Future<void> minimizeToTray() async {
|
||||
await windowManager.hide();
|
||||
_isMinimizedToTray = true;
|
||||
|
||||
if (kDebugMode) {
|
||||
print('Window minimized to system tray');
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> showWindow() async {
|
||||
await windowManager.show();
|
||||
await windowManager.focus();
|
||||
_isMinimizedToTray = false;
|
||||
|
||||
if (kDebugMode) {
|
||||
print('Window restored from system tray');
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> maximizeWindow() async {
|
||||
bool isMaximized = await windowManager.isMaximized();
|
||||
if (isMaximized) {
|
||||
await windowManager.unmaximize();
|
||||
} else {
|
||||
await windowManager.maximize();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> closeWindow() async {
|
||||
// Close button should exit the app
|
||||
await exitApp();
|
||||
}
|
||||
|
||||
Future<void> exitApp() async {
|
||||
await trayManager.destroy();
|
||||
await windowManager.destroy();
|
||||
SystemNavigator.pop();
|
||||
}
|
||||
|
||||
// Window event handlers
|
||||
@override
|
||||
void onWindowClose() async {
|
||||
// Prevent default close behavior
|
||||
await closeWindow();
|
||||
}
|
||||
|
||||
@override
|
||||
void onWindowMinimize() async {
|
||||
// When window is minimized (via minimize button or taskbar), go to tray
|
||||
await minimizeToTray();
|
||||
if (kDebugMode) {
|
||||
print('Window minimized to tray');
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onWindowRestore() {
|
||||
_isMinimizedToTray = false;
|
||||
if (kDebugMode) {
|
||||
print('Window restored');
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onWindowMaximize() {
|
||||
if (kDebugMode) {
|
||||
print('Window maximized');
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onWindowUnmaximize() {
|
||||
if (kDebugMode) {
|
||||
print('Window unmaximized');
|
||||
}
|
||||
}
|
||||
|
||||
// Tray event handlers
|
||||
@override
|
||||
void onTrayIconMouseDown() async {
|
||||
// Single click to show/hide window
|
||||
if (_isMinimizedToTray) {
|
||||
await showWindow();
|
||||
} else {
|
||||
await minimizeToTray();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onTrayIconRightMouseDown() async {
|
||||
// Right click shows context menu (handled automatically)
|
||||
}
|
||||
|
||||
@override
|
||||
void onTrayMenuItemClick(MenuItem menuItem) async {
|
||||
switch (menuItem.key) {
|
||||
case 'show_window':
|
||||
await showWindow();
|
||||
break;
|
||||
case 'check_updates':
|
||||
await showWindow();
|
||||
// The update check will be handled by the UI
|
||||
if (kDebugMode) {
|
||||
print('Checking for updates from tray menu');
|
||||
}
|
||||
break;
|
||||
case 'about':
|
||||
await showWindow();
|
||||
_showAboutDialog();
|
||||
break;
|
||||
case 'exit_app':
|
||||
await exitApp();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Update tray tooltip with current status
|
||||
Future<void> updateTrayTooltip(String status) async {
|
||||
try {
|
||||
await trayManager.setToolTip('rmtPocketWatcher - $status');
|
||||
} catch (e) {
|
||||
if (kDebugMode) {
|
||||
print('Failed to update tray tooltip: $e');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update tray menu with dynamic content
|
||||
Future<void> updateTrayMenu({bool hasUpdate = false}) async {
|
||||
try {
|
||||
Menu menu = Menu(
|
||||
items: [
|
||||
MenuItem(
|
||||
key: 'show_window',
|
||||
label: 'Show rmtPocketWatcher',
|
||||
),
|
||||
MenuItem.separator(),
|
||||
MenuItem(
|
||||
key: 'check_updates',
|
||||
label: hasUpdate ? '🔄 Update Available!' : 'Check for Updates',
|
||||
),
|
||||
MenuItem.separator(),
|
||||
MenuItem(
|
||||
key: 'about',
|
||||
label: 'About',
|
||||
),
|
||||
MenuItem.separator(),
|
||||
MenuItem(
|
||||
key: 'exit_app',
|
||||
label: 'Exit',
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
await trayManager.setContextMenu(menu);
|
||||
} catch (e) {
|
||||
if (kDebugMode) {
|
||||
print('Failed to update tray menu: $e');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
bool get isMinimizedToTray => _isMinimizedToTray;
|
||||
bool get isInitialized => _isInitialized;
|
||||
|
||||
void _showAboutDialog() {
|
||||
if (_context != null) {
|
||||
// Import the about dialog dynamically to avoid circular imports
|
||||
showDialog(
|
||||
context: _context!,
|
||||
builder: (context) {
|
||||
// We'll create a simple about dialog here to avoid import issues
|
||||
return AlertDialog(
|
||||
backgroundColor: const Color(0xFF1A1F3A),
|
||||
title: const Row(
|
||||
children: [
|
||||
Icon(Icons.analytics, color: Color(0xFF50E3C2), size: 32),
|
||||
SizedBox(width: 12),
|
||||
Text('rmtPocketWatcher', style: TextStyle(color: Colors.white)),
|
||||
],
|
||||
),
|
||||
content: const Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Star Citizen AUEC Price Tracker',
|
||||
style: TextStyle(color: Colors.white70, fontSize: 14),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
'Developed by Lambda Banking Conglomerate',
|
||||
style: TextStyle(color: Colors.white70, fontSize: 12),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Text(
|
||||
'Features:',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF50E3C2),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Text('• Real-time AUEC price tracking', style: TextStyle(color: Colors.white70, fontSize: 12)),
|
||||
Text('• Multiple vendor monitoring', style: TextStyle(color: Colors.white70, fontSize: 12)),
|
||||
Text('• Historical price charts', style: TextStyle(color: Colors.white70, fontSize: 12)),
|
||||
Text('• Price alerts & notifications', style: TextStyle(color: Colors.white70, fontSize: 12)),
|
||||
Text('• System tray integration', style: TextStyle(color: Colors.white70, fontSize: 12)),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
ElevatedButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF50E3C2),
|
||||
foregroundColor: Colors.black,
|
||||
),
|
||||
child: const Text('Close'),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
void dispose() {
|
||||
windowManager.removeListener(this);
|
||||
trayManager.removeListener(this);
|
||||
}
|
||||
}
|
||||
176
flutter_app/lib/widgets/about_dialog.dart
Normal file
176
flutter_app/lib/widgets/about_dialog.dart
Normal file
@@ -0,0 +1,176 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class AppAboutDialog extends StatelessWidget {
|
||||
const AppAboutDialog({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FutureBuilder<PackageInfo>(
|
||||
future: PackageInfo.fromPlatform(),
|
||||
builder: (context, snapshot) {
|
||||
final packageInfo = snapshot.data;
|
||||
|
||||
return AlertDialog(
|
||||
backgroundColor: const Color(0xFF1A1F3A),
|
||||
title: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/logo.png',
|
||||
width: 32,
|
||||
height: 32,
|
||||
errorBuilder: (context, error, stackTrace) =>
|
||||
const Icon(Icons.analytics, color: Color(0xFF50E3C2), size: 32),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
const Text(
|
||||
'rmtPocketWatcher',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
],
|
||||
),
|
||||
content: SizedBox(
|
||||
width: 400,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Version ${packageInfo?.version ?? 'Unknown'}',
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF50E3C2),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const Text(
|
||||
'Star Citizen AUEC Price Tracker',
|
||||
style: TextStyle(color: Colors.white70, fontSize: 14),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Text(
|
||||
'Bloomberg-style terminal interface for real-time RMT price monitoring',
|
||||
style: TextStyle(color: Colors.white70, fontSize: 12),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const Divider(color: Color(0xFF50E3C2)),
|
||||
const SizedBox(height: 16),
|
||||
_buildInfoRow('Developer', 'Lambda Banking Conglomerate'),
|
||||
const SizedBox(height: 8),
|
||||
_buildInfoRow('Platform', 'Flutter Desktop'),
|
||||
const SizedBox(height: 8),
|
||||
_buildInfoRow('Build', packageInfo?.buildNumber ?? 'Unknown'),
|
||||
const SizedBox(height: 16),
|
||||
const Text(
|
||||
'Features:',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF50E3C2),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
_buildFeatureItem('Real-time AUEC price tracking'),
|
||||
_buildFeatureItem('Multiple vendor monitoring'),
|
||||
_buildFeatureItem('Historical price charts'),
|
||||
_buildFeatureItem('Price alerts & notifications'),
|
||||
_buildFeatureItem('System tray integration'),
|
||||
_buildFeatureItem('Automatic updates'),
|
||||
const SizedBox(height: 16),
|
||||
const Text(
|
||||
'Data Sources:',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF50E3C2),
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
_buildFeatureItem('Eldorado.gg'),
|
||||
_buildFeatureItem('PlayerAuctions'),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => _launchUrl('https://git.hudsonriggs.systems/LambdaBankingConglomerate/rmtPocketWatcher'),
|
||||
child: const Text(
|
||||
'Source Code',
|
||||
style: TextStyle(color: Color(0xFF50E3C2)),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => _launchUrl('https://git.hudsonriggs.systems/LambdaBankingConglomerate/rmtPocketWatcher/releases'),
|
||||
child: const Text(
|
||||
'Releases',
|
||||
style: TextStyle(color: Color(0xFF50E3C2)),
|
||||
),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF50E3C2),
|
||||
foregroundColor: Colors.black,
|
||||
),
|
||||
child: const Text('Close'),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInfoRow(String label, String value) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 80,
|
||||
child: Text(
|
||||
'$label:',
|
||||
style: const TextStyle(
|
||||
color: Colors.white70,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
value,
|
||||
style: const TextStyle(color: Colors.white, fontSize: 12),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildFeatureItem(String feature) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 16, bottom: 4),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.check_circle,
|
||||
color: Color(0xFF50E3C2),
|
||||
size: 12,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
feature,
|
||||
style: const TextStyle(color: Colors.white70, fontSize: 12),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _launchUrl(String url) async {
|
||||
final uri = Uri.parse(url);
|
||||
if (await canLaunchUrl(uri)) {
|
||||
await launchUrl(uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -460,6 +460,12 @@ class _PriceChartState extends State<PriceChart> {
|
||||
getTooltipColor: (touchedSpot) => const Color(0xFF2A2F4A),
|
||||
tooltipRoundedRadius: 4,
|
||||
tooltipPadding: const EdgeInsets.all(8),
|
||||
tooltipMargin: 8,
|
||||
fitInsideHorizontally: true,
|
||||
fitInsideVertically: true,
|
||||
rotateAngle: 0,
|
||||
tooltipHorizontalAlignment: FLHorizontalAlignment.center,
|
||||
tooltipHorizontalOffset: 0,
|
||||
getTooltipItems: (List<LineBarSpot> touchedBarSpots) {
|
||||
return touchedBarSpots.map((barSpot) {
|
||||
final seller = sellers[barSpot.barIndex];
|
||||
@@ -493,15 +499,73 @@ class _PriceChartState extends State<PriceChart> {
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 12), // Reduced from 16
|
||||
// X-axis zoom controls
|
||||
// Timeline scrubber and controls (Bloomberg style)
|
||||
Consumer<PriceProvider>(
|
||||
builder: (context, provider, child) {
|
||||
if (provider.historyData == null || provider.historyData!.prices.isEmpty) {
|
||||
return const SizedBox();
|
||||
}
|
||||
|
||||
return Wrap(
|
||||
// Get first and last timestamps for display
|
||||
final groupedData = <int, Map<String, double>>{};
|
||||
for (final price in provider.historyData!.prices) {
|
||||
final timestamp = price.timestamp.millisecondsSinceEpoch;
|
||||
groupedData.putIfAbsent(timestamp, () => {});
|
||||
}
|
||||
final sortedTimestamps = groupedData.keys.toList()..sort();
|
||||
|
||||
final firstDate = DateTime.fromMillisecondsSinceEpoch(sortedTimestamps.first);
|
||||
final lastDate = DateTime.fromMillisecondsSinceEpoch(sortedTimestamps.last);
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
// Timeline scrubber
|
||||
Container(
|
||||
height: 40,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF2A2F4A), // Lighter gray background
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'${firstDate.month}/${firstDate.day}',
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF888888),
|
||||
fontSize: 10,
|
||||
fontFamily: 'monospace',
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Slider(
|
||||
value: _xCenterPoint,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_xCenterPoint = value;
|
||||
});
|
||||
},
|
||||
activeColor: const Color(0xFF50E3C2),
|
||||
inactiveColor: const Color(0xFF1A1F3A),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${lastDate.month}/${lastDate.day}',
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF888888),
|
||||
fontSize: 10,
|
||||
fontFamily: 'monospace',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
// Centered X-axis zoom controls
|
||||
Center(
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
spacing: 4, // Reduced spacing
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
@@ -599,67 +663,9 @@ class _PriceChartState extends State<PriceChart> {
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 12), // Reduced from 16
|
||||
// Timeline scrubber (Bloomberg style)
|
||||
Consumer<PriceProvider>(
|
||||
builder: (context, provider, child) {
|
||||
if (provider.historyData == null || provider.historyData!.prices.isEmpty) {
|
||||
return const SizedBox();
|
||||
}
|
||||
|
||||
// Get first and last timestamps for display
|
||||
final groupedData = <int, Map<String, double>>{};
|
||||
for (final price in provider.historyData!.prices) {
|
||||
final timestamp = price.timestamp.millisecondsSinceEpoch;
|
||||
groupedData.putIfAbsent(timestamp, () => {});
|
||||
}
|
||||
final sortedTimestamps = groupedData.keys.toList()..sort();
|
||||
|
||||
final firstDate = DateTime.fromMillisecondsSinceEpoch(sortedTimestamps.first);
|
||||
final lastDate = DateTime.fromMillisecondsSinceEpoch(sortedTimestamps.last);
|
||||
|
||||
return Container(
|
||||
height: 40,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF2A2F4A), // Lighter gray background
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'${firstDate.month}/${firstDate.day}',
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF888888),
|
||||
fontSize: 10,
|
||||
fontFamily: 'monospace',
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Slider(
|
||||
value: _xCenterPoint,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_xCenterPoint = value;
|
||||
});
|
||||
},
|
||||
activeColor: const Color(0xFF50E3C2),
|
||||
inactiveColor: const Color(0xFF1A1F3A),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${lastDate.month}/${lastDate.day}',
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF888888),
|
||||
fontSize: 10,
|
||||
fontFamily: 'monospace',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: archive
|
||||
sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.7"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -33,6 +41,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.4.0"
|
||||
cli_util:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cli_util
|
||||
sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.4.2"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -49,6 +65,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.19.1"
|
||||
console:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: console
|
||||
sha256: e04e7824384c5b39389acdd6dc7d33f3efe6b232f6f16d7626f194f6a01ad69a
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.0"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -168,6 +192,14 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
get_it:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: get_it
|
||||
sha256: ae78de7c3f2304b8d81f2bb6e320833e5e81de942188542328f074978cc0efa9
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.3.0"
|
||||
http:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -184,6 +216,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.2"
|
||||
image:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image
|
||||
sha256: "51555e36056541237b15b57afc31a0f53d4f9aefd9bd00873a6dc0090e54e332"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.6.0"
|
||||
intl:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -256,6 +296,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.17.0"
|
||||
msix:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: msix
|
||||
sha256: f88033fcb9e0dd8de5b18897cbebbd28ea30596810f4a7c86b12b0c03ace87e5
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.16.12"
|
||||
nested:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -264,6 +312,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
package_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_config
|
||||
sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
package_info_plus:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -360,6 +416,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.8"
|
||||
posix:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: posix
|
||||
sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.0.3"
|
||||
provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -368,6 +432,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.5+1"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pub_semver
|
||||
sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
screen_retriever:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -693,6 +765,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.6.1"
|
||||
yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: yaml
|
||||
sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.3"
|
||||
sdks:
|
||||
dart: ">=3.9.0 <4.0.0"
|
||||
flutter: ">=3.35.0"
|
||||
|
||||
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
version: 1.0.0+1
|
||||
version: 1.0.1+2
|
||||
|
||||
environment:
|
||||
sdk: '>=3.5.0 <4.0.0'
|
||||
@@ -87,6 +87,9 @@ dev_dependencies:
|
||||
# rules and activating additional ones.
|
||||
flutter_lints: ^5.0.0
|
||||
|
||||
# Windows installer creation
|
||||
msix: ^3.16.8
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
|
||||
@@ -130,3 +133,22 @@ flutter:
|
||||
#
|
||||
# For details regarding fonts from package dependencies,
|
||||
# see https://flutter.dev/to/font-from-package
|
||||
|
||||
# MSIX configuration for Windows installer
|
||||
msix_config:
|
||||
display_name: rmtPocketWatcher
|
||||
publisher_display_name: Lambda Banking Conglomerate
|
||||
identity_name: LambdaBankingConglomerate.rmtPocketWatcher
|
||||
msix_version: 1.0.1.0
|
||||
description: Star Citizen AUEC Price Tracker - Bloomberg-style terminal interface for real-time RMT price monitoring
|
||||
publisher: CN=Lambda Banking Conglomerate, O=Lambda Banking Conglomerate, C=US
|
||||
logo_path: assets/logo.png
|
||||
start_menu_icon_path: assets/logo.png
|
||||
tile_icon_path: assets/logo.png
|
||||
icons_background_color: transparent
|
||||
architecture: x64
|
||||
capabilities: 'internetClient,privateNetworkClientServer'
|
||||
store: false
|
||||
install_certificate: false
|
||||
certificate_path: certificates/rmtPocketWatcher.pfx
|
||||
certificate_password: rmtPocketWatcher2024!
|
||||
|
||||
110
flutter_app/sign_executable.ps1
Normal file
110
flutter_app/sign_executable.ps1
Normal file
@@ -0,0 +1,110 @@
|
||||
# Sign Executable Script for rmtPocketWatcher
|
||||
# Signs the standalone executable with the self-signed certificate
|
||||
|
||||
param(
|
||||
[string]$ExePath = "build\windows\standalone\rmtpocketwatcher.exe",
|
||||
[string]$CertPath = "certificates\rmtPocketWatcher.pfx",
|
||||
[string]$CertPassword = $(if ($env:CERT_PASSWORD) { $env:CERT_PASSWORD } else { "rmtPocketWatcher2024!" }),
|
||||
[switch]$Force = $false
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Write-Host "Signing rmtPocketWatcher Executable" -ForegroundColor Green
|
||||
Write-Host "===================================" -ForegroundColor Green
|
||||
|
||||
# Check if executable exists
|
||||
if (-not (Test-Path $ExePath)) {
|
||||
Write-Error "Executable not found at: $ExePath"
|
||||
Write-Host "Build the application first using .\build_windows.ps1" -ForegroundColor Yellow
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check if certificate exists
|
||||
if (-not (Test-Path $CertPath)) {
|
||||
Write-Error "Certificate not found at: $CertPath"
|
||||
Write-Host "Create a certificate first using .\create_certificate.ps1" -ForegroundColor Yellow
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check if already signed (unless forcing)
|
||||
if (-not $Force) {
|
||||
try {
|
||||
$signature = Get-AuthenticodeSignature -FilePath $ExePath
|
||||
if ($signature.Status -eq "Valid") {
|
||||
Write-Host "Executable is already signed and valid" -ForegroundColor Green
|
||||
Write-Host "Certificate: $($signature.SignerCertificate.Subject)" -ForegroundColor Cyan
|
||||
Write-Host "Use -Force to re-sign" -ForegroundColor Yellow
|
||||
return
|
||||
}
|
||||
} catch {
|
||||
# File not signed or error checking, continue with signing
|
||||
}
|
||||
}
|
||||
|
||||
# Find SignTool
|
||||
Write-Host "Looking for SignTool..." -ForegroundColor Yellow
|
||||
$signtool = $null
|
||||
|
||||
# Common SignTool locations
|
||||
$signToolPaths = @(
|
||||
"${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.22621.0\x64\signtool.exe",
|
||||
"${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe",
|
||||
"${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.18362.0\x64\signtool.exe"
|
||||
)
|
||||
|
||||
foreach ($path in $signToolPaths) {
|
||||
if (Test-Path $path) {
|
||||
$signtool = $path
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
# If not found in common locations, search for it
|
||||
if (-not $signtool) {
|
||||
Write-Host "Searching for SignTool in Windows Kits..." -ForegroundColor Yellow
|
||||
$foundSignTools = Get-ChildItem -Path "${env:ProgramFiles(x86)}\Windows Kits" -Recurse -Name "signtool.exe" -ErrorAction SilentlyContinue
|
||||
if ($foundSignTools) {
|
||||
$signtool = Join-Path "${env:ProgramFiles(x86)}\Windows Kits" $foundSignTools[0]
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $signtool -or -not (Test-Path $signtool)) {
|
||||
Write-Error "SignTool not found. Please install Windows SDK."
|
||||
Write-Host "Download from: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/" -ForegroundColor Yellow
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Found SignTool: $signtool" -ForegroundColor Cyan
|
||||
|
||||
# Sign the executable
|
||||
Write-Host "Signing executable: $ExePath" -ForegroundColor Yellow
|
||||
try {
|
||||
& $signtool sign `
|
||||
/f $CertPath `
|
||||
/p $CertPassword `
|
||||
/fd SHA256 `
|
||||
/tr http://timestamp.digicert.com `
|
||||
/td SHA256 `
|
||||
/d "rmtPocketWatcher" `
|
||||
/du "https://git.hudsonriggs.systems/LambdaBankingConglomerate/rmtPocketWatcher" `
|
||||
$ExePath
|
||||
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "✅ Executable signed successfully!" -ForegroundColor Green
|
||||
|
||||
# Verify the signature
|
||||
$signature = Get-AuthenticodeSignature -FilePath $ExePath
|
||||
Write-Host "Signature Status: $($signature.Status)" -ForegroundColor Cyan
|
||||
Write-Host "Signer Certificate: $($signature.SignerCertificate.Subject)" -ForegroundColor Cyan
|
||||
Write-Host "Timestamp: $($signature.TimeStamperCertificate.NotBefore)" -ForegroundColor Cyan
|
||||
|
||||
} else {
|
||||
Write-Error "Failed to sign executable (Exit code: $LASTEXITCODE)"
|
||||
}
|
||||
} catch {
|
||||
Write-Error "Error signing executable: $($_.Exception.Message)"
|
||||
}
|
||||
|
||||
Write-Host "`n🎉 Code signing completed!" -ForegroundColor Green
|
||||
Write-Host "The executable should now be trusted by Windows" -ForegroundColor Green
|
||||
Reference in New Issue
Block a user