Skip to content

Commit a1e0a5a

Browse files
committed
Support removal of arrays
Match patterns such as "string-array" that would previously only return "array", and subsequently fail in `remove_resource_value`
1 parent 73eef7f commit a1e0a5a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

android_clean_app.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ def add_element(self, message):
4040
if res_all:
4141
res = res_all[0]
4242
bits = res.split('.')[-2:]
43-
self.elements.append((bits[0], bits[1]))
43+
if bits[0] != 'array':
44+
type=bits[0]
45+
else:
46+
# array is a generic type, which may take form string-array, integer-array, etc.
47+
# The only way to get type is to parse from errorLine1 which is less reliable than message.
48+
type=re.findall(Issue.pattern_array, errorLine1)[0][0]
49+
self.elements.append((type, bits[1]))
4450
else:
4551
print("The pattern '%s' seems to find nothing in the error message '%s'. We can't find the resource and can't remove it. The pattern might have changed, please check and report this in github issues." % (
4652
Issue.pattern, message))

0 commit comments

Comments
 (0)