Script/QuantumultX/File/vsco.js

39 lines
1013 B
JavaScript
Raw Normal View History

2022-06-07 00:41:56 +08:00
/*
* Membership unlock for vsco & filebox
* Please note that you may need to reinstall app to make it work.
*
* Type: http-response (requires body)
* Regex: ^https?:\/\/api\.revenuecat\.com\/v\d\/subscribers\/
* Mitm: api.revenuecat.com
*/
const resp = {};
const obj = JSON.parse($response.body || null);
const product = {
"membership": "com.circles.fin.premium.yearly", //vsco
"filebox_pro": "com.premium.yearly" //filebox
2021-05-31 22:45:01 +08:00
}
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"
};
if (obj && obj.subscriber) {
if (!obj.subscriber.subscriptions) {
obj.subscriber.subscriptions = {};
}
if (!obj.subscriber.entitlements) {
obj.subscriber.entitlements = {};
}
for (const i in product) {
obj.subscriber.subscriptions[product[i]] = data;
obj.subscriber.entitlements[i] = data;
obj.subscriber.entitlements[i].product_identifier = product[i];
}
resp.body = JSON.stringify(obj);
2021-05-31 22:45:01 +08:00
}
2022-06-07 00:41:56 +08:00
$done(resp);