-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLauncher.scala
346 lines (332 loc) · 37.6 KB
/
Launcher.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.belfry.deployer
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.jar.Attributes;
import java.util.jar.JarEntry;
import java.util.jar.JarInputStream;
import java.util.jar.JarOutputStream;
import java.util.jar.Pack200;
import java.util.jar.Pack200.Unpacker;
/**
*
* @author rodrigo
*/
object Launcher {
val launcherBytes = Array[Byte](
-54, -2, -70, -66, 0, 0, 0, 50, 0, -28, 10, 0, 10, 0, 119, 10, 0, 51, 0, 120, 10, 0, 121, 0, 122,
7, 0, 123, 3, 0, 46, -32, 0, 10, 0, 4, 0, 124, 9, 0, 125, 0, 126, 8, 0, 127, 10, 0, -128, 0,
-127, 7, 0, -126, 8, 0, -125, 10, 0, 48, 0, -124, 10, 0, 48, 0, -123, 7, 0, -122, 10, 0, 14, 0, -121,
11, 0, 74, 0, -120, 8, 0, -119, 10, 0, 4, 0, -118, 9, 0, 10, 0, -117, 10, 0, 10, 0, -116, 8, 0,
-115, 10, 0, 10, 0, -114, 7, 0, -113, 10, 0, 23, 0, -112, 10, 0, 33, 0, -111, 10, 0, -110, 0, -109, 10,
0, 23, 0, -108, 9, 0, 10, 0, -107, 10, 0, -110, 0, -106, 11, 0, -105, 0, -104, 7, 0, -103, 8, 0, -102,
7, 0, -101, 7, 0, -100, 10, 0, 34, 0, -99, 10, 0, 33, 0, -112, 11, 0, -105, 0, -98, 7, 0, 60, 10,
0, 10, 0, -97, 7, 0, -96, 10, 0, 40, 0, -95, 10, 0, 33, 0, -94, 10, 0, -93, 0, -92, 8, 0, -91,
10, 0, -90, 0, -89, 10, 0, 40, 0, -88, 8, 0, 100, 7, 0, -87, 7, 0, 103, 10, 0, 48, 0, -86, 7,
0, -85, 10, 0, -84, 0, -83, 7, 0, -82, 10, 0, 53, 0, 120, 7, 0, -81, 1, 0, 0, 1, 0, 12, 73,
110, 110, 101, 114, 67, 108, 97, 115, 115, 101, 115, 1, 0, 13, 83, 112, 101, 99, 105, 97, 108, 76, 111, 97, 100,
101, 114, 1, 0, 11, 117, 110, 112, 97, 99, 107, 101, 100, 65, 112, 112, 1, 0, 2, 91, 66, 1, 0, 5, 105,
110, 100, 101, 120, 1, 0, 15, 76, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 77, 97, 112, 59, 1, 0, 9,
83, 105, 103, 110, 97, 116, 117, 114, 101, 1, 0, 37, 76, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 77, 97,
112, 60, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 91, 66, 62, 59, 1,
0, 6, 60, 105, 110, 105, 116, 62, 1, 0, 3, 40, 41, 86, 1, 0, 4, 67, 111, 100, 101, 1, 0, 15, 76,
105, 110, 101, 78, 117, 109, 98, 101, 114, 84, 97, 98, 108, 101, 1, 0, 18, 76, 111, 99, 97, 108, 86, 97, 114,
105, 97, 98, 108, 101, 84, 97, 98, 108, 101, 1, 0, 4, 116, 104, 105, 115, 1, 0, 10, 76, 76, 97, 117, 110,
99, 104, 101, 114, 59, 1, 0, 8, 108, 111, 97, 100, 80, 97, 99, 107, 1, 0, 8, 117, 110, 112, 97, 99, 107,
101, 114, 7, 0, -80, 1, 0, 8, 85, 110, 112, 97, 99, 107, 101, 114, 1, 0, 32, 76, 106, 97, 118, 97, 47,
117, 116, 105, 108, 47, 106, 97, 114, 47, 80, 97, 99, 107, 50, 48, 48, 36, 85, 110, 112, 97, 99, 107, 101, 114,
59, 1, 0, 21, 98, 121, 116, 101, 65, 114, 114, 97, 121, 79, 117, 116, 112, 117, 116, 83, 116, 114, 101, 97, 109,
1, 0, 31, 76, 106, 97, 118, 97, 47, 105, 111, 47, 66, 121, 116, 101, 65, 114, 114, 97, 121, 79, 117, 116, 112,
117, 116, 83, 116, 114, 101, 97, 109, 59, 1, 0, 10, 69, 120, 99, 101, 112, 116, 105, 111, 110, 115, 1, 0, 1,
99, 1, 0, 11, 105, 79, 69, 120, 99, 101, 112, 116, 105, 111, 110, 1, 0, 21, 76, 106, 97, 118, 97, 47, 105,
111, 47, 73, 79, 69, 120, 99, 101, 112, 116, 105, 111, 110, 59, 1, 0, 5, 105, 110, 112, 117, 116, 1, 0, 30,
76, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 106, 97, 114, 47, 74, 97, 114, 73, 110, 112, 117, 116, 83, 116,
114, 101, 97, 109, 59, 1, 0, 8, 106, 97, 114, 69, 110, 116, 114, 121, 1, 0, 24, 76, 106, 97, 118, 97, 47,
117, 116, 105, 108, 47, 106, 97, 114, 47, 74, 97, 114, 69, 110, 116, 114, 121, 59, 1, 0, 3, 100, 105, 110, 1,
0, 25, 76, 106, 97, 118, 97, 47, 105, 111, 47, 68, 97, 116, 97, 73, 110, 112, 117, 116, 83, 116, 114, 101, 97,
109, 59, 1, 0, 13, 83, 116, 97, 99, 107, 77, 97, 112, 84, 97, 98, 108, 101, 7, 0, -101, 7, 0, -113, 7,
0, -79, 7, 0, -103, 1, 0, 8, 103, 101, 116, 73, 110, 112, 117, 116, 1, 0, 32, 40, 41, 76, 106, 97, 118,
97, 47, 117, 116, 105, 108, 47, 106, 97, 114, 47, 74, 97, 114, 73, 110, 112, 117, 116, 83, 116, 114, 101, 97, 109,
59, 1, 0, 8, 103, 101, 116, 69, 110, 116, 114, 121, 1, 0, 22, 40, 76, 106, 97, 118, 97, 47, 108, 97, 110,
103, 47, 83, 116, 114, 105, 110, 103, 59, 41, 91, 66, 1, 0, 5, 101, 110, 116, 114, 121, 1, 0, 18, 76, 106,
97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 1, 0, 4, 109, 97, 105, 110, 1, 0,
22, 40, 91, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 41, 86, 1, 0,
4, 97, 114, 103, 115, 1, 0, 19, 91, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110,
103, 59, 1, 0, 13, 115, 112, 101, 99, 105, 97, 108, 76, 111, 97, 100, 101, 114, 1, 0, 24, 76, 76, 97, 117,
110, 99, 104, 101, 114, 36, 83, 112, 101, 99, 105, 97, 108, 76, 111, 97, 100, 101, 114, 59, 1, 0, 6, 118, 97,
108, 117, 101, 115, 1, 0, 26, 76, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 106, 97, 114, 47, 65, 116, 116,
114, 105, 98, 117, 116, 101, 115, 59, 1, 0, 9, 109, 97, 105, 110, 67, 108, 97, 115, 115, 1, 0, 11, 108, 111,
97, 100, 101, 100, 67, 108, 97, 115, 115, 1, 0, 17, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 67, 108,
97, 115, 115, 59, 1, 0, 22, 76, 111, 99, 97, 108, 86, 97, 114, 105, 97, 98, 108, 101, 84, 121, 112, 101, 84,
97, 98, 108, 101, 1, 0, 20, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 67, 108, 97, 115, 115, 60, 42,
62, 59, 7, 0, -78, 1, 0, 10, 97, 99, 99, 101, 115, 115, 36, 49, 48, 48, 1, 0, 2, 120, 48, 1, 0,
8, 60, 99, 108, 105, 110, 105, 116, 62, 1, 0, 10, 83, 111, 117, 114, 99, 101, 70, 105, 108, 101, 1, 0, 13,
76, 97, 117, 110, 99, 104, 101, 114, 46, 106, 97, 118, 97, 12, 0, 96, 0, 97, 12, 0, 65, 0, 66, 7, 0,
-77, 12, 0, -76, 0, -75, 1, 0, 29, 106, 97, 118, 97, 47, 105, 111, 47, 66, 121, 116, 101, 65, 114, 114, 97,
121, 79, 117, 116, 112, 117, 116, 83, 116, 114, 101, 97, 109, 12, 0, 65, 0, -74, 7, 0, -73, 12, 0, -72, 0,
-71, 1, 0, 9, 85, 110, 112, 97, 99, 107, 105, 110, 103, 7, 0, -70, 12, 0, -69, 0, -68, 1, 0, 8, 76,
97, 117, 110, 99, 104, 101, 114, 1, 0, 4, 47, 97, 112, 112, 12, 0, -67, 0, -66, 12, 0, -65, 0, -64, 1,
0, 29, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 106, 97, 114, 47, 74, 97, 114, 79, 117, 116, 112, 117, 116,
83, 116, 114, 101, 97, 109, 12, 0, 65, 0, -63, 12, 0, -62, 0, -61, 1, 0, 14, 85, 110, 112, 97, 99, 107,
105, 110, 103, 32, 100, 111, 110, 101, 12, 0, -60, 0, -59, 12, 0, 59, 0, 60, 12, 0, 61, 0, 66, 1, 0,
8, 73, 110, 100, 101, 120, 105, 110, 103, 12, 0, 94, 0, 95, 1, 0, 23, 106, 97, 118, 97, 47, 105, 111, 47,
68, 97, 116, 97, 73, 110, 112, 117, 116, 83, 116, 114, 101, 97, 109, 12, 0, 65, 0, -58, 12, 0, -57, 0, -56,
7, 0, -79, 12, 0, -55, 0, -54, 12, 0, -53, 0, -52, 12, 0, 61, 0, 62, 12, 0, -51, 0, -50, 7, 0,
-49, 12, 0, -48, 0, -47, 1, 0, 19, 106, 97, 118, 97, 47, 105, 111, 47, 73, 79, 69, 120, 99, 101, 112, 116,
105, 111, 110, 1, 0, 10, 73, 110, 100, 101, 120, 32, 100, 111, 110, 101, 1, 0, 28, 106, 97, 118, 97, 47, 117,
116, 105, 108, 47, 106, 97, 114, 47, 74, 97, 114, 73, 110, 112, 117, 116, 83, 116, 114, 101, 97, 109, 1, 0, 28,
106, 97, 118, 97, 47, 105, 111, 47, 66, 121, 116, 101, 65, 114, 114, 97, 121, 73, 110, 112, 117, 116, 83, 116, 114,
101, 97, 109, 12, 0, 65, 0, -52, 12, 0, -46, 0, -45, 12, 0, 72, 0, 66, 1, 0, 22, 76, 97, 117, 110,
99, 104, 101, 114, 36, 83, 112, 101, 99, 105, 97, 108, 76, 111, 97, 100, 101, 114, 12, 0, 65, 0, -44, 12, 0,
-43, 0, -42, 7, 0, -41, 12, 0, -40, 0, -39, 1, 0, 10, 77, 97, 105, 110, 45, 67, 108, 97, 115, 115, 7,
0, -38, 12, 0, -37, 0, -36, 12, 0, -35, 0, -34, 1, 0, 15, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47,
67, 108, 97, 115, 115, 12, 0, -33, 0, -32, 1, 0, 16, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 79, 98,
106, 101, 99, 116, 7, 0, -31, 12, 0, -30, 0, -29, 1, 0, 17, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47,
72, 97, 115, 104, 77, 97, 112, 1, 0, 10, 76, 97, 117, 110, 99, 104, 101, 114, 36, 49, 1, 0, 30, 106, 97,
118, 97, 47, 117, 116, 105, 108, 47, 106, 97, 114, 47, 80, 97, 99, 107, 50, 48, 48, 36, 85, 110, 112, 97, 99,
107, 101, 114, 1, 0, 22, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 106, 97, 114, 47, 74, 97, 114, 69, 110,
116, 114, 121, 1, 0, 19, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 69, 120, 99, 101, 112, 116, 105, 111, 110,
1, 0, 21, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 106, 97, 114, 47, 80, 97, 99, 107, 50, 48, 48, 1,
0, 11, 110, 101, 119, 85, 110, 112, 97, 99, 107, 101, 114, 1, 0, 34, 40, 41, 76, 106, 97, 118, 97, 47, 117,
116, 105, 108, 47, 106, 97, 114, 47, 80, 97, 99, 107, 50, 48, 48, 36, 85, 110, 112, 97, 99, 107, 101, 114, 59,
1, 0, 4, 40, 73, 41, 86, 1, 0, 16, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 121, 115, 116, 101,
109, 1, 0, 3, 111, 117, 116, 1, 0, 21, 76, 106, 97, 118, 97, 47, 105, 111, 47, 80, 114, 105, 110, 116, 83,
116, 114, 101, 97, 109, 59, 1, 0, 19, 106, 97, 118, 97, 47, 105, 111, 47, 80, 114, 105, 110, 116, 83, 116, 114,
101, 97, 109, 1, 0, 7, 112, 114, 105, 110, 116, 108, 110, 1, 0, 21, 40, 76, 106, 97, 118, 97, 47, 108, 97,
110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 41, 86, 1, 0, 11, 103, 101, 116, 82, 101, 115, 111, 117, 114, 99,
101, 1, 0, 34, 40, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 41, 76,
106, 97, 118, 97, 47, 110, 101, 116, 47, 85, 82, 76, 59, 1, 0, 19, 103, 101, 116, 82, 101, 115, 111, 117, 114,
99, 101, 65, 115, 83, 116, 114, 101, 97, 109, 1, 0, 41, 40, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47,
83, 116, 114, 105, 110, 103, 59, 41, 76, 106, 97, 118, 97, 47, 105, 111, 47, 73, 110, 112, 117, 116, 83, 116, 114,
101, 97, 109, 59, 1, 0, 25, 40, 76, 106, 97, 118, 97, 47, 105, 111, 47, 79, 117, 116, 112, 117, 116, 83, 116,
114, 101, 97, 109, 59, 41, 86, 1, 0, 6, 117, 110, 112, 97, 99, 107, 1, 0, 55, 40, 76, 106, 97, 118, 97,
47, 105, 111, 47, 73, 110, 112, 117, 116, 83, 116, 114, 101, 97, 109, 59, 76, 106, 97, 118, 97, 47, 117, 116, 105,
108, 47, 106, 97, 114, 47, 74, 97, 114, 79, 117, 116, 112, 117, 116, 83, 116, 114, 101, 97, 109, 59, 41, 86, 1,
0, 11, 116, 111, 66, 121, 116, 101, 65, 114, 114, 97, 121, 1, 0, 4, 40, 41, 91, 66, 1, 0, 24, 40, 76,
106, 97, 118, 97, 47, 105, 111, 47, 73, 110, 112, 117, 116, 83, 116, 114, 101, 97, 109, 59, 41, 86, 1, 0, 15,
103, 101, 116, 78, 101, 120, 116, 74, 97, 114, 69, 110, 116, 114, 121, 1, 0, 26, 40, 41, 76, 106, 97, 118, 97,
47, 117, 116, 105, 108, 47, 106, 97, 114, 47, 74, 97, 114, 69, 110, 116, 114, 121, 59, 1, 0, 7, 103, 101, 116,
83, 105, 122, 101, 1, 0, 3, 40, 41, 74, 1, 0, 9, 114, 101, 97, 100, 70, 117, 108, 108, 121, 1, 0, 5,
40, 91, 66, 41, 86, 1, 0, 7, 103, 101, 116, 78, 97, 109, 101, 1, 0, 20, 40, 41, 76, 106, 97, 118, 97,
47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 1, 0, 13, 106, 97, 118, 97, 47, 117, 116, 105, 108,
47, 77, 97, 112, 1, 0, 3, 112, 117, 116, 1, 0, 56, 40, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47,
79, 98, 106, 101, 99, 116, 59, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 79, 98, 106, 101, 99, 116, 59,
41, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 79, 98, 106, 101, 99, 116, 59, 1, 0, 3, 103, 101, 116,
1, 0, 38, 40, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 79, 98, 106, 101, 99, 116, 59, 41, 76, 106,
97, 118, 97, 47, 108, 97, 110, 103, 47, 79, 98, 106, 101, 99, 116, 59, 1, 0, 15, 40, 76, 76, 97, 117, 110,
99, 104, 101, 114, 36, 49, 59, 41, 86, 1, 0, 11, 103, 101, 116, 77, 97, 110, 105, 102, 101, 115, 116, 1, 0,
26, 40, 41, 76, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 106, 97, 114, 47, 77, 97, 110, 105, 102, 101, 115,
116, 59, 1, 0, 22, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 106, 97, 114, 47, 77, 97, 110, 105, 102, 101,
115, 116, 1, 0, 17, 103, 101, 116, 77, 97, 105, 110, 65, 116, 116, 114, 105, 98, 117, 116, 101, 115, 1, 0, 28,
40, 41, 76, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 106, 97, 114, 47, 65, 116, 116, 114, 105, 98, 117, 116,
101, 115, 59, 1, 0, 24, 106, 97, 118, 97, 47, 117, 116, 105, 108, 47, 106, 97, 114, 47, 65, 116, 116, 114, 105,
98, 117, 116, 101, 115, 1, 0, 8, 103, 101, 116, 86, 97, 108, 117, 101, 1, 0, 38, 40, 76, 106, 97, 118, 97,
47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 41, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47,
83, 116, 114, 105, 110, 103, 59, 1, 0, 9, 108, 111, 97, 100, 67, 108, 97, 115, 115, 1, 0, 37, 40, 76, 106,
97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 41, 76, 106, 97, 118, 97, 47, 108, 97,
110, 103, 47, 67, 108, 97, 115, 115, 59, 1, 0, 9, 103, 101, 116, 77, 101, 116, 104, 111, 100, 1, 0, 64, 40,
76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 91, 76, 106, 97, 118, 97, 47,
108, 97, 110, 103, 47, 67, 108, 97, 115, 115, 59, 41, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 114, 101,
102, 108, 101, 99, 116, 47, 77, 101, 116, 104, 111, 100, 59, 1, 0, 24, 106, 97, 118, 97, 47, 108, 97, 110, 103,
47, 114, 101, 102, 108, 101, 99, 116, 47, 77, 101, 116, 104, 111, 100, 1, 0, 6, 105, 110, 118, 111, 107, 101, 1,
0, 57, 40, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 79, 98, 106, 101, 99, 116, 59, 91, 76, 106, 97,
118, 97, 47, 108, 97, 110, 103, 47, 79, 98, 106, 101, 99, 116, 59, 41, 76, 106, 97, 118, 97, 47, 108, 97, 110,
103, 47, 79, 98, 106, 101, 99, 116, 59, 0, 33, 0, 10, 0, 51, 0, 0, 0, 2, 0, 10, 0, 59, 0, 60,
0, 0, 0, 10, 0, 61, 0, 62, 0, 1, 0, 63, 0, 0, 0, 2, 0, 64, 0, 8, 0, 1, 0, 65, 0,
66, 0, 1, 0, 67, 0, 0, 0, 51, 0, 1, 0, 1, 0, 0, 0, 5, 42, -73, 0, 2, -79, 0, 0, 0,
2, 0, 68, 0, 0, 0, 10, 0, 2, 0, 0, 0, 24, 0, 4, 0, 95, 0, 69, 0, 0, 0, 12, 0, 1,
0, 0, 0, 5, 0, 70, 0, 71, 0, 0, 0, 10, 0, 72, 0, 66, 0, 2, 0, 67, 0, 0, 0, -100, 0,
5, 0, 2, 0, 0, 0, 72, -72, 0, 3, 75, -69, 0, 4, 89, 18, 5, -73, 0, 6, 76, -78, 0, 7, 18,
8, -74, 0, 9, 19, 0, 10, 18, 11, -74, 0, 12, 87, 42, 19, 0, 10, 18, 11, -74, 0, 13, -69, 0, 14,
89, 43, -73, 0, 15, -71, 0, 16, 3, 0, -78, 0, 7, 18, 17, -74, 0, 9, 43, -74, 0, 18, -77, 0, 19,
-72, 0, 20, -79, 0, 0, 0, 2, 0, 68, 0, 0, 0, 38, 0, 9, 0, 0, 0, 30, 0, 4, 0, 31, 0,
14, 0, 32, 0, 22, 0, 33, 0, 31, 0, 36, 0, 53, 0, 38, 0, 61, 0, 39, 0, 68, 0, 40, 0, 71,
0, 41, 0, 69, 0, 0, 0, 22, 0, 2, 0, 4, 0, 68, 0, 73, 0, 76, 0, 0, 0, 14, 0, 58, 0,
77, 0, 78, 0, 1, 0, 79, 0, 0, 0, 4, 0, 1, 0, 31, 0, 10, 0, 61, 0, 66, 0, 2, 0, 67,
0, 0, 1, 3, 0, 3, 0, 4, 0, 0, 0, 73, -78, 0, 7, 18, 21, -74, 0, 9, -72, 0, 22, 75, -69,
0, 23, 89, 42, -73, 0, 24, 77, 42, -74, 0, 25, 89, 76, -58, 0, 33, 43, -74, 0, 26, -120, -68, 8, 78,
44, 45, -74, 0, 27, -78, 0, 28, 43, -74, 0, 29, 45, -71, 0, 30, 3, 0, 87, -89, -1, -36, -89, 0, 4,
78, -78, 0, 7, 18, 32, -74, 0, 9, -79, 0, 1, 0, 21, 0, 60, 0, 63, 0, 31, 0, 3, 0, 68, 0,
0, 0, 50, 0, 12, 0, 0, 0, 44, 0, 8, 0, 45, 0, 12, 0, 47, 0, 21, 0, 49, 0, 30, 0, 50,
0, 38, 0, 51, 0, 43, 0, 52, 0, 57, 0, 53, 0, 60, 0, 55, 0, 63, 0, 54, 0, 64, 0, 56, 0,
72, 0, 57, 0, 69, 0, 0, 0, 52, 0, 5, 0, 38, 0, 19, 0, 80, 0, 60, 0, 3, 0, 64, 0, 0,
0, 81, 0, 82, 0, 3, 0, 12, 0, 61, 0, 83, 0, 84, 0, 0, 0, 27, 0, 46, 0, 85, 0, 86, 0,
1, 0, 21, 0, 52, 0, 87, 0, 88, 0, 2, 0, 89, 0, 0, 0, 46, 0, 4, -2, 0, 21, 7, 0, 90,
0, 7, 0, 91, -1, 0, 38, 0, 3, 7, 0, 90, 7, 0, 92, 7, 0, 91, 0, 0, -1, 0, 2, 0, 3,
7, 0, 90, 0, 7, 0, 91, 0, 1, 7, 0, 93, 0, 0, 79, 0, 0, 0, 4, 0, 1, 0, 31, 0, 10,
0, 94, 0, 95, 0, 2, 0, 67, 0, 0, 0, 42, 0, 5, 0, 0, 0, 0, 0, 18, -69, 0, 33, 89, -69,
0, 34, 89, -78, 0, 19, -73, 0, 35, -73, 0, 36, -80, 0, 0, 0, 1, 0, 68, 0, 0, 0, 6, 0, 1,
0, 0, 0, 60, 0, 79, 0, 0, 0, 4, 0, 1, 0, 31, 0, 10, 0, 96, 0, 97, 0, 2, 0, 67, 0,
0, 0, 55, 0, 2, 0, 1, 0, 0, 0, 13, -78, 0, 28, 42, -71, 0, 37, 2, 0, -64, 0, 38, -80, 0,
0, 0, 2, 0, 68, 0, 0, 0, 6, 0, 1, 0, 0, 0, 64, 0, 69, 0, 0, 0, 12, 0, 1, 0, 0,
0, 13, 0, 98, 0, 99, 0, 0, 0, 79, 0, 0, 0, 4, 0, 1, 0, 31, 0, 9, 0, 100, 0, 101, 0,
2, 0, 67, 0, 0, 0, -65, 0, 6, 0, 5, 0, 0, 0, 67, -72, 0, 39, -69, 0, 40, 89, 1, -73, 0,
41, 76, -72, 0, 22, -74, 0, 42, -74, 0, 43, 77, 44, 18, 44, -74, 0, 45, 78, 43, 45, -74, 0, 46, 58,
4, 25, 4, 18, 47, 4, -67, 0, 48, 89, 3, 19, 0, 49, 83, -74, 0, 50, 1, 4, -67, 0, 51, 89, 3,
42, 83, -74, 0, 52, 87, -79, 0, 0, 0, 3, 0, 68, 0, 0, 0, 30, 0, 7, 0, 0, 0, 86, 0, 3,
0, 87, 0, 12, 0, 89, 0, 22, 0, 90, 0, 29, 0, 91, 0, 36, 0, 92, 0, 66, 0, 93, 0, 69, 0,
0, 0, 52, 0, 5, 0, 0, 0, 67, 0, 102, 0, 103, 0, 0, 0, 12, 0, 55, 0, 104, 0, 105, 0, 1,
0, 22, 0, 45, 0, 106, 0, 107, 0, 2, 0, 29, 0, 38, 0, 108, 0, 99, 0, 3, 0, 36, 0, 31, 0,
109, 0, 110, 0, 4, 0, 111, 0, 0, 0, 12, 0, 1, 0, 36, 0, 31, 0, 109, 0, 112, 0, 4, 0, 79,
0, 0, 0, 4, 0, 1, 0, 113, 16, 8, 0, 114, 0, 97, 0, 2, 0, 67, 0, 0, 0, 47, 0, 1, 0,
1, 0, 0, 0, 5, 42, -72, 0, 1, -80, 0, 0, 0, 2, 0, 68, 0, 0, 0, 6, 0, 1, 0, 0, 0,
24, 0, 69, 0, 0, 0, 12, 0, 1, 0, 0, 0, 5, 0, 115, 0, 99, 0, 0, 0, 79, 0, 0, 0, 4,
0, 1, 0, 31, 0, 8, 0, 116, 0, 66, 0, 1, 0, 67, 0, 0, 0, 35, 0, 2, 0, 0, 0, 0, 0,
11, -69, 0, 53, 89, -73, 0, 54, -77, 0, 28, -79, 0, 0, 0, 1, 0, 68, 0, 0, 0, 6, 0, 1, 0,
0, 0, 27, 0, 2, 0, 117, 0, 0, 0, 2, 0, 118, 0, 57, 0, 0, 0, 26, 0, 3, 0, 55, 0, 10,
0, 0, 16, 8, 0, 40, 0, 10, 0, 58, 0, 10, 0, 74, 0, 121, 0, 75, 6, 9
)
val launcher$1Bytes = Array[Byte](
-54, -2, -70, -66, 0, 0, 0, 50, 0, 12, 7, 0, 7, 7, 0, 10, 1, 0, 10, 83, 111, 117, 114, 99, 101,
70, 105, 108, 101, 1, 0, 13, 76, 97, 117, 110, 99, 104, 101, 114, 46, 106, 97, 118, 97, 1, 0, 15, 69, 110,
99, 108, 111, 115, 105, 110, 103, 77, 101, 116, 104, 111, 100, 7, 0, 11, 1, 0, 10, 76, 97, 117, 110, 99, 104,
101, 114, 36, 49, 1, 0, 0, 1, 0, 12, 73, 110, 110, 101, 114, 67, 108, 97, 115, 115, 101, 115, 1, 0, 16,
106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 79, 98, 106, 101, 99, 116, 1, 0, 8, 76, 97, 117, 110, 99, 104,
101, 114, 16, 32, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 0, 2, 0, 4, 0,
5, 0, 0, 0, 4, 0, 6, 0, 0, 0, 9, 0, 0, 0, 10, 0, 1, 0, 1, 0, 6, 0, 0, 16, 8
)
val launcher$SpecialLoader = Array[Byte](
-54, -2, -70, -66, 0, 0, 0, 50, 0, 80, 10, 0, 16, 0, 50, 10, 0, 17, 0, 50, 7, 0, 51, 10, 0,
3, 0, 50, 10, 0, 52, 0, 53, 10, 0, 3, 0, 54, 8, 0, 55, 10, 0, 3, 0, 56, 10, 0, 57, 0,
58, 7, 0, 59, 10, 0, 10, 0, 50, 10, 0, 16, 0, 60, 7, 0, 61, 8, 0, 62, 10, 0, 10, 0, 63,
7, 0, 64, 7, 0, 65, 1, 0, 6, 60, 105, 110, 105, 116, 62, 1, 0, 3, 40, 41, 86, 1, 0, 4, 67,
111, 100, 101, 1, 0, 15, 76, 105, 110, 101, 78, 117, 109, 98, 101, 114, 84, 97, 98, 108, 101, 1, 0, 18, 76,
111, 99, 97, 108, 86, 97, 114, 105, 97, 98, 108, 101, 84, 97, 98, 108, 101, 1, 0, 4, 116, 104, 105, 115, 1,
0, 13, 83, 112, 101, 99, 105, 97, 108, 76, 111, 97, 100, 101, 114, 1, 0, 12, 73, 110, 110, 101, 114, 67, 108,
97, 115, 115, 101, 115, 1, 0, 24, 76, 76, 97, 117, 110, 99, 104, 101, 114, 36, 83, 112, 101, 99, 105, 97, 108,
76, 111, 97, 100, 101, 114, 59, 1, 0, 9, 102, 105, 110, 100, 67, 108, 97, 115, 115, 1, 0, 37, 40, 76, 106,
97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 41, 76, 106, 97, 118, 97, 47, 108, 97,
110, 103, 47, 67, 108, 97, 115, 115, 59, 1, 0, 5, 101, 110, 116, 114, 121, 1, 0, 2, 91, 66, 1, 0, 2,
101, 120, 1, 0, 21, 76, 106, 97, 118, 97, 47, 105, 111, 47, 73, 79, 69, 120, 99, 101, 112, 116, 105, 111, 110,
59, 1, 0, 4, 110, 97, 109, 101, 1, 0, 18, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114,
105, 110, 103, 59, 1, 0, 13, 83, 116, 97, 99, 107, 77, 97, 112, 84, 97, 98, 108, 101, 7, 0, 30, 7, 0,
64, 7, 0, 66, 7, 0, 61, 1, 0, 10, 69, 120, 99, 101, 112, 116, 105, 111, 110, 115, 1, 0, 9, 83, 105,
103, 110, 97, 116, 117, 114, 101, 1, 0, 40, 40, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114,
105, 110, 103, 59, 41, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 67, 108, 97, 115, 115, 60, 42, 62, 59,
7, 0, 67, 1, 0, 0, 1, 0, 15, 40, 76, 76, 97, 117, 110, 99, 104, 101, 114, 36, 49, 59, 41, 86, 1,
0, 2, 120, 48, 1, 0, 12, 76, 76, 97, 117, 110, 99, 104, 101, 114, 36, 49, 59, 1, 0, 10, 83, 111, 117,
114, 99, 101, 70, 105, 108, 101, 1, 0, 13, 76, 97, 117, 110, 99, 104, 101, 114, 46, 106, 97, 118, 97, 12, 0,
18, 0, 19, 1, 0, 23, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 66, 117, 105,
108, 100, 101, 114, 7, 0, 66, 12, 0, 68, 0, 69, 12, 0, 70, 0, 71, 1, 0, 6, 46, 99, 108, 97, 115,
115, 12, 0, 72, 0, 73, 7, 0, 74, 12, 0, 75, 0, 76, 1, 0, 32, 106, 97, 118, 97, 47, 108, 97, 110,
103, 47, 67, 108, 97, 115, 115, 78, 111, 116, 70, 111, 117, 110, 100, 69, 120, 99, 101, 112, 116, 105, 111, 110, 12,
0, 77, 0, 78, 1, 0, 19, 106, 97, 118, 97, 47, 105, 111, 47, 73, 79, 69, 120, 99, 101, 112, 116, 105, 111,
110, 1, 0, 21, 70, 97, 105, 108, 101, 100, 32, 100, 117, 114, 105, 110, 103, 32, 108, 111, 97, 100, 105, 110, 103,
12, 0, 18, 0, 79, 1, 0, 22, 76, 97, 117, 110, 99, 104, 101, 114, 36, 83, 112, 101, 99, 105, 97, 108, 76,
111, 97, 100, 101, 114, 1, 0, 21, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 67, 108, 97, 115, 115, 76, 111,
97, 100, 101, 114, 1, 0, 16, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 1, 0,
10, 76, 97, 117, 110, 99, 104, 101, 114, 36, 49, 1, 0, 7, 114, 101, 112, 108, 97, 99, 101, 1, 0, 22, 40,
67, 67, 41, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 1, 0, 6, 97,
112, 112, 101, 110, 100, 1, 0, 45, 40, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110,
103, 59, 41, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 66, 117, 105, 108, 100,
101, 114, 59, 1, 0, 8, 116, 111, 83, 116, 114, 105, 110, 103, 1, 0, 20, 40, 41, 76, 106, 97, 118, 97, 47,
108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 1, 0, 8, 76, 97, 117, 110, 99, 104, 101, 114, 1, 0,
10, 97, 99, 99, 101, 115, 115, 36, 49, 48, 48, 1, 0, 22, 40, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103,
47, 83, 116, 114, 105, 110, 103, 59, 41, 91, 66, 1, 0, 11, 100, 101, 102, 105, 110, 101, 67, 108, 97, 115, 115,
1, 0, 41, 40, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 91, 66, 73,
73, 41, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 67, 108, 97, 115, 115, 59, 1, 0, 42, 40, 76, 106,
97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 76, 106, 97, 118, 97, 47, 108, 97, 110,
103, 47, 84, 104, 114, 111, 119, 97, 98, 108, 101, 59, 41, 86, 0, 32, 0, 16, 0, 17, 0, 0, 0, 0, 0,
3, 0, 2, 0, 18, 0, 19, 0, 1, 0, 20, 0, 0, 0, 47, 0, 1, 0, 1, 0, 0, 0, 5, 42, -73,
0, 2, -79, 0, 0, 0, 2, 0, 21, 0, 0, 0, 6, 0, 1, 0, 0, 0, 95, 0, 22, 0, 0, 0, 12,
0, 1, 0, 0, 0, 5, 0, 23, 0, 26, 0, 0, 0, 4, 0, 27, 0, 28, 0, 3, 0, 20, 0, 0, 0,
-66, 0, 5, 0, 3, 0, 0, 0, 64, -69, 0, 3, 89, -73, 0, 4, 43, 16, 46, 16, 47, -74, 0, 5, -74,
0, 6, 18, 7, -74, 0, 6, -74, 0, 8, -72, 0, 9, 77, 44, -57, 0, 11, -69, 0, 10, 89, -73, 0, 11,
-65, 42, 43, 44, 3, 44, -66, -74, 0, 12, -80, 77, -69, 0, 10, 89, 18, 14, 44, -73, 0, 15, -65, 0, 1,
0, 0, 0, 51, 0, 52, 0, 13, 0, 3, 0, 21, 0, 0, 0, 22, 0, 5, 0, 0, 0, 100, 0, 30, 0,
101, 0, 42, 0, 102, 0, 52, 0, 103, 0, 53, 0, 104, 0, 22, 0, 0, 0, 42, 0, 4, 0, 30, 0, 22,
0, 29, 0, 30, 0, 2, 0, 53, 0, 11, 0, 31, 0, 32, 0, 2, 0, 0, 0, 64, 0, 23, 0, 26, 0,
0, 0, 0, 0, 64, 0, 33, 0, 34, 0, 1, 0, 35, 0, 0, 0, 24, 0, 2, -4, 0, 42, 7, 0, 36,
-1, 0, 9, 0, 2, 7, 0, 37, 7, 0, 38, 0, 1, 7, 0, 39, 0, 40, 0, 0, 0, 4, 0, 1, 0,
10, 0, 41, 0, 0, 0, 2, 0, 42, 16, 0, 0, 18, 0, 45, 0, 1, 0, 20, 0, 0, 0, 57, 0, 1,
0, 2, 0, 0, 0, 5, 42, -73, 0, 1, -79, 0, 0, 0, 2, 0, 21, 0, 0, 0, 6, 0, 1, 0, 0,
0, 95, 0, 22, 0, 0, 0, 22, 0, 2, 0, 0, 0, 5, 0, 23, 0, 26, 0, 0, 0, 0, 0, 5, 0,
46, 0, 47, 0, 1, 0, 2, 0, 48, 0, 0, 0, 2, 0, 49, 0, 25, 0, 0, 0, 18, 0, 2, 0, 16,
0, 57, 0, 24, 0, 10, 0, 43, 0, 57, 0, 0, 16, 8
)
private var unpackedApp: Array[Byte] = null
private val index = new java.util.HashMap[String, Array[Byte]]()
private def loadPack() {
val unpacker = Pack200.newUnpacker()
val byteArrayOutputStream = new ByteArrayOutputStream(3000 * 1024)
System.out.println("Unpacking")
// unpacker.unpack(new FileInputStream("/home/rodrigo/NetBeansProjects/rolmanager/target/scala_2.8.0/rol-manager_2.8.0-1.0-snapshot-shrinked.jar"),
// new JarOutputStream(byteArrayOutputStream));
unpacker.unpack(getClass.getResourceAsStream("/app"),
new JarOutputStream(byteArrayOutputStream))
System.out.println("Unpacking done")
unpackedApp = byteArrayOutputStream.toByteArray()
doIndex()
}
private def doIndex() {
System.out.println("Indexing")
var input = getInput()
var jarEntry: JarEntry = null
var din = new DataInputStream(input)
try {
jarEntry = input.getNextJarEntry()
while (jarEntry != null) {
val c = new Array[Byte](jarEntry.getSize().asInstanceOf[Int])
din.readFully(c)
index.put(jarEntry.getName(), c)
jarEntry = input.getNextJarEntry()
}
} catch {
case ex =>
}
System.out.println("Index done")
}
private def getInput(): JarInputStream = {
new JarInputStream(new ByteArrayInputStream(unpackedApp))
}
private def getEntry(entry: String): Array[Byte] = {
return index.get(entry)
// else {
// int pos = posObj.intValue();
// JarInputStream jar = getInput();
// int count = 0;
// while (true) {
// JarEntry jarEntry = jar.getNextJarEntry();
// if (jarEntry == null) return null;
// else if (count == pos) {
// byte[] res = new byte[(int) jarEntry.getSize()];
// new DataInputStream(jar).readFully(res);
// jar.close();
// return res;
// } else {
// jar.skip(jarEntry.getSize());
// }
// count++;
// }
// }
}
def main(args: Array[String]): Unit = {
loadPack()
val specialLoader = new SpecialLoader()
val values = getInput().getManifest().getMainAttributes()
val mainClass = values.getValue("Main-Class")
val loadedClass = specialLoader.loadClass(mainClass)
val arg = new Array[Object](1)
arg(0) = args
loadedClass.getMethod("main", classOf[Array[String]]).invoke(null, arg)
}
private class SpecialLoader extends ClassLoader {
override protected def findClass(name: String): Class[_] = {
try {
val entry = getEntry(name.replace('.', '/') + ".class")
if (entry == null) throw new ClassNotFoundException()
return defineClass(name, entry, 0, entry.length)
} catch {
case ex =>
throw new ClassNotFoundException("Failed during loading", ex);
}
}
}
}