質問

enter image description here

using the tools dex2jar and Java Decompiler I examined two versions of an apk file that was built in eclipse with proguard enabled. One version of the apk was made with this command as part of proguard-project.txt file

  -libraryjars /libs/GraphView-3.1.1.jar

and in the other verson of the apk has this line commented out

looking at the resulting apk files after conversion from apk to jar and viewing them. both of the apk files are obfuscated however they are exactly the same. so the -libraryjars command is having no effect at all? why is the obfuscated code exactly the same in both cases?

in comparison I make two versions of apk files with other modifications and they result in different looking files. for example I added this line to the proguard-project.txt file

  -keep class com.example.proguardwithgson.MainActivity$TestObject { *; }

and it changed the resulting code for the apk, the TestObject inner class is no longer obfuscated and is clearly readable.

if the -keep command is working, then why does the -libraryjars command not do anything?

役に立ちましたか?

解決

The Android build process already specifies all the necessary -injars/-libraryjars/-outjars options for you. You should never specify them in your configuration file; you'd only get lots of warnings about duplicate classes.

You can find an explanation of their purpose in the ProGuard manual > Introduction.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top