logo NodeSeekbeta

运营商只发了激活码?写了个 Python 脚本本地一键转 eSIM 二维码 (安全/离线/防覆盖)

12
  • 其实很多文本转二维码的网页都是通过本地浏览器来计算和转换的,看一下网页源码就知道了,不会有隐私风险。

    直接现场给你搓一个:

    <!DOCTYPE html>
    <html lang="zh">
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>eSIM QR Code Generator</title>
    <style>
      /* 全局样式 */
      body {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        background: #f5f6fa;
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        min-height: 100vh;
      }
    
      .container {
        background: #fff;
        padding: 30px 20px;
        margin: 20px;
        border-radius: 16px;
        box-shadow: 0 8px 20px rgba(0,0,0,0.1);
        max-width: 400px;
        width: 100%;
      }
    
      h2 {
        text-align: center;
        color: #2f3640;
        margin-bottom: 20px;
      }
    
      label {
        font-weight: 500;
        color: #2f3640;
      }
    
      input[type="text"], textarea {
        width: 100%;
        padding: 10px;
        margin: 6px 0 12px 0;
        border-radius: 8px;
        border: 1px solid #dcdde1;
        font-size: 14px;
        box-sizing: border-box;
      }
    
      textarea {
        resize: vertical;
      }
    
      button {
        width: 100%;
        padding: 12px;
        background: #4cd137;
        border: none;
        border-radius: 8px;
        color: #fff;
        font-size: 16px;
        cursor: pointer;
        transition: all 0.2s ease-in-out;
      }
    
      button:hover {
        background: #44bd32;
      }
    
      #qrcode {
        margin-top: 20px;
        display: flex;
        justify-content: center;
      }
    
      .download-btn {
        display: block;
        margin: 15px auto 0 auto;
        padding: 10px 20px;
        background: #273c75;
        color: #fff;
        border-radius: 8px;
        text-decoration: none;
        text-align: center;
        font-size: 14px;
      }
    
      .download-btn:hover {
        background: #192a56;
      }
    
      @media (max-width: 480px) {
        .container {
          margin: 10px;
          padding: 20px 15px;
        }
    
        h2 {
          font-size: 20px;
        }
    
        button {
          font-size: 14px;
          padding: 10px;
        }
      }
    </style>
    </head>
    <body>
    
    <div class="container">
      <h2>eSIM QR Code Generator</h2>
    
      <label>直接粘贴 LPA 字符串:</label>
      <textarea id="lpaInput" rows="3" placeholder="LPA:1$SM-DP+$ActivationCode"></textarea>
    
      <label>或者分段输入:</label>
      <input type="text" id="smdp" placeholder="SM-DP+ 地址">
      <input type="text" id="actCode" placeholder="激活码">
    
      <button onclick="generateQR()">生成二维码</button>
    
      <div id="qrcode"></div>
      <a id="downloadBtn" class="download-btn" style="display:none" download="esim_qr.png">下载二维码</a>
    </div>
    
    <!-- 引入二维码库 -->
    <script src="https://cdn.jsdelivr.net/npm/qrcode/build/qrcode.min.js"></script>
    <script>
    function generateQR() {
        let lpa = document.getElementById("lpaInput").value.trim();
        const smdp = document.getElementById("smdp").value.trim();
        const act = document.getElementById("actCode").value.trim();
    
        if (!lpa && smdp && act) {
            lpa = `LPA:1$${smdp}$${act}`;
        }
    
        if (!lpa) {
            alert("请输入 LPA 字符串或分段信息!");
            return;
        }
    
        const qrContainer = document.getElementById("qrcode");
        qrContainer.innerHTML = "";
    
        QRCode.toCanvas(lpa, { errorCorrectionLevel: 'M', width: 256 }, function (err, canvas) {
            if (err) {
                alert("生成失败: " + err);
                return;
            }
            qrContainer.appendChild(canvas);
    
            // 设置下载链接
            const downloadLink = document.getElementById("downloadBtn");
            downloadLink.href = canvas.toDataURL("image/png");
            downloadLink.style.display = "block";
        });
    }
    </script>
    
    </body>
    </html>
    
  • 这个代码风格一眼克劳德啊

  • 支持楼主!

  • 收藏一下

  • 收藏

12

你好啊,陌生人!

我的朋友,看起来你是新来的,如果想参与到讨论中,点击下面的按钮!

📈用户数目📈

目前论坛共有72783位seeker

🎉欢迎新用户🎉