-
Notifications
You must be signed in to change notification settings - Fork 397
Open
Description
Description
When using the following method to write file content:
public static void setFileContent(String path, String content) {
Shell.getShell();
ByteArrayInputStream inputStream = new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8));
Shell.cmd("cat > " + path).add(inputStream).exec();
}The resulting file contains the expected content, but an extra marker (e.g. __RET=$?;echo ade68241-...) is appended at the end.
In addition, the app freezes, so the command never seems to finish.
Expected Behavior
- The file should contain only the provided content, not any additional markers.
- The command should terminate after writing to the file without freezing.
Actual Behavior
- An unwanted marker (e.g. __RET=$?;echo ade68241-...) is appended to the file as the last line.
- The command appears to hang (or does not complete correctly), freezing the application.
There is no crash, but the whole application just freezes.
Environment
libsu version: 6.0.0
OS/Device: Android 14
Magisk Version: 27000
Maybe I misunderstood, but I thought the add method was for adding an input stream for the cat command. I would appreciate any help.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels