mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 15:00:30 +03:00
Only match label of the first application element
This commit is contained in:
parent
3f7b6b8734
commit
d1ef217895
1 changed files with 11 additions and 5 deletions
|
|
@ -864,9 +864,15 @@ def description_html(lines,linkres):
|
||||||
|
|
||||||
# Retrieve the package name
|
# Retrieve the package name
|
||||||
def fetch_real_name(app_dir):
|
def fetch_real_name(app_dir):
|
||||||
|
app_search = re.compile(r'.*<application.*').search
|
||||||
name_search = re.compile(r'.*android:label="([^"]+)".*').search
|
name_search = re.compile(r'.*android:label="([^"]+)".*').search
|
||||||
|
app_found = False
|
||||||
name = None
|
name = None
|
||||||
for line in file(os.path.join(app_dir, 'AndroidManifest.xml')):
|
for line in file(os.path.join(app_dir, 'AndroidManifest.xml')):
|
||||||
|
if not app_found:
|
||||||
|
if app_search(line):
|
||||||
|
app_found = True
|
||||||
|
else:
|
||||||
if name is not None:
|
if name is not None:
|
||||||
break
|
break
|
||||||
matches = name_search(line)
|
matches = name_search(line)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue