forked from Guding88/Script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFinaleToDo.js
38 lines (34 loc) · 1.57 KB
/
FinaleToDo.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
/*
Finale To Do:https://apps.apple.com/app/id1622931101
[rewrite_local]
^https?:\/\/api\.revenuecat\.com\/v1\/(subscribers\/[^\/]+$|receipts$) url script-response-body https://raw.githubusercontent.com/Guding88/Script/main/FinaleToDo.js
^https?:\/\/api\.revenuecat\.com\/v1\/(subscribers\/[^\/]+$|receipts$) url script-request-header https://raw.githubusercontent.com/Guding88/Script/main/FinaleToDo.js
[MITM]
hostname = api.revenuecat.com
*/
const guding = {};
const guding6 = JSON.parse(typeof $response != "undefined" && $response.body || null);
if (typeof $response == "undefined") {
delete $request.headers["x-revenuecat-etag"];
delete $request.headers["X-RevenueCat-ETag"];
guding.headers = $request.headers;
} else if (guding6 && guding6.subscriber) {
guding6.subscriber.subscriptions = guding6.subscriber.subscriptions || {};
guding6.subscriber.entitlement = guding6.subscriber.entitlement || {};
const app = 'gd';const list = {'gd':{name: 'FinalePro', id: 'FinaleProLifetime'}};
const data = {
"expires_date": "6666-06-06T06:06:06Z",
"original_purchase_date": "2023-02-23T02:33:33Z",
"purchase_date": "2023-02-23T02:33:33Z",
"ownership_type" : "PURCHASED",
"store" : "app_store"};
for (const i in list) { if (new RegExp(`^${i}`, `i`).test(app)) {
guding6.subscriber.subscriptions[list[i].id] = data;
guding6.subscriber.entitlements[list[i].name] = JSON.parse(JSON.stringify(data));
guding6.subscriber.entitlements[list[i].name].product_identifier = list[i].id;
break;
}
}
guding.body = JSON.stringify(guding6);
}
$done(guding);