Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Remove obsolete debug actions

Neeraj Gupta06e3f4f0eaef
diff --git a/mobile/apps/photos/lib/services/sync/local_sync_service.dart b/mobile/apps/photos/lib/services/sync/local_sync_service.dart
index b54e31a39e..9c4b7de9c3 100644
--- a/mobile/apps/photos/lib/services/sync/local_sync_service.dart
+++ b/mobile/apps/photos/lib/services/sync/local_sync_service.dart
@@ -337,21 +337,6 @@ class LocalSyncService {
backupPreferenceService.isOnlyNewBackupEnabled;
}
- // Warning: resetLocalSync should only be used for testing imported related
- // changes
- Future<void> resetLocalSync() async {
- assert(kDebugMode, "only available in debug mode");
- await FilesDB.instance.deleteDB();
- for (var element in [
- kHasCompletedFirstImportKey,
- kDbUpdationTimeKey,
- "has_synced_edit_time",
- "has_selected_all_folders_for_backup",
- ]) {
- await _prefs.remove(element);
- }
- }
-
Future<void> _loadAndStoreDiff(
Set<String> existingLocalDs, {
required int fromTime,
diff --git a/mobile/apps/photos/lib/services/update_service.dart b/mobile/apps/photos/lib/services/update_service.dart
index 3eb8a88ef0..de1889f89a 100644
--- a/mobile/apps/photos/lib/services/update_service.dart
+++ b/mobile/apps/photos/lib/services/update_service.dart
@@ -70,10 +70,6 @@ class UpdateService {
return _prefs.setInt(changeLogVersionKey, currentChangeLogVersion);
}
- Future<bool> resetChangeLog() async {
- return _prefs.remove(changeLogVersionKey);
- }
-
Future<bool> shouldUpdate() async {
if (!isIndependent()) {
return false;
diff --git a/mobile/apps/photos/lib/ui/settings/debug/debug_settings_page.dart b/mobile/apps/photos/lib/ui/settings/debug/debug_settings_page.dart
index 08c13c8258..545e4f97c2 100644
--- a/mobile/apps/photos/lib/ui/settings/debug/debug_settings_page.dart
+++ b/mobile/apps/photos/lib/ui/settings/debug/debug_settings_page.dart
@@ -1,14 +1,9 @@
import "package:ente_components/ente_components.dart";
-import "package:ente_crypto/ente_crypto.dart";
import "package:flutter/material.dart";
import "package:hugeicons/hugeicons.dart";
-import "package:photos/core/configuration.dart";
import "package:photos/core/event_bus.dart";
import "package:photos/events/christmas_banner_event.dart";
import "package:photos/service_locator.dart";
-import "package:photos/services/ignored_files_service.dart";
-import "package:photos/services/sync/local_sync_service.dart";
-import "package:photos/services/sync/sync_service.dart";
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/components/menu_item_widget/menu_item_widget_new.dart";
import "package:photos/ui/components/settings/settings_grouped_card.dart";
@@ -215,20 +210,6 @@ class _DebugSettingsPageState extends State<DebugSettingsPage> {
const SizedBox(height: 8),
SettingsGroupedCard(
children: [
- MenuItemWidgetNew(
- title: "Key attributes",
- leadingIconWidget: _buildIconWidget(
- context,
- HugeIcons.strokeRoundedKey01,
- ),
- trailingIcon: Icons.chevron_right_outlined,
- trailingIconIsMuted: true,
- onTap: () async {
- await updateService.resetChangeLog();
- if (!context.mounted) return;
- _showKeyAttributesDialog(context);
- },
- ),
MenuItemWidgetNew(
title: "Show change log",
leadingIconWidget: _buildIconWidget(
@@ -244,35 +225,6 @@ class _DebugSettingsPageState extends State<DebugSettingsPage> {
);
},
),
- MenuItemWidgetNew(
- title: "Delete Local Import DB",
- leadingIconWidget: _buildIconWidget(
- context,
- HugeIcons.strokeRoundedDelete02,
- ),
- trailingIcon: Icons.chevron_right_outlined,
- trailingIconIsMuted: true,
- onTap: () async {
- await LocalSyncService.instance.resetLocalSync();
- if (!context.mounted) return;
- showShortToast(context, "Done");
- },
- ),
- MenuItemWidgetNew(
- title: "Allow auto-upload for ignored files",
- leadingIconWidget: _buildIconWidget(
- context,
- HugeIcons.strokeRoundedUpload04,
- ),
- trailingIcon: Icons.chevron_right_outlined,
- trailingIconIsMuted: true,
- onTap: () async {
- await IgnoredFilesService.instance.reset();
- SyncService.instance.sync().ignore();
- if (!context.mounted) return;
- showShortToast(context, "Done");
- },
- ),
MenuItemWidgetNew(
title: "Social settings",
leadingIconWidget: _buildIconWidget(
@@ -312,53 +264,4 @@ class _DebugSettingsPageState extends State<DebugSettingsPage> {
);
}
- void _showKeyAttributesDialog(BuildContext context) {
- final keyAttributes = Configuration.instance.getKeyAttributes()!;
- final AlertDialog alert = AlertDialog(
- title: const Text("key attributes"),
- content: SingleChildScrollView(
- child: Column(
- children: [
- const Text("Key", style: TextStyle(fontWeight: FontWeight.bold)),
- Text(CryptoUtil.bin2base64(Configuration.instance.getKey()!)),
- const Padding(padding: EdgeInsets.all(12)),
- const Text(
- "Encrypted Key",
- style: TextStyle(fontWeight: FontWeight.bold),
- ),
- Text(keyAttributes.encryptedKey),
- const Padding(padding: EdgeInsets.all(12)),
- const Text(
- "Key Decryption Nonce",
- style: TextStyle(fontWeight: FontWeight.bold),
- ),
- Text(keyAttributes.keyDecryptionNonce),
- const Padding(padding: EdgeInsets.all(12)),
- const Text(
- "KEK Salt",
- style: TextStyle(fontWeight: FontWeight.bold),
- ),
- Text(keyAttributes.kekSalt),
- const Padding(padding: EdgeInsets.all(12)),
- ],
- ),
- ),
- actions: [
- TextButton(
- child: const Text("OK"),
- onPressed: () {
- Navigator.of(context).pop('dialog');
- },
- ),
- ],
- );
-
- showDialog(
- useRootNavigator: false,
- context: context,
- builder: (BuildContext context) {
- return alert;
- },
- );
- }
}