Skip to content

About

Pure python ABX file viewer with option to export to regular XML. Written using AI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ABX Browser

A small Python desktop browser for Android Binary XML (ABX version 0). It uses only the Python standard library and Tkinter.

python3 abx_browser.py
python3 abx_browser.py /path/to/settings.xml

Python 3.9 or newer with Tk support is required. Some Linux distributions package Tk separately as python3-tk; macOS Python distributions may also require their matching Tk package.

Open an ABX file, then expand the tree to inspect elements, attributes, text, comments, CDATA, processing instructions, and declarations. The columns show decoded values, original attribute types, and byte offsets. Select any row to see its complete name and value in the lower pane.

Enter a Python regular expression and press Search or Enter. Search covers every node's name and value, with an optional case-insensitive mode. Matching rows turn yellow. Next and Previous move through individual occurrences, wrap at either end, expand parent nodes, and highlight the current occurrence in orange in the detail pane. F3 / Shift-F3 also navigate results. Zero-width matches count as results and highlight the next available character. Editing the expression clears stale results. Ctrl/Cmd+O opens a file; Ctrl/Cmd+F focuses search.

Export XML writes UTF-8 XML with escaped values and preserves mixed content without adding indentation. Binary data becomes hex or base64; typed numbers and booleans become text. XML does not retain ABX types, offsets, or string references. Null attributes become empty strings. The source file is protected from accidental overwrite. Invalid XML names or characters produce an error rather than an invalid export.

Conversion is also available without launching the UI:

python3 abx_browser.py input.abx --export output.xml
python3 -m unittest discover -s tests -v

Format review

This implements the Google/AOSP ABX wire format, not the chunk-based AXML format used for APK AndroidManifest.xml files.

The authoritative references are AOSP's BinaryXmlSerializer, BinaryXmlPullParser, and FastDataInput.

  • Header: four bytes 41 42 58 00 (ABX\0), with the last byte specifying version 0.
  • Every event starts with one byte: low nibble = XML event; high nibble = value type.
  • Events 0–10: start document, end document, start tag, end tag, text, CDATA, entity reference, ignorable whitespace, processing instruction, comment, document declaration. Event 15 is an attribute immediately following a start tag.
  • Types 1–13: null, string, interned string, hex bytes, base64 bytes, int, hex int, long, hex long, float, double, true, false.
  • Integers, references, lengths, and IEEE floating-point values use big-endian byte order. Integers are signed 32 or 64 bits; hex integer text follows AOSP's signed base-16 conversion.
  • Strings have an unsigned 16-bit byte length. Android's base FastDataInput uses modified UTF-8, including encoded NUL and UTF-16 surrogate pairs; this reader also accepts standard UTF-8 used by optimized implementations.
  • Interned strings start with a 16-bit reference. FFFF means a new length-prefixed string; subsequent references index the shared table. The table stores at most 65,535 strings.
  • Tag and attribute names use interned strings. Text events use ordinary strings. An attribute has an interned name followed by a value encoded according to its type nibble.
  • ABX has no namespace/prefix model. This reader rejects unsupported versions, unknown tokens/types, truncated values, bad references, mismatched tags, duplicate attributes, and incomplete documents. Like Android, it accepts EOF at a complete document boundary without an explicit end-document token.

The application loads the document and tree into memory. Very large files and pathological regex patterns can delay the UI; this simple browser is intended for interactive inspection of ordinary Android configuration files. Float formatting preserves numeric value but does not promise identical lexical formatting to Java. No external entities are fetched during export validation.

About

Pure python ABX file viewer with option to export to regular XML. Written using AI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages