天锐绿盾魔法

天锐绿盾本地解密!

目前为 2024-07-10 提交的版本。查看 最新版本

// ==UserScript==
// @name         天锐绿盾魔法
// @namespace    http://tampermonkey.net/
// @version      0.4.0
// @description  天锐绿盾本地解密!
// @author       xiuyuan
// @match        *://*/*
// @noframes
// @license      MIT
// @require      https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js
// ==/UserScript==
(function() {
    'use strict';
    // Create a new input element
	const input1 = document.createElement('input');
    input1.type='file';
    input1.style.display='none';

    const input2 = document.createElement('input');
    input2.type='file';
    input2.style.display='none';
    input2.multiple=true;//'directory webkitdirectory';
    input2.directory=true;
    input2.webkitdirectory=true;


    // Create a new button element
	const button = document.createElement('button');
	button.innerText = '魔法';
    const button2 = document.createElement('button');
	button2.innerText = '超级\n魔法';

	// Change the button style
	button.style.backgroundColor = 'black';
	button.style.color = 'white';
	button.style.position = 'fixed';
	button.style.bottom = '150px';
	button.style.right = '5px';
	button.style.zIndex = '9999';
    button.style.width ='60px';
    button.style.height = '30px';

    // Change the button2 style
	button2.style.backgroundColor = 'black';
	button2.style.color = 'white';
	button2.style.position = 'fixed';
	button2.style.bottom = '180px';
	button2.style.right = '5px';
	button2.style.zIndex = '9999';
    button2.style.width ='60px';
    button2.style.height = '50px';

	// Add the button to the page
	document.body.appendChild(input1);
    document.body.appendChild(button);
    document.body.appendChild(input2);
    document.body.appendChild(button2);

    button.addEventListener('click', () => {input1.click();});
    button2.addEventListener('click', () => {input2.click();});

    input1.addEventListener('change', () => {
        var file = input1.files[0];
        var reader = new FileReader();

        reader.onload = function(e) {
            var renamedContent = file.name;
            console.log(renamedContent);
            var blob = new Blob([e.target.result], { type: file.type });
            var url = URL.createObjectURL(blob);

            var downloadLink = document.createElement("a");
            downloadLink.href = url;
            //downloadLink.setAttribute('download', renamedContent);
            //downloadLink.style.display = 'block';
            downloadLink.download =renamedContent;
            downloadLink.click();
        }

        reader.readAsArrayBuffer(file);
    });
    input2.addEventListener('change', () => {
        var files = input2.files;
        var zip = new JSZip();
        for (var i = 0; i < files.length; i++) {
            var file = files[i];
            zip.file(file.webkitRelativePath, file); // 假设文件是Blob或ArrayBuffer类型
        }

        zip.generateAsync({type: "blob"})
        .then(function(content) {
            // 创建下载链接
            var a = document.createElement('a');
            document.body.appendChild(a);
            a.style = 'display: none';
            var url = window.URL.createObjectURL(content);
            a.href = url;
            a.download = 'files.zip';
            a.click();
            window.URL.revokeObjectURL(url);
        });
    });
})();

QingJ © 2025

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