Hi
I am beginner in proguard and trying to obfuscate my code with Proguard.
the module(spring bbot project) which I want to obfuscate ,generate multiple jars and few of those jars I want to obfuscate.
lets say my module is generating a.jar,ab.jar, c.jar.
now I want to obfuscate only those jars which are starting with a.
I have given the below statement in my proguard.cfg file
-injar a*.jar
but its failing and giving me an error by saying that no jar present at this location .
let me know how to fix this
Hello Shradha,
From the sounds of it, ProGuard cannot find the .jar file you are trying to specify as an input. Therefore, you would want to adjust your path to:
-injars /path/to/a*.jar
Note: ‘-injar’ is incorrect syntax. The correct syntax here is ‘-injars’ (plural)
Of course the path you provide, needs to point to the directory where all of those .jar files are located. Otherwise, ProGuard will not be able to locate those inputs.
To help us best guide you, please provide us with the full error you got (or a complete stacktrace). It would also be beneficial to see how you define these inputs in your gradle file(s).
Please let us know if anything is not clear.
Kind Regards,
Jack
HI Jack
I have provided injars only…it was a typo that I wrote injar
so my cfg files looks like that
-injars target/edos-dp-geobox-bin/edos-dp-geobox/jars/edos-dp-geobox-cm-pci*.jar
-outjars obfuscate/edos-dp-geobox-cm-pci_obfuscate.jar
-dontshrink
-ignorewarnings
-dontoptimize
-adaptclassstrings
-keepattributes
Exceptions,
InnerClasses,
Signature,
Deprecated,
SourceFile,
LineNumberTable,
Annotation,
EnclosingMethod
-keepnames interface **
-keep
class com.ericsson.edosdp.geobox.GeoBoxMain {
public void main(java.lang.String[]);
}
-keepdirectories “com.ericsson.edosdp.geobox.decoder.e3g.spec."
-keepdirectories "com.ericsson.edosdp.geobox.decoder.e4g.spec.”
and edos-dp-geobox-cm-pci-20.12.45.0-20201103.160532-12.jar is my jar name
now I am getting the below error
[proguard] Error: Can’t read [C:\Geobox\traces-geobox\edos-dp-geobox-main\target\edos-dp-geobox-bin\edos-dp-geobox\jars\edos-dp-geobox-cm-pci*.jar] (No such file or directory: C:\Geobox\traces-geobox\edos-dp-geobox-main\target\edos-dp-geobox-bin\edos-dp-geobox\jars\edos-dp-geobox-cm-pci*.jar)
note - I tried with ** also
I tried giving jar name in quotes also
nothing worked
ok
it worked by putting semicolon
Hi Shradha,
Glad to hear that worked out!
Could you please provide the solution you used to solve this problem? Hopefully, this will help others on this community, in the event they encounter a similar problem.
Thank you!
Sure jack
solution is injars (/path/to/a*.jar;)
We need to put semicolon ,then it will work