Skip to content

Commit 4af089f

Browse files
kelvin_benYour Name
kelvin_ben
authored and
Your Name
committed
1. 优化域名过滤规则 2. 修复以Android模式进行目录扫描时反编译原目录被覆盖的问题 3. 修复AI智能分析后不能得到过滤的问题
1 parent a940a8d commit 4af089f

File tree

5 files changed

+25
-12
lines changed

5 files changed

+25
-12
lines changed

libs/task/android_task.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,26 @@ def start(self):
3737

3838
def __decode_file__(self,file_path):
3939
apktool_path = str(cores.apktool_path)
40-
output_path = str(cores.output_path)
4140
backsmali_path = str(cores.backsmali_path)
42-
suffix_name = file_path.split(".")[-1]
41+
base_out_path = str(cores.output_path)
42+
filename = os.path.basename(file_path)
43+
suffix_name = filename.split(".")[-1]
44+
4345
if suffix_name == "apk":
46+
name = filename.split(".")[0]
47+
output_path = os.path.join(base_out_path,name)
4448
self.__decode_apk__(file_path,apktool_path,output_path)
4549
elif suffix_name == "dex":
46-
with open(file_path,'rb') as f:
47-
dex_md5 = str(hashlib.md5().update(f.read()).hexdigest()).upper()
48-
self.file_identifier.append(dex_md5)
50+
f = open(file_path,'rb')
51+
md5_obj = hashlib.md5()
52+
while True:
53+
r = f.read(1024)
54+
if not r:
55+
break
56+
md5_obj.update(r)
57+
dex_md5 = md5_obj.hexdigest().lower()
58+
self.file_identifier.append(dex_md5)
59+
output_path = os.path.join(base_out_path,dex_md5)
4960
self.__decode_dex__(file_path,backsmali_path,output_path)
5061
else:
5162
return "error"

libs/task/base_task.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ def __tast_control__(self):
7575
cacar_path = cache_info["path"]
7676
types = cache_info["type"]
7777

78-
print(os.path.exists(cacar_path))
79-
print(cores.download_flag)
80-
8178
if (not os.path.exists(cacar_path) and cores.download_flag):
8279
print("[-] File download failed! Please download the file manually and try again.")
8380
return task_info
@@ -147,7 +144,7 @@ def __history_handle__(self):
147144
self.domain_history_list.append(domain)
148145
domain_count = lines.count(line)
149146
if domain_count >= cout:
150-
config.filter_no.append(domain)
147+
config.filter_no.append(".*" + domain)
151148
f.close()
152149

153150

libs/task/download_task.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ def start(self,path,types):
3232
file_name = create_time + ".html"
3333

3434
if not(path.startswith("http://") or path.startswith("https://")):
35-
if not os.path.isdir(path):
35+
if not os.path.isdir(path): # 不是目录
3636
return {"path":path,"type":types}
37-
else:
37+
else: # 目录处理
38+
3839
return {"path":path,"type":types}
3940
else:
4041
print("[*] Detected that the task is not local, preparing to download file......")

libs/task/net_task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __write_result_to_txt__(self):
7070
if (("http://" in result) or ("https://" in result)) and ("." in result):
7171
domain = result.replace("https://","").replace("http://","")
7272

73-
if "{" in result or "}" in result or "[" in result or "]" in result:
73+
if "{" in result or "}" in result or "[" in result or "]" in result or "\\" in result or "!" in result or "," in result:
7474
continue
7575

7676
if "/" in domain:

update.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
- 优化配置文件相关的参数信息
77
- 优化部分代码执行逻辑
88
- 优化README.md内容
9+
- 优化域名过滤规则
910
- 修复自动下载进度问题
11+
- 修复以目录的方式对Android反编译原目录被覆盖的问题
12+
- 修复AI分析完毕后不能很好过滤的问题
13+
1014

1115
### V1.0.6
1216
- 新增AI智能分析快速过滤第三方URL地址

0 commit comments

Comments
 (0)