shawenguan 2 年之前
父節點
當前提交
d41cb31120
共有 1 個文件被更改,包括 40 次插入0 次删除
  1. 40 0
      Scripts/nicegram/nicegram.js

+ 40 - 0
Scripts/nicegram/nicegram.js

@@ -0,0 +1,40 @@
+/******************************
+
+> 应用名称:Nicegram
+
+*******************************
+
+[rewrite_local]
+
+https?:\/\/restore-access\.indream\.app\/restoreAccess\?id=\d{5,10} url echo-response text/json echo-response https://git.jojo21.cf/shawenguan/Quantumult-X/raw/master/Scripts/nicegram/nicegram.js
+
+[MITM]
+
+hostname=restore-access.indream.app
+
+********************************/
+
+const isTaskDefined = typeof $task !== 'undefined';
+const isHttpClientDefined = typeof $httpClient !== 'undefined';
+
+function logAndUnlockPremium() {
+    console.log('Nicegram Premium已解锁😎');
+    const responseBody = { data: { premiumAccess: true } };
+    const response = {
+        status: 'HTTP/1.1 200 OK',
+        body: JSON.stringify(responseBody),
+        headers: { 'Content-Type': 'application/json' }
+    };
+
+    if (isHttpClientDefined) {
+        // For Surge
+        $done({ response: { status: 200, body: JSON.stringify(responseBody) } });
+    } else if (isTaskDefined) {
+        // For Quantumult X
+        $done(response);
+    } else {
+        // Other environments, fallback to a simple response
+        $done({ status: 200, body: JSON.stringify(responseBody) });
+    }
+}
+logAndUnlockPremium();