From 3f085422081db5d7da5dfc394a0b9c2696c2e9be Mon Sep 17 00:00:00 2001 From: Svet Ganov Date: Thu, 22 Mar 2018 20:58:52 -0700 Subject: Fix resource by name lookup Test: added: '@' cases to ResourceUtilsTest pass: ./out/host/darwin-x86/nativetest/libandroidfw_tests/libandroidfw_tests pass: ./out/host/darwin-x86/nativetest/aapt2_tests/aapt2_tests pass: cts-tradefed run cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.PermissionsHostTest Bug: 74612500 Change-Id: I144e4ca1b63b9cce71052fc02089bb6092739889 --- libs/androidfw/ResourceUtils.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libs/androidfw/ResourceUtils.cpp') diff --git a/libs/androidfw/ResourceUtils.cpp b/libs/androidfw/ResourceUtils.cpp index 1aa6cf6da28d..d63feb01ef83 100644 --- a/libs/androidfw/ResourceUtils.cpp +++ b/libs/androidfw/ResourceUtils.cpp @@ -26,6 +26,9 @@ bool ExtractResourceName(const StringPiece& str, StringPiece* out_package, Strin bool has_type_separator = false; const char* start = str.data(); const char* end = start + str.size(); + if (start[0] == '@') { + start++; + } const char* current = start; while (current != end) { if (out_type->size() == 0 && *current == '/') { -- cgit v1.2.3-59-g8ed1b