A single-commit snapshot of better-remote (7a8c4cb plus the uncommitted remote.js work), with every DRM-bearing piece replaced by a stub that keeps the same interface: - src/ui/drm.js: no DRM pipelines; needsDrm/isDrmUrl false, bestEncryptedTranscoding null, playDrmAudio rejects. The engine switcher and drmVjs* helpers stay as no-ops. - src/electron/drm.ts: initCdm/setupLicenseCors no-ops; the drm:license and api:stream:drm-info IPC handlers reject with "DRM is not available". - src/api/soundcloud.ts: resolveEncryptedStream keeps its signature, rejects. - src/electron/main.ts: license host dropped from the header rewrite. - src/ui/pb-lease.js: the expiry self-check uses a placeholder URL instead of a captured DRM manifest URL (same policy values, still passes). - scripts/vmp-sign.js, forge.config.js vmpSign: Widevine signing skipped, so no castLabs EVS account is needed to run or package. - README: says DRM is stubbed here. Go+ tracks SoundCloud only serves encrypted are unplayable and skipped; previews and everything else play as before. No history: the private branches' DRM code is not reachable from this commit. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
38 lines
1.7 KiB
JavaScript
Executable File
38 lines
1.7 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
'use strict'
|
|
// Build a multi-resolution icons/icon.ico from the PNG set (no dependencies).
|
|
// A modern .ico is just a small directory header followed by the PNG files embedded
|
|
// verbatim (Windows Vista+ supports PNG-compressed icon entries). Regenerate after
|
|
// changing the source art: `node scripts/gen-ico.js`.
|
|
const fs = require('fs')
|
|
const path = require('path')
|
|
|
|
const iconsDir = path.join(__dirname, '..', 'icons')
|
|
const sizes = [16, 32, 48, 64, 128, 256] // .ico max is 256; taskbar picks the best fit
|
|
const imgs = sizes.map(s => ({ size: s, data: fs.readFileSync(path.join(iconsDir, `${s}x${s}.png`)) }))
|
|
|
|
const header = Buffer.alloc(6)
|
|
header.writeUInt16LE(0, 0) // reserved
|
|
header.writeUInt16LE(1, 2) // type: 1 = icon
|
|
header.writeUInt16LE(imgs.length, 4) // image count
|
|
|
|
const entries = []
|
|
let offset = 6 + imgs.length * 16 // pixel data starts after header + all dir entries
|
|
for (const { size, data } of imgs) {
|
|
const e = Buffer.alloc(16)
|
|
e.writeUInt8(size >= 256 ? 0 : size, 0) // width (0 means 256)
|
|
e.writeUInt8(size >= 256 ? 0 : size, 1) // height (0 means 256)
|
|
e.writeUInt8(0, 2) // palette color count
|
|
e.writeUInt8(0, 3) // reserved
|
|
e.writeUInt16LE(1, 4) // color planes
|
|
e.writeUInt16LE(32, 6) // bits per pixel
|
|
e.writeUInt32LE(data.length, 8) // size of PNG data
|
|
e.writeUInt32LE(offset, 12) // offset to PNG data
|
|
entries.push(e)
|
|
offset += data.length
|
|
}
|
|
|
|
const ico = Buffer.concat([header, ...entries, ...imgs.map(i => i.data)])
|
|
fs.writeFileSync(path.join(iconsDir, 'icon.ico'), ico)
|
|
console.log(`[gen-ico] wrote icons/icon.ico — ${imgs.length} sizes (${sizes.join(', ')}), ${ico.length} bytes`)
|