33 Commits
Author SHA1 Message Date
aydencharles ef90f9430f feat(notify): add a startup thanks toast 2026-10-02 18:24:10 +08:00
aydencharles dee1c1d523 feat(log): share the file sink and cap rotation from config 2026-10-02 16:40:23 +08:00
aydencharles 9beb4c58c6 refactor(boot): extract acquire use case and consolidate fs helpers 2026-09-14 10:20:40 +08:00
aydencharles 92b346566e feat(i18n): add remaining PS5 system language catalogs 2026-09-14 09:28:42 +08:00
aydencharles 1cdbfc5752 perf(unpacker): cache bootstrapper ELF to skip LZMA on reboot 2026-09-04 17:26:28 +08:00
aydencharles db59d1d45d fix(notify): fall back to plain toast on rich failure 2026-09-04 15:52:20 +08:00
aydencharles b84bac3027 fix(notify): write toast icon to /user/data 2026-09-04 15:37:48 +08:00
Hexwell 6803b4a7d5 refactor(cheats): copy HENCC files without renaming 2026-08-31 05:55:18 +08:00
Hexwell d30c9c2eac fix(crash): preserve logs and point reports to GitHub 2026-08-21 23:54:54 +08:00
Hexwell 994944a43f chore(cheats): cheats download page UI 2026-08-18 22:42:38 +08:00
Hexwell c5e30c4fd0 feat(cheats): add toolbox download UI and HTTP probe
Expose catalog download on the Game Tools page and put the
mirror picker in Preferences. Probe gstatic/miui generate_204
before clone so auto can pick GitHub or cnb.cool by reachability.

Also fix the CNB slug, rename the util CMake target so it no
longer clashes with libgit2, and keep last-error text off the
download button.
2026-08-18 12:38:27 +08:00
ModmyconandModmycon 2ac2793ab4 feat(i18n): add Thai (th-TH) locale
Add a key-complete th-TH catalog and wire it through settings, Toolbox, and notifications. Follow PS5 system language 27 when toolbox.language is system.

Co-authored-by: Modmycon <monmycod@gmail.com>
2026-08-17 22:22:14 +08:00
Hexwell c19d560d5e feat(i18n): add Italian, Russian, and Polish
Add key-complete catalogs and wire them through settings, Toolbox,
and notifications. Follow PS5 system languages 5, 8, and 16 when
toolbox.language is system. Existing locale ids stay unchanged.
2026-08-17 13:18:07 +08:00
Hexwell cd0c0450f0 feat(i18n): add Korean, Spanish, and Brazilian Portuguese
Add key-complete catalogs and wire them through settings, Toolbox,
and notifications. Follow PS5 system languages 9, 3/20, and 7/17
when toolbox.language is system. Existing locale ids stay unchanged.
2026-08-17 13:02:05 +08:00
Hexwell 58d6c4d5bb feat(i18n): add zh-Hant, Japanese, French, and German
Add key-complete catalogs and wire them through settings, Toolbox,
and notifications. Follow PS5 system languages 10, 0, 2/22, and 4
when toolbox.language is system. Existing zh-Hans, en, and ar ids
stay unchanged.
2026-08-17 12:46:48 +08:00
Hexwell fbf4c3c64b chore: remove unused ELF self-integrity
Ed25519 signing no longer adds useful friction. Drop
libonion_integrity, tools/elf_sign, and the XOR integrity toasts
so builds no longer sign daemon.elf.
2026-08-17 10:45:02 +08:00
Hexwell 5c07eee777 feat(i18n): add a trial Arabic locale
Scan every locale JSON into N-column catalogs and wire ar through
settings, Toolbox, and PS5 system language 21. The Settings page
stays LTR; XOR trial banners stay bilingual.
2026-08-17 10:32:55 +08:00
Hexwell 57826d5424 refactor(i18n): use stable keys and whole-sentence formats
Notifications look up notify.* keys instead of English source
strings. Toolbox interpolations go through toolbox_i18n::format so
zh/en word order lives in the JSON catalogs.
2026-08-17 09:50:33 +08:00
Hexwell 9a9c37e318 feat(logging): add runtime levels and log rotation 2026-08-06 18:12:52 +08:00
Hexwell 9736b1f99a feat: obfuscate beta banner and boot notify strings
Keep redistribution and integrity notices out of ELF .rodata by storing
XOR+position-math blobs and decoding at runtime, so casual string search
cannot locate and patch them. Covers toolbox XML banner, bootstrapper
debug toasts, and the shared integrity failure path in daemon.
2026-08-03 20:05:29 +08:00
Hexwell 5fa2c9bf67 feat(activation): add pluggable beta Ed25519 certificate gate
Introduce a self-contained libonion_activation module for internal-test
license checks, with compile-time public-key injection, debug-style
toasts, and shared notification i18n. Disable with
ONION_ENABLE_BETA_ACTIVATION=OFF when the beta gate is no longer needed.
2026-08-03 11:35:56 +08:00
Hexwell c88b173f34 fix(log): keep daemon log files reachable 2026-07-30 23:11:11 +08:00
HexwellandClaude Fable 5 7e64b92d98 refactor(log): route every call site through the shared logger
There were seven ways to log, each invented where the previous one was not
reachable:

  OnionHEN_log   libonion_platform, the only one with a file sink
  shellui_log    libonion_ipc, klog only — because it did not depend on
                 libonion_platform
  game_log       same body as shellui_log
  onion_ipc_log  same body again
  logf           libonion_ipc's IPC server, with a sink the host had to
                 register
  log_msg        onion_elfldr_server
  crash_log      util's fault handler, plus a second copy in common/
  boot_log       bootstrapper's fault handler
  klog_printf / klog_puts / printf / puts, called directly

