From 20873792c2a9f89f4a1d19dd906b31eddf7ba0cc Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Mon, 2 Mar 2026 16:58:38 +0100 Subject: [PATCH 1/2] fix(android): Fall back to compiled_item ref ID for AAB resource resolution When an AAB manifest attribute has a string value like "@string/app_name_bootstrap" that doesn't match any entry in the protobuf resource table, the code now falls back to resolving via the compiled_item's reference ID instead of returning None. This fixes apps (e.g. ING Banking) where the manifest label references a resource name that doesn't exist in resources.pb, but the numeric resource ID in compiled_item.ref.id resolves correctly. --- .../artifacts/android/manifest/proto_xml.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/launchpad/artifacts/android/manifest/proto_xml.py b/src/launchpad/artifacts/android/manifest/proto_xml.py index 29a61b52..91f2bf00 100644 --- a/src/launchpad/artifacts/android/manifest/proto_xml.py +++ b/src/launchpad/artifacts/android/manifest/proto_xml.py @@ -389,7 +389,18 @@ def _get_optional_attr_value( # Special handling for string references if value.startswith("@"): - return ProtoXmlUtils._get_resource_by_key_from_proto_resource_files(value, proto_res_tables) + resolved = ProtoXmlUtils._get_resource_by_key_from_proto_resource_files(value, proto_res_tables) + if resolved is not None: + return resolved + + # Key-based lookup failed, fall back to compiled_item ref ID + logger.debug(f"key-based lookup failed for {value}, trying compiled_item ref") + compiled_item = getattr(attribute, "compiled_item", None) + if compiled_item and compiled_item.HasField("ref") and compiled_item.ref.id: + return ProtoXmlUtils._get_resource_by_id_from_proto_resource_files( + compiled_item.ref.id, proto_res_tables + ) + return None return str(value) From 4afd363bf64df58233a5058b0c52249e8291d671 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Mon, 2 Mar 2026 18:35:35 +0100 Subject: [PATCH 2/2] fix(android): Use HasField for protobuf compiled_item check Use the idiomatic protobuf HasField() instead of getattr() since compiled_item is a defined field on the proto message and always exists as an attribute. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/launchpad/artifacts/android/manifest/proto_xml.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/launchpad/artifacts/android/manifest/proto_xml.py b/src/launchpad/artifacts/android/manifest/proto_xml.py index 91f2bf00..7a7cfefe 100644 --- a/src/launchpad/artifacts/android/manifest/proto_xml.py +++ b/src/launchpad/artifacts/android/manifest/proto_xml.py @@ -395,10 +395,13 @@ def _get_optional_attr_value( # Key-based lookup failed, fall back to compiled_item ref ID logger.debug(f"key-based lookup failed for {value}, trying compiled_item ref") - compiled_item = getattr(attribute, "compiled_item", None) - if compiled_item and compiled_item.HasField("ref") and compiled_item.ref.id: + if ( + attribute.HasField("compiled_item") + and attribute.compiled_item.HasField("ref") + and attribute.compiled_item.ref.id + ): return ProtoXmlUtils._get_resource_by_id_from_proto_resource_files( - compiled_item.ref.id, proto_res_tables + attribute.compiled_item.ref.id, proto_res_tables ) return None