3 Commits

Author SHA1 Message Date
Cametendo
66e4247199 Added dd 2026-04-04 19:54:18 +02:00
Cametendo
1661e3e060 Merge branch 'working-flasher' into dev 2026-04-03 15:14:23 +02:00
Cametendo
68d7520e26 Clarify description in README.md
Removed redundant wording for clarity.
2026-03-20 12:14:57 +01:00
3 changed files with 30 additions and 2 deletions

26
Dd.java Normal file
View File

@@ -0,0 +1,26 @@
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Dd {
public static void dd() {
try {
ProcessBuilder pb = new ProcessBuilder("sudo", "dd", "if=" + FilePathAdd.ImagePath, "of=" + StorageDeviceLister.fullPath, "bs=" + BlockSize.blockSizeString, "status=progress", "oflag=" + OflagHandler.oflagHandleString);
pb.redirectErrorStream(true);
Process process = pb.start();
BufferedReader reader = new BufferedReader(
new InputStreamReader(process.getInputStream())
);
int character;
while ((character = reader.read()) != -1) {
char c = (char) character;
System.out.print(c);
System.out.flush();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}

View File

@@ -12,10 +12,12 @@ public class Flasher {
System.out.println(" - To be used oflag: " + OflagHandler.oflagHandleString);
input = UserInput.nextLine();
if (YesNo.check(input)) {
System.out.println("Flashing...");
System.out.println("Starting to flash...");
} else {
System.out.println("Canceling...");
System.exit(0);
}
Dd.dd();
System.out.println("Flash completed.");
}
}

View File

@@ -7,7 +7,7 @@ Small and lightweight image and iso flasher build on `dd`.
[![Status](https://img.shields.io/badge/Status-Beta-red.svg)](https://en.wikipedia.org/wiki/Software_release_life_cycle#Beta)
# About
Java program using `dd` to make flashing iso and image files easier on the terminal. This program allows anyone to flash iso and image files without having to search for extra GUI tools and by keeping it simple and resource-friendly.
Java program using `dd` to make flashing iso and image files easier on the terminal. This program allows anyone to flash iso and image files without having to search for extra GUI tools by keeping it simple and resource-friendly.
# Requirements
- `Java`: 21 (Download [here](https://www.oracle.com/java/technologies/downloads/#java21)