From 0f386bc12bc11ab76fc151ef06d00dd91478d4bb Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Wed, 18 Jan 2023 12:59:23 +0000 Subject: [PATCH] Allow obfuscated classes on bootclasspath Previously, the signature_trie python library would reject classes which started with a lower case character which in turn caused the verify_overlaps tool to fail. That meant that it was impossible to add obfuscated classes (which commonly used lower case characters for their name) from being used on the bootclasspath. This change removes that restriction and the accompanying test. Bug: 265833521 Test: TH and partner testing Change-Id: I70710484e427f64d79fb30301f3413f3b67b27e7 --- scripts/hiddenapi/signature_trie.py | 4 ---- scripts/hiddenapi/signature_trie_test.py | 8 -------- 2 files changed, 12 deletions(-) diff --git a/scripts/hiddenapi/signature_trie.py b/scripts/hiddenapi/signature_trie.py index 3650fa159..2ff0c5f24 100644 --- a/scripts/hiddenapi/signature_trie.py +++ b/scripts/hiddenapi/signature_trie.py @@ -150,10 +150,6 @@ class InteriorNode(Node): f"wildcard '{last_element}' and " f"member signature '{member[0]}'") wildcard = [last_element] - elif last_element.islower(): - raise Exception(f"Invalid signature '{signature}': last element " - f"'{last_element}' is lower case but should be an " - f"upper case class name or wildcard") else: packages = elements[0:-1] # Split the class name into outer / inner classes diff --git a/scripts/hiddenapi/signature_trie_test.py b/scripts/hiddenapi/signature_trie_test.py index 6d4e660e3..bd4a9a8de 100755 --- a/scripts/hiddenapi/signature_trie_test.py +++ b/scripts/hiddenapi/signature_trie_test.py @@ -117,14 +117,6 @@ class TestSignatureToElements(unittest.TestCase): self.assertEqual(elements, self.signature_to_elements(signature)) self.assertEqual(signature, self.elements_to_signature(elements)) - def test_invalid_no_class_or_wildcard(self): - signature = "java/lang" - with self.assertRaises(Exception) as context: - self.signature_to_elements(signature) - self.assertIn( - "last element 'lang' is lower case but should be an " - "upper case class name or wildcard", str(context.exception)) - def test_non_standard_class_name(self): elements = [ ("package", "javax"),