mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 01:01:56 +01:00
Revert "feat: filter apps by patch count"
This reverts commit d78868b462
.
This commit is contained in:
parent
4505f10e50
commit
d7624e5e1f
2 changed files with 5 additions and 6 deletions
|
@ -94,14 +94,15 @@ class PatcherAPI {
|
|||
return filteredApps;
|
||||
}
|
||||
|
||||
List<Patch> getFilteredPatches(String packageName) {
|
||||
Future<List<Patch>> getFilteredPatches(String packageName) async {
|
||||
List<Patch> filteredPatches = [];
|
||||
_patches.forEach((patch) {
|
||||
if (patch.compatiblePackages.isEmpty) {
|
||||
filteredPatches.add(patch);
|
||||
} else {
|
||||
if (!patch.name.contains('settings') &&
|
||||
patch.compatiblePackages.any((pack) => pack.name == packageName)) {
|
||||
patch.compatiblePackages.any((pack) => pack.name == packageName)
|
||||
) {
|
||||
filteredPatches.add(patch);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'dart:io';
|
|||
import 'package:device_apps/device_apps.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/models/patched_application.dart';
|
||||
import 'package:revanced_manager/services/patcher_api.dart';
|
||||
|
@ -21,10 +22,7 @@ class AppSelectorViewModel extends BaseViewModel {
|
|||
|
||||
Future<void> initialize() async {
|
||||
apps.addAll(await _patcherAPI.getFilteredInstalledApps());
|
||||
apps.sort(((a, b) => _patcherAPI
|
||||
.getFilteredPatches(b.packageName)
|
||||
.length
|
||||
.compareTo(_patcherAPI.getFilteredPatches(a.packageName).length)));
|
||||
apps.sort((a, b) => a.appName.compareTo(b.appName));
|
||||
noApps = apps.isEmpty;
|
||||
notifyListeners();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue