Commit 08e0d2d2 by sikang

update

parent 1c9b504c
......@@ -40,24 +40,25 @@ class JavaGarble:
def __garble_java_file(self,file):
with open(file,"r",encoding="utf-8") as fin:
lines = fin.readlines()
#初始化全局变量
self.__generate_variable()
with open(file,"w+",encoding="utf-8") as fout:
for line in lines:
# interface 不混淆
if "interface" in line and "{\n" in line:
fout.write(line)
continue
#初始化全局变量
self.__generate_variable()
#class下插入全局变量
if (line.startswith("class ") or " class " in line) and "{" in line:
for var in self.__variables:
line +="%s\n"% var
#只有一个缩进的方法,为类方法,可插入同级方法
func_re = re.compile(r'\s{4}[a-zA-Z](.*)[)]\s{0,}[{]')
result = func_re.match(line)
if result != None:
print(result.group())
# func_re = re.compile(r'\s{4}[a-zA-Z](.*)[)]\s{0,}[{]')
# result = func_re.match(line)
# if result != None:
# print(result.group())
# if :
......
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