import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
public class Xulianhao {
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.";
public String getSerial(String userId, String type) {
NumberFormat nf = new DecimalFormat("000");
Calendar cal = Calendar.getInstance();
cal.add(Calendar.YEAR, 3);
cal.add(Calendar.DAY_OF_YEAR, -1);
String licenseNum = nf.format((int) (Math.random() * 1000));
String expTime = new StringBuilder("-").append(
new SimpleDateFormat("yyMMdd").format(cal.getTime())).append(
"0").toString();
String need = new StringBuilder(userId.substring(0, 1)).append("Y")
.append(type).append("-100").append(licenseNum).append(expTime)
.toString();
String dx = new StringBuilder(need).append(LL).append(userId)
.toString();
int suf = this.decode(dx);
String code = new StringBuilder(need).append(String.valueOf(suf))
.toString();
return this.change(code);
}
private int decode(String s) {
int i;
char[] ac;
int j;
int k;
i = 0;
ac = s.toCharArray();
j = 0;
k = ac.length;
while (j < k) {
i = (31 * i) + ac[j];
j++;
}
return Math.abs(i);
}
private String change(String s) {
byte[] abyte0;
char[] ac;
int i;
int k;
int j;
abyte0 = s.getBytes();
ac = new char[s.length()];
i = 0;
k = abyte0.length;
while (i < k) {
j = abyte0[i];
if ((j >= 48) && (j <= 57)) {
j = (((j - 48) + 5) % 10) + 48;
} else if ((j >= 65) && (j <= 90)) {
j = (((j - 65) + 13) % 26) + 65;
} else if ((j >= 97) && (j <= 122)) {
j = (((j - 97) + 13) % 26) + 97;
}
ac[i] = (char) j;
i++;
}
return String.valueOf(ac);
}
public static void main(String[] args) {
try {
System.out.println("please input register name:");
BufferedReader reader = new BufferedReader(new InputStreamReader(
System.in));
String userId = null;
userId = reader.readLine();
if(userId == null || "".equals(userId)){
System.out.println("name is null");
System.exit(0);
}
Xulianhao myeclipsegen = new Xulianhao();
String res = myeclipsegen.getSerial(userId, "E3MS");
System.out.println("Serial:" + res);
reader.readLine();
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
分享到:
相关推荐
用于重新生成MyEclipse5.5序列号
MyEclipse6.5自动生成序列号注册机源码
Myeclipse6.0和Myeclipse6.5序列号生成器 代码实现
这个是一个Myeclipse序列号生成小工具 能直接生成6.0-8.5所用的Myeclipse序列号.但是要使用他的情况是电脑中必须有JDK的支持
MyEclipse6.0自动生成序列号的方法,太简单强大了 Myeclipse序列号 使用方法:运行里面的这段小代码,然后输入一个用户名,就会自动打印出对应此用户名的序列号
MyEclipse8.5序列号生成器,这个版本不用手动记序列号了!会在程序目录下生成序列号文件!
myeclipse6.0 序列号生成器 hen shi yong de
点击run.bat运行,输入用户名,自动生成序列号,有效期3年
Myeclipse blue 6.5 序列号计算工具 Myeclipse blue 6.5 序列号计算工具
用执行代码的方式生成序列号,很好,而且很直观。可以学到想不到的东西。很适合初学者。
此代码可用于生产MyEclipse的序列号,过期时间和用户名都可以自己设定,简单实用。
将源文件放到myEclipse里,运行该软件就可以生成注册号了.然后使用它进行注册就可以了.
在myEclipse里面的任意包下面,运行此类,输入用户名回车即可生成序列号
java代码自动生成MyEclipse注册码序列号。可以手动输入序列号名,生成序列号,非常实用
myEclipse 序列号 自动生成。运行代码后,在Console中输入名字 确定即可
NULL 博文链接:https://houlinyan.iteye.com/blog/775175
NULL 博文链接:https://regedit-123.iteye.com/blog/578068
这主要用来生成MyEclipse序列号,共大家分享一下哈
MyEclipse8.5 GA 序列号生成器 支持最新的8.5版本MyEclipse
MyEclipse9的序列号生成器 绝对好用