mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-04 22:40:12 +01:00
Try and use new gradle AM.xml path
This commit is contained in:
parent
a49b405780
commit
59e212d7a3
@ -874,13 +874,22 @@ def retrieve_string(app_dir, string_id):
|
|||||||
return s.replace("\\'","'")
|
return s.replace("\\'","'")
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
# Find the AM.xml - try the new gradle method first.
|
||||||
|
def manifest_path(app_dir):
|
||||||
|
gradlepath = os.path.join(app_dir, 'source', 'main', 'AndroidManifest.xml')
|
||||||
|
if os.path.exists(gradlepath):
|
||||||
|
return gradlepath
|
||||||
|
rootpath = os.path.join(app_dir, 'AndroidManifest.xml')
|
||||||
|
return rootpath
|
||||||
|
|
||||||
|
|
||||||
# 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
|
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
|
app_found = False
|
||||||
name = None
|
name = None
|
||||||
for line in file(os.path.join(app_dir, 'AndroidManifest.xml')):
|
for line in file(manifest_path(app_dir)):
|
||||||
if not app_found:
|
if not app_found:
|
||||||
if app_search(line):
|
if app_search(line):
|
||||||
app_found = True
|
app_found = True
|
||||||
@ -907,7 +916,7 @@ def parse_androidmanifest(app_dir):
|
|||||||
version = None
|
version = None
|
||||||
vercode = None
|
vercode = None
|
||||||
package = None
|
package = None
|
||||||
for line in file(os.path.join(app_dir, 'AndroidManifest.xml')):
|
for line in file(manifest_path(app_dir)):
|
||||||
if not package:
|
if not package:
|
||||||
matches = psearch(line)
|
matches = psearch(line)
|
||||||
if matches:
|
if matches:
|
||||||
|
Loading…
Reference in New Issue
Block a user