mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
fix: Update package name if MicroG was applied
This commit is contained in:
parent
9f3a30d9f2
commit
cdb492910c
@ -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…
Reference in New Issue
Block a user