修复虎牙手机号登录并统一部署项目名
This commit is contained in:
@@ -13,6 +13,10 @@ function makeEnv(overrides) {
|
||||
const VW = ov.screenWidth ? Math.round(ov.screenWidth / 2.75) : 393;
|
||||
const VH = ov.screenHeight ? Math.round(ov.screenHeight / 2.75) : 851;
|
||||
const W = globalThis;
|
||||
// Node 18/20 do not expose a browser navigator; create one before defining
|
||||
// the properties consumed by hydevice. Newer Node versions already expose
|
||||
// a Navigator instance, which is retained.
|
||||
W.navigator = W.navigator || {};
|
||||
W.screen = {width:VW, height:VH, availWidth:VW, availHeight:VH,
|
||||
colorDepth:24, pixelDepth:24, availLeft:0, availTop:0, orientation:{type:'portrait-primary', angle:0}};
|
||||
W.devicePixelRatio = 2.75;
|
||||
|
||||
@@ -6,12 +6,18 @@ const path = require('path');
|
||||
const https = require('https');
|
||||
|
||||
globalThis.window = globalThis;
|
||||
const stateDir = process.argv[2] || '.';
|
||||
let _deviceOverrides = null;
|
||||
try { _deviceOverrides = JSON.parse(fs.readFileSync(process.argv[3] || '', 'utf8')); } catch (e) {}
|
||||
// Prefer an explicitly supplied JSON path; otherwise use the device hint that
|
||||
// get_huya_sdid writes into the per-account state directory.
|
||||
try {
|
||||
const hintPath = process.argv[3] && process.argv[3].endsWith('.json')
|
||||
? process.argv[3] : path.join(stateDir, 'device.json');
|
||||
_deviceOverrides = JSON.parse(fs.readFileSync(hintPath, 'utf8'));
|
||||
} catch (e) {}
|
||||
require(path.join(__dirname, 'env.js')).makeEnv(_deviceOverrides);
|
||||
|
||||
// ---- localStorage 持久化(设备稳定性) ----
|
||||
const stateDir = process.argv[2] || '.';
|
||||
try { fs.mkdirSync(stateDir, {recursive: true}); } catch (e) {}
|
||||
const lsFile = path.join(stateDir, 'localstorage.json');
|
||||
let _ls = {};
|
||||
|
||||
Reference in New Issue
Block a user