Spaces:
Running
Running
vrkforever
commited on
Commit
•
3ad16bc
1
Parent(s):
c32b3d5
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import tempfile
|
3 |
import os
|
4 |
-
from androguard.
|
5 |
|
6 |
def extract_apk_info(apk_file):
|
7 |
if apk_file is None:
|
@@ -14,31 +14,31 @@ def extract_apk_info(apk_file):
|
|
14 |
temp_apk.write(apk_file.read())
|
15 |
temp_apk_path = temp_apk.name
|
16 |
|
17 |
-
|
18 |
|
19 |
output = []
|
20 |
-
output.append(f"Package: {
|
21 |
-
output.append(f"Version: {
|
22 |
-
output.append(f"Main Activity: {
|
23 |
|
24 |
output.append("\nPermissions:")
|
25 |
-
for permission in
|
26 |
output.append(f"- {permission}")
|
27 |
|
28 |
output.append("\nActivities:")
|
29 |
-
for activity in
|
30 |
output.append(f"- {activity}")
|
31 |
|
32 |
output.append("\nServices:")
|
33 |
-
for service in
|
34 |
output.append(f"- {service}")
|
35 |
|
36 |
output.append("\nReceivers:")
|
37 |
-
for receiver in
|
38 |
output.append(f"- {receiver}")
|
39 |
|
40 |
output.append("\nProviders:")
|
41 |
-
for provider in
|
42 |
output.append(f"- {provider}")
|
43 |
|
44 |
return "\n".join(output)
|
|
|
1 |
import gradio as gr
|
2 |
import tempfile
|
3 |
import os
|
4 |
+
from androguard.misc import AnalyzeAPK
|
5 |
|
6 |
def extract_apk_info(apk_file):
|
7 |
if apk_file is None:
|
|
|
14 |
temp_apk.write(apk_file.read())
|
15 |
temp_apk_path = temp_apk.name
|
16 |
|
17 |
+
a, d, dx = AnalyzeAPK(temp_apk_path)
|
18 |
|
19 |
output = []
|
20 |
+
output.append(f"Package: {a.get_package()}")
|
21 |
+
output.append(f"Version: {a.get_androidversion_name()}")
|
22 |
+
output.append(f"Main Activity: {a.get_main_activity()}")
|
23 |
|
24 |
output.append("\nPermissions:")
|
25 |
+
for permission in a.get_permissions():
|
26 |
output.append(f"- {permission}")
|
27 |
|
28 |
output.append("\nActivities:")
|
29 |
+
for activity in a.get_activities():
|
30 |
output.append(f"- {activity}")
|
31 |
|
32 |
output.append("\nServices:")
|
33 |
+
for service in a.get_services():
|
34 |
output.append(f"- {service}")
|
35 |
|
36 |
output.append("\nReceivers:")
|
37 |
+
for receiver in a.get_receivers():
|
38 |
output.append(f"- {receiver}")
|
39 |
|
40 |
output.append("\nProviders:")
|
41 |
+
for provider in a.get_providers():
|
42 |
output.append(f"- {provider}")
|
43 |
|
44 |
return "\n".join(output)
|