A message's destination therefore depended on which module happened to emit
it: ShellUI's ~300 records went to volatile klog and never reached a log file,
while the daemon's went to klog, stdout and disk.

Everything now goes through the LOG_* macros. All seven legacy entry points
are gone, and klog_printf survives only as a sink inside log.c.

The bare -nostdlib libraries deliberately did not get their own backend. Those
flags only affect the static library's own link step; each is linked into a
host with full libc and pthread, which is why they already called vsnprintf.
A second backend would have recreated the split this removes.

Levels were inferred from message text rather than applied uniformly — the old
entry points carried no severity, so a blanket mapping would either bury real
failures at debug or promote routine chatter to error. Result: 291 error, 63
warn, 140 info, 309 debug.

Consequences worth noting:

  * ShellUI records now reach the log file, so a user report finally contains
    what the injected process did. In release builds most of them are debug
    and compile out, so this costs nothing on a retail unit.
  * The IPC server's log-sink injection is gone; both servers registered the
    same forwarder.
  * common/backtrace.cpp and backtrace.hpp are deleted. That was a third copy
    of the frame walking plus its own crash_log, and every caller of
    printBacktrace/printBacktraceForCrash had already been commented out.
  * Fault handlers use onion_log_emergency, so crash records go to the same
    file as everything else instead of a separate crash log.

The shared entry point carries a printf format attribute, which the old
shellui_log explicitly avoided. That attribute found seven real format
defects: %p given typed pointers, %lx given a MonoObject*, %p given a
uint64_t, and %u given an unsigned long. Four of them only compile in debug
builds, so they had gone unnoticed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 21:10:08 +08:00
HexwellandClaude Fable 5 510106f2de feat(log): make the log level configurable from config.ini
Adds [logging] level to the shared config schema, applied on every settings
load — so BREW_RELOAD_SETTINGS re-applies it and a user can raise verbosity
for a bug report without a debug payload or a reboot.

libonion_settings stays independent of libonion_platform, so the level
constants exist in both. onion/log_settings.hpp is the single place that sees
both headers and static_asserts that they still agree; it also clamps a
request to what the build actually compiled in and reports the effective
level back, so asking for trace in a release build logs why it stayed at
info rather than silently ignoring the setting.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 20:44:37 +08:00
HexwellandClaude Fable 5 e5f937be0b feat(log): add levels, rotation and thread safety
OnionHEN_log wrote unconditionally to klog, stdout and a file: no level, no
size bound, no locking, and an open/write/close per record. Release builds
therefore logged exactly as much as debug builds, and the file grew without
limit on a console the user cannot easily clean out.

Add ERROR/WARN/INFO/DEBUG/TRACE behind two gates. ONION_LOG_COMPILE_LEVEL is
checked first and is a constant expression, so a level compiled out costs
nothing at all — the arguments are never evaluated, which matters for the
LOG_TRACE sites that format state. onion_log_set_level then allows raising
verbosity at runtime for a bug report.

