vrkforever commited on
Commit
c32b3d5
1 Parent(s): ae63b67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -7,6 +7,7 @@ def extract_apk_info(apk_file):
7
  if apk_file is None:
8
  return "No file uploaded. Please upload an APK file."
9
 
 
10
  try:
11
  # Create a temporary file
12
  with tempfile.NamedTemporaryFile(delete=False, suffix=".apk") as temp_apk:
@@ -46,7 +47,7 @@ def extract_apk_info(apk_file):
46
  return f"Error analyzing APK: {str(e)}"
47
  finally:
48
  # Clean up the temporary file
49
- if os.path.exists(temp_apk_path):
50
  os.unlink(temp_apk_path)
51
 
52
  # Create Gradio interface
 
7
  if apk_file is None:
8
  return "No file uploaded. Please upload an APK file."
9
 
10
+ temp_apk_path = None
11
  try:
12
  # Create a temporary file
13
  with tempfile.NamedTemporaryFile(delete=False, suffix=".apk") as temp_apk:
 
47
  return f"Error analyzing APK: {str(e)}"
48
  finally:
49
  # Clean up the temporary file
50
+ if temp_apk_path and os.path.exists(temp_apk_path):
51
  os.unlink(temp_apk_path)
52
 
53
  # Create Gradio interface