mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2025-05-11 13:05:37 +02:00
fix: Update package name if MicroG was applied
This commit is contained in:
parent
9f3a30d9f2
commit
cdb492910c
3 changed files with 8 additions and 3 deletions
|
@ -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(
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue