From 7f213d0d08686188a745ae1dfd886c792d16c5bf Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 11 Nov 2020 09:56:03 -0800 Subject: file: identify Android Binary XML. Android is introducing a new binary XML format that is a drop-in replacement for many existing .xml files written by system_server. Since engineers may be surprised when encountering this new format, add it to the "file" tool to aid identification in the field. --- toys/posix/file.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'toys/posix') diff --git a/toys/posix/file.c b/toys/posix/file.c index 5ec24919..4ff2cca7 100644 --- a/toys/posix/file.c +++ b/toys/posix/file.c @@ -394,6 +394,11 @@ static void do_regular_file(int fd, char *name) xprintf("Android DTB/DTBO v%d, %d entries\n", (int) peek_be(s+28, 4), (int) peek_be(s+16, 4)); + // frameworks/base/core/java/com/android/internal/util/BinaryXmlSerializer.java + } else if (len>4 && !memcmp(s, "ABX", 3)) { + xprintf("Android Binary XML v%d\n", s[3]); + + // Text files, including shell scripts. } else { char *what = 0; int i, bytes; -- cgit v1.2.3