mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 15:00:30 +03:00
Try and use new gradle AM.xml path
This commit is contained in:
parent
a49b405780
commit
59e212d7a3
1 changed files with 11 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue