mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
feat: option to delete temporary directory.
This commit is contained in:
parent
f5ebfc92fc
commit
3b8dc66da6
@ -139,7 +139,10 @@
|
|||||||
"restartAppForChanges": "Restart the app to apply changes",
|
"restartAppForChanges": "Restart the app to apply changes",
|
||||||
"deleteKeystoreLabel": "Delete keystore",
|
"deleteKeystoreLabel": "Delete keystore",
|
||||||
"deleteKeystoreHint": "Delete the keystore used to sign the app",
|
"deleteKeystoreHint": "Delete the keystore used to sign the app",
|
||||||
"deletedKeystore": "Keystore deleted"
|
"deletedKeystore": "Keystore deleted",
|
||||||
|
"deleteTempDirLabel": "Delete temp directory",
|
||||||
|
"deleteTempDirHint": "Delete the temporary directory used to store temporary files",
|
||||||
|
"deletedTempDir": "Temp directory deleted"
|
||||||
},
|
},
|
||||||
"appInfoView": {
|
"appInfoView": {
|
||||||
"widgetTitle": "App Info",
|
"widgetTitle": "App Info",
|
||||||
|
@ -98,6 +98,13 @@ class ManagerAPI {
|
|||||||
await _prefs.setBool('crashlyticsEnabled', value);
|
await _prefs.setBool('crashlyticsEnabled', value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> deleteTempFolder() async {
|
||||||
|
final Directory dir = Directory('/data/local/tmp/revanced-manager');
|
||||||
|
if (await dir.exists()) {
|
||||||
|
await dir.delete(recursive: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> deleteKeystore() async {
|
Future<void> deleteKeystore() async {
|
||||||
final File keystore = File(
|
final File keystore = File(
|
||||||
'/sdcard/Android/data/app.revanced.manager.flutter/files/revanced-keystore.keystore');
|
'/sdcard/Android/data/app.revanced.manager.flutter/files/revanced-keystore.keystore');
|
||||||
|
@ -152,6 +152,22 @@ class SettingsView extends StatelessWidget {
|
|||||||
subtitle: I18nText('settingsView.deleteKeystoreHint'),
|
subtitle: I18nText('settingsView.deleteKeystoreHint'),
|
||||||
onTap: () => model.deleteKeystore,
|
onTap: () => model.deleteKeystore,
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
|
title: I18nText(
|
||||||
|
'settingsView.deleteTempDirLabel',
|
||||||
|
child: const Text(
|
||||||
|
'',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
subtitle: I18nText('settingsView.deleteTempDirHint'),
|
||||||
|
onTap: () => model.deleteTempDir(),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
_settingsDivider,
|
_settingsDivider,
|
||||||
|
@ -343,6 +343,12 @@ class SettingsViewModel extends BaseViewModel {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void deleteTempDir() {
|
||||||
|
_managerAPI.deleteTempFolder();
|
||||||
|
_toast.showBottom('settingsView.deletedTempDir');
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
Future<int> getSdkVersion() async {
|
Future<int> getSdkVersion() async {
|
||||||
AndroidDeviceInfo info = await DeviceInfoPlugin().androidInfo;
|
AndroidDeviceInfo info = await DeviceInfoPlugin().androidInfo;
|
||||||
return info.version.sdkInt ?? -1;
|
return info.version.sdkInt ?? -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user