-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAllinOneRewrite.js
64 lines (45 loc) · 2.28 KB
/
AllinOneRewrite.js
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
60
61
62
63
64
const resp = {};
const obj = JSON.parse(typeof $response != "undefined" && $response.body || null);
const ua = $request.headers['User-Agent'] || $request.headers['user-agent'];
const list = {
'incognito': { eKey: 'unlock', pID: 'com.overdesigned.incognito.lifetime' },
'chat': { eKey: 'plus', pID: 'PlusMonthly' },
'chat': { eKey: 'pro', pID: 'yearly' },
'jodel': { eKey: 'jodel_premium', pID: 'no_ads_v1_1mo_ar_full' },
'teak': { eKey: 'pro', pID: 'com.tk.client.lifetime' },
'code': { eKey: 'pro', pID: 'code_runner_yearly_plan' },
'WidgetSmith': { eKey: 'Premium', pID: 'PremiumMonthlyWidgetsmith' },
'VSCO': { eKey: 'pro', pID: 'vscopro_global_5999_annual_7D_free' },
'Darkroom': { eKey: 'co.bergen.Darkroom.entitlement.allToolsAndFilters', pID: 'co.bergen.Darkroom.product.forever.everything' },
'Structured': { eKey: 'pro', pID: 'today.structured.pro' },
'FitnessAi': { eKey: 'Premium', pID: 'annual_189.99_3' },
'BookmarkPro': { eKey: 'pro', pID: 'it.beatcode.bookmarkmanager.lifetime' },
'Pillow': { eKey: 'premium', pID: 'com.neybox.pillow.premium.year' },
'Off': { eKey: 'unlock_everthing', pID: 'com.bridgetech.off.lifetime' },
'Amie': { eKey: 'pro', pID: 'amie_pro_9999_1y_23012024' },
'AppName': { eKey: 'entitlement', pID: 'product identifier' }
};
const data = {
"expires_date": "2099-09-09T13:37:37Z",
"original_purchase_date": "2024-01-01T13:37:37Z",
"purchase_date": "2024-01-01T13:37:37Z",
"event_status": "PURCHASED"
};
if (typeof $response == "undefined") {
delete $request.headers["x-revenuecat-etag"];
delete $request.headers["X-RevenueCat-ETag"];
resp.headers = $request.headers;
} else if (obj && obj.subscriber) {
obj.subscriber.subscriptions = obj.subscriber.subscriptions || {};
obj.subscriber.entitlements = obj.subscriber.entitlements || {};
for (const i in list) {
if (new RegExp(`^${i}`, `i`).test(ua)) {
obj.subscriber.subscriptions[list[i].pID] = data;
obj.subscriber.entitlements[list[i].eKey] = JSON.parse(JSON.stringify(data));
obj.subscriber.entitlements[list[i].eKey].product_identifier = list[i].pID;
break;
}
}
resp.body = JSON.stringify(obj);
}
$done(resp);