本文仅供学习交流使用。
Subscriber:chiefleo
Subscription Code:pLR8ZC-855444-6850525653008304
Subscriber:scott
Subscription Code:fLR8ZC-855444-6850525396179836

1 | public class MyEclipseKeyGen { |
2 | private static final String LL = "Decompiling this copyrighted software is a violation of both your license agreement and the Digital Millenium Copyright Act of 1998 (http://www.loc.gov/copyright/legislation/dmca.pdf). Under section 1204 of the DMCA, penalties range up to a $500,000 fine or up to five years imprisonment for a first offense. Think about it; pay for a license, avoid prosecution, and feel better about yourself." ; |
4 | public String getSerial(String userId, String licenseNum) { |
5 | java.util.Calendar cal = java.util.Calendar.getInstance(); |
8 | java.text.NumberFormat nf = new java.text.DecimalFormat( "000" ); |
9 | licenseNum = nf.format(Integer.valueOf(licenseNum)); |
10 | String verTime = new StringBuilder( "-" ) |
11 | .append( new java.text.SimpleDateFormat( "yyMMdd" ).format(cal.getTime())).append( "0" ) |
13 | String type = "YE3MP-" ; |
14 | String need = new StringBuilder(userId.substring( 0 , 1 )).append(type).append( "300" ) |
15 | .append(licenseNum).append(verTime).toString(); |
16 | String dx = new StringBuilder(need).append(LL).append(userId).toString(); |
17 | int suf = this .decode(dx); |
18 | String code = new StringBuilder(need).append(String.valueOf(suf)).toString(); |
19 | return this .change(code); |
22 | private int decode(String s) { |
38 | private String change(String s) { |
44 | abyte0 = s.getBytes(); |
45 | ac = new char [s.length()]; |
50 | if ((j > 48 ) && (j <= 57 )) { |
51 | j = (((j - 48 ) + 5 ) % 10 ) + 48 ; |
52 | } else if ((j >= 65 ) && (j <= 90 )) { |
53 | j = (((j - 65 ) + 13 ) % 26 ) + 65 ; |
54 | } else if ((j >= 97 ) && (j <= 122 )) { |
55 | j = (((j - 97 ) + 13 ) % 26 ) + 97 ; |
60 | return String.valueOf(ac); |
63 | public MyEclipseKeyGen() { |
67 | public static void main(String[] args) { |
68 | String userId = "scott" ; |
70 | String subscriptionCode = new MyEclipseKeyGen().getSerial(userId, String.valueOf(licenses)); |
71 | System.out.println( "Subscriber:" + userId + "\nSubscription Code:" + subscriptionCode); |
原文链接:http://user.ccw.com.cn/ucHome/space.php?uid=1016&do=thread&id=859
http://xzh.i3geek.com