Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,24 +30,24 @@ def check_apk(apk_to_check):
|
|
| 30 |
if os.path.exists(model_path):
|
| 31 |
print("test0")
|
| 32 |
result, apk_data = analyser.identify(file_to_check, model_path)
|
| 33 |
-
|
| 34 |
if result == 1:
|
| 35 |
output_builder = output_builder + "Analysed file, identified as malware!"
|
| 36 |
else:
|
| 37 |
output_builder = output_builder + "Analysed file, identified as not malware.".format(file_to_check)
|
| 38 |
-
|
| 39 |
output_builder = output_builder + "\n"+"-"*20 +"\n"+"Permissions: \n"
|
| 40 |
-
print("
|
| 41 |
permissions = apk_data["permissions"]
|
| 42 |
print("permissions: {}".format(permissions))
|
| 43 |
-
|
| 44 |
for permission in permissions:
|
| 45 |
print(permission)
|
| 46 |
output_builder = output_builder + permission + "\n"
|
| 47 |
-
|
| 48 |
print(output_builder)
|
| 49 |
return output_builder
|
| 50 |
-
print("
|
| 51 |
else:
|
| 52 |
return "No model found, please train model"
|
| 53 |
print(output_builder)
|
|
|
|
| 30 |
if os.path.exists(model_path):
|
| 31 |
print("test0")
|
| 32 |
result, apk_data = analyser.identify(file_to_check, model_path)
|
| 33 |
+
print("test1")
|
| 34 |
if result == 1:
|
| 35 |
output_builder = output_builder + "Analysed file, identified as malware!"
|
| 36 |
else:
|
| 37 |
output_builder = output_builder + "Analysed file, identified as not malware.".format(file_to_check)
|
| 38 |
+
print("test2")
|
| 39 |
output_builder = output_builder + "\n"+"-"*20 +"\n"+"Permissions: \n"
|
| 40 |
+
print("test3")
|
| 41 |
permissions = apk_data["permissions"]
|
| 42 |
print("permissions: {}".format(permissions))
|
| 43 |
+
print("test4")
|
| 44 |
for permission in permissions:
|
| 45 |
print(permission)
|
| 46 |
output_builder = output_builder + permission + "\n"
|
| 47 |
+
print("test5")
|
| 48 |
print(output_builder)
|
| 49 |
return output_builder
|
| 50 |
+
print("Test6")
|
| 51 |
else:
|
| 52 |
return "No model found, please train model"
|
| 53 |
print(output_builder)
|