Skip to content

Commit 1c98387

Browse files
committed
Remove release checker, fix settings screen scrolling
Release checker removed -- DNS MITM blocks all outbound DNS including to GitHub, and raw UDP bypass didn't work on Switch. Removed curl/jansson/mbedtls dependencies. Fixed settings screen not scrolling when items overflow the visible area. Added clip rect and auto-scroll to cursor.
1 parent f8e751a commit 1c98387

8 files changed

Lines changed: 51 additions & 610 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ jobs:
1818
- name: Checkout
1919
uses: actions/checkout@v4
2020

21-
- name: Install dependencies
22-
run: |
23-
dkp-pacman -Sy --noconfirm switch-curl switch-jansson switch-mbedtls switch-zlib
24-
2521
- name: Build
2622
run: make
2723

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ CFLAGS := -g -Wall -Wextra -Wno-unused-parameter -O2 -ffunction-sections \
2727
$(ARCH) $(DEFINES)
2828

2929
CFLAGS += $(INCLUDE) -D__SWITCH__ \
30-
$(shell $(DEVKITPRO)/portlibs/switch/bin/aarch64-none-elf-pkg-config --cflags SDL2_ttf libcurl jansson)
30+
$(shell $(DEVKITPRO)/portlibs/switch/bin/aarch64-none-elf-pkg-config --cflags SDL2_ttf)
3131

3232
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
3333
ASFLAGS := -g $(ARCH)
3434
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
3535

36-
LIBS := $(shell $(DEVKITPRO)/portlibs/switch/bin/aarch64-none-elf-pkg-config --libs SDL2_ttf) \
37-
-lcurl -ljansson -lmbedtls -lmbedx509 -lmbedcrypto -lz -lnx
36+
LIBS := $(shell $(DEVKITPRO)/portlibs/switch/bin/aarch64-none-elf-pkg-config --libs SDL2_ttf) -lnx
3837

3938
#---------------------------------------------------------------------------------
4039
LIBDIRS := $(PORTLIBS) $(LIBNX)

README.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,6 @@
5252
- Preserves existing comments and manual edits in your INI file
5353
- Safe for sysnand online play -- all overrides are local only
5454

55-
### Atmosphere Release Checker
56-
- Fetches the latest Atmosphere release from GitHub in a background thread
57-
- Shows your current firmware and Atmosphere versions side by side
58-
- Compares against the latest release and tells you if an update is available
59-
- Extracts supported firmware version from release notes
60-
- Scrollable release notes viewer
61-
6255
## Controls
6356

6457
| Button | Action |
@@ -73,9 +66,7 @@
7366
| - | Seed default Nintendo entries |
7467
| + | Quit (with unsaved changes check) |
7568

76-
**Settings Screen:** A Toggle | Y Save | X Release Checker | B Back
77-
78-
**Release Checker:** A Refresh | B Back | Up/Down scroll notes
69+
**Settings Screen:** A Toggle | Y Save | B Back
7970

8071
## Installation
8172

