Skip to content

Latest commit

Β 

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AmnShield Desktop - Unified Guardian

A modern Flutter desktop application for Windows that unifies desktop process monitoring, blocking, and configuration settings into a single, fast, and maintainable cross-platform solution.

πŸš€ Migration Summary

What Was Converted

From C# Desktop App (AmnShield-Desktop-App):

  • βœ… Password protection with encryption (SHA-256 + AES)
  • βœ… Application discovery from registry and file system
  • βœ… Process monitoring and blocking
  • βœ… Advanced scheduling (Always, Weekdays, Weekend, Custom time ranges)
  • βœ… Browser URL blocking via Windows registry
  • βœ… System tray integration
  • βœ… Admin privilege detection
  • βœ… Modern Material Design UI

From Electron Manager (AmnShield-Desktop-Manager):

  • βœ… Quick launch dashboard
  • βœ… Search functionality
  • βœ… Todo list management
  • βœ… Notes/memo feature
  • βœ… System power controls (Lock, Shutdown, Restart)
  • βœ… Alt+Space hotkey support (via window_manager)
  • βœ… Clean, modern interface

πŸ“ Project Structure

lib/
β”œβ”€β”€ main.dart                 # App entry point with Hive & window setup
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ blocked_app.dart      # App blocking model with scheduling
β”‚   β”œβ”€β”€ todo_item.dart        # Todo list items
β”‚   └── installed_application.dart  # Discovered apps
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ password_service.dart # Password encryption & verification
β”‚   β”œβ”€β”€ guardian_service.dart # Process monitoring & blocking
β”‚   └── windows_service.dart  # Windows API integration
β”œβ”€β”€ screens/
β”‚   β”œβ”€β”€ splash_screen.dart    # Initial loading screen
β”‚   β”œβ”€β”€ home_screen.dart      # Main app with navigation
β”‚   β”œβ”€β”€ dashboard_tab.dart    # Dashboard with status & quick actions
β”‚   β”œβ”€β”€ apps_tab.dart         # App management (to be implemented)
β”‚   β”œβ”€β”€ browser_tab.dart      # Browser controls (to be implemented)
β”‚   └── security_tab.dart     # Security settings (to be implemented)
β”œβ”€β”€ widgets/                  # Reusable UI components
β”œβ”€β”€ providers/                # Riverpod state management
└── utils/                    # Helper functions

πŸ”§ Setup Instructions

Prerequisites

  • Flutter SDK 3.5.0+
  • Windows 10/11
  • Visual Studio C++ Build Tools (for native compilation)

Installation

  1. Install Dependencies
cd c:\Users\habib\PROJECTS\AmnShield\AmnShield_flutter
flutter pub get
  1. Generate Hive Adapters
flutter pub run build_runner build --delete-conflicting-outputs
  1. Run the Application
flutter run -d windows
  1. Build Release
flutter build windows --release

🎯 Key Features

Security

  • Encrypted Password Storage: Uses flutter_secure_storage with SHA-256 hashing
  • Default Password: deen (can be changed from Security tab)
  • Minimum Password Length: 4 characters

App Protection

  • Full Block: Terminates app immediately when detected
  • Scheduled Block: Block only during specific times/days
    • Always: Block 24/7
    • Weekdays: Monday-Friday
    • Weekend: Saturday-Sunday
    • Custom: e.g., "Mon,Wed,Fri 08:00-17:00"

System Integration

  • Process Monitoring: Checks every 2 seconds
  • Admin Detection: Warns if not running with elevated privileges
  • Registry Management: Blocks Chrome/Edge extension pages
  • System Tray: Minimizes to tray instead of closing

Dashboard Features

  • Live Clock: Current time and date
  • Status Cards: Guardian status and protected app count
  • Quick Search: Launch web searches
  • Todo List: Track tasks
  • Notes: Quick memo taking

πŸ”¨ Development Roadmap

