PageSourceSearch

https://ejjava.github.io/js/gengduo.js

js ejjava.github.io collected 2026-10-03 09:08:55 UTC 1,427 bytes, 53 lines download raw bytes

1// 加密算法
2function encrypt(code) {
3  var encryptedCode = '';
4  for (var i = 0; i < code.length; i++) {
5    var charCode = code.charCodeAt(i);
6    encryptedCode += String.fromCharCode(charCode + 1);
7  }
8  return encryptedCode;
9}
10
11// 解密算法
12function decrypt(encryptedCode) {
13  var decryptedCode = '';
14  for (var i = 0; i < encryptedCode.length; i++) {
15    var charCode = encryptedCode.charCodeAt(i);
16    decryptedCode += String.fromCharCode(charCode - 1);
17  }
18  return decryptedCode;
19}
20
21// 检查本地存储中的激活码
22function checkActivationCode() {
23  var encryptedCode = localStorage.getItem('activationCode');
24  if (encryptedCode) {
25    // 如果已保存激活码,则解密并验证
26    var savedCode = decrypt(encryptedCode);
27    verifyActivationCode(savedCode);
28  } else {
29    showInputBox();
30  }
31}
32
33// 弹出输入框进行验证
34function showInputBox() {
35  var userInput = prompt('很抱歉,希望您的理解!请输入激活码(Q群901594028获取)');
36  verifyActivationCode(userInput);
37}
38
39// 验证激活码
40function verifyActivationCode(code) {
41  var encryptedInput = encrypt(code);
42  var encryptedValidCode = encrypt('ejjava520');
43  if (encryptedInput === encryptedValidCode) {
44    var encryptedCode = encrypt(code);
45    localStorage.setItem('activationCode', encryptedCode);
46     
47  } else {
48    showInputBox();
49  }
50}
51
52// 每六秒检查一次激活码
53setInterval(checkActivationCode, 2000);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.