mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
fix: update name, version and icon when saving on prefs
This commit is contained in:
parent
0ccf1fb3b8
commit
6487284dd2
@ -6,15 +6,15 @@ part 'patched_application.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class PatchedApplication {
|
||||
final String name;
|
||||
String name;
|
||||
final String packageName;
|
||||
final String version;
|
||||
String version;
|
||||
final String apkFilePath;
|
||||
@JsonKey(
|
||||
fromJson: decodeBase64,
|
||||
toJson: encodeBase64,
|
||||
)
|
||||
final Uint8List icon;
|
||||
Uint8List icon;
|
||||
DateTime patchDate;
|
||||
final bool isRooted;
|
||||
final bool isFromStorage;
|
||||
|
@ -68,6 +68,13 @@ class ManagerAPI {
|
||||
Future<void> savePatchedApp(PatchedApplication app) async {
|
||||
List<PatchedApplication> patchedApps = getPatchedApps();
|
||||
patchedApps.removeWhere((a) => a.packageName == app.packageName);
|
||||
ApplicationWithIcon? installed =
|
||||
await DeviceApps.getApp(app.packageName, true) as ApplicationWithIcon?;
|
||||
if (installed != null) {
|
||||
app.name = installed.appName;
|
||||
app.version = installed.versionName!;
|
||||
app.icon = installed.icon;
|
||||
}
|
||||
patchedApps.add(app);
|
||||
await setPatchedApps(patchedApps);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user