1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-11 15:13:27 +02:00

Properly support escaped strings

See:
https://developer.android.com/guide/topics/resources/string-resource.html
This commit is contained in:
Daniel Martí 2015-06-04 15:56:20 +02:00
parent 2231e72812
commit d0b5e60369

View File

@ -859,6 +859,13 @@ class vcs_bzr(vcs):
p.output.splitlines()]
def unescape_string(string):
if string[0] == '"' and string[-1] == '"':
return string[1:-1]
return string.replace("\\'", "'")
def retrieve_string(app_dir, string, xmlfiles=None):
if xmlfiles is None:
@ -872,7 +879,7 @@ def retrieve_string(app_dir, string, xmlfiles=None):
xmlfiles += [os.path.join(r, x) for x in f if x.endswith('.xml')]
if not string.startswith('@string/'):
return string.replace("\\'", "'")
return unescape_string(string)
name = string[len('@string/'):]