11package dev .skidfuscator .obfuscator .command ;
22
3+ import dev .skidfuscator .migration .ExemptToConfigMigration ;
34import dev .skidfuscator .obfuscator .Skidfuscator ;
45import dev .skidfuscator .obfuscator .SkidfuscatorSession ;
56import dev .skidfuscator .obfuscator .util .ConsoleColors ;
@@ -55,6 +56,12 @@ public class ObfuscateCommand implements Callable<Integer> {
5556 )
5657 private File output ;
5758
59+ @ CommandLine .Option (
60+ names = {"-cfg" , "--config" },
61+ description = "Path to the config file"
62+ )
63+ private File config ;
64+
5865 @ CommandLine .Option (
5966 names = {"-ph" , "--phantom" },
6067 description = "Declare if phantom computation should be used"
@@ -73,6 +80,12 @@ public class ObfuscateCommand implements Callable<Integer> {
7380 )
7481 private boolean notrack ;
7582
83+ @ CommandLine .Option (
84+ names = {"-re" , "--renamer" },
85+ description = "Enables renamer for the obfuscation"
86+ )
87+ private boolean renamer ;
88+
7689 @ Override
7790 public Integer call () {
7891 /* Total number of processors or cores available to the JVM */
@@ -127,7 +140,7 @@ public Integer call() {
127140 " │ " + topMemory + " │" ,
128141 " └───────────────────────────────────────────┘" ,
129142 "" ,
130- " Author: Ghast Version: 2.0.5 Today: "
143+ " Author: Ghast Version: 2.0.6 Today: "
131144 + DateFormat .getDateTimeInstance ().format (new Date (Instant .now ().toEpochMilli ())),
132145 ""
133146 };
@@ -154,6 +167,28 @@ public Integer call() {
154167 );
155168 }
156169
170+ if (exempt != null ) {
171+ final File converted = new File (exempt .getAbsolutePath ()
172+ .substring (0 , exempt .getAbsolutePath ().lastIndexOf ("/" )) + "/config.hocon" );
173+ final String warning = "\n " + ConsoleColors .YELLOW
174+ + "██╗ ██╗ █████╗ ██████╗ ███╗ ██╗██╗███╗ ██╗ ██████╗ \n "
175+ + "██║ ██║██╔══██╗██╔══██╗████╗ ██║██║████╗ ██║██╔════╝ \n "
176+ + "██║ █╗ ██║███████║██████╔╝██╔██╗ ██║██║██╔██╗ ██║██║ ███╗\n "
177+ + "██║███╗██║██╔══██║██╔══██╗██║╚██╗██║██║██║╚██╗██║██║ ██║\n "
178+ + "╚███╔███╔╝██║ ██║██║ ██║██║ ╚████║██║██║ ╚████║╚██████╔╝\n "
179+ + " ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝ ╚═════╝ \n "
180+ + "\n "
181+ + "⚠️ Warning! Skidfuscator has deprecated the exempt file!\n "
182+ + ConsoleColors .RESET
183+ + "\n Launching migrator service..."
184+ + "\n Config will be found at " + converted
185+ + "\n " ;
186+ Skidfuscator .LOGGER .post (warning );
187+ new ExemptToConfigMigration ().migrate (exempt , converted );
188+
189+ config = converted ;
190+ }
191+
157192 final File [] libs ;
158193 if (libFolder != null ) {
159194 libs = libFolder .listFiles ();
@@ -170,6 +205,8 @@ public Integer call() {
170205 .phantom (phantom )
171206 .jmod (MiscUtil .getJavaVersion () > 8 )
172207 .fuckit (fuckit )
208+ .config (config )
209+ .renamer (renamer )
173210 .analytics (!notrack )
174211 .build ();
175212
0 commit comments