v0.1.1: external modules, publish YAML, proxy reset, binary-first README
All checks were successful
release / build-and-upload (push) Successful in 6m8s
modules-release / build-and-upload (push) Successful in 4m47s

- Host discovers/builds modules under modules/ (bbc, rte, tg4)
- module-publish.yaml tracked; local module.yaml gitignored
- drm --modules-dir / DRM_MODULES_DIR
- drm proxy reset; Magisk reinject reliability
- modules-v* Forgejo release workflow + build scripts
- BBC full Explore channel map including S4C
- README quickstart based on release binaries
This commit is contained in:
404errordeveloper 2026-10-08 23:16:14 +02:00
parent 1d36961a7c
commit f9c28be3f1
52 changed files with 2915 additions and 636 deletions

View file

@ -12,18 +12,27 @@ import (
"drmdecryption/adb"
"drmdecryption/app"
"drmdecryption/modcfg"
"drmdecryption/modhost"
"drmdecryption/phonecap"
"drmdecryption/repo"
)
// Run performs one capture. App modules are compiled in, so there is no modules
// directory to scan: --app names a registered provider.
// Run performs one capture. Providers live under modules/<name>/ and are built
// and executed by modhost — they are not linked into drm.exe.
func Run(args []string) error {
args = normalizeArgs(args)
root := repo.Root()
available, _ := modhost.Names(root)
appChoices := strings.Join(available, "|")
if appChoices == "" {
appChoices = "NAME"
}
fs := flag.NewFlagSet("capture", flag.ContinueOnError)
appName := fs.String("app", "", "app module. Empty = passive MITM, no launch/auto-play")
appName := fs.String("app", "", "app module under modules/<name>/. Empty = passive MITM, no launch/auto-play")
channel := fs.String("channel", "", "channel id for --auto-play")
autoPlay := fs.Bool("auto-play", false, "auto-navigate to --channel (requires --app and --channel)")
autoPlay := fs.Bool("auto-play", false, "auto-navigate to --channel (implied when --channel is set)")
waitSec := fs.Int("wait", 180, "seconds to wait for license/mpd capture")
python := fs.String("python", "", "python for wvkey.py (default: .venv)")
wvd := fs.String("wvd", "", "path to .wvd device file (required for key fetch)")
@ -31,10 +40,8 @@ func Run(args []string) error {
serial := fs.String("serial", "", "adb device serial (default: sole/USB selected device)")
closeApp := fs.Bool("close", true, "force-stop --app when capture finishes (ignored in passive mode)")
keyMode := fs.String("key-mode", "", "override the app's key mode: modulardrm | raw | none")
// Each module contributes --<app>.<field> overrides for its local values.
app.BindFlags(fs)
fs.Usage = func() {
fmt.Fprintf(fs.Output(), "capture — one-shot phone MITM capture\n\nUsage:\n capture --app <%s> [--channel ID] [--auto-play] [--wvd PATH]\n capture (passive: play anything on the phone)\n\nExample (BBC + NordVPN UK):\n capture --app bbc --channel bbcone --wait 120\n\nFlags:\n", strings.Join(app.Names(), "|"))
fmt.Fprintf(fs.Output(), "capture — one-shot phone MITM capture\n\nUsage:\n capture --app <%s> [--channel ID] [--auto-play] [--wvd PATH]\n capture (passive: play anything on the phone)\n\nExample (BBC + NordVPN UK):\n capture --app bbc --channel bbcone --wait 120\n\nFlags:\n", appChoices)
fs.PrintDefaults()
}
@ -65,26 +72,29 @@ func Run(args []string) error {
return err
}
a, err := app.Get(*appName)
a, err := modhost.Open(root, *appName)
if err != nil {
return err
return modhost.FormatUnknown(root, *appName)
}
if *autoPlay && strings.TrimSpace(*channel) == "" {
channelID := strings.TrimSpace(*channel)
// --channel implies interactive auto-play (Explore → channel → Watch live).
doAutoPlay := *autoPlay || channelID != ""
if *autoPlay && channelID == "" {
return fmt.Errorf("--auto-play requires --channel (%s)", knownChannels(a))
}
if *channel != "" && !a.HasChannel(*channel) {
return fmt.Errorf("unknown channel %q for %s (%s)", *channel, a.Name(), knownChannels(a))
if channelID != "" && !a.HasChannel(channelID) {
return fmt.Errorf("unknown channel %q for %s (%s)", channelID, a.Name(), knownChannels(a))
}
_, err = phonecap.Run(phonecap.Options{
App: a,
Channel: *channel,
Channel: channelID,
Client: c,
Python: *python,
WVD: *wvd,
UserAgent: *userAgent,
Wait: time.Duration(*waitSec) * time.Second,
NoAutoPlay: !*autoPlay,
NoAutoPlay: !doAutoPlay,
CloseApp: *closeApp,
KeyMode: *keyMode,
ClearProxy: true,