@@ -88,7 +79,7 @@
8879
Requires [devkitPro](https://devkitpro.org/) with the following packages:
8980

9081
```bash
91-
(dkp-)pacman -S switch-dev switch-sdl2 switch-sdl2_ttf switch-freetype switch-curl switch-jansson switch-mbedtls switch-zlib
82+
(dkp-)pacman -S switch-dev switch-sdl2 switch-sdl2_ttf switch-freetype
9283
make
9384
```
9485

@@ -98,14 +89,12 @@ make
9889

9990
**System Settings:** Reads and modifies `/atmosphere/config/system_settings.ini`. Atmosphere parses this file at boot and overrides the corresponding system settings via its set:sys mitm service. Changes here require a reboot to take effect.
10091

101-
**Release Checker:** Hits the GitHub API (`/repos/Atmosphere-NX/Atmosphere/releases/latest`) on a background thread and parses the JSON response with jansson. Reads local Atmosphere version via `splGetConfig` with config item 65000.
102-
10392
## Credits
10493

10594
- DNS reload mechanism via [DNS-MITM_Manager](https://github.com/znxDomain/DNS-MITM_Manager) by znxDomain
10695
- Server list from [NintendoClients Wiki](https://github.com/kinnay/NintendoClients/wiki/Server-List)
10796
- Settings verified against [Atmosphere](https://github.com/Atmosphere-NX/Atmosphere) source (`settings_sd_kvs.cpp`)
108-
- Built with [libnx](https://github.com/switchbrew/libnx), [SDL2](https://www.libsdl.org/), [libcurl](https://curl.se/libcurl/), and [jansson](https://github.com/akheron/jansson)
97+
- Built with [libnx](https://github.com/switchbrew/libnx) and [SDL2](https://www.libsdl.org/)
10998

11099
## License
111100

include/release_checker.h

Lines changed: 0 additions & 50 deletions
This file was deleted.

include/ui.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "profiles.h"
1010
#include "net_test.h"
1111
#include "sys_settings.h"
12-
#include "release_checker.h"
1312

1413
typedef enum {
1514
SCREEN_MAIN_LIST = 0,
@@ -18,7 +17,6 @@ typedef enum {
1817
SCREEN_STATUS,
1918
SCREEN_NET_TEST,
2019
SCREEN_SYS_SETTINGS,
21-
SCREEN_RELEASE_CHECK,
2220
} AppScreen;
2321

2422
typedef struct {
@@ -44,10 +42,8 @@ typedef struct {
4442
int net_test_scroll;
4543

4644
int sys_settings_cursor;
45+
int sys_settings_scroll;
4746
SysSettingsFile *sys_settings_file;
48-
49-
ReleaseInfo release_info;
50-
int release_scroll;
5147
} UIState;
5248

5349
bool uiInit(UIState *ui);

source/main.c

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
#include <string.h>
44
#include <switch.h>
55

6-
#include <curl/curl.h>
7-
86
#include "config.h"
97
#include "hosts_parser.h"
108
#include "dns_reload.h"
@@ -13,7 +11,6 @@
1311
#include "ui.h"
1412
#include "net_test.h"
1513
#include "sys_settings.h"
16-
#include "release_checker.h"
1714

1815
static HostsFile s_hosts;
1916
static UIState s_ui;
@@ -133,6 +130,7 @@ static void handleMainList(InputState *input) {
133130

134131
case INPUT_R:
135132
s_ui.sys_settings_cursor = 0;
133+
s_ui.sys_settings_scroll = 0;
136134
s_ui.current_screen = SCREEN_SYS_SETTINGS;
137135
break;
138136

@@ -286,13 +284,6 @@ static void handleSysSettings(InputState *input) {
286284
}
287285
break;
288286

289-
case INPUT_X:
290-
releaseReadLocal(&s_ui.release_info);
291-
s_ui.release_scroll = 0;
292-
s_ui.current_screen = SCREEN_RELEASE_CHECK;
293-
releaseFetchAsync(&s_ui.release_info);
294-
break;
295-
296287
case INPUT_B:
297288
s_ui.current_screen = SCREEN_MAIN_LIST;
298289
break;
@@ -303,38 +294,6 @@ static void handleSysSettings(InputState *input) {
303294
}
304295
}
305296

306-
static void handleReleaseCheck(InputState *input) {
307-
releaseFetchDone(&s_ui.release_info);
308-
309-
for (int i = 0; i < input->count; i++) {
310-
switch (input->events[i]) {
311-
case INPUT_A:
312-
if (!s_ui.release_info.thread_running) {
313-
releaseReadLocal(&s_ui.release_info);
314-
releaseFetchAsync(&s_ui.release_info);
315-
s_ui.release_scroll = 0;
316-
}
317-
break;
318-
319-
case INPUT_B:
320-
s_ui.current_screen = SCREEN_SYS_SETTINGS;
321-
break;
322-
323-
case INPUT_UP:
324-
if (s_ui.release_scroll > 0)
325-
s_ui.release_scroll--;
326-
break;
327-
328-
case INPUT_DOWN:
329-
s_ui.release_scroll++;
330-
break;
331-
332-
default:
333-
break;
334-
}
335-
}
336-
}
337-
338297
static bool shouldQuit(InputState *input) {
339298
for (int i = 0; i < input->count; i++) {
340299
if (input->events[i] == INPUT_PLUS && s_ui.current_screen == SCREEN_MAIN_LIST && !s_hosts.dirty)
@@ -356,23 +315,20 @@ int main(int argc, char *argv[]) {
356315
romfsInit();
357316
plInitialize(PlServiceType_User);
358317
socketInitializeDefault();
359-
curl_global_init(CURL_GLOBAL_DEFAULT);
360318

361319
hostsLoad(&s_hosts);
362320

363321
sysSettingsLoad(&s_sys_settings);
364322
sysSettingsReadStates(&s_sys_settings);
365323

366324
if (!uiInit(&s_ui)) {
367-
curl_global_cleanup();
368325
plExit();
369326
romfsExit();
370327
socketExit();
371328
return 1;
372329
}
373330

374331
s_ui.sys_settings_file = &s_sys_settings;
375-
releaseInit(&s_ui.release_info);
376332

377333
inputInit();
378334

@@ -402,9 +358,6 @@ int main(int argc, char *argv[]) {
402358
case SCREEN_SYS_SETTINGS:
403359
handleSysSettings(&input);
404360
break;
405-
case SCREEN_RELEASE_CHECK:
406-
handleReleaseCheck(&input);
407-
break;
408361
}
409362

410363
if (shouldQuit(&input))
@@ -413,7 +366,6 @@ int main(int argc, char *argv[]) {
413366
uiRender(&s_ui, &s_hosts);
414367
}
415368
uiDestroy(&s_ui);
416-
curl_global_cleanup();
417369
socketExit();
418370
plExit();
419371
romfsExit();

0 commit comments

Comments
 (0)