Files
RedLintu16andClaude Opus 5.5 b67b29b40b CrossSound desktop with the DRM stubbed out
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]>
2026-10-14 10:06:08 -07:00

49 lines
2.4 KiB
JavaScript
Executable File

#!/usr/bin/env node
'use strict'
// Build a self-contained app with DevTools enabled and the renderer left
// un-obfuscated (readable code + real line numbers in DevTools). Sets CS_DEBUG so
// electron-forge's generateAssets hook runs the debug asset build instead of the
// obfuscated release build.
//
// Usage: node scripts/make-debug.js [win32|darwin|linux] (default: win32)
// Output: win32 → out/make/squirrel.windows/
// darwin → out/make/{CrossSound.dmg, zip/darwin/...}
// Electron's makers can't cross-compile, so build each platform ON that platform.
process.env.CS_DEBUG = '1'
// Also minify the first-party renderer JS so the packaged debug app is smaller
// and launches faster. build-prod.js reads CS_DEBUG_MIN (inherited through the
// forge generateAssets hook). DevTools stay on.
process.env.CS_DEBUG_MIN = '1'
const { execSync } = require('child_process')
const path = require('path')
// Default win32 so `npm run win:debug` behaves exactly as before.
const PLATFORMS = ['win32', 'darwin', 'linux']
const platform = process.argv.slice(2).find((a) => !a.startsWith('-')) || 'win32'
if (!PLATFORMS.includes(platform)) {
console.error(`make-debug: unknown platform "${platform}" — expected one of ${PLATFORMS.join(', ')}`)
process.exit(1)
}
// macOS: ship the debug build as CrossSoundDebugging.app so it can live alongside
// the release app and is identifiable in the Dock / Applications. forge.config.js
// reads CS_APP_NAME. Windows keeps the plain name — its Squirrel update identity
// depends on it (see forge.config.js packagerConfig.name).
if (platform === 'darwin') process.env.CS_APP_NAME = 'CrossSoundDebugging'
// Wipe any stale packaged output first, or electron-packager reuses it and ships
// the previous version's app.asar (see scripts/clean-out.js).
require('./clean-out.js')
// Pull the Electron binary down FIRST, with a visible progress bar. Once forge's
// listr spinner takes over the terminal its download is invisible and the build
// looks frozen for minutes (see scripts/prefetch-electron.js). Best-effort: if
// this fails, forge downloads it itself.
try {
execSync(`node "${path.join(__dirname, 'prefetch-electron.js')}" ${platform}`, { stdio: 'inherit', env: process.env })
} catch (e) {
console.warn(`[make-debug] Electron prefetch skipped: ${(e && e.message) || e}`)
}
execSync(`npx electron-forge make --platform ${platform}`, { stdio: 'inherit', env: process.env })