vrkforever commited on
Commit
3ad16bc
1 Parent(s): c32b3d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
  import tempfile
3
  import os
4
- from androguard.core.bytecodes.apk import APK
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
- apk = APK(temp_apk_path)
18
 
19
  output = []
20
- output.append(f"Package: {apk.get_package()}")
21
- output.append(f"Version: {apk.get_androidversion_name()}")
22
- output.append(f"Main Activity: {apk.get_main_activity()}")
23
 
24
  output.append("\nPermissions:")
25
- for permission in apk.get_permissions():
26
  output.append(f"- {permission}")
27
 
28
  output.append("\nActivities:")
29
- for activity in apk.get_activities():
30
  output.append(f"- {activity}")
31
 
32
  output.append("\nServices:")
33
- for service in apk.get_services():
34
  output.append(f"- {service}")
35
 
36
  output.append("\nReceivers:")
37
- for receiver in apk.get_receivers():
38
  output.append(f"- {receiver}")
39
 
40
  output.append("\nProviders:")
41
- for provider in apk.get_providers():
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)