License Server started at ").append(licenseUrl); 260 | html.append("
JetBrains Activation address was: ").append(licenseUrl).append("/");
261 | html.append(" JRebel 7.1 and earlier version Activation address was: ")
262 | .append(licenseUrl).append("/{tokenname}")
263 | .append(", with any email.");
264 | html.append(" JRebel 2018.1 and later version Activation address was: ")
265 | .append(licenseUrl).append("/{guid}")
266 | .append("(eg:")
267 | .append(licenseUrl).append("/").append(UUID.randomUUID().toString())
268 | .append("), with any email.");
269 |
270 | html.append(" JetBrains许可服务器激活地址 ").append(licenseUrl);
274 | html.append(" JetBrains激活地址是: ").append(licenseUrl).append("/");
275 | html.append(" JRebel 7.1 及旧版本激活地址: ")
276 | .append(licenseUrl).append("/{tokenname}")
277 | .append(", 以及任意邮箱地址。");
278 | html.append(" JRebel 2018.1+ 版本激活地址: ")
279 | .append(licenseUrl).append("/{guid}")
280 | .append("(例如:")
281 | .append(licenseUrl).append("/").append(UUID.randomUUID().toString())
282 | .append("), 以及任意邮箱地址。");
283 |
284 | response.getWriter().println(html);
285 | }
286 | }
--------------------------------------------------------------------------------
/src/main/java/com/vvvtimes/util/Base64.java:
--------------------------------------------------------------------------------
1 | package com.vvvtimes.util;
2 |
3 |
4 | public class Base64 {
5 | /**
6 | * 编码
7 | *
8 | * @param bstr
9 | * @return String
10 | */
11 | public static String encode(byte[] bstr) {
12 | return org.apache.commons.codec.binary.Base64.encodeBase64String(bstr);
13 | }
14 |
15 | /**
16 | * 解码
17 | *
18 | * @param str
19 | * @return string
20 | */
21 | public static byte[] decode(String str) {
22 | return org.apache.commons.codec.binary.Base64.decodeBase64(str);
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/com/vvvtimes/util/Hex.java:
--------------------------------------------------------------------------------
1 | package com.vvvtimes.util;
2 |
3 | public class Hex {
4 | public static String bytesToHexString(byte[] src){
5 | StringBuilder stringBuilder = new StringBuilder("");
6 | if (src == null || src.length <= 0) {
7 | return null;
8 | }
9 | for (int i = 0; i < src.length; i++) {
10 | int v = src[i] & 0xFF;
11 | String hv = Integer.toHexString(v);
12 | if (hv.length() < 2) {
13 | stringBuilder.append(0);
14 | }
15 | stringBuilder.append(hv);
16 | }
17 | return stringBuilder.toString();
18 | }
19 | /**
20 | * Convert hex string to byte[]
21 | * @param hexString the hex string
22 | * @return byte[]
23 | */
24 | public static byte[] hexStringToBytes(String hexString) {
25 | if (hexString == null || hexString.equals("")) {
26 | return null;
27 | }
28 | hexString = hexString.toUpperCase();
29 | int length = hexString.length() / 2;
30 | char[] hexChars = hexString.toCharArray();
31 | byte[] d = new byte[length];
32 | for (int i = 0; i < length; i++) {
33 | int pos = i * 2;
34 | d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));
35 | }
36 | return d;
37 | }
38 | private static byte charToByte(char c) {
39 | return (byte) "0123456789ABCDEF".indexOf(c);
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/com/vvvtimes/util/rsasign.java:
--------------------------------------------------------------------------------
1 | package com.vvvtimes.util;
2 |
3 | import org.bouncycastle.asn1.ASN1InputStream;
4 | import org.bouncycastle.asn1.ASN1Primitive;
5 | import org.bouncycastle.asn1.pkcs.RSAPrivateKeyStructure;
6 |
7 | import java.security.KeyFactory;
8 | import java.security.PrivateKey;
9 | import java.security.spec.PKCS8EncodedKeySpec;
10 | import java.security.spec.RSAPrivateKeySpec;
11 |
12 |
13 | public class rsasign {
14 | static String header = "
");
271 |
272 | html.append("Hello,此地址是 Jrebel & JetBrains License Server!
");
273 | html.append("