//运行后即可得到注册码

import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStreamReader;

public class MyEclipseKeyGen {

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 licenseNum) {

java.util.Calendar cal = java.util.Calendar.getInstance();

cal.add(1, 3);

cal.add(6, -1);

java.text.NumberFormat nf = new java.text.DecimalFormat("000");

licenseNum = nf.format(Integer.valueOf(licenseNum));

String verTime = new StringBuilder("-").append(

new java.text.SimpleDateFormat("yyMMdd").format(cal.getTime()))

.append("0").toString();

String type = "YE3MP-";

String need = new StringBuilder(userId.substring(0, 1)).append(type)

.append("300").append(licenseNum).append(verTime).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 MyEclipseKeyGen() {

super();

}

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();

MyEclipseKeyGen myeclipsekeygen = new MyEclipseKeyGen();

String res = myeclipsekeygen.getSerial(userId, "5");

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

reader.readLine();

} catch (IOException ex) {

}

}

}

生成MyEclipse6.5&7.5&8.0注册码的java源码的更多相关文章

  1. centos 7 下 rabbitmq 3.8.0 & erlang 22.1 源码编译安装

    centos 7 下 rabbitmq 3.8.0 & erlang 22.1 源码编译安装 安装前请检查好erlang和rabbitmq版本是否相匹配参考:RabbitMQ Erlang V ...

  2. java源码——0~9十个数字不重复地使用使加法表达式成立

    这个问题是在我写个的几个博客里较为复杂的一个.首先,先看看整个问题的表述. 星号表示0~9的一个数字,而且不允许重复,使得下面的加法表达式成立.输出所有结果. ※ ※ ※ ※ ※    +  2   ...

  3. Tomcat9.0环境搭建与源码编译

    使用IntelliJ IDEA  搭建Tomcat9.0项目   准备条件:   下载源码 这里我们下载的Tomcat的源码版本是9.0.12. 下载地址: https://tomcat.apache ...

  4. linux设备驱动程序-i2c(0)-i2c设备驱动源码实现

    (基于4.14内核版本) 为了梳理清楚linux内核中的i2c实现框架,从本文开始,博主将分几个章节分别解析i2c总线在linux内核中的形成过程.匹配过程.以及设备驱动程序源码实现. 在介绍linu ...

  5. qt-5.6.0 移植之qt源码编译

    其实这只是给自己看的一个configure选项笔记,没有太多的东西. 首先: 下载qt5.6的源码: 地址: http://download.qt.io/archive/qt/5.6/ 下载完解压: ...

  6. hadoop-2.0.0-cdh4.2.1源码编译总结

    经过一个星期多的努力,这两个包的编译工作总算告一段落. 首先看一下这一篇文章: 在eclipse下编译hadoop2.0源码 http://www.cnblogs.com/meibenjin/arch ...

  7. 2018-09-13 代码翻译尝试-使用Roaster解析和生成Java源码

    此文是前文使用现有在线翻译服务进行代码翻译的体验的编程语言方面第二点的一个尝试. 参考Which framework to generate source code ? - Cleancode and ...

  8. CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构

    很高兴你能在浮躁的年代里还有兴趣阅读源代码,CesiumJS 至今已有十年以上,代码量也积累了三十多万行(未压缩状态). 我也很荣幸自己的文章能被读者看到,如果对你有帮助.有启发,点个赞就是对我最大的 ...

  9. 长链接生成短链接Java源码(调用百度接口)

    public static DefaultHttpClient httpclient; static { httpclient = new DefaultHttpClient(); //httpcli ...

随机推荐

  1. Finding Palindromes - 猥琐的字符串(Manacher+trie)

    题目大意:有 N 个字符串,所有的字符串长度不超过 200W 任意俩俩字符串可以自由组合,问组合的字符串是回文串的个数有多少个?   分析:这是一个相当猥琐的字符串处理,因为没有说单个的字符串最少多长 ...

  2. Intellij 快捷键大全

    Intellij IDEA的快捷键非常好用,能大大提高我们的开发速度.这里列举了一些常用的快捷键. 快速查找: Ctrl+N  查找类 Ctrl+R  替换当前窗口的文本 Ctrl+F  当前代码中查 ...

  3. GitLib

    http://www.360doc.com/content/15/0603/14/21631240_475362133.shtml 原文 http://blog.csdn.net/williamwan ...

  4. Android中自定义View的MeasureSpec使用

    有时,Android系统控件无法满足我们的需求,因此有必要自定义View.具体方法参见官方开发文档:http://developer.android.com/guide/topics/ui/custo ...

  5. ping and traceroute(tracert)

    1.ping程序简单介绍 这个程序是Mike Muuss编写的.目的是測试另外一台机子是否可达. 运用的协议就是ICMP.运用的是ICMP的回显应答和请求回显两个类型.曾经呢.能ping通说明可以进行 ...

  6. Struts2 Spring hibernate 整合示例 .

    示例工具:MyEclipse 8.5.Tomcat 6.0.MySql 步骤: 1.创建一个WEB工程,命名为BookShop(名字自己取,此处为示例工程名): 2.导入struts2的核心jar包, ...

  7. iOS平台基于ffmpeg的视频直播技术揭秘

    现在非常流行直播,相信很多人都跟我一样十分好奇这个技术是如何实现的,正好最近在做一个ffmpeg的项目,发现这个工具很容易就可以做直播,下面来给大家分享下技术要点: 首先你得编译出ffmpeg运行所需 ...

  8. 今日推荐(三)AndroidResideMenu类似QQ侧滑效果

    效果图: DEMO 本代码即是DEMO,您可以下载后选择您喜欢的IDE运行.SDK版本建议使用4.0以上 Version Migration 从 v1.0, v1.1, v1.2, v1.3 升级到  ...

  9. JSON 遍历转为Model Bean

    @RequestMapping(value = "/batchAddPageIndexBrand") @ResponseBody public HashMap<String, ...

  10. android背景平铺方式 tileMode

    创建重复的背景图片  在drawable目录下创建一个repeat_bg.xml:    然后在布局的xml文件中可以这样引用:    ================================ ...