mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
fix: use original package name to load patches.
This commit is contained in:
parent
3ab5d12f3e
commit
b550016681
@ -72,14 +72,10 @@ class PatcherAPI {
|
||||
}
|
||||
|
||||
Future<List<Patch>> getFilteredPatches(String packageName) async {
|
||||
String newPackageName = packageName.replaceFirst(
|
||||
'app.revanced.',
|
||||
'com.google.',
|
||||
);
|
||||
return _patches
|
||||
.where((patch) =>
|
||||
!patch.name.contains('settings') &&
|
||||
patch.compatiblePackages.any((pack) => pack.name == newPackageName))
|
||||
patch.compatiblePackages.any((pack) => pack.name == packageName))
|
||||
.toList();
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
||||
|
||||
Future<void> initialize() async {
|
||||
patches.addAll(await _patcherAPI.getFilteredPatches(
|
||||
locator<PatcherViewModel>().selectedApp!.packageName,
|
||||
locator<PatcherViewModel>().selectedApp!.originalPackageName,
|
||||
));
|
||||
patches.sort((a, b) => a.name.compareTo(b.name));
|
||||
notifyListeners();
|
||||
@ -74,8 +74,7 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
||||
query.isEmpty ||
|
||||
query.length < 2 ||
|
||||
patch.name.toLowerCase().contains(query.toLowerCase()) ||
|
||||
patch.getSimpleName().toLowerCase().contains(query.toLowerCase())
|
||||
)
|
||||
patch.getSimpleName().toLowerCase().contains(query.toLowerCase()))
|
||||
.toList();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user