Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use proguard on intellij IDEA?

Tags:

java

proguard

I am using Intellij IDEA to develop java desktop application. And I want to obfuscate my source code using proguard. How to integrate/use proguard on Intellij IDEA 2016.1.14?

like image 876
Adil Patuldil Avatar asked Nov 25 '17 09:11

Adil Patuldil


People also ask

How can I obfuscate a jar in Intellij?

Obfuscate the jar file: File --> project settings --> Facets( + Obfuscation ), then choose the path to ygurad-bundle/lib/yuguard. jar, and choose the main class.


1 Answers

1. add plugin Intellijguar2

enter image description here

2. in Project Structure ->modules->obfuscation press download yguard as it prompts. It brings to a html page where yguard is placed next to right edge of the page. Unzip.Get jar. Navigate to the jar. Set its path. Uncheck pedantic error-checking (optionally) , define project's MainClass. Ok it.

3. Build -> Build project -> build artifacts and get ordinary executable jar. (If you cannot see artifacts enabled in Run menu go to file-> project structure ->artfact and create by + new item with dependensy to the main class)

4. build -> obfuscate *** module

enter image description here

5. Add YourProject/out/production/YourProject/firstfolder_of_packagename containing your project's *.class files(mine was 'uz', e.g.) .

6. Remove Module compile output Assign a path to the jar to be obfuscated below and press 'build'

7. Open obfuscated jar with zip program. Make sure the class files are all obfuscated by JD-GUI app.

8. cut off META-INF folder and add META-INF one from executable inobfuscated jar and also folders like libs or assets(or find out them in artifacts you setup previously) manually. In turn you'll get an obfuscated executable jar E.g. for json lib finally I've got the result view in zip editor: enter image description here

like image 119
CodeToLife Avatar answered Sep 21 '22 03:09

CodeToLife