mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
fix: Export patcher logs as a file instead of text
This commit is contained in:
parent
698f1ac383
commit
855b8373e4
@ -194,7 +194,18 @@ class PatcherAPI {
|
||||
}
|
||||
}
|
||||
|
||||
void shareLog(String logs) {
|
||||
ShareExtend.share(logs, 'text');
|
||||
Future<void> sharePatcherLog(String logs) async {
|
||||
Directory appCache = await getTemporaryDirectory();
|
||||
Directory logDir = Directory('${appCache.path}/logs');
|
||||
logDir.createSync();
|
||||
String dateTime = DateTime.now()
|
||||
.toIso8601String()
|
||||
.replaceAll('-', '')
|
||||
.replaceAll(':', '')
|
||||
.replaceAll('T', '')
|
||||
.replaceAll('.', '');
|
||||
File log = File('${logDir.path}/revanced-manager_patcher_$dateTime.log');
|
||||
log.writeAsStringSync(logs);
|
||||
ShareExtend.share(log.path, 'file');
|
||||
}
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ class InstallerViewModel extends BaseViewModel {
|
||||
}
|
||||
|
||||
void shareLog() {
|
||||
_patcherAPI.shareLog(logs);
|
||||
_patcherAPI.sharePatcherLog(logs);
|
||||
}
|
||||
|
||||
Future<void> cleanPatcher() async {
|
||||
|
@ -235,7 +235,7 @@ class SettingsViewModel extends BaseViewModel {
|
||||
.replaceAll(':', '')
|
||||
.replaceAll('T', '')
|
||||
.replaceAll('.', '');
|
||||
File logcat = File('${logDir.path}/revanced-manager_$dateTime.log');
|
||||
File logcat = File('${logDir.path}/revanced-manager_logcat_$dateTime.log');
|
||||
String logs = await Logcat.execute();
|
||||
logcat.writeAsStringSync(logs);
|
||||
ShareExtend.share(logcat.path, 'file');
|
||||
|
Loading…
Reference in New Issue
Block a user