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

39 lines
1.3 KiB
JavaScript
Executable File

#!/usr/bin/env node
'use strict'
// Reads credentials from .env and generates src/api/credentials.ts with
// XOR-encoded values. The generated file is gitignored — run this before
// building. The obfuscation pipeline further scrambles the decoded logic.
const fs = require('fs')
const path = require('path')
const envPath = path.join(__dirname, '../.env')
require('dotenv').config({ path: envPath })
// 8-byte rolling key used for XOR encoding
const KEY = [0x4B, 0x7E, 0x23, 0x91, 0x5A, 0x3F, 0xC2, 0x8D]
function encode(str) {
return Array.from(str).map((c, i) => c.charCodeAt(0) ^ KEY[i % KEY.length])
}
const fields = {
_EI: process.env.SC_CLIENT_ID ?? '',
_ES: process.env.SC_CLIENT_SECRET ?? '',
_ER: process.env.SC_REDIRECT_URI ?? 'http://127.0.0.1:52123/callback',
}
const out = [
'// AUTO-GENERATED by scripts/encode-creds.js — do not edit or commit',
`const _K: number[] = [${KEY.join(', ')}]`,
`export function _cx(e: number[]): string {`,
` return e.map((c, i) => String.fromCharCode(c ^ _K[i % _K.length])).join('')`,
`}`,
...Object.entries(fields).map(
([name, val]) => `export const ${name}: number[] = [${encode(val).join(', ')}]`
),
].join('\n') + '\n'
const outPath = path.join(__dirname, '../src/api/credentials.ts')
fs.writeFileSync(outPath, out, 'utf8')
console.log('[encode-creds] wrote src/api/credentials.ts')