mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
feat: option to delete manager logs.
This commit is contained in:
parent
56e715cd3c
commit
2d732288a7
@ -142,7 +142,10 @@
|
||||
"deletedKeystore": "Keystore deleted",
|
||||
"deleteTempDirLabel": "Delete temp directory",
|
||||
"deleteTempDirHint": "Delete the temporary directory used to store temporary files",
|
||||
"deletedTempDir": "Temp directory deleted"
|
||||
"deletedTempDir": "Temp directory deleted",
|
||||
"deleteLogsLabel": "Delete logs",
|
||||
"deleteLogsHint": "Delete collected manager logs",
|
||||
"deletedLogs": "Logs deleted"
|
||||
},
|
||||
"appInfoView": {
|
||||
"widgetTitle": "App Info",
|
||||
|
@ -168,6 +168,22 @@ class SettingsView extends StatelessWidget {
|
||||
subtitle: I18nText('settingsView.deleteTempDirHint'),
|
||||
onTap: () => model.deleteTempDir(),
|
||||
),
|
||||
ListTile(
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
title: I18nText(
|
||||
'settingsView.deleteLogsLabel',
|
||||
child: const Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
subtitle: I18nText('settingsView.deleteLogsHint'),
|
||||
onTap: () => model.deleteLogs(),
|
||||
),
|
||||
],
|
||||
),
|
||||
_settingsDivider,
|
||||
|
@ -354,6 +354,15 @@ class SettingsViewModel extends BaseViewModel {
|
||||
return info.version.sdkInt ?? -1;
|
||||
}
|
||||
|
||||
Future<void> deleteLogs() async {
|
||||
Directory appCacheDir = await getTemporaryDirectory();
|
||||
Directory logsDir = Directory('${appCacheDir.path}/logs');
|
||||
if (logsDir.existsSync()) {
|
||||
logsDir.deleteSync(recursive: true);
|
||||
}
|
||||
_toast.showBottom('settingsView.deletedLogs');
|
||||
}
|
||||
|
||||
Future<void> exportLogcatLogs() async {
|
||||
Directory appCache = await getTemporaryDirectory();
|
||||
Directory logDir = Directory('${appCache.path}/logs');
|
||||
|
Loading…
Reference in New Issue
Block a user