nicegram.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /******************************
  2. > 应用名称:Nicegram
  3. *******************************
  4. [rewrite_local]
  5. 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
  6. [MITM]
  7. hostname=restore-access.indream.app
  8. ********************************/
  9. const isTaskDefined = typeof $task !== 'undefined';
  10. const isHttpClientDefined = typeof $httpClient !== 'undefined';
  11. function logAndUnlockPremium() {
  12. console.log('Nicegram Premium已解锁😎');
  13. const responseBody = { data: { premiumAccess: true } };
  14. const response = {
  15. status: 'HTTP/1.1 200 OK',
  16. body: JSON.stringify(responseBody),
  17. headers: { 'Content-Type': 'application/json' }
  18. };
  19. if (isHttpClientDefined) {
  20. // For Surge
  21. $done({ response: { status: 200, body: JSON.stringify(responseBody) } });
  22. } else if (isTaskDefined) {
  23. // For Quantumult X
  24. $done(response);
  25. } else {
  26. // Other environments, fallback to a simple response
  27. $done({ status: 200, body: JSON.stringify(responseBody) });
  28. }
  29. }
  30. logAndUnlockPremium();