Skip to content

Commit

Permalink
fix: Update package name if MicroG was applied
Browse files Browse the repository at this point in the history
  • Loading branch information
ponces committed Sep 14, 2022
1 parent 9f3a30d commit cdb4929
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/models/patched_application.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ part 'patched_application.g.dart';
@JsonSerializable()
class PatchedApplication {
String name;
final String packageName;
String packageName;
String version;
final String apkFilePath;
@JsonKey(
Expand Down
7 changes: 7 additions & 0 deletions lib/ui/views/installer/installer_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ class InstallerViewModel extends BaseViewModel {
update(1.0, 'Installed!', 'Installed!');
_app.patchDate = DateTime.now();
_app.appliedPatches = _patches.map((p) => p.name).toList();
bool hasMicroG = _patches.any((p) => p.name.endsWith('microg-support'));
if (hasMicroG) {
_app.packageName = _app.packageName.replaceFirst(
'com.google.',
'app.revanced.',
);
}
await _managerAPI.savePatchedApp(_app);
}
}
Expand Down
2 changes: 0 additions & 2 deletions lib/ui/views/navigation/navigation_viewmodel.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// ignore_for_file: use_build_context_synchronously
import 'package:app_installer/app_installer.dart';
import 'package:device_apps/device_apps.dart';
import 'package:dynamic_themes/dynamic_themes.dart';
import 'package:flutter/material.dart';
import 'package:injectable/injectable.dart';
Expand Down

0 comments on commit cdb4929

Please sign in to comment.