Repository navigation
Expand file tree
/
Copy pathdtd.js
More file actions
41 lines (38 loc) · 1.65 KB
/
Copy pathdtd.js
File metadata and controls
41 lines (38 loc) · 1.65 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
/**************************************
脚本功能:Dtd Sounds睡眠白噪音-解锁订阅
脚本作者:afengye
注意事项:查看频道说明
频道地址:https://t.me/afengye
使用声明:️仅供学习交流, 🈲️商业用途
***************************************
[rewrite_local]
^https?:\/\/api\.revenuecat\.com\/.+\/(receipts$|subscribers\/?(.*?)*$) url script-response-body https://raw.githubusercontent.com/afengye/QX/main/dtd.js
^https?:\/\/api\.revenuecat\.com\/.+\/(receipts$|subscribers\/?(.*?)*$) url script-request-header https://raw.githubusercontent.com/afengye/QX/main/dtd.js
[mitm]
hostname = api.revenuecat.com
*******************************/
let obj = {};
if(typeof $response == "undefined") {
delete $request.headers["x-revenuecat-etag"];
delete $request.headers["X-RevenueCat-ETag"];
obj.headers = $request.headers;
}else {
let body = JSON.parse(typeof $response != "undefined" && $response.body || null);
if(body && body.subscriber) {
const name = "\u0070\u0072\u006f";
const appid = "\u0063\u006f\u006d\u002e\u0064\u0074\u0064\u002e\u0061\u0072\u006f\u0075\u006e\u0064\u0075\u002e\u006c\u0069\u0066\u0065";
let data = {
"expires_date": "2999-01-01T00:00:00Z",
"original_purchase_date": "2021-01-01T00:00:00Z",
"purchase_date": "2021-01-01T00:00:00Z",
"ownership_type": "PURCHASED",
"store": "app_store"
};
let subscriber = body.subscriber;
subscriber.subscriptions[(appid)] = data;
subscriber.entitlements[(name)] = JSON.parse(JSON.stringify(data));
subscriber.entitlements[(name)].product_identifier = (appid);
obj.body = JSON.stringify(body);
}
}
$done(obj);