Phase 1: Core Functionality βœ…

  • Project structure
  • Models and services
  • Basic UI navigation
  • Complete Hive adapter generation
  • Test basic app flow

Phase 2: App Management

  • Full apps tab implementation
  • Application discovery dialog
  • Add/remove blocked apps
  • Schedule editor dialog
  • App filtering and search

Phase 3: Browser & Security

  • Browser tab with URL list
  • Registry integration for Chrome/Edge
  • Security tab with password reset
  • Admin privilege request

Phase 4: Dashboard Enhancement

  • Full todo list CRUD
  • Notes persistence (Hive)
  • Quick launch tiles
  • Power controls integration
  • Search integration with url_launcher

Phase 5: Polish & Distribution

  • System tray with context menu
  • Global hotkey (Alt+Space)
  • Auto-start on Windows boot
  • Installer creation
  • App icon and branding

πŸ“¦ Dependencies

Core

  • flutter_riverpod: State management
  • hive & hive_flutter: Local database
  • window_manager: Window controls & hotkeys

Security

  • flutter_secure_storage: Secure password storage
  • encrypt: AES encryption
  • crypto: Hashing algorithms

Windows

  • win32: Windows API access
  • ffi: Native code interop

Utilities

  • shared_preferences: Simple key-value storage
  • path_provider: File system paths
  • url_launcher: Open URLs & files
  • intl: Date/time formatting

πŸ”„ Migration Benefits

Why Flutter vs C# WinForms?

  1. Modern UI: Material Design 3, smooth animations
  2. Hot Reload: Instant UI updates during development
  3. Cross-Platform Ready: Easy to port to macOS/Linux
  4. Smaller Binary: ~25MB vs ~100MB+ with .NET runtime
  5. Better Performance: Native rendering, GPU acceleration
  6. Easier Maintenance: Simpler codebase, better tooling

Why Flutter vs Electron?

  1. Smaller Size: ~25MB vs ~150MB+ (Chromium overhead)
  2. Better Performance: Native widgets vs web rendering
  3. Lower Memory: ~50MB vs ~200MB+ RAM usage
  4. Faster Startup: <1s vs 2-3s
  5. Native Feel: OS-native controls and behaviors

πŸ› οΈ Windows-Specific Features

Process Management

WindowsService.killProcess('spotify');
WindowsService.isProcessRunning('chrome');
WindowsService.getRunningProcesses();

Registry Operations

WindowsService.updateBrowserBlocklist(true, [
  'chrome://extensions',
  'edge://extensions',
]);

Power Controls

WindowsService.lockWorkstation();
WindowsService.shutdown();
WindowsService.restart();

πŸ› Known Issues & Limitations

  1. Admin Rights Required: For registry modifications and some process operations
  2. Windows Only: Currently targets Windows 10/11 (can be extended)
  3. No UWP/Store Apps: Can only manage Win32 executables
  4. Manual Refresh: App list doesn't auto-update (requires manual scan)

πŸ“ Development Notes

Testing Without Admin

Most features work without admin except:

  • Browser URL blocking (registry)
  • Some protected process termination
  • System-wide hooks

Debugging

# Run with verbose logging
flutter run -d windows -v

# Check for Windows-specific issues
flutter doctor -v

Building

# Debug build (faster, includes DevTools)
flutter build windows

# Release build (optimized, smaller)
flutter build windows --release

# Executable location:
# build/windows/runner/Release/amnshield_flutter.exe

🀝 Next Steps

  1. Install dependencies: flutter pub get
  2. Generate Hive adapters: flutter pub run build_runner build
  3. Run the app: flutter run -d windows
  4. Implement remaining tabs: Apps, Browser, Security
  5. Add system tray integration
  6. Test all features thoroughly

πŸ“„ License

Same as original AmnShield projects.

πŸ”— Related Projects

  • AmnShield Extension: Browser extension (Chrome/Firefox)
  • Original C# App: AmnShield-Desktop-App
  • Original Electron Manager: AmnShield-Desktop-Manager

Built with ❀️ using Flutter