Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/col-e/binary-resources
Fork of Android's base tools project with some assorted fixes for obfuscated inputs
https://github.com/col-e/binary-resources
android android-resources reverse-engineering
Last synced: about 2 months ago
JSON representation
Fork of Android's base tools project with some assorted fixes for obfuscated inputs
- Host: GitHub
- URL: https://github.com/col-e/binary-resources
- Owner: Col-E
- Created: 2023-08-26T21:21:00.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-02T09:18:00.000Z (over 1 year ago)
- Last Synced: 2023-09-03T09:57:41.873Z (over 1 year ago)
- Topics: android, android-resources, reverse-engineering
- Language: Java
- Homepage: https://android.googlesource.com/platform/tools/base/+/refs/heads/mirror-goog-studio-main/apkparser/binary-resources/
- Size: 2.46 MB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Binary Resources [![badge](https://jitpack.io/v/Col-E/binary-resources.svg)](https://jitpack.io/#Col-E/binary-resources/)
A fork of the upstream [binary-resources](https://android.googlesource.com/platform/tools/base/+/refs/heads/mirror-goog-studio-main/apkparser/binary-resources/) tool project.
## What's changed?
- No longer requires/depends-on the Android SDK artifacts
- Helper utilities for printing binary XML
- Obfuscation resilience, handling inputs that would otherwise crash the base project, but are valid at install-time## Usage as a library
Here's a code sample of taking the `byte[]` of an `AndroidManifest.xml` and transforming it into a formatted `String`.
```java
// Create resource providers, which translate resource id values/keys into strings used in XML decoding
// - Implementing this interface is your responsibility.
// - While this is a bit of work, it allows you to update what values are provided even if this project never updates.
// - An example implementation is provided in this projects test module.
AndroidResourceProvider androidResources = ...
AndroidResourceProvider appResources = ...// Create the binary resource (AndroidManifest.xml) reader and pass it to the XML decoder,
// yielding a decoded string representation of the file contents.
BinaryResourceFile binaryResource = new BinaryResourceFile(binaryXmlBytes);
String decoded = XmlDecoder.decode(binaryResource, androidResources, appResources);
```
The example implementation of `AndroidResourceProvider` can be found here:
- [`AndroidResourceProviderImpl.java`](src/test/java/software/coley/androidres/AndroidResourceProviderImpl.java)
- The data it pulls from can be found in [`src/test/resources/android`](src/test/resources/android)You can use the project as a maven artifact via [JitPack](https://jitpack.io/#Col-E/binary-resources/)