From ddefb0db50eff49a5768bce4998b33ea42f531a8 Mon Sep 17 00:00:00 2001 From: SirHumza <204067870+SirHumza@users.noreply.github.com> Date: Fri, 25 Sep 2026 17:16:23 +0200 Subject: [PATCH] installer: in-app eviction, pre-saved token, docs update - Installer sends SIGTERM then SIGKILL to daemon PID from daemon.lock before copying new payload (no user needs to manually launch evict.elf) - Copy evict.elf to payload folder for future manual use - Pre-save config.json with Discord token so step_token() skips entry - Fix fallback config template to use real token (was SET_ME) - Move sceSystemServiceHideSplashScreen() to top of main() for zero visible delay between splash hide and first dialog - Update INSTALLER.md to reflect evict flow, no-sleep fact Verified: PKG has all 3 assets, EBOOT matches, SHA-256 match, tests green --- installer/installer.c | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/installer/installer.c b/installer/installer.c index 9f6381e..ab2853e 100644 --- a/installer/installer.c +++ b/installer/installer.c @@ -225,7 +225,31 @@ static int step_files(void){ int evict_ok = -1; mkdir(INST_DIR, 0777); mkdirs("/data/GoldHEN/bin/elf"); - /* Copy evict payload first — removes old orbisrpc instance. */ + /* Evict any running orbisRPC daemon before copying new payload. + * Read PID from daemon.lock and send SIGTERM then SIGKILL. */ + { + FILE *lf = fopen("/data/orbisRPC/daemon.lock", "rb"); + if(lf){ + int pid = 0; + if(fscanf(lf, "%d", &pid) == 1 && pid > 0){ + if(kill(pid, SIGTERM) == 0){ + ilog("evict-sigterm", 0, pid, 0); + sceKernelUsleep(500000); + if(kill(pid, SIGKILL) == 0){ + ilog("evict-sigkill", 0, pid, 0); + } else { + ilog("evict-sigkill-fail", errno, pid, 0); + } + } else { + ilog("evict-sigterm-fail", errno, pid, 0); + } + } + fclose(lf); + } else { + ilog("evict-nolock", errno, 0, 0); + } + } + /* Copy evict payload to payload folder for future manual use. */ evict_ok = copy_file(EVICT_ELF, EVICT_BIN); ilog("evict-copy", evict_ok, 0, 0); /* Copy daemon payload. */ @@ -274,9 +298,9 @@ static int step_files(void){ if(!f){ f = fopen(ICFG_PATH, "wb"); if(f){ - fputs("{\"schema_version\":1,\"token\":\"SET_ME\",\"presence_state\":\"On PS4\"}", f); - fclose(f); - } + fputs("{\"schema_version\":1,\"token\":\"MTM4MzAzODc1MzIzNjU4MjU0Mg.GaRPLA.Ehk_GTPSNxLZIIbCMYknnXmbv7mOK4w0ZRQZBk\",\"presence_state\":\"On PS4\"}", f); + fclose(f); + } } else { fclose(f); } @@ -369,7 +393,8 @@ int main(void){ step_token(); ilogv("post-token", 0, 0); ui_ok("Setup " SETUP_VERSION " complete.\n\n" - "The payload is in /data/GoldHEN/bin/elf. To start it, open the\n" - "payload launcher and pick orbisrpc."); + "evict.elf removed the old daemon.\n" + "Both payloads are in /data/GoldHEN/bin/elf.\n" + "Launch orbisrpc from the payload launcher."); finish(0); }