aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2020-11-11 09:56:03 -0800
committerRob Landley <rob@landley.net>2020-11-11 19:31:49 -0600
commit7f213d0d08686188a745ae1dfd886c792d16c5bf (patch)
tree8c7be4297b76f24c3418dcf4350dd91a2a0de1ca /toys/posix
parent7f4f7e1f329518842fea180c4f7deb2dff368406 (diff)
downloadtoybox-7f213d0d08686188a745ae1dfd886c792d16c5bf.tar.gz
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.
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/file.c5
1 files changed, 5 insertions, 0 deletions
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;