Skip to content

Commit 65337b7

Browse files
committed
删除与zip和clean app有关的所有内容。
1 parent 6b21157 commit 65337b7

File tree

2 files changed

+3
-34
lines changed

2 files changed

+3
-34
lines changed

main/detect.py

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@
1515
import re
1616
import subprocess
1717
import sys
18-
import zipfile
1918
from time_recorder import TimeRecord
2019

2120
"""
2221
RM_STATUS : {
2322
0 Remove Nothing
2423
1 Remove all
25-
2 Remove Lib Code
2624
}
2725
"""
2826
RM_STATUS = 1
@@ -63,7 +61,8 @@ def __init__(self):
6361
self.packages_feature = []
6462
self.libs_feature = []
6563
self.project_path = os.path.dirname(sys.argv[0])
66-
64+
if self.project_path == "":
65+
self.project_path = "."
6766
self.load_data()
6867

6968

@@ -73,24 +72,6 @@ def rm_lib_files(lib_list):
7372
cmd = 'rm -rf %s' % lib_dir_name
7473
subprocess.call(cmd, shell=True)
7574

76-
@staticmethod
77-
def zip_apk(source, target):
78-
if not os.path.exists(os.path.dirname(target)):
79-
os.mkdir(os.path.dirname(target))
80-
file_list = []
81-
if os.path.isdir(source):
82-
for root, dirs, files in os.walk(source):
83-
for name in files:
84-
file_list.append(os.path.join(root, name))
85-
else:
86-
# print '%s is not a directory.' % source
87-
file_list.append(source)
88-
zf = zipfile.ZipFile(target, 'w', zipfile.zlib.DEFLATED)
89-
for tar in file_list:
90-
arcname = tar[len(source):]
91-
zf.write(tar, arcname)
92-
zf.close()
93-
9475
def get_number(self, string):
9576
"""
9677
Get API ID From API Dictionary.
@@ -425,16 +406,6 @@ def find_features(package):
425406
if RM_STATUS > 0:
426407
self.rm_lib_files(lib_dir_list)
427408

428-
zip_file_name = self.project_path + '/../clean_app/' + os.path.basename(apk_path)[:-3] + 'zip'
429-
smali_path = apk_path + '/smali'
430-
self.zip_apk(smali_path, zip_file_name)
431-
432409
if RM_STATUS == 1:
433410
cmd = 'rm -rf %s' % apk_path
434411
subprocess.call(cmd, shell=True)
435-
elif RM_STATUS == 2:
436-
zip_file_name = self.project_path + '/../clean_app/' + os.path.basename(apk_path)[:-3] + 'zip'
437-
smali_path = apk_path + '/smali'
438-
self.zip_apk(smali_path, zip_file_name)
439-
return zip_file_name
440-
return "No Zip File Here."

main/main.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ def main_func(path):
2020
print "--Decoding--"
2121
detector = Detector()
2222
decoded_path = detector.get_smali(path)
23-
clean_app_path = detector.get_hash(decoded_path)
24-
print "--Splitter--"
25-
print('clean app path : %s' % clean_app_path)
23+
detector.get_hash(decoded_path)
2624

2725

2826
if __name__ == '__main__':

0 commit comments

Comments
 (0)