From 0fe9bf8540e1cdf7c6d0a711ec6a0df8d106edcc Mon Sep 17 00:00:00 2001 From: okmsbun Date: Sun, 1 Nov 2026 13:38:20 +0300 Subject: [PATCH 1/4] Update README and API to enhance app listing filters and bump version to 1.1.0 --- README.md | 6 ++--- ...lutter_device_apps_platform_interface.dart | 23 ++++++------------- pubspec.yaml | 6 ++--- test/package_queries_test.dart | 5 +++- 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 1bba01b..ece9333 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# flutter\_device\_apps\_platform\_interface +# flutter_device_apps_platform_interface

Pub -Star on Github -Flutter Website +flutter_device_apps Pub points +Star on Github License: MIT Umbrella Package

diff --git a/lib/flutter_device_apps_platform_interface.dart b/lib/flutter_device_apps_platform_interface.dart index f00f208..919d508 100644 --- a/lib/flutter_device_apps_platform_interface.dart +++ b/lib/flutter_device_apps_platform_interface.dart @@ -221,13 +221,17 @@ abstract class FlutterDeviceAppsPlatform extends PlatformInterface { /// Lists installed apps. /// - /// [packageNamePrefix] filters package names with a case-sensitive prefix - /// before loading app metadata and icons. Null or empty disables this filter. + /// [packageNamePrefix] matches the start of a package name, and + /// [packageNameContains] matches a substring anywhere in a package name. + /// Both filters are case-sensitive and run before loading app metadata and + /// icons. Null or empty disables each filter independently. When both are + /// provided, both must match. Future> listApps({ bool includeSystem = false, bool onlyLaunchable = true, bool includeIcons = false, String? packageNamePrefix, + String? packageNameContains, }); /// Gets details for a single app. @@ -300,14 +304,6 @@ abstract class FlutterDeviceAppsPlatform extends PlatformInterface { /// API 30, only installingPackageName is available. A returned model can have /// null fields when Android does not provide the corresponding information. Future getInstallSourceInfo(String packageName); - - /// Gets the installer store for the specified package name. - /// - /// Platform implementations should return the installer store for the given package. - /// Returns the installer store name or null if not available. - // Newly deprecated; retain the method for backwards compatibility. - @Deprecated('Use getInstallSourceInfo() and its installingPackageName instead.') - Future getInstallerStore(String packageName); } /// Default no-op implementation to throw if no platform is registered. @@ -320,6 +316,7 @@ class _UnimplementedPlatform extends FlutterDeviceAppsPlatform { bool onlyLaunchable = true, bool includeIcons = false, String? packageNamePrefix, + String? packageNameContains, }) => Future.error(UnsupportedError('FlutterDeviceAppsPlatform not implemented')); @override @@ -369,10 +366,4 @@ class _UnimplementedPlatform extends FlutterDeviceAppsPlatform { @override Future getInstallSourceInfo(String packageName) => Future.error(UnsupportedError('FlutterDeviceAppsPlatform not implemented')); - - @override - // Newly deprecated; retain the method for backwards compatibility. - @Deprecated('Use getInstallSourceInfo() and its installingPackageName instead.') - Future getInstallerStore(String packageName) => - Future.error(UnsupportedError('FlutterDeviceAppsPlatform not implemented')); } diff --git a/pubspec.yaml b/pubspec.yaml index f159559..2837f2f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,9 @@ name: flutter_device_apps_platform_interface description: Platform-agnostic API contract for flutter_device_apps (federated). -version: 1.0.0 +version: 1.1.0 repository: https://github.com/okmsbun/flutter_device_apps_platform_interface issue_tracker: https://github.com/okmsbun/flutter_device_apps/issues topics: - - flutter - - android - installed-apps - app-management - package-manager @@ -18,4 +16,4 @@ dependencies: dev_dependencies: lints: 6.1.0 - test: 1.32.0 + test: 1.33.0 diff --git a/test/package_queries_test.dart b/test/package_queries_test.dart index a41e529..023cb12 100644 --- a/test/package_queries_test.dart +++ b/test/package_queries_test.dart @@ -4,7 +4,10 @@ import 'package:test/test.dart'; void main() { test('an unregistered platform still reports unsupported operations', () async { final FlutterDeviceAppsPlatform platform = FlutterDeviceAppsPlatform.instance; - await expectLater(platform.listApps(packageNamePrefix: 'com.example.'), throwsUnsupportedError); + await expectLater( + platform.listApps(packageNamePrefix: 'com.', packageNameContains: 'example'), + throwsUnsupportedError, + ); await expectLater(platform.getAppIcon('com.example.user'), throwsUnsupportedError); await expectLater(platform.isAppInstalled('com.example.user'), throwsUnsupportedError); await expectLater(platform.isSystemApp('com.example.user'), throwsUnsupportedError); From 0e53b2e1f792378fdde4c98802e3682f392d9ab7 Mon Sep 17 00:00:00 2001 From: okmsbun Date: Sun, 1 Nov 2026 13:51:50 +0300 Subject: [PATCH 2/4] Add getApps method to FlutterDeviceAppsPlatform and update tests for unsupported operations --- lib/flutter_device_apps_platform_interface.dart | 13 +++++++++++++ test/package_queries_test.dart | 1 + 2 files changed, 14 insertions(+) diff --git a/lib/flutter_device_apps_platform_interface.dart b/lib/flutter_device_apps_platform_interface.dart index 919d508..2101c7d 100644 --- a/lib/flutter_device_apps_platform_interface.dart +++ b/lib/flutter_device_apps_platform_interface.dart @@ -237,6 +237,15 @@ abstract class FlutterDeviceAppsPlatform extends PlatformInterface { /// Gets details for a single app. Future getApp(String packageName, {bool includeIcon = false}); + /// Gets installed apps by their exact [packageNames] without listing all apps. + /// + /// Returns each available package once, in order of its first occurrence. + /// Missing, hidden, and blank package names are skipped. An empty input returns + /// an empty list. Names are case-sensitive and are not trimmed. + /// Includes system apps and apps without a launcher entry when visible. + /// Set [includeIcons] to load icons alongside app metadata (default: false). + Future> getApps(List packageNames, {bool includeIcons = false}); + /// Gets the app icon as PNG bytes without loading the full app metadata. /// /// Returns null when the package is missing, not visible, or its icon resources @@ -323,6 +332,10 @@ class _UnimplementedPlatform extends FlutterDeviceAppsPlatform { Future getApp(String packageName, {bool includeIcon = false}) => Future.error(UnsupportedError('FlutterDeviceAppsPlatform not implemented')); + @override + Future> getApps(List packageNames, {bool includeIcons = false}) => + Future.error(UnsupportedError('FlutterDeviceAppsPlatform not implemented')); + @override Future getAppIcon(String packageName) => Future.error(UnsupportedError('FlutterDeviceAppsPlatform not implemented')); diff --git a/test/package_queries_test.dart b/test/package_queries_test.dart index 023cb12..c6e89cc 100644 --- a/test/package_queries_test.dart +++ b/test/package_queries_test.dart @@ -9,6 +9,7 @@ void main() { throwsUnsupportedError, ); await expectLater(platform.getAppIcon('com.example.user'), throwsUnsupportedError); + await expectLater(platform.getApps(['com.example.user']), throwsUnsupportedError); await expectLater(platform.isAppInstalled('com.example.user'), throwsUnsupportedError); await expectLater(platform.isSystemApp('com.example.user'), throwsUnsupportedError); await expectLater(platform.isAppEnabled('com.example.user'), throwsUnsupportedError); From f7fad44089c04054e8c916a870b732db16a7de50 Mon Sep 17 00:00:00 2001 From: okmsbun Date: Sun, 1 Nov 2026 15:32:37 +0300 Subject: [PATCH 3/4] Add detectAppFrameworks method to FlutterDeviceAppsPlatform and update tests --- ...lutter_device_apps_platform_interface.dart | 36 +++++++++++++++++++ test/package_queries_test.dart | 1 + 2 files changed, 37 insertions(+) diff --git a/lib/flutter_device_apps_platform_interface.dart b/lib/flutter_device_apps_platform_interface.dart index 2101c7d..03da0bd 100644 --- a/lib/flutter_device_apps_platform_interface.dart +++ b/lib/flutter_device_apps_platform_interface.dart @@ -4,6 +4,30 @@ import 'package:plugin_platform_interface/plugin_platform_interface.dart'; import 'flutter_device_apps_app_change_event.dart'; +/// Framework or runtime families identified by known Android APK library names. +/// +/// A match indicates a packaged component, not which technology renders every +/// screen or whether that component is currently in use. +enum AppFramework { + /// Flutter engine libraries. + flutter, + + /// React Native libraries, including the legacy JNI library. + reactNative, + + /// Unity engine libraries. + unity, + + /// Unreal Engine libraries, including the legacy UE4 library. + unrealEngine, + + /// Godot engine libraries. + godot, + + /// .NET Android runtime glue; does not distinguish MAUI from Xamarin. + dotnetAndroid, +} + /// Information about an installed app on the device. /// /// Contains metadata like package name, version, install times, and optional icon data. @@ -246,6 +270,14 @@ abstract class FlutterDeviceAppsPlatform extends PlatformInterface { /// Set [includeIcons] to load icons alongside app metadata (default: false). Future> getApps(List packageNames, {bool includeIcons = false}); + /// Detects known framework library names in the base and installed split APKs. + /// + /// Returns unique matches in [AppFramework.values] order. An empty list means + /// no supported indicator was found after all APKs were read successfully. + /// Throws if [packageName] is blank, missing or hidden, or any APK cannot be + /// read. Does not inspect DEX code or determine the app's primary UI framework. + Future> detectAppFrameworks(String packageName); + /// Gets the app icon as PNG bytes without loading the full app metadata. /// /// Returns null when the package is missing, not visible, or its icon resources @@ -336,6 +368,10 @@ class _UnimplementedPlatform extends FlutterDeviceAppsPlatform { Future> getApps(List packageNames, {bool includeIcons = false}) => Future.error(UnsupportedError('FlutterDeviceAppsPlatform not implemented')); + @override + Future> detectAppFrameworks(String packageName) => + Future.error(UnsupportedError('FlutterDeviceAppsPlatform not implemented')); + @override Future getAppIcon(String packageName) => Future.error(UnsupportedError('FlutterDeviceAppsPlatform not implemented')); diff --git a/test/package_queries_test.dart b/test/package_queries_test.dart index c6e89cc..66f7d9f 100644 --- a/test/package_queries_test.dart +++ b/test/package_queries_test.dart @@ -10,6 +10,7 @@ void main() { ); await expectLater(platform.getAppIcon('com.example.user'), throwsUnsupportedError); await expectLater(platform.getApps(['com.example.user']), throwsUnsupportedError); + await expectLater(platform.detectAppFrameworks('com.example.user'), throwsUnsupportedError); await expectLater(platform.isAppInstalled('com.example.user'), throwsUnsupportedError); await expectLater(platform.isSystemApp('com.example.user'), throwsUnsupportedError); await expectLater(platform.isAppEnabled('com.example.user'), throwsUnsupportedError); From 48842e5837ae119a71b001432640ee9f5646f690 Mon Sep 17 00:00:00 2001 From: okmsbun Date: Sun, 1 Nov 2026 16:27:43 +0300 Subject: [PATCH 4/4] Update CHANGELOG for version 1.1.0: add breaking changes and new AppFramework enum --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2375a3c..40abe04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 1.1.0 + +- **BREAKING**: Implementations must add `getApps` and `detectAppFrameworks`. +- **BREAKING**: Added `packageNameContains` to `listApps`; combine filters with AND. +- **BREAKING**: Removed `getInstallerStore`; use `getInstallSourceInfo`. +- Added the `AppFramework` enum. + ## 1.0.0 - **BREAKING**: Raised the minimum Dart SDK version to 3.12.0.