Merge branch 'master' of gitorious.org:f-droid/fdroidserver

This commit is contained in:
Ciaran Gultnieks 2013-06-15 11:14:56 +01:00
commit ffdc92bd96

View file

@ -864,19 +864,25 @@ 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 name is not None: if not app_found:
break if app_search(line):
matches = name_search(line) app_found = True
if matches: else:
name = matches.group(1) if name is not None:
break
matches = name_search(line)
if matches:
name = matches.group(1)
if name.startswith('@string/'): if name.startswith('@string/'):
id = name[8:] id = name[8:]
name2 = None name2 = None
string_search= re.compile(r'.*"'+id+'">([^<]+?)<.*').search string_search= re.compile(r'.*"'+id+'".*>([^<]+?)<.*').search
for xmlfile in glob.glob(os.path.join( for xmlfile in glob.glob(os.path.join(
app_dir, 'res', 'values', 'strings*.xml')): app_dir, 'res', 'values', 'strings*.xml')):
for line in file(xmlfile): for line in file(xmlfile):
@ -887,10 +893,10 @@ def fetch_real_name(app_dir):
name2 = matches.group(1) name2 = matches.group(1)
if name2 is not None: if name2 is not None:
return name2 return name2
return ''
if name is not None: else:
return name return name
return ''
# Extract some information from the AndroidManifest.xml at the given path. # Extract some information from the AndroidManifest.xml at the given path.
# Returns (version, vercode, package), any or all of which might be None. # Returns (version, vercode, package), any or all of which might be None.
@ -1443,6 +1449,8 @@ def scan_source(build_dir, root_dir, thisbuild):
'admob-sdk-android', 'admob-sdk-android',
'googleadview', 'googleadview',
'googleadmobadssdk', 'googleadmobadssdk',
'google-play-services',
'crittercism',
'heyzap', 'heyzap',
'jpct-ae'] 'jpct-ae']