26 lines
729 B
JavaScript
26 lines
729 B
JavaScript
/*
|
||
README:https://github.com/yichahucha/surge/tree/master
|
||
*/
|
||
|
||
const path1 = "/interface/sdk/sdkad.php";
|
||
const path2 = "/wbapplua/wbpullad.lua";
|
||
|
||
const url = $request.url;
|
||
let body = $response.body;
|
||
let obj;
|
||
if (url.indexOf(path1) !== -1) {
|
||
let re = /\{.*}/;
|
||
body = body.match(re);
|
||
obj = JSON.parse(body);
|
||
if (obj.background_delay_display_time) obj.background_delay_display_time = 60*60*24*365;
|
||
if (obj.show_push_splash_ad) obj.show_push_splash_ad = false;
|
||
if (obj.ads) obj.ads = [];
|
||
body = JSON.stringify(obj) + 'OK';
|
||
}
|
||
if (url.indexOf(path2) !== -1) {
|
||
obj = JSON.parse(body);
|
||
if (obj.cached_ad && obj.cached_ad.ads) obj.cached_ad.ads = [];
|
||
body = JSON.stringify(obj);
|
||
}
|
||
|
||
$done({body}); |