Files
MoHadiShibli 5e38f1db2d Launcher: leave the app sandbox so it can reach Control4Free
On the console the app's connections to 127.0.0.1 and to the console's own
address both failed with EACCES: the app sandbox does not let an app reach
the console itself. So the app reached neither Control4Free nor PayLoader,
while a phone or PC on the network could.

The app now takes itself out of the sandbox at startup with GoldHEN's SDK
call, the same one the auto-start setup used, and stays out. The bundled
payload is read into memory first, since /app0 is only visible from inside,
and starts send it from there. When nothing connects at all, the screen
says the app cannot reach Control4Free instead of blaming another copy.

OpenOrbis's headers give SIGSYS Linux's value (31); the kernel's is 12.
2026-10-04 21:23:14 +03:00

30 lines
1.2 KiB
C

#ifndef C4F_LAUNCHER_SERVICE_H
#define C4F_LAUNCHER_SERVICE_H
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
enum { C4F_SERVICE_UNKNOWN = -1, C4F_SERVICE_DOWN = 0, C4F_SERVICE_RUNNING = 1 };
typedef struct { int controllers, stopping; char version[24]; } C4fServiceStatus;
uint64_t c4fLauncherTimeMs(void);
/* The console's own IPv4 address, when known. The app's sandbox may not reach
* 127.0.0.1, so it is the second way to reach Control4Free and PayLoader. */
void c4fLauncherSetHost(const char *ipv4);
/* Why the last probe could not confirm the service, for the screen. */
const char *c4fLauncherProblem(void);
/* DOWN only when nothing accepted a connection and something refused one.
* Ambiguous answers must not allow starting another copy in the shared
* payload host. */
int c4fLauncherProbe(C4fServiceStatus *status);
/* Whether the last probe connected anywhere, so "no answer" can be told apart
* from "cannot reach". */
int c4fLauncherReached(void);
int c4fLauncherStart(const unsigned char *payload, size_t payloadSize, char *message, size_t size);
int c4fLauncherStop(char *message, size_t size);
#ifdef __cplusplus
}
#endif
#endif