您的位置:首页 > 编程语言 > Java开发

MyEclipse注册码获取

2014-03-24 15:18 281 查看
多次在网上查找myeclipse8.6的注册码,均发现一般到期日都很近,所以经常被myeclipse提醒需要注册,由于不注册则打开文件就会提示注册框,很不方便,故注册成功很重要,在网上寻找到的获取myeclipse8.6的代码,可以根据用户名生成注册码,经本人实验,最近的也要到2017年截止。

importjava.io.BufferedReader;

importjava.io.IOException;

importjava.io.InputStreamReader;

import java.text.DecimalFormat;

importjava.text.NumberFormat;

importjava.text.SimpleDateFormat;

importjava.util.Calendar;

public class pojie{

private staticfinal String LL = "Decompiling this copyrighted software is a violation ofboth your license agreement and the Digital Millenium Copyright Act of 1998(http://www.loc.gov/copyright/legislation/dmca.pdf). Under section 1204 of theDMCA, penalties
range up to a $500,000 fine or up to five years imprisonmentfor a first offense. Think about it; pay for a license, avoid prosecution, andfeel better about yourself.";

public StringgetSerial(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(

newSimpleDateFormat("yyMMdd").format(cal.getTime())).append(

"0").toString();

String need = newStringBuilder(userId.substring(0, 1)).append("Y")

.append(type).append("-100").append(licenseNum).append(expTime)

.toString();

String dx = newStringBuilder(need).append(LL).append(userId)

.toString();

int suf =this.decode(dx);

String code = newStringBuilder(need).append(String.valueOf(suf))

.toString();

returnthis.change(code);

}

private intdecode(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++;

}

returnMath.abs(i);

}

private Stringchange(String s) {

byte[] abyte0;

char[] ac;

int i;

int k;

int j;

abyte0 =s.getBytes();

ac = newchar[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 voidmain(String[] args) {

try {

System.out.println("pleaseinput register name:");

BufferedReaderreader = new BufferedReader(new InputStreamReader(

System.in));

String userId =null;

userId =reader.readLine();

if(userId == null|| "".equals(userId)){

System.out.println("nameis null");

System.exit(0);

}

pojie myeclipsegen= new pojie();

String res =myeclipsegen.getSerial(userId, "E3MS");

System.out.println("Serial:"+ res);

reader.readLine();

} catch(IOException ex) {

ex.printStackTrace();

}

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: