2022-07-03 07:41:54 +08:00
|
|
|
/********************************
|
2023-08-17 22:51:45 +08:00
|
|
|
Membership unlock for VSCO & 1Blocker & HTTPBot
|
2022-07-03 07:41:54 +08:00
|
|
|
Please note that you may need to reinstall app for script to work.
|
2022-06-07 00:41:56 +08:00
|
|
|
|
2022-07-03 07:41:54 +08:00
|
|
|
QuantumultX rewrite link:
|
|
|
|
https://raw.githubusercontent.com/NobyDa/Script/master/QuantumultX/File/vsco.js
|
2022-06-07 00:41:56 +08:00
|
|
|
|
2022-07-03 07:41:54 +08:00
|
|
|
Please note that the above rewrite link requires open KOP-XIAO's resource parser
|
|
|
|
|
|
|
|
*********************************
|
|
|
|
Surge4, Loon and Shadowrocket configuration:
|
|
|
|
|
|
|
|
[Script]
|
|
|
|
http-request ^https?:\/\/api\.revenuecat\.com\/v\d\/subscribers\/ script-path=https://raw.githubusercontent.com/NobyDa/Script/master/QuantumultX/File/vsco.js
|
|
|
|
http-response ^https?:\/\/api\.revenuecat\.com\/v\d\/subscribers\/ requires-body=1,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/QuantumultX/File/vsco.js
|
|
|
|
|
|
|
|
[MITM]
|
|
|
|
hostname = api.revenuecat.com
|
|
|
|
********************************/
|
|
|
|
|
|
|
|
const resp = {};
|
|
|
|
const obj = JSON.parse(typeof $response != "undefined" && $response.body || null);
|
|
|
|
const ua = $request.headers['User-Agent'] || $request.headers['user-agent'];
|
|
|
|
const list = {
|
2023-08-17 22:51:45 +08:00
|
|
|
'HTTPBot': { name: 'rc_lifetime', id: 'com.behindtechlines.HTTPBot.prounlock' },
|
2022-07-03 07:41:54 +08:00
|
|
|
'VSCO': { name: 'membership', id: 'com.circles.fin.premium.yearly' },
|
|
|
|
'1Blocker': { name: 'premium', id: 'blocker.ios.subscription.yearly' }
|
|
|
|
};
|
2022-06-07 00:41:56 +08:00
|
|
|
const data = {
|
|
|
|
"expires_date": "2030-02-18T07:52:54Z",
|
|
|
|
"original_purchase_date": "2020-02-11T07:52:55Z",
|
|
|
|
"purchase_date": "2020-02-11T07:52:54Z"
|
|
|
|
};
|
|
|
|
|
2022-07-03 07:41:54 +08:00
|
|
|
if (typeof $response == "undefined") {
|
|
|
|
delete $request.headers["x-revenuecat-etag"]; // prevent 304 issues
|
|
|
|
delete $request.headers["X-RevenueCat-ETag"];
|
|
|
|
resp.headers = $request.headers;
|
|
|
|
} else if (obj && obj.subscriber) {
|
|
|
|
obj.subscriber.subscriptions = obj.subscriber.subscriptions || {};
|
|
|
|
obj.subscriber.entitlement = obj.subscriber.entitlement || {};
|
|
|
|
for (const i in list) {
|
|
|
|
if (new RegExp(`^${i}`, `i`).test(ua)) {
|
|
|
|
obj.subscriber.subscriptions[list[i].id] = data;
|
|
|
|
obj.subscriber.entitlements[list[i].name] = JSON.parse(JSON.stringify(data));
|
|
|
|
obj.subscriber.entitlements[list[i].name].product_identifier = list[i].id;
|
|
|
|
break;
|
|
|
|
}
|
2022-06-07 00:41:56 +08:00
|
|
|
}
|
|
|
|
resp.body = JSON.stringify(obj);
|
2021-05-31 22:45:01 +08:00
|
|
|
}
|
|
|
|
|
2022-06-07 00:41:56 +08:00
|
|
|
$done(resp);
|