守望者--AIR技术交流

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
热搜: ANE FlasCC 炼金术
查看: 2743|回复: 0

[java] MyEclipse-6.5注册码生成器源码

[复制链接]
  • TA的每日心情
    擦汗
    2018-4-10 15:18
  • 签到天数: 447 天

    [LV.9]以坛为家II

    1742

    主题

    2094

    帖子

    13万

    积分

    超级版主

    Rank: 18Rank: 18Rank: 18Rank: 18Rank: 18

    威望
    562
    贡献
    29
    金币
    52683
    钢镚
    1422

    开源英雄守望者

    发表于 2015-2-16 13:47:11 | 显示全部楼层 |阅读模式
    本帖最后由 破晓 于 2015-2-16 13:50 编辑

    打开MyEclipse新建一个Java工程,然后新建类,粘贴如下代码,即可生成MyEclipse的注册码


    1. import java.io.BufferedReader;
    2. import java.io.IOException;
    3. import java.io.InputStreamReader;

    4. public class MyEclipseGen {
    5. 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.";

    6. public String getSerial(String userId, String licenseNum) {
    7. java.util.Calendar cal = java.util.Calendar.getInstance();
    8. cal.add(1, 3);
    9. cal.add(6, -1);
    10. java.text.NumberFormat nf = new java.text.DecimalFormat("000");
    11. licenseNum = nf.format(Integer.valueOf(licenseNum));
    12. String verTime = new StringBuilder("-").append(
    13. new java.text.SimpleDateFormat("yyMMdd").format(cal.getTime()))
    14. .append("0").toString();
    15. String type = "YE3MP-";
    16. String need = new StringBuilder(userId.substring(0, 1)).append(type)
    17. .append("300").append(licenseNum).append(verTime).toString();
    18. String dx = new StringBuilder(need).append(LL).append(userId)
    19. .toString();
    20. int suf = this.decode(dx);
    21. String code = new StringBuilder(need).append(String.valueOf(suf))
    22. .toString();
    23. return this.change(code);
    24. }

    25. private int decode(String s) {
    26. int i;
    27. char[] ac;
    28. int j;
    29. int k;
    30. i = 0;
    31. ac = s.toCharArray();
    32. j = 0;
    33. k = ac.length;
    34. while (j < k) {
    35. i = (31 * i) + ac[j];
    36. j++;
    37. }
    38. return Math.abs(i);
    39. }

    40. private String change(String s) {
    41. byte[] abyte0;
    42. char[] ac;
    43. int i;
    44. int k;
    45. int j;
    46. abyte0 = s.getBytes();
    47. ac = new char[s.length()];
    48. i = 0;
    49. k = abyte0.length;
    50. while (i < k) {
    51. j = abyte0[i];
    52. if ((j >= 48) && (j <= 57)) {
    53. j = (((j - 48) + 5) % 10) + 48;
    54. } else if ((j >= 65) && (j <= 90)) {
    55. j = (((j - 65) + 13) % 26) + 65;
    56. } else if ((j >= 97) && (j <= 122)) {
    57. j = (((j - 97) + 13) % 26) + 97;
    58. }
    59. ac[i] = (char) j;
    60. i++;
    61. }
    62. return String.valueOf(ac);
    63. }

    64. public MyEclipseGen() {
    65. super();
    66. }

    67. public static void main(String[] args) {
    68. try {
    69. System.out.println("please input register name:");
    70. BufferedReader reader = new BufferedReader(new InputStreamReader(
    71. System.in));
    72. String userId = null;
    73. userId = reader.readLine();
    74. MyEclipseGen myeclipsegen = new MyEclipseGen();
    75. String res = myeclipsegen.getSerial(userId, "5");
    76. System.out.println("Serial:" + res);
    77. reader.readLine();
    78. } catch (IOException ex) {
    79. }
    80. }
    81. }


    复制代码

    源码下载:

    游客,如果您要查看本帖隐藏内容请回复

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有帐号?立即注册

    x
    守望者AIR技术交流社区(www.airmyth.com)
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    
    关闭

    站长推荐上一条 /4 下一条

    QQ|手机版|Archiver|网站地图|小黑屋|守望者 ( 京ICP备14061876号

    GMT+8, 2024-4-16 20:12 , Processed in 0.052888 second(s), 34 queries .

    守望者AIR

    守望者AIR技术交流社区

    本站成立于 2014年12月31日

    快速回复 返回顶部 返回列表