Runtime behaviour:
  * one mutex around the three sinks so records never interleave, with
    formatting kept outside it — the daemon logs from five threads
  * the file sink rotates at a size cap, keeping one previous generation
  * the descriptor stays open instead of reopening per record
  * a monotonic timestamp and the level are prefixed to every record
  * exactly one trailing newline regardless of what the caller passed

onion_log_emergency is the fault-handler path: it formats on the stack and
writes without locking, since the faulting thread may already hold the log
lock, and it bypasses both gates because a crash is always worth recording.

OnionHEN_log keeps its name and maps to INFO. Its ~600 call sites predate
levels and are mostly lifecycle reporting, so demoting them wholesale would
empty out a release log.

The test Makefile now emits and consumes depfiles: editing onion/log.h
previously reused a stale log.o, which reported a failure the source no
longer had.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 20:44:14 +08:00
HexwellandClaude Fable 5 2ab1fa9b13 refactor: share fault-handler frame walking
util and bootstrapper each carried their own copy of the frame-pointer
walking primitives and backtrace printer, so a fix to either had to be made
twice.

Move them to onion/fault_frame.h. They stay header-inline rather than
becoming library functions because onion_current_frame() returns the frame of
its caller and a fault handler uses that to overwrite its own return address:
putting it behind a call would insert a frame and shift which one gets
rewritten. Signal registration, cleanup policy and the setjmp site differ
between the two handlers and stay where they are.

The backtrace addresses are now assembled into one line and sent through the
sink. util previously printed the frames with raw printf() while the markers
around them went through crash_log(), so the crash log recorded
"backtrace start/end" with no addresses between them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 20:04:28 +08:00
HexwellandClaude Fable 5 2df9e0b2fb fix: share console IP lookup across modules
get_ip_address had three independent implementations (shellui, util, daemon)
because each module also carried its own copy of SceNetCtlInfo and its own
prototype for sceNetCtlGetInfo, with the pointer typed as SceNetCtlInfo* in
two of them and void* in the third.

The shellui and util copies stored the result in an unsigned int and tested
`ret < 0`, which is never true for an unsigned value. Their error branch was
unreachable, so a failed lookup returned success, left not_connected clear,
and copied an uninitialised SceNetCtlInfo to the caller instead of the
IP NOT FOUND placeholder. util's rest-mode network-recovery retry keys off
that return value and therefore never ran.

Declare the netctl ABI once in source/include/ps5/net_ctl.h, add
onion_net_get_ip_address to libonion_platform with an explicit buffer-size
contract, and keep util's not_connected latch in util where it belongs.
Cover the status mapping, the placeholder length and buffer validation with
host tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 19:49:50 +08:00
Hexwell 5654190b7a fix: simplify language caching 2026-07-20 17:59:45 +08:00
Hexwell a4cc7c835e fix: localize welcome toast and cache language
Cache the PS5 system language once per process and share the resolved locale across Toolbox, plain notifications, and rich notifications. Keep ShellUI queries behind the registered trampoline, localize the daemon welcome toast, and cover cache refresh and localized payload generation in host tests.
2026-07-20 17:36:30 +08:00
Hexwell 734e86ed29 feat: localize notification messages
Share the Toolbox language setting across bootstrapper, daemon, util, and ShellUI notifications. Localize both plain and icon-rich toast text with system-language fallback, and add host coverage for language resolution and rich payload formatting.
2026-07-20 17:25:29 +08:00
Hexwell 4412785bf7 remove: drop FPS overlay inject and fps_elf embed
Remove FPS calculation from the shellui monitor bar while keeping CPU,
GPU, RAM, and IP metrics, and delete the full game-process inject path
(fps_elf, fps.prx, SHM) so titles are no longer soft-injected.

Clear any legacy fps_overlay ready marker on daemon/shellui start, and
bound CPU sampling retries so a stuck probe cannot block other metrics.
2026-07-16 22:22:29 +08:00
Hexwell 547c5b4bd7 fix: use rich startup notification 2026-07-16 21:06:42 +08:00
Hexwell aad2cdaabc refactor: rebrand OrionHEN to OnionHEN
Rename product, namespaces, libraries, paths, and assets from Orion/orion
to Onion/onion across the tree. TCP stack-shutdown magic is now ONIO
(0x4F4E494F) to match the corrected branding.
2026-07-15 18:23:16 +08:00