mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
15 lines
594 B
Dart
15 lines
594 B
Dart
import 'package:revanced_manager/app/app.locator.dart';
|
|
import 'package:revanced_manager/models/patch.dart';
|
|
import 'package:revanced_manager/models/patched_application.dart';
|
|
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
|
|
|
bool isPatchSupported(Patch patch) {
|
|
final PatchedApplication app = locator<PatcherViewModel>().selectedApp!;
|
|
return patch.compatiblePackages.isEmpty ||
|
|
patch.compatiblePackages.any(
|
|
(pack) =>
|
|
pack.name == app.packageName &&
|
|
(pack.versions.isEmpty || pack.versions.contains(app.version)),
|
|
);
|
|
}
|