From 9ba58c756eea756881381f86a85b56e77c2b5131 Mon Sep 17 00:00:00 2001 From: zpj80231 Date: Mon, 21 Jul 2025 09:41:39 +0800 Subject: [PATCH] Update project directory structure and usage instructions --- README.md | 4 +- activate/MyJBLS_plugin.js | 142 ++++++++++++++++++ .../activation_code.txt | 0 tampermonkey.js.zip | Bin 2296 -> 0 bytes 4 files changed, 144 insertions(+), 2 deletions(-) create mode 100644 activate/MyJBLS_plugin.js rename activation_code.txt => activate/activation_code.txt (100%) delete mode 100644 tampermonkey.js.zip diff --git a/README.md b/README.md index 227d55e..893b0f8 100644 --- a/README.md +++ b/README.md @@ -84,9 +84,9 @@ ### 非正式激活-支持功能列表 - IntelliJ IDEA 激活 -- 付费插件激活:存在访问权限问题,自行解决后可正常使用。(配合猴油脚本,解压 `tampermonkey.js.zip` 后,手动添加脚本到猴油中,打开 [https://plugins.jetbrains.com](https://plugins.jetbrains.com/) 搜索你想要激活的插件, 点击 `Generate Code` 按钮就能得到该插件的激活码, 粘入到插件的 `Activation Code` 中即可) +- 付费插件激活:_需要 linux.do 访问认证,请自行解决_。配合猴油脚本,手动添加 `MyJBLS_plugin.js` 脚本到猴油中,打开 [https://plugins.jetbrains.com](https://plugins.jetbrains.com/) 搜索你想要激活的插件, 点击 `Generate Code` 按钮就能得到该插件的激活码, 粘入到插件的 `Activation Code` 中即可 - ~~GitHub Copilot 激活,cocopilot 公车已废弃~~ -- Augment 激活:下载 Augment 插件,点击 Sign In 按钮【本地授权】,即可无限免费使用 Claude Sonnet 4 系列模型(代码开发和编程最强模型) +- Augment 激活:_需要 linux.do 访问认证,请自行解决_。下载 Augment 插件,点击 Sign In 按钮【本地授权】,即可无限免费使用 Claude Sonnet 4 系列模型(代码开发和编程最强模型) ## 配置同步 diff --git a/activate/MyJBLS_plugin.js b/activate/MyJBLS_plugin.js new file mode 100644 index 0000000..5b129d1 --- /dev/null +++ b/activate/MyJBLS_plugin.js @@ -0,0 +1,142 @@ +// ==UserScript== +// @name MyJBLS +// @namespace https://jbls.ide-soft.com +// @version 2024-04-17 +// @description tampermonkey magic script for jetbrains, generate activation code for jetbrains plugin,use tampermonkey https://chromewebstore.google.com/detail/%E7%AF%A1%E6%94%B9%E7%8C%B4/dhdgffkkebhmkfjojejmpbldmpobfkfo to install this script +// @author anonymous +// @match https://plugins.jetbrains.com/ +// @match https://plugins.jetbrains.com/* +// @grant GM_setClipboard +// @grant GM_addStyle +// @grant GM_xmlhttpRequest +// @grant window.onurlchange +// @run-at document-end +// @license MIT +// ==/UserScript== +(function () { + const maxAttempts = 50; + const retryInterval = 100; + const backendBaseUrl = "https://jbls.ide-soft.com"; + const codes = ["YTD", "QDGO", "MF", "DG", "PS", "QA", "IIE", "YTWE", "FLS", "DLE", "RFU", "PPS", "PCWMP", "II", "TCC", "RSU", "PCC", "RC", "PCE", "FLIJ", "TBA", "DL", "SPP", "QDCLD", "SPA", "DMCLP", "PSW", "GW", "PSI", "IIU", "DMU", "PWS", "HB", "WS", "PCP", "KT", "DCCLT", "RSCLT", "WRS", "RSC", "RRD", "TC", "IIC", "QDPY", "DPK", "DC", "PDB", "DPPS", "QDPHP", "GO", "HCC", "RDCPPP", "QDJVMC", "CL", "DM", "CWML", "FLL", "RR", "QDJS", "RS", "RM", "DS", "MPS", "DPN", "US", "CLN", "DPCLT", "RSV", "MPSIIP", "DB", "QDANDC", "AC", "QDJVM", "PRB", "RD", "CWMR", "SP", "RS0", "DP", "RSF", "PGO", "QDPYC", "PPC", "PC", "EHS", "RSCHB", "FL", "QDNET", "JCD"]; + + async function findElementWithRetry(cssSelector, timeout = 5000) { + const maxAttempts = timeout / retryInterval; + for (let attempts = 0; attempts < maxAttempts; attempts++) { + const element = document.querySelector(cssSelector); + if (element) { + return element; + } + await new Promise((resolve) => setTimeout(resolve, retryInterval)); + } + throw new Error( + `Element with selector '${cssSelector}' not found after ${maxAttempts} attempts.` + ); + } + + async function addButton() { + ("use strict"); + GM_addStyle(` + .jetbra-button { + margin: 10px 0 0 10px; + } + `); + + const url = window.location.href; + if (!url.startsWith("https://plugins.jetbrains.com/plugin/")) { + return; + } + + const pluginId = url.split("/")[4].split("-")[0]; + + const pluginDetail = await fetch( + `https://plugins.jetbrains.com/api/plugins/${pluginId}` + ).then((r) => r.json()); + const parentElement = await findElementWithRetry( + ".plugin-header__controls-panel > div:first-child" + ); + + if ( + parentElement.querySelector(".refill-button") || + !pluginDetail.purchaseInfo + ) { + return; + } + const originalButton = await findElementWithRetry( + '.plugin-header__controls-panel button[data-test="button"]' + ); + const buttonClasses = originalButton.className; + if(document.getElementsByClassName("jetbra-button").length>0){ + return; + } + const newButton = document.createElement("button"); + newButton.setAttribute("type", "button"); + newButton.className = `${buttonClasses} jetbra-button`; + newButton.textContent = "Generate Code"; + + originalButton.parentNode.insertBefore( + newButton, + originalButton.nextSibling + ); + newButton.addEventListener("click", async () => { + let ls = window.localStorage; + let licenseeName = ls.getItem("licenseeName"); + if (!licenseeName) { + licenseeName = + window.prompt("Please enter the licensee name:") || "SuperMan"; + ls.setItem("licenseeName", licenseeName); + } + + if (!pluginDetail.purchaseInfo) { + window.alert("This plugin is not a paid plugin in the market"); + return; + } + + codes.push(pluginDetail.purchaseInfo.productCode); + const currentDate = new Date(); + currentDate.setFullYear(currentDate.getFullYear() + 1); + const paidUpTo = currentDate.toISOString().slice(0, 10); + + const data = { + licenseeName, + codes, + paidUpTo + }; + try { + GM_xmlhttpRequest({ + method: "POST", + url: backendBaseUrl + "/api/generateLicense", + headers: { + "Content-Type": "application/json", + }, + data: JSON.stringify(data), + onload: function (response) { + const data = JSON.parse(response.responseText); + if (data.error || !data.license) { + console.log(response.responseText); + window.alert(`${data.error} will jump to the oauth page,then go back try again.`); + setTimeout(() => { + window.open(backendBaseUrl + "/oauth2/authorize", "_blank"); + }, 1000); + return; + } + let license = data.license; + GM_setClipboard(license, "text"); + window.alert("The activation code has been copied to your clipboard"); + }, + }); + } catch (error) { + console.error("Error generating license:", error); + window.alert("An error occurred while generating the license."); + } + }); + } + window.onload = function() { + addButton(); + }; + + if (!window.onurlchange) { + window.addEventListener("urlchange", () => { + addButton(); + }); + } +})(); \ No newline at end of file diff --git a/activation_code.txt b/activate/activation_code.txt similarity index 100% rename from activation_code.txt rename to activate/activation_code.txt diff --git a/tampermonkey.js.zip b/tampermonkey.js.zip deleted file mode 100644 index e558297b29e93782c815613401f1dec796b2e5c2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2296 zcmb7`c{J1w7sr1i%S86AEHyC_CbDE#p+zQ4#xi;$B}~XNV-_UYO7JNS0)o#DiDoyzhD6f8X!--1EKX+;i{!_k(~R;FbWu`}QWKpn!i%R~i6> z0SFLy>z=GYQnFV2U8I<(R>$FHsLSO|@Wp?||aX+QuPr4`avX8jI%g4V~ za;$uHua#oezy(C(m^-Cwe-B>>iz1pMf)i>T$ETpO(xRMomSu-Ubxzl|fu!|h+9Owi zd7@9zm1AIOkbqzufl4S%7`QvLq!HY$YzFUJ6Z2DO(SzMcJ2f)tK6zX_t|uZO(1w*e z1ChX0Lyu3P#G*`&7`xKO+|H^nNHL!}Ar);A5<#Uznxv=fs>Q6CmUXU@8{AT2xx@x4 zgkB@>b+-R*ZT~%*wo6xT%F7Q7Ln=1CRUYpvXOY2ToaK<`LSMBfGiAf^ z$7<2mF=tB158LrJaT9Fia-`|aozU#=^}SXEedE#A((JTDUk;BOL02Z{%=fc6XDe+@ zo%S4W7cq}WHLGD0y{pVnt)sFxmS1{Kbg@3mCkobOZ8hX(Wrm9qz0vWMtVe64^5rV- zY?tjhyR`acf3HF%;i{Y~tCf4c!MshkmSps2Y=W0IZ9bS`mvCLE+b<_JBcvN`hgU12|8Qk=QR}HtAS`}S!_|#XuHd!B^-OBZO{`S{7a)}P7>9EYm zLgOPmn^U3TsZo9T_A5b?r#x+3W-n}>#8x;#9Q9NIADftiq>qtNj+eEDM5N&IYE%aq zc-yo}v9FZdJnS!W>Ih@6Gi{hVp~f~}F- zX|U91>x|5xa)FgLFQ2V>-Y+m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