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
Metadata
Release files for ARParser 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arparser-0.2.tar.gz | 103.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arparser-0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 210.0 kB
Release files / arparser-0.2.tar.gz
| Download URL | arparser-0.2.tar.gz |
|---|---|
| Size | 103.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5cd66228618ebac89a940977895e1a366a349a9081c75efe905433f78f9b90e5
|
|
BLAKE2b-256 checksum How to use checksums |
49a6b9a53a45c0fdeefe3fdcce03ebb832aa19851c7360917c1a25c491d853a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Release files / arparser-0.2-py3-none-any.whl
| Download URL | arparser-0.2-py3-none-any.whl |
|---|---|
| Size | 106.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88206cf5cd5b79bb19d16b169055878059afad46210b143e93585fa0c4f70748
|
|
BLAKE2b-256 checksum How to use checksums |
8193f6662f0daf97420b6944defe8b2edc202fe436570c207d56a09e27d8f9e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|