@@ -292,6 +292,9 @@ public boolean onOptionsItemSelected(MenuItem item) {
292292 } else if (itemId == R .id .menuDumpEditorExportDump ) {
293293 exportDump ();
294294 return true ;
295+ } else if (itemId == R .id .menuDumpEditorCopyAllSectors ) {
296+ copyAllSectorsToClipboard ();
297+ return true ;
295298 }
296299 return super .onOptionsItemSelected (item );
297300 }
@@ -905,6 +908,37 @@ private void exportDump() {
905908 startActivity (intent );
906909 }
907910
911+ /**
912+ * Copy all sectors as a string to the clipboard, maintaining newlines
913+ * between all blocks.
914+ */
915+ private void copyAllSectorsToClipboard () {
916+ int err = checkDumpAndUpdateLines ();
917+ if (err != 0 ) {
918+ Common .isValidDumpErrorToast (err , this );
919+ return ;
920+ }
921+
922+ // Build the dump string from mLines
923+ StringBuilder dumpString = new StringBuilder ();
924+ for (int i = 0 ; i < mLines .length ; i ++) {
925+ String line = mLines [i ];
926+ if (line .startsWith ("+" )) {
927+ // It's a sector header (e.g., "+Sector: 0")
928+ // Remove the "+" prefix and add newline before sector (except first)
929+ if (i > 0 ) {
930+ dumpString .append (System .lineSeparator ());
931+ }
932+ dumpString .append (line .substring (1 )); // Remove "+" prefix
933+ } else {
934+ // It's block data
935+ dumpString .append (System .lineSeparator ()).append (line );
936+ }
937+ }
938+
939+ Common .copyToClipboard (dumpString .toString (), this , true );
940+ }
941+
908942 /**
909943 * The dump will be checked and stored in the {@link Common#TMP_DIR} directory.
910944 * @return The temporary dump file.
0 commit comments