16
16
import picocli .CommandLine ;
17
17
18
18
import javax .swing .*;
19
+ import java .awt .*;
19
20
import java .io .File ;
21
+ import java .io .IOException ;
22
+ import java .net .URI ;
23
+ import java .net .URISyntaxException ;
24
+ import java .util .concurrent .CompletableFuture ;
25
+ import java .util .concurrent .TimeUnit ;
20
26
21
27
public class SkidfuscatorMain {
22
28
@@ -33,7 +39,41 @@ public static void main(String[] args) {
33
39
} catch (Exception e ) {
34
40
e .printStackTrace ();
35
41
}
36
- new MainFrame ().setVisible (true );
42
+
43
+ final int option = JOptionPane .showOptionDialog (
44
+ null ,
45
+ "You are running Skidfuscator Community! Whilst this project is free and open-source, " +
46
+ "we heavily encourage commercial usage to support the project by licensing via the enterprise" +
47
+ " edition available on our website" ,
48
+ "Notice!" ,
49
+ JOptionPane .DEFAULT_OPTION ,
50
+ JOptionPane .INFORMATION_MESSAGE ,
51
+ UIManager .getIcon ("OptionPane.informationIcon" ),
52
+ new Object []{"OK" , "Buy Enterprise" , "Join the Discord" },
53
+ "OK"
54
+ );
55
+
56
+ if (option == 0 ) {
57
+ new MainFrame ().setVisible (true );
58
+ return ;
59
+ }
60
+
61
+ final String url = switch (option ) {
62
+ case 1 -> "https://skidfuscator.dev/pricing" ;
63
+ case 2 -> "https://discord.gg/QJC9g8fBU9" ;
64
+ default -> throw new IllegalStateException ("Impossible" );
65
+ };
66
+
67
+ CompletableFuture .delayedExecutor (1 , TimeUnit .SECONDS ).execute (() -> {
68
+ try {
69
+ Desktop .getDesktop ().browse (new URI (url ));
70
+ } catch (IOException | URISyntaxException e ) {
71
+ throw new RuntimeException (e );
72
+ }
73
+ });
74
+ main (args );
75
+ return ;
76
+
37
77
});
38
78
return ;
39
79
}
0 commit comments