mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-17 10:40:12 +02:00
Properly support escaped strings
See: https://developer.android.com/guide/topics/resources/string-resource.html
This commit is contained in:
parent
2231e72812
commit
d0b5e60369
@ -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/'):]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user