From e307cdec596fe3b90423e9ce79d5aa72fe5d1eca Mon Sep 17 00:00:00 2001 From: Marcus Hoffmann Date: Tue, 24 Oct 2017 15:19:38 +0200 Subject: [PATCH] common: check file existence before opening manifest This fixes a problem when there is a broken symlink with the name AndroidManifest.xml which will then lead to a crash when trying to open it for trying to remove the debuggable flag. --- fdroidserver/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 984f4636..c6fbf0d2 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -1210,7 +1210,7 @@ def remove_debuggable_flags(root_dir): # Remove forced debuggable flags logging.debug("Removing debuggable flags from %s" % root_dir) for root, dirs, files in os.walk(root_dir): - if 'AndroidManifest.xml' in files: + if 'AndroidManifest.xml' in files and os.path.isfile(os.path.join(root, 'AndroidManifest.xml')): regsub_file(r'android:debuggable="[^"]*"', '', os.path.join(root, 'AndroidManifest.xml'))