Repository navigation
Expand file tree
/
Copy pathAppRaven.js
More file actions
59 lines (50 loc) · 2.12 KB
/
Copy pathAppRaven.js
File metadata and controls
59 lines (50 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
#!name=AppRaven ✨
#!desc=Active Pro!
#!category=🔐APP
#!author=🅚Ⓐ🅦Ⓞ🅐Ⓣ
#!openUrl=https://apps.apple.com/app/id1490607195
#!icon=https://raw.githubusercontent.com/KawOat9/icons/main/AppRaven.png
𒊹𒊹𒊹𒊹𒊹𒊹𒊹𒊹𒊹𒊹𒊹𒊹𒊹𒊹𒊹𒊹𒊹𒊹𒊹𒊹𒊹
[rewrite_local]
^https:\/\/appraven\.net\/appraven\/graphql url script-response-body https://raw.githubusercontent.com/KawOat9/Scripts/main/AppRaven.js
[MITM]
hostname = appraven.net
*/
// ===== 轻量通知 + 冷却 =====
const APP_NAME = "✨ AppRaven ✨"; // ← 只改这个显示名
const ID = "appraven"; // ← 对应键名,保持纯字母数字(无 emoji)
const EN = "n:"+ID+":e"; // 开关
const TS = "n:"+ID+":t"; // 时间戳
const CD = 600000; // 冷却时长:10 分钟(毫秒)
// ---- 通知函数(兼容 QX / Surge / Loon)----
function notify(t,s,b){
if (typeof $notify==="function") $notify(t,s,b);
else if ($notification?.post) $notification.post(t,s,b);
else console.log("[Notify]", t, s, b);
}
// ---- 判定逻辑 ----
let enabled = (($persistentStore.read(EN) || "1") === "1");
if (enabled) {
let now = Date.now();
let last = parseInt($persistentStore.read(TS) || "0",10) || 0;
if (last===0 || now-last>CD) {
notify(APP_NAME,"🎉 ปลดล็อกฟีเจอร์พรีเมียมเรียบร้อย", "เพลิดเพลินกับ AppRaven แบบไร้โฆษณา);
$persistentStore.write(String(now), TS);
}
}
// 主脚本函数...
let body = $response.body;
if (!body) { $done({}); }
// Apply replacements
[
{ pattern: /"premium":false/g, replacement: '"premium":true' },
{ pattern: /"hasInAppPurchases":false/g, replacement: '"hasInAppPurchases":true' },
{ pattern: /"youOwn":false/g, replacement: '"youOwn":true' },
{ pattern: /"arcade":false/g, replacement: '"arcade":true' },
{ pattern: /"preorder":false/g, replacement: '"preorder":true' }
].forEach(({ pattern, replacement }) => {
body = body.replace(pattern, replacement);
});
$done({ body });
// 主脚本函数...