A colorful and highly configurable alternative to the `adb logcat` command from
the Android SDK with on the fly deobfuscation! (based on Marshall Culpepper's great [logcat-color](https://github.com/marshall/logcat-color)).
recat uses [pyretrace](https://github.com/EverythingMe/pyretrace) to deobfuscate logs.
**Note**: recat (logcat-color) is targetted at OS X and Linux, and does not currently
work in Windows.
[](https://badge.fury.io/py/recat-color)
# Installation
**Installation via pip**
```bash
$ pip install recat-color
```
**Installation from source** (requires setuptools, may require sudo)
You can clone the recat git repository directly:
```bash
$ git clone https://github.com/EverythingMe/recat.git
```
To install logcat-color from the source directory, run:
```bash
$ sudo pip install .
```
or
```bash
$ sudo python setup.py install
```
## Examples
#### for logcat-color usage examples, configuration and profiles, go to (logcat-color's original [README](https://github.com/marshall/logcat-color/blob/master/README.md))
##Deobfuscation
**recat** retraces obfuscated logs using [pyretrace](https://github.com/EverythingMe/pyretrace), a python reimplementation on Proguard's Retrace, with a deobfuscation API for python.
When looking at logs from an obfuscated release build, trace messages are obfuscated too, here's a crash log from EverythingMe Launcher's release build:

Supplying a mapping file path as a command line argument will trigger the deobfuscation mechanism, causing every log line to go through pyretrace's deobfuscator.
```bash
$ recat -m path/to/mapping/file.txt
```
Same log, now with mapping file path added:

This will make the best effort to deobfuscate the 'message' in each line.
### Deobfuscating tags
The following snippet is taken from [iosched](https://github.com/google/iosched/blob/master/android/src/main/java/com/google/samples/apps/iosched/util/LogUtils.java). It became a pretty popular strategy for log tag creation.
```java
public static String makeLogTag(String str) {
if (str.length() > MAX_LOG_TAG_LENGTH - LOG_PREFIX_LENGTH) {
return LOG_PREFIX + str.substring(0, MAX_LOG_TAG_LENGTH - LOG_PREFIX_LENGTH - 1);
}
return LOG_PREFIX + str;
}
/**
* Don't use this when obfuscating class names!
*/
public static String makeLogTag(Class cls) {
return makeLogTag(cls.getSimpleName());
}
```
If you use this type of deobfuscation and wish to deobfuscate the tag as well, you must supply a prefix for your tags (i.e. `LOG_PREFIX`), here's an example:
EverythingMe Launcher used `ev.` as its base log prefix, adding `-t ev` will now deobfuscate the tags as well:
```bash
$ recat -m path/to/mapping/file.txt -t ev
```
Same output, now with deobfuscated tags:

## TODO - Mapping Fetcher
I also added a skeleton for a mapping file fetcher. It should auto download a mapping file from a file server by supplying a mapping file path template.
## Thanks
Thanks to [Marshall Culpepper](https://github.com/marshall) for the great [logcat-color](https://github.com/marshall/logcat-color).
Metadata
Release files for recat-color 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| recat-color-0.1.1.tar.gz | 11.6 kB | Without provenance | Details for recat-color-0.1.1.tar.gz |
Release files / recat-color-0.1.1.tar.gz
| Download URL | recat-color-0.1.1.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d3b6650819bf3feb7ec50020f4a17530f31ed685175d2adad1a880051cc25b20
|
|
BLAKE2b-256 checksum How to use checksums |
c15b483e5e0f73bf67dc71711a862840aa1e0fc9d591fc97fb0a84988cc748ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for recat-color 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.