Skip to content

Latest commit

Β 

History

History
315 lines (225 loc) Β· 7.39 KB

File metadata and controls

315 lines (225 loc) Β· 7.39 KB

Flutter Flatseal

A Flutter application that manages Flatpak sandbox permissions, inspired by the original Flatseal project.

Features

  • πŸ” View Installed Apps: Browse all Flatpak applications installed on your system
  • πŸ” Manage Permissions: Control filesystem access, device access, sockets, and other permissions
  • 🎨 Modern UI: Flutter-native Material Design interface
  • πŸ–₯️ Desktop-First: Optimized for Linux desktop with GTK support
  • πŸ”„ Real-time Updates: Instantly apply permission changes
  • πŸ”™ Reset Overrides: Easily restore default permissions

Screenshots

The application features a two-pane layout:

  • Left Pane: Searchable list of installed Flatpak applications
  • Right Pane: Detailed permission settings for the selected application

Prerequisites

  • Flutter SDK (3.0.0 or later)
  • Flatpak (installed and configured on your system)
  • Linux Desktop Environment (for full functionality)
  • GTK 3.0+ (for Linux desktop builds)

Installing Flatpak

If you don't have Flatpak installed:

# Ubuntu/Debian
sudo apt install flatpak

# Fedora
sudo dnf install flatpak

# Arch Linux
sudo pacman -S flatpak

Building the Application

1. Clone the Repository

git clone https://github.com/meta-flutter/flutter-flatseal.git
cd flutter-flatseal

2. Install Dependencies

flutter pub get

3. Enable Linux Desktop Support (if not already enabled)

flutter config --enable-linux-desktop

4. Build for Linux

flutter build linux --release

The built application will be located at:

build/linux/x64/release/bundle/

Running the Application

Development Mode

Run directly with Flutter:

flutter run -d linux

Production Build

After building, run the executable:

./build/linux/x64/release/bundle/flutter_flatseal

Installation

Manual Installation

  1. Build the application (see above)
  2. Copy the bundle to your preferred location:
sudo cp -r build/linux/x64/release/bundle /opt/flutter-flatseal
sudo ln -s /opt/flutter-flatseal/flutter_flatseal /usr/local/bin/flutter-flatseal
  1. Install the desktop entry:
sudo cp linux/flutter_flatseal.desktop /usr/share/applications/

CMake Installation

cd build/linux/x64/release
sudo cmake --install . --prefix /usr

Usage

  1. Launch the Application

    • From application menu: Search for "Flutter Flatseal"
    • From terminal: flutter-flatseal or flutter run
  2. Select an Application

    • Browse or search for a Flatpak app in the left pane
    • Click on an app to view its permissions
  3. Manage Permissions

    • Toggle switches to enable/disable specific permissions
    • Changes are applied immediately
    • Look for categories: Filesystem, Devices, Sockets, Features, Network
  4. Reset Overrides

    • Click the restore icon in the app header
    • Confirm to reset all custom permissions to defaults

Project Structure

flutter-flatseal/
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ main.dart              # Application entry point
β”‚   β”œβ”€β”€ models/                # Data models
β”‚   β”‚   β”œβ”€β”€ flatpak_app.dart   # Flatpak application model
β”‚   β”‚   └── permission.dart    # Permission definitions
β”‚   β”œβ”€β”€ services/              # Business logic
β”‚   β”‚   └── flatpak_service.dart  # Flatpak command interaction
β”‚   β”œβ”€β”€ screens/               # Main screens
β”‚   β”‚   └── home_screen.dart   # Home screen with app list
β”‚   └── widgets/               # Reusable UI components
β”‚       β”œβ”€β”€ app_list.dart      # Application list widget
β”‚       β”œβ”€β”€ permission_details.dart  # Permission view
β”‚       └── permission_group.dart    # Permission category
β”œβ”€β”€ linux/                     # Linux desktop configuration
β”‚   β”œβ”€β”€ CMakeLists.txt
β”‚   β”œβ”€β”€ main.cc
β”‚   β”œβ”€β”€ my_application.cc/h
β”‚   └── flutter_flatseal.desktop
β”œβ”€β”€ test/                      # Unit tests
└── pubspec.yaml              # Dependencies

Permissions Categories

The application manages the following permission categories:

Filesystem Access

  • Home directory
  • All system files
  • XDG directories (Downloads, Documents, Pictures, Music, Videos)

Device Access

  • All devices
  • GPU acceleration (DRI)
  • Virtualization (KVM)

Sockets

  • X11/Wayland display servers
  • PulseAudio sound system
  • D-Bus (session and system)
  • SSH authentication agent
  • Smart cards (PCSC)
  • CUPS printing

Features

  • Development tools
  • Bluetooth
  • Network access
  • Multi-architecture support

Development

Running Tests

flutter test

Code Analysis

flutter analyze

Format Code

flutter format lib/

Packaging

Snap Package (Planned)

# Coming soon
snapcraft

Flatpak Package (Planned)

# Coming soon
flatpak-builder --force-clean build-dir com.example.FlutterFlatseal.yml

AppImage (Planned)

AppImage packaging will be added in future releases.

Troubleshooting

Flatpak Not Found

Error: "Flatpak is not installed on this system"

Solution: Install Flatpak using your distribution's package manager (see Prerequisites)

Permission Denied

Error: Failed to override permissions

Solution: Ensure you have proper permissions. Some operations may require sudo:

sudo flutter-flatseal

No Applications Shown

Issue: Application list is empty

Causes:

  • No Flatpak applications installed
  • Flatpak not properly configured

Solution: Install Flatpak apps or check Flatpak installation:

flatpak list --app

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Comparison with Original Flatseal

This Flutter implementation provides:

  • βœ… Modern Material Design UI
  • βœ… Fast, native performance via Flutter
  • βœ… Easy to extend and maintain
  • βœ… Matches core Flatseal functionality
  • βœ… Linux desktop focused

Original Flatseal advantages:

  • More mature and battle-tested
  • GTK native (better desktop integration)
  • Broader Linux distribution support

License

This project is intended as a Flutter implementation study of Flatseal functionality.

Original Flatseal: Copyright Β© 2020-2024 Martin Abente Lahaye (GPLv3)

Acknowledgments

  • Original Flatseal by Martin Abente Lahaye
  • Flutter team for the excellent framework
  • Flatpak community for the sandboxing technology

Roadmap

  • Basic application listing
  • Permission viewing
  • Permission overrides
  • Linux desktop support
  • Advanced permission editing (custom paths, environment variables)
  • D-Bus permission management
  • Import/Export permission profiles
  • Multiple application selection
  • Undo/Redo functionality
  • Search and filter improvements
  • Package as Snap/Flatpak/AppImage

Support

For issues, questions, or suggestions:

  • Open an issue on GitHub
  • Check existing issues for similar problems
  • Provide detailed information about your system and the issue