#ProGuard Guides?

72 messages · Page 1 of 1 (latest)

dapper brook
#

I wan't to shrink the size of my .jar file using ProGuard, but I can't figure out how it works

viscid fulcrumBOT
#

This post has been reserved for your question.

Hey @dapper brook! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

hoary salmon
#

What is the exact issue?

dapper brook
#

I have installed proguard and there is no .jar

hoary salmon
#

How did you configure Prouard?

#

Did you configure a main class?

#

Can you run the JAR before proguard?

dapper brook
#

yes

#

my problem is proguard.jar not existing

hoary salmon
#

Can you rename it to proguard.zip?

#

and then show its content?

#

also run the dir command in the cmd window first

dapper brook
#

it didn't come with proguard when I downloaded it

hoary salmon
#

Oh so the issue is you cannot run proguard?

dapper brook
hoary salmon
#

What is in there?

#

I thought you had an issue running the minified executable

dapper brook
#

heres the bin folder

hoary salmon
#

What happens when running proguard.bat from cmd?

#

Did your antivirus maybe delete the JAR?

dapper brook
hoary salmon
#

I meant you run proguard.bat from inside cmd

dapper brook
#

ok

hoary salmon
#

Can you show the content of the proguard.bat file?

dapper brook
hoary salmon
# dapper brook

Can you show the full command you were executing to get that and the full output?

dapper brook
#

i just went into cmd and ran the command "proguard.bat"

hoary salmon
#

Can you right-click on the proguard.bat file and select edit?

#

What other files and directories are in the proguard installation other than bin?

dapper brook
# hoary salmon Can you right-click on the proguard.bat file and select edit?

@ECHO OFF

REM Start-up script for ProGuard -- free class file shrinker, optimizer,
REM obfuscator, and preverifier for Java bytecode.
REM
REM Note: when passing file names containing spaces to this script,
REM you'll have to add escaped quotes around them, e.g.
REM ""C:/My Directory/My File.txt""

IF EXIST "%PROGUARD_HOME%" GOTO home
SET PROGUARD_HOME=%~dp0..
:home

java -jar "%PROGUARD_HOME%\lib\proguard.jar" %*

hoary salmon
#

Can you run proguardgui.bat?

dapper brook
#

yes

hoary salmon
#

ok that should work

#

in input/output, you should be enable to configure the JAR etc

#

and then use other options

#

and in shrinking you can do other things

dapper brook
#

heres some errors i got

hoary salmon
#

these are warnings from what I see

#

What happens when running the generated JAR?

dapper brook
#

cat

#

*cant

hoary salmon
#

oh ok

#

Cab you show your configuration?

dapper brook
hoary salmon
#

Was that file created by the GUI?

dapper brook
#

theres a save configuration button

hoary salmon
#

Can you show the options in the GUI?

dapper brook
hoary salmon
#

e.g. for input/output and shrinking

dapper brook
hoary salmon
#

Can you add -dontwarn javax.swing.**?

#

idk where exactly to add it

hoary salmon
# dapper brook

otherwise what happens if you disable the Swing L&F button there?

dapper brook
#

same thing

hoary salmon
#

What's the output with the dontwarn thing

dapper brook
#

idk where to add it

hoary salmon
#

maybe put it in a file

#

add the dontwarns (you'd also need -dontwarn java.awt.**)
and then run proguard.bat @yourconfigfilehere

#

something like that maybe

dapper brook
#

Are there any other ways to shrink a jar file?

#

i vaguely remember reading something about 7zip