@@ -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+
927+ // Skip sector headers
928+ if (line .startsWith ("+" )) {
929+ continue ;
930+ }
931+
932+ // Add a newline before appending (except for the very first block)
933+ if (dumpString .length () > 0 ) {
934+ dumpString .append (System .lineSeparator ());
935+ }
936+ dumpString .append (line );
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