Skip to content

Obfuscate and transform log constant code like Proguard

Notifications You must be signed in to change notification settings

eritpchy/log-mapping-processor

Repository files navigation

Log Mapping Processor

Download

Log Mapping Processor is an open-source library to obfuscate and transform log constant code like Proguard

sample

Getting started

  1. Adjust your log code like: Log.java
  2. run Log Mapping Processor
    java -jar log-mapping.jar \
        --input-dir <path_to_your_java_project_source> \
        --output-dir <path_to_processed_source_output> \
        --mapping-file <path_to_mapping_file_output> \
        --log-keyword net.xdow.Log.debug \
        --log-keyword net.xdow.Log.error
  3. Unmapping your mapping.txt using Log Mapping Reverse

Compiling

To compile Log Mapping Processor, you need a Java Development Kit 1.8 (JDK8)

git clone https://github.com/eritpchy/log-mapping-processor
cd log-mapping-processor
./gradlew jar

Usage as library

Gradle:

implementation 'net.xdow:log-mapping:1.0.7'

Maven:

<dependency>
    <groupId>net.xdow</groupId>
    <artifactId>log-mapping</artifactId>
    <version>1.0.7</version>
</dependency>

Java:

Launcher.main(new String[]{
        "-v",
        "--input-dir", "<path_to_your_java_project_source>",
        "--output-dir", "<path_to_processed_source_output>",
        "--mapping-file", "<path_to_mapping_file_output>",
        "--log-keyword", "net.xdow.Log.debug",
        "--log-keyword", "net.xdow.Log.error",
});

Code example: TestMain.java

Notice

  • Log format like "Log.error(...)" is supported
  • Log format like "Log.error("arg1:{} arg2:{}", arg1, arg2, ...)" is NOT supported

References

About

Obfuscate and transform log constant code like Proguard

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published