code wiki / _hdl_build / nx_roku_install.nx
nx_roku_install.nx
buildroot/runtime/_hdl_build/nx_roku_install.nx
about
nx_roku_install.nx -- SOVEREIGN Roku sideloader (R0b): pushes a channel zip onto a Roku in Developer Mode via
the device's Development Application Installer (HTTP Digest auth + multipart/form-data POST to /plugin_install).
This is the sovereign, third-party-free replacement for `curl --digest -F` and for the manual browser upload --
it gives us the emit -> PUSH -> verify loop on the device (the live-testable-publish-loop standard).
Flow: TCP connect -> GET / to fetch the 401 Digest challenge -> parse realm+nonce -> compute response via the
KAT-proven nx_digest_auth (HA1=MD5(user:realm:pass), HA2=MD5(POST:/plugin_install), qop=auth) -> POST the zip
as multipart -> success iff the response carries "Install Success" / "Received" / "Identical".
Proven WITHOUT the device against a python HTTP-Digest mock (the 3rd-party oracle for this standard protocol).
nx_roku_install <ip> <port> <zippath> <user> <passfile>
e.g. nx_roku_install 192.168.8.50 80 /mnt/c/Users/elder/nishi_roku.zip rokudev /tmp/roku_pass.txt
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_connect.nxnx_digest_auth.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 15 | const K_MAGIC_8388608: i64 = 8388608 |
| 16 | const K_MAGIC_1024: i64 = 1024 |
| 17 | const K_MAGIC_131072: i64 = 131072 |
functions
| 19 | func ri_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 20 | func ri_num(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=(48 as u8);k=1}; while m>0{t[k]=((48+(m%10)) as u8);m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 } |
| 21 | func ri_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 22 | func ri_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ dst[off+i]=s[i]; i=i+1 } return off+i } called by 1: main |
| 23 | func ri_catb(dst: *u8, off: i64, src: *u8, n: i64) -> i64 { var i: i64=0; while i<n { dst[off+i]=src[i]; i=i+1 } return off+n } called by 1: main |
| 24 | func ri_catn(dst: *u8, off: i64, v: i64) -> i64 { var m: i64=v; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var o: i64=off; var i: i64=0; while i<k{dst[o]=t[k-1-i];o=o+1;i=i+1} return o } |
| 25 | func ri_dump(buf: *u8, n: i64) -> i64 { var m: i64=n; if m>600 { m=600 } sys_write(1, buf, m); sys_write(1,"\n" as *u8,1); return 0 } |
| 27 | func ri_read_file(path: *u8, buf: *u8, cap: i64) -> i64 |
| 34 | func ri_parse_ip(s: *u8, oct: *i64) -> i64 called by 1: main |
| 45 | func ri_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ let c: i64=s[i] as i64; if c>=48 { if c<=57 { v=v*10+(c-48) } } i=i+1 } return v } called by 1: main |
| 47 | func ri_sockaddr(buf: *u8, port: i64, a: i64, b: i64, c: i64, d: i64) -> i64 called by 1: ri_http |
| 55 | func ri_find(hay: *u8, n: i64, needle: *u8) -> i64 |
| 61 | func ri_contains(hay: *u8, n: i64, needle: *u8) -> i64 { if ri_find(hay,n,needle)>=0 { return 1 } return 0 } |
| 63 | func ri_extract_q(hay: *u8, n: i64, key: *u8, out: *u8, cap: i64) -> i64 |
| 70 | func ri_http(a: i64, b: i64, c: i64, d: i64, port: i64, req: *u8, reqlen: i64, resp: *u8, cap: i64) -> i64 called by 1: main calls 9: sys_socketsys_set_socket_timeoutsys_mmapri_sockaddrnx_connect_boundedsys_close+3 |
| 81 | func main(argc: i64, argv: *i64) -> i64 |