1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-09 00:40:11 +01:00

update: use sets for permissions and features to avoid duplicates

This commit is contained in:
Daniel Martí 2014-08-05 23:04:21 +02:00
parent 7809ef419f
commit 7ac0c5abb2

View File

@ -370,8 +370,8 @@ def scan_apks(apps, apkcache, repodir, knownapks):
if os.path.exists(os.path.join(repodir, srcfilename)):
thisinfo['srcname'] = srcfilename
thisinfo['size'] = os.path.getsize(apkfile)
thisinfo['permissions'] = []
thisinfo['features'] = []
thisinfo['permissions'] = set()
thisinfo['features'] = set()
thisinfo['icons_src'] = {}
thisinfo['icons'] = {}
p = SilentPopen([config['aapt'], 'dump', 'badging', apkfile])
@ -432,7 +432,7 @@ def scan_apks(apps, apkcache, repodir, knownapks):
perm = re.match(string_pat, line).group(1)
if perm.startswith("android.permission."):
perm = perm[19:]
thisinfo['permissions'].append(perm)
thisinfo['permissions'].add(perm)
elif line.startswith("uses-feature:"):
perm = re.match(string_pat, line).group(1)
# Filter out this, it's only added with the latest SDK tools and
@ -441,7 +441,7 @@ def scan_apks(apps, apkcache, repodir, knownapks):
and perm != "android.hardware.screen.landscape":
if perm.startswith("android.feature."):
perm = perm[16:]
thisinfo['features'].append(perm)
thisinfo['features'].add(perm)
if 'sdkversion' not in thisinfo:
logging.warn("no SDK version information found")