Python library for the Android binary XML ( AXML ) file format.
Project description
ARParser
Androguard's axml
This is a library for handling the AXML file format. "AXML" is the informal
common name for the compiled binary XML data format used in Android app files.
The Android Open Source Project does not seem to have named the format, other
than referring to is as "binary XML" or "compiled XML". So AXML stands for
Android XML. The file format is based on compiling XML source into a binary
format based on protobuf. There are a number of different Android XML file
types that are compiled to AXML, these are generically known as Android
Resources.
All of these files are included in the APK's ZIP package with the file extension
.xml even though they are actually AXML and not XML.
Some specific data files, like String Resources and Style Resources, are instead
compiled into a single file resources.arsc in its own data format, known as
ASRC. AXML files often refer to values that are in resources.arsc.
The entry point for an app is the "app
manifest"
defines the essential data points that every app must have, like Package Name
and Version Code, and includes lots of other metadata that describe the
app. Every Android app file (APK) must include
AndroidManifest.xml,
which in the APK is the compiled binary AXML format, not XML, despite the file
extension. The source code files for the binary app manifest file are also
called AndroidManifest.xml, but they are actually XML. There can be
multiple source files,
but there is only ever one single compiled binary AndroidManifest.xml that is
valid in the APK.
https://developer.android.com/guide/topics/manifest/manifest-intro#reference
Installation Method
๐ข Requirement PKG ๐ข
termux-setup-storage && pkg update -y && pkg upgrade -y && pkg install python libxslt -y && pip install click pygments rich lxml
๐๐ป To install ARParser, Run only any one cmd from the Installation Method
๐ข PYPI ( Just Testing ) ๐ข
pip install ARParser
1st. Method
๐ข For Latest Commit ( From Mainย Branch )ย ๐ข
pip install --force-reinstall https://github.com/TechnoIndian/ARParser/archive/refs/heads/main.zip
Or
pip install --force-reinstall https://github.com/TechnoIndian/ARParser/archive/refs/heads/main.tar.gz
Or
curl -Ls https://github.com/TechnoIndian/Tools/releases/download/Tools/ARParser.sh | bash
2nd. Method
pkg install python git && pip install --force-reinstall git+https://github.com/TechnoIndian/ARParser.git
Uninstall ARParser
pip uninstall ARParser
Usage
AXMLPrinter
โโข AXMLPrinter ( Support APK & XML )
ARParser axml -i AndroidManifest.xml
Or
ARParser axml AndroidManifest.xml
With APK
ARParser axml Apk_Path.apk
โโข ID2Name, Default is ID ( @7F140004 ๐ @xml/network_security_config | _attr_01010003 ๐ android:name )
ARParser axml Apk_Path.apk -n
โโข ResParser ( Res AXML Parse )
ARParser axml Apk_Path.apk -r res/xml/xyz.xml
ID2Name
ARParser axml Apk_Path.apk -r res/xml/xyz.xml -n
Mode Help ( --help )
ARParser axml --help
ARSCParser
โโข Public XML ( Default )
ARParser arsc Apk_Path.apk
โโข hex ID ( Resolve ๐ locale and package )
ARParser arsc Apk_Path.apk -id 7f060008
โโข Locale ( en-rIN, en-rGB, zh-rCN etc. )
ARParser arsc Apk_Path.apk -l en-rIN
โโข Type [string|strings|bool|id|color|dimen|integer|public]
ARParser arsc Apk_Path.apk -t string
Mode Help ( --help )
ARParser arsc --help
Current status
- Passing androguard tests for axml and arsc.
Structure
axml/
โโโ axml/
โ โโโ __init__.py # Expose the public API (parse_axml, AXMLParser, AXMLPrinter)
โ โโโ apk.py # input APK_Path.apk, AndroidManifest.xml, resources.arsc
โ โโโ cli.py # Command Helper
โ โโโ main.py # Script Execution
โ โโโ constants.py # All constants (chunk types, flag values...)
โ โโโ exceptions.py # Custom exceptions (like ResParserError)
โ โโโ stringblock.py # The StringBlock class and its helper functions (_decode8, _decode16...)
โ โโโ parser_arsc.py # The resources parser class and related parsing functions
โ โโโ parser_axml.py # The AXMLParser class and related parsing functions
โ โโโ printer.py # The AXMLPrinter class for converting parsed AXML into an ElementTree
โ โโโ formatters.py # Helper functions like format_value and any formatting utilities
โ โโโ resources
โ โ โโโ __init__.py
โ โ โโโ public.json
โ โ โโโ public.py
โ โ โโโ public.xml
โโโ tests/
โ โโโ test_*.py # Unit tests for each module
โโโ setup.py # Packaging file
โโโ pyproject.toml # Build configuration
โโโ README.md # Project description and usage instructions
Goals
- Write tests early approach, so we can immediately verify breaking changes.
- Expose a clean public API
- Standalone capabilities for axml parsing
- Provide basic documentation
Coding style
- Follow PEP 257 guidelines using the reStructuredText (reST) format for all docstrings.
AXML binary format
Some references about the binary AXML format:
- aapt2 compiles XML to protobuf-based AXML
- aapt2 source code
- aapt source code
- The binary format for
AndroidManifest.xmlis defined inApkInfo.proto.
๐ฎ๐ณ Welcome By Techno India ๐ฎ๐ณ
Credit
- axml compiles XML to protobuf-based AXML
- androguard compiles XML to protobuf-based AXML
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arparser-0.2.tar.gz.
File metadata
- Download URL: arparser-0.2.tar.gz
- Upload date:
- Size: 103.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cd66228618ebac89a940977895e1a366a349a9081c75efe905433f78f9b90e5
|
|
| MD5 |
4f2426fd46ff0d99a9dbe7f62d2bf835
|
|
| BLAKE2b-256 |
49a6b9a53a45c0fdeefe3fdcce03ebb832aa19851c7360917c1a25c491d853a9
|
File details
Details for the file arparser-0.2-py3-none-any.whl.
File metadata
- Download URL: arparser-0.2-py3-none-any.whl
- Upload date:
- Size: 106.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88206cf5cd5b79bb19d16b169055878059afad46210b143e93585fa0c4f70748
|
|
| MD5 |
afb91df56130303729fa11bfb68b3824
|
|
| BLAKE2b-256 |
8193f6662f0daf97420b6944defe8b2edc202fe436570c207d56a09e27d8f9e6
|