|
|
@@ -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();
|