reardenlife
reardenlife

Reputation: 317

r8 obfuscation map of class names

I am using r8 dexer to make classes.dex file from a bunch of *.class files. I would like to use obfuscation feature for all my classes, but the problem is that I also have AndroidManifest.xml file where class names are specified. So I have to know from which name to which name the r8 transformation took place in order to change my AndroidManifest.xml accordingly. The question is - how to prodice such a map?

Here is how the things are looking so far:

javac -cp $CLASSPATH -source 1.8 -target 1.8 com/obs/*.java
#dx --dex --output classes.dex com/obs/*.class $(cat classes.json | jq .[] | xargs -I{} echo -n "{} ")

# https://r8.googlesource.com/r8/+/refs/heads/d8-1.5.13
# https://r8.googlesource.com/r8/+archive/refs/heads/d8-1.5.13.tar.gz
#
java -jar /opt/r8/build/libs/r8.jar --version
java -jar /opt/r8/build/libs/r8.jar --release --output . --pg-conf proguard.cfg $(echo -n "$CLASSPATH" | xargs -I{} -d: echo -n " --lib {} ") com/obs/*.class $(cat classes.json | jq -r .[] | xargs -I{} echo -n "{} ")

Upvotes: 0

Views: 1646

Answers (2)

sgjesse
sgjesse

Reputation: 4628

On the R8 command line you can use the option --pg-map-output <file> instead of adding -printmapping to the configuration.

When building using the Android Gradle Plugin with minifyEnabled true the mapping file is by default generated in app/build/outputs/mapping/release.

Upvotes: 0

reardenlife
reardenlife

Reputation: 317

Oh. Found it apparently.

-printmapping

https://www.guardsquare.com/en/products/proguard/manual/usage

Upvotes: 1

Related Questions