天锐绿盾魔法

天锐绿盾本地解密!

  1. // ==UserScript==
  2. // @name 天锐绿盾魔法
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.4.5
  5. // @description 天锐绿盾本地解密!
  6. // @author xiuyuan
  7. // @match *://*/*
  8. // @noframes
  9. // @license MIT
  10. // @require https://cdnjs.cloudflare.com/ajax/libs/jszip/3.6.0/jszip.min.js
  11. // ==/UserScript==
  12.  
  13. function updateProgress(percentage) {
  14. return new Promise(resolve => {
  15. const progressBar = document.getElementById('progress-bar');
  16. progressBar.style.width = `${percentage}%`;
  17. resolve();
  18. });
  19. }
  20.  
  21. // 异步 延时 秒
  22. function sleep1(time) {
  23. time*=1000
  24. return new Promise(resolve => {
  25. setTimeout(() => {
  26. resolve();
  27. }, time);
  28. });
  29. }
  30.  
  31. (function() {
  32. 'use strict';
  33. function addCSS(styles) {
  34. var css = styles + '';
  35. var head = document.getElementsByTagName('head')[0];
  36. var style = document.createElement('style');
  37. style.type = 'text/css';
  38. style.innerHTML = css;
  39. head.appendChild(style);
  40. }
  41. //添加css
  42. addCSS(`#progress-bar-container {
  43. width: 100%;
  44. background-color: #f3f3f3;
  45. border-radius: 5px;
  46. overflow: hidden;
  47. margin-top: 20px;
  48. display: none;
  49. }
  50. #progress-bar {
  51. height: 20px;
  52. width: 0;
  53. background-color: #1008f5;
  54. border-radius: 5px;
  55. }`);
  56. //添加进度条div
  57. var jindu = document.createElement('div');
  58. jindu.style.position = 'fixed';
  59. jindu.style.width = '200px';
  60. jindu.style.height = '30px';
  61. jindu.style.zIndex = '9999';
  62. jindu.style.right = '10px';
  63. jindu.style.bottom = '20px';
  64. jindu.innerHTML = `<div id="progress-bar-container">
  65. <div id="progress-bar"></div>`;
  66.  
  67. // Create a new input element
  68. const input1 = document.createElement('input');
  69. input1.type='file';
  70. input1.style.display='none';
  71.  
  72. const input2 = document.createElement('input');
  73. input2.type='file';
  74. input2.style.display='none';
  75. input2.multiple=true;//'directory webkitdirectory';
  76. input2.directory=true;
  77. input2.webkitdirectory=true;
  78.  
  79.  
  80. // Create a new button element
  81. const button = document.createElement('button');
  82. button.innerText = '魔法';
  83. const button2 = document.createElement('button');
  84. button2.innerText = '超级\n魔法';
  85.  
  86. // Change the button style
  87. button.style.backgroundColor = 'black';
  88. button.style.color = 'white';
  89. button.style.position = 'fixed';
  90. button.style.bottom = '150px';
  91. button.style.right = '5px';
  92. button.style.zIndex = '9999';
  93. button.style.width ='60px';
  94. button.style.height = '30px';
  95.  
  96. // Change the button2 style
  97. button2.style.backgroundColor = 'black';
  98. button2.style.color = 'white';
  99. button2.style.position = 'fixed';
  100. button2.style.bottom = '180px';
  101. button2.style.right = '5px';
  102. button2.style.zIndex = '9999';
  103. button2.style.width ='60px';
  104. button2.style.height = '50px';
  105.  
  106. // Add the button to the page
  107. document.body.appendChild(input1);
  108. document.body.appendChild(button);
  109. document.body.appendChild(input2);
  110. document.body.appendChild(button2);
  111. document.body.appendChild(jindu);
  112.  
  113. button.addEventListener('click', () => {input1.click();});
  114. button2.addEventListener('click', () => {input2.click();});
  115.  
  116. input1.addEventListener('change', () => {
  117. var file = input1.files[0];
  118. var reader = new FileReader();
  119.  
  120. reader.onload = function(e) {
  121. var renamedContent = file.name;
  122. console.log(renamedContent);
  123. var blob = new Blob([e.target.result], { type: file.type });
  124. var url = URL.createObjectURL(blob);
  125.  
  126. var downloadLink = document.createElement("a");
  127. downloadLink.href = url;
  128. downloadLink.download =renamedContent;
  129. downloadLink.click();
  130. }
  131.  
  132. reader.readAsArrayBuffer(file);
  133. });
  134. input2.addEventListener('change', async () => {
  135. const progress_s = document.getElementById('progress-bar-container');
  136. const progress_bar = document.getElementById('progress-bar');
  137.  
  138. var files = input2.files;
  139. // 检查是否有文件被选中
  140. if(files.length==0){
  141. console.log("请选择文件");
  142. return;
  143. }
  144. var bo_set=-20;
  145. var move_flag=0;
  146. var download_flag=0;
  147. progress_s.style.display = 'block';
  148. var interid0=setInterval(() => {
  149. if(bo_set>=20){
  150. clearInterval(interid0);
  151. move_flag=1;
  152. }else{
  153. jindu.style.bottom = bo_set + 'px';
  154. bo_set+=5;
  155. }
  156. },20);
  157. await updateProgress(0);
  158. try{
  159. var zip = new JSZip();
  160. // jindu.style.display = 'block';
  161. for (var i = 0; i < files.length; i++) {
  162. var file = files[i];
  163. zip.file(file.webkitRelativePath, file); // 假设文件是Blob或ArrayBuffer类型
  164. await updateProgress((i + 1) / files.length * 100);
  165. // await sleep1(1);
  166. }
  167.  
  168. //生成压缩文件
  169. progress_bar.style.background = 'green';
  170. zip.generateAsync({type: "blob"},metadata => {
  171. console.log(metadata.percent+'%');
  172. updateProgress(metadata.percent);
  173. })
  174. .then(async function(content) {
  175. // 创建下载链接
  176. var a = document.createElement('a');
  177. document.body.appendChild(a);
  178. a.style = 'display: none';
  179. a.href = window.URL.createObjectURL(content);
  180. a.download = 'decfiles.zip';
  181. a.click();
  182. window.URL.revokeObjectURL(a.href);
  183. download_flag=1;
  184. });
  185. }catch(err){
  186. console.log(err);
  187. document.getElementById('progress-bar').style.background = 'red';
  188. download_flag=1;
  189. }
  190. setTimeout(() => {
  191. var interid1=setInterval(() => {
  192. if(move_flag==1 && download_flag==1){
  193. if(bo_set<=-20){
  194. progress_s.style.display = 'none';
  195. clearInterval(interid1);
  196. }else{
  197. jindu.style.bottom = bo_set + 'px';
  198. bo_set-=2;
  199. }
  200. }
  201. },20);
  202. }, 1000);
  203. });
  204. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址