Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 922ec1a

Browse files
committed
Support null bytes in module.prop (Fix #167)
1 parent 392409b commit 922ec1a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/main/java/com/fox2code/mmm/utils/PropUtils.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ public static void readProperties(ModuleInfo moduleInfo, InputStream inputStream
106106
String line;
107107
int lineNum = 0;
108108
while ((line = bufferedReader.readLine()) != null) {
109+
if (lineNum == 0 && line.startsWith("\u0000")) {
110+
while (line.startsWith("\u0000"))
111+
line = line.substring(1);
112+
}
109113
lineNum++;
110114
int index = line.indexOf('=');
111115
if (index == -1 || line.startsWith("#"))
@@ -319,6 +323,8 @@ public static String readModuleId(InputStream inputStream) {
319323
new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {
320324
String line;
321325
while ((line = bufferedReader.readLine()) != null) {
326+
while (line.startsWith("\u0000"))
327+
line = line.substring(1);
322328
if (line.startsWith("id=")) {
323329
moduleId = line.substring(3).trim();
324330
}

0 commit comments

Comments
 (0)