diff --git a/apps/server/AliasVault.Client/Main/Pages/Settings/ImportExport/ImportExport.razor b/apps/server/AliasVault.Client/Main/Pages/Settings/ImportExport/ImportExport.razor index 13d01d413..47790e5b8 100644 --- a/apps/server/AliasVault.Client/Main/Pages/Settings/ImportExport/ImportExport.razor +++ b/apps/server/AliasVault.Client/Main/Pages/Settings/ImportExport/ImportExport.razor @@ -90,6 +90,24 @@ + +@* + DEBUG-only raw SQLite export. Stripped from release builds. +*@ +#if DEBUG +
+
+
+

Export raw SQLite

+ DEBUG +
+

+ Downloads the unencrypted SQLite vault file as-is. Anyone with the file can read everything. +

+
+ +
+#endif @@ -295,6 +313,29 @@ } } +#if DEBUG + // DEBUG-only: downloads the in-memory SQLite vault in unencrypted form. + private async Task ExportVaultSqlite() + { + GlobalLoadingSpinner.Show("Exporting SQLite vault..."); + try + { + var base64 = await DbService.ExportSqliteToBase64Async(); + var bytes = Convert.FromBase64String(base64); + await JsInteropService.DownloadFileFromStream(await GetExportFileName("sqlite"), bytes); + } + catch (Exception ex) + { + Logger.LogError(ex, "Error exporting raw SQLite vault"); + GlobalNotificationService.AddErrorMessage(SharedLocalizer["ErrorGeneric"], true); + } + finally + { + GlobalLoadingSpinner.Hide(); + } + } +#endif + private async Task ExportVaultAvux() { GlobalLoadingSpinner.Show(Localizer["ExportingVaultMessage"]);