Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 26, 2025

This PR implements the integration of the flutter_appavailability package as requested in the issue to enable users to view and select installed apps when reporting security vulnerabilities.

What's Changed

Package Integration

  • Added flutter_appavailability: ^0.0.9 dependency to pubspec.yaml
  • Added required QUERY_ALL_PACKAGES permission to AndroidManifest.xml for app discovery on Android

New Components

  • InstalledAppsService: Service class handling app discovery, filtering system apps, and sorting alphabetically
  • InstalledAppsWidget: Reusable UI widget with expandable interface, multi-select functionality, and comprehensive error handling

Report Bug Form Enhancement

The bug reporting form now includes an "Installed Apps for Vulnerability Scan" section that allows users to:

  • View all installed apps on their device (excluding system apps)
  • Select multiple apps that may be relevant to the security issue
  • Provide additional context for vulnerability researchers

Data Model Updates

  • Extended Issue model to include installedApps field
  • Selected apps are sent to the backend as {appName, packageName} objects
  • App data only included in API calls when user makes selections

UI Features

  • Expandable Section: Clean collapsible interface that doesn't clutter the form
  • Loading States: Progress indicator while fetching apps from device
  • Error Handling: Retry functionality if app loading fails
  • Badge Counter: Visual indicator showing number of selected apps
  • Scrollable List: Fixed height (250px) container for devices with many apps
  • Privacy Conscious: Automatically filters out system apps

Screenshot

Installed Apps Widget

The collapsed state of the installed apps widget integrated into the report bug form

Benefits

This enhancement helps security researchers by providing context about which applications users were interacting with when security issues occurred, enabling more targeted vulnerability analysis and better issue categorization.

Files Changed

  • pubspec.yaml - Added flutter_appavailability dependency
  • lib/src/pages/home/report_bug.dart - Integrated widget and updated Issue creation
  • lib/src/models/issue_model.dart - Added installedApps field
  • lib/src/util/services/installed_apps_service.dart - New service class
  • lib/src/util/widgets/installed_apps_widget.dart - New UI widget
  • android/app/src/main/AndroidManifest.xml - Added required permissions
  • test/installed_apps_integration_test.dart - Integration tests

Fixes #[issue_number]

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.24.5-stable.tar.xz
    • Triggering command: curl -fsSL REDACTED -o flutter.tar.xz (http block)
    • Triggering command: wget -q REDACTED -O flutter.tar.xz (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>For the app integrate the flutter_appavailability</issue_title>
<issue_description>To integrate the flutter_appavailability package into your app, you can follow these steps:

  1. Add the flutter_appavailability package to your project by adding the following line to your pubspec.yaml file:
dependencies:
  flutter_appavailability: ^0.5.2+1

  1. Import the package in your Dart file where you want to use it:
import 'package:flutter_appavailability/flutter_appavailability.dart';

  1. Use the getInstalledApps() method to get a list of installed apps on the device:
List&lt;Application&gt; installedApps = [];

void getInstalledApps() async {
  List&lt;Application&gt; apps = await AppAvailability.getInstalledApps();
  setState(() {
    installedApps = apps;
  });
}

In this example, we're using the getInstalledApps() method from the flutter_appavailability package to get a list of all installed apps on the device. The getInstalledApps() method returns a List&lt;Application&gt; object containing information about each installed app, such as the app name, package name, and icon.

  1. Display the list of installed apps in your app's UI.
ListView.builder(
  itemCount: installedApps.length,
  itemBuilder: (context, index) {
    return ListTile(
      leading: CircleAvatar(
        backgroundImage: MemoryImage(installedApps[index].icon),
      ),
      title: Text(installedApps[index].appName),
      subtitle: Text(installedApps[index].packageName),
    );
  },
)

In this example, we're using a ListView.builder widget to display the list of installed apps in a scrollable list. Each app is displayed as a ListTile widget, with the app icon, name, and package name shown.

  1. Use the installed app list when reporting an issue.
    You can use the installed app list to provide additional information when reporting an issue in your app. For example, you could ask the user to select the app they were using when the issue occurred, and include this information in the bug report.
    Note that the getInstalledApps() method can take a long time to complete on devices with many installed apps, so you should consider using a loading indicator while the list is being fetched.
    </issue_description>

<agent_instructions>please integrate this plugin so that the app will show what apps are installed with the user's permission in order to scan for vulnerabilities and report it to the user</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@justary27 @fredfalcon What's this issue about? Show installed apps in our app? @justary27 Done. @WaniAthar @DonnieBLT It looks like this didn't make it in to the code, it's still a useful feature. @DonnieBLT @coderabbitai please code this flutter feature for the BLT-Flutter repo
Fixes OWASP-BLT/BLT#3355

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] For the app integrate the flutter_appavailability Integrate flutter_appavailability package for vulnerability scanning Sep 26, 2025
@Copilot Copilot AI requested a review from DonnieBLT September 26, 2025 15:58
Copilot finished work on behalf of DonnieBLT September 26, 2025 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

For the app integrate the flutter_appavailability

2 participants