From 1e4b0e54a3db31bdbcb9385bf22bab4b96096d1f Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Thu, 27 Apr 2017 15:01:10 -0700 Subject: AAPT2: Workaround for findViewById with package ID > 0x7f The entire View code base checks IDs against View.NO_ID except findViewById(), which checks to see if the ID is negative. Any package ID > 0x7f is interpreted as a negative number in Java (no unsigned ints), so this check prevents the use of IDs > 0x7f. findViewById is final, so support library workarounds are not possible. Instead, IDs (@id/foo) are just sentinels, their values don't matter. If building for pre-O devices, rewrite any references to these IDs of the for 0xPPTTEEEE, where PP > 7f, to 0x7fPPEEEE. The symbol table will check for potential collisions against the base APK, so this should be safe. Bug: 37498913 Test: manual Change-Id: Ife3bbd29db287757ef8a2ffd83053d97f1db2613 --- tools/aapt2/Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/aapt2/Main.cpp') diff --git a/tools/aapt2/Main.cpp b/tools/aapt2/Main.cpp index 87fda16ee956..9d00c529ac71 100644 --- a/tools/aapt2/Main.cpp +++ b/tools/aapt2/Main.cpp @@ -25,7 +25,7 @@ namespace aapt { static const char* sMajorVersion = "2"; // Update minor version whenever a feature or flag is added. -static const char* sMinorVersion = "13"; +static const char* sMinorVersion = "14"; int PrintVersion() { std::cerr << "Android Asset Packaging Tool (aapt) " << sMajorVersion << "." -- cgit v1.2.3-59-g8ed1b