mirror of
https://github.com/aydencharles/onionHEN.git
synced 2026-10-22 11:53:07 -05:00
A --release build defined both DEBUG and NDEBUG, and SHELL_DEBUG was hardcoded to 1 in defs.h. Every debug branch therefore shipped: the extra checks in libhijacker's containers, and ~50 verbose diagnostic blocks in the ShellUI hooks — the chattiest logging in the project, running inside an injected system process on every boot. DEBUG is now defined only for non-Release configurations, and SHELL_DEBUG follows NDEBUG (override with -DSHELL_DEBUG=1 to keep the verbose blocks in a release build while chasing a report). The symbols that exist only to serve those blocks are guarded alongside them. Also drop the hardcoded -O0. Release only got -O3 because it was appended after it; reordering the flag strings would have silently produced an unoptimised release build. Optimisation now comes from the build type alone. Release shellui.elf is 24% smaller than the Debug one, and smaller than before this change despite the added logging code. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
46 lines
1.4 KiB
C
46 lines
1.4 KiB
C
/* Copyright (C) 2025 OnionHEN / LightningMods
|
|
|
|
This program is free software; you can redistribute it and/or modify it
|
|
under the terms of the GNU General Public License as published by the
|
|
Free Software Foundation; either version 3, or (at your option) any
|
|
later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; see the file COPYING. If not, see
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
#pragma once
|
|
|
|
#include <onion/version.h>
|
|
|
|
#define PUBLIC_TEST 0
|
|
#define PRE_RELEASE 0
|
|
|
|
/*
|
|
* Guards ~50 verbose diagnostic blocks in the ShellUI hooks. It was hardcoded
|
|
* to 1, so those blocks shipped in release payloads — ShellUI is an injected
|
|
* system process, and the chattiest logs in the project ran on every boot.
|
|
*
|
|
* Follows the build type via NDEBUG; override with -DSHELL_DEBUG=1 to get the
|
|
* verbose blocks in a release build when chasing a report.
|
|
*/
|
|
#ifndef SHELL_DEBUG
|
|
#ifdef NDEBUG
|
|
#define SHELL_DEBUG 0
|
|
#else
|
|
#define SHELL_DEBUG 1
|
|
#endif
|
|
#endif
|
|
|
|
#define libSceKernelHandle 0x2001
|
|
#define KERNEL_DLSYM(handle, sym) \
|
|
(*(void**)&sym=(void*)kernel_dynlib_dlsym(-1, handle, #sym))
|
|
|
|
|
|
typedef void* ScePthread;
|