Commit 779b2c96 by sikang

bug fix

parent d4b4a2d9
......@@ -34,9 +34,9 @@ class StringGarble:
strings = ""
for i in range(0,random.randint(100,500)):
strings += "%s\n"% ''.join(random.sample("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", random.randint(5, 100)))
strings += "%s\n"% ''.join(random.choices(string.ascii_uppercase + string.ascii_lowercase, k=random.randint(5, 100)))
with open(path, "w") as f_w:
fileContent = fileContent.replace("</resources>","%s\n</resources>"% strings)
fileContent = fileContent.replace("</resources>","<string>%s</string>\n</resources>"% strings)
f_w.write(fileContent)
......@@ -47,5 +47,7 @@ class StringGarble:
if file.endswith("strings.xml"):
# get the path of the java file
path = os.path.join(directory, file)
print("process %s"% path)
self.__string_garble(path)
self.__insert_strings(path)
\ No newline at end of file
self.__insert_strings(path)
print("done")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment