myEclipse 6.5注册码生成类[转帖]_Android, Python及开发编程讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  Android, Python及开发编程讨论区 »
总帖数
3
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 2049 | 回复: 2   主题: myEclipse 6.5注册码生成类[转帖]        下一篇 
    本主题由 koei123 于 2015-7-14 11:08:50 移动
yr
注册用户
等级:少校
经验:1085
发帖:5
精华:0
注册:2015-1-19
状态:离线
发送短消息息给yr 加好友    发送短消息息给yr 发消息
发表于: IP:您无权察看 2015-6-25 8:56:27 | [全部帖] [楼主帖] 楼主

import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStreamReader;

public class MyEclipseGen {

    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 MyEclipseGen() {

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

    MyEclipseGen myeclipsegen = new MyEclipseGen();

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

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

    reader.readLine();

    } catch (IOException ex) {

    }

    }

}

该贴由koei123转至本版2015-7-14 11:08:50




赞(0)    操作        顶端 
hei_nihao
注册用户
等级:少校
经验:1279
发帖:19
精华:0
注册:2015-4-17
状态:离线
发送短消息息给hei_nihao 加好友    发送短消息息给hei_nihao 发消息
发表于: IP:您无权察看 2015-6-26 9:00:26 | [全部帖] [楼主帖] 2  楼

最近一直在找,但是找不到,有代码真不错,可以自动生成



赞(0)    操作        顶端 
tuhao
注册用户
等级:少尉
经验:339
发帖:2
精华:0
注册:2015-5-6
状态:离线
发送短消息息给tuhao 加好友    发送短消息息给tuhao 发消息
发表于: IP:您无权察看 2015-6-26 9:04:15 | [全部帖] [楼主帖] 3  楼

是不错!



赞(0)    操作        顶端 
总帖数
3
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论