mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 09:07:47 +01:00
feat: option to delete manager logs.
This commit is contained in:
parent
56e715cd3c
commit
2d732288a7
3 changed files with 29 additions and 1 deletions
|
@ -142,7 +142,10 @@
|
||||||
"deletedKeystore": "Keystore deleted",
|
"deletedKeystore": "Keystore deleted",
|
||||||
"deleteTempDirLabel": "Delete temp directory",
|
"deleteTempDirLabel": "Delete temp directory",
|
||||||
"deleteTempDirHint": "Delete the temporary directory used to store temporary files",
|
"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": {
|
"appInfoView": {
|
||||||
"widgetTitle": "App Info",
|
"widgetTitle": "App Info",
|
||||||
|
|
|
@ -168,6 +168,22 @@ class SettingsView extends StatelessWidget {
|
||||||
subtitle: I18nText('settingsView.deleteTempDirHint'),
|
subtitle: I18nText('settingsView.deleteTempDirHint'),
|
||||||
onTap: () => model.deleteTempDir(),
|
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,
|
_settingsDivider,
|
||||||
|
|
|
@ -354,6 +354,15 @@ class SettingsViewModel extends BaseViewModel {
|
||||||
return info.version.sdkInt ?? -1;
|
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 {
|
Future<void> exportLogcatLogs() async {
|
||||||
Directory appCache = await getTemporaryDirectory();
|
Directory appCache = await getTemporaryDirectory();
|
||||||
Directory logDir = Directory('${appCache.path}/logs');
|
Directory logDir = Directory('${appCache.path}/logs');
|
||||||
|
|
Loading…
Reference in a new issue