Repository navigation
Expand file tree
/
Copy pathfpws.js
More file actions
33 lines (31 loc) · 1.48 KB
/
Copy pathfpws.js
File metadata and controls
33 lines (31 loc) · 1.48 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
/*******************************
脚本功能:防拍卫士-解锁订阅
脚本作者:afengye
注意事项:查看频道说明
频道地址:https://t.me/afengye
使用声明:️仅供学习交流, 🈲️商业用途
********************************
[rewrite_local]
^https?:\/\/api\.revenuecat\.com\/.+\/(receipts$|subscribers\/?(.*?)*$) url script-response-body https://raw.githubusercontent.com/afengye/QX/main/fpws.js
^https?:\/\/api\.revenuecat\.com\/.+\/(receipts$|subscribers\/?(.*?)*$) url script-request-header https://raw.githubusercontent.com/afengye/QX/main/fpws.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 product_id = "CameraFinder_MonthlyVip";
const entitlement = "pro";
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.entitlements[(entitlement)] = subscriber.subscriptions[(product_id)] = data;
subscriber.entitlements[(entitlement)].product_identifier = product_id;
obj.body = JSON.stringify(body);
}
}
$done(obj);