mirror of
https://github.com/HamletDuFromage/aio-switch-updater.git
synced 2025-02-20 07:25:40 +00:00
(hopefully) increased copying reliability
This commit is contained in:
parent
f20f24cad1
commit
0f76f7a39d
8 changed files with 43 additions and 22 deletions
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
|
@ -11,6 +11,10 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
- name: Update libnx to 4.0.
|
||||||
|
run: |
|
||||||
|
pacman -S libnx>=4.0
|
||||||
|
|
||||||
- name: Building aio-switch-updater
|
- name: Building aio-switch-updater
|
||||||
run: |
|
run: |
|
||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
.vscode/settings.json
|
.vscode/
|
||||||
|
!.vscode/c_cpp_properties.json
|
||||||
build/
|
build/
|
||||||
screenshots/
|
screenshots/
|
||||||
switch/
|
switch/
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -45,7 +45,7 @@ DATA := data
|
||||||
INCLUDES := include lib/zipper/include
|
INCLUDES := include lib/zipper/include
|
||||||
APP_TITLE := All-in-One Switch Updater
|
APP_TITLE := All-in-One Switch Updater
|
||||||
APP_AUTHOR := HamletDuFromage
|
APP_AUTHOR := HamletDuFromage
|
||||||
APP_VERSION := 1.4.1
|
APP_VERSION := 1.4.2
|
||||||
TARGET := $(notdir $(CURDIR))-v$(APP_VERSION)
|
TARGET := $(notdir $(CURDIR))-v$(APP_VERSION)
|
||||||
|
|
||||||
ROMFS := resources
|
ROMFS := resources
|
||||||
|
|
|
@ -34,7 +34,7 @@ Downloads and extracts daily-updated cheat code. The program will only extract c
|
||||||
- Reboot to specific payload.
|
- Reboot to specific payload.
|
||||||
- Download payloads to `/bootloader/payloads`.
|
- Download payloads to `/bootloader/payloads`.
|
||||||
- Change software color scheme of Joy-Cons. Additional color profiles can be found in the releases and should be copied to `config/aio-switch-updater/jc_profiles.json`.
|
- Change software color scheme of Joy-Cons. Additional color profiles can be found in the releases and should be copied to `config/aio-switch-updater/jc_profiles.json`.
|
||||||
- Change software color scheme of Pro controllers (has to be paired as Player 1). Additional color profiles can be found in the releases and should be copied to `config/aio-switch-updater/pc_profiles.json`.
|
- Change software color scheme of Pro Controllers (has to be paired as Player 1). Additional color profiles can be found in the releases and should be copied to `config/aio-switch-updater/pc_profiles.json`.
|
||||||
- View which of your games got cheat codes from the app.
|
- View which of your games got cheat codes from the app.
|
||||||
- Launch the Switch's web browser.
|
- Launch the Switch's web browser.
|
||||||
- Edit internet settings (DNS, IP address, MTU, etc). Add you own configs to `config/aio-switch-updater/internet.json`. You can find a template in the root of the repo.
|
- Edit internet settings (DNS, IP address, MTU, etc). Add you own configs to `config/aio-switch-updater/internet.json`. You can find a template in the root of the repo.
|
||||||
|
|
|
@ -52,6 +52,8 @@
|
||||||
"v1_4_0_text": "\uE016 Added possibility to use pre-set network settings. Add your own in `config/aio-switch-updater/internet.json.\n\uE016 Added web browser.",
|
"v1_4_0_text": "\uE016 Added possibility to use pre-set network settings. Add your own in `config/aio-switch-updater/internet.json.\n\uE016 Added web browser.",
|
||||||
"v1_4_1": "v1.4.1",
|
"v1_4_1": "v1.4.1",
|
||||||
"v1_4_1_text": "\uE016 Fixed misleading display in internet settings page.",
|
"v1_4_1_text": "\uE016 Fixed misleading display in internet settings page.",
|
||||||
|
"v1_4_2": "v1.4.2",
|
||||||
|
"v1_4_2_text": "\uE016 (hopefully) fixed unreliable copy of payloads",
|
||||||
"Ok_button": "Ok",
|
"Ok_button": "Ok",
|
||||||
|
|
||||||
"cheats_page.cpp":"",
|
"cheats_page.cpp":"",
|
||||||
|
@ -105,7 +107,7 @@
|
||||||
|
|
||||||
"pro_con": "Pro-Con color swapper",
|
"pro_con": "Pro-Con color swapper",
|
||||||
"pc_you_can" : "You can change the internal color of your Pro Controller. Make sure it's set to Player 1.",
|
"pc_you_can" : "You can change the internal color of your Pro Controller. Make sure it's set to Player 1.",
|
||||||
"pc_color": "Pro controller color swapper",
|
"pc_color": "Pro Controller color swapper",
|
||||||
"pc_backing": "Backing up the color profile",
|
"pc_backing": "Backing up the color profile",
|
||||||
"pc_all_done": "All done! You may need to turn your controller on and off for the change to take effect",
|
"pc_all_done": "All done! You may need to turn your controller on and off for the change to take effect",
|
||||||
|
|
||||||
|
@ -156,7 +158,7 @@
|
||||||
"tools_tab.cpp":"",
|
"tools_tab.cpp":"",
|
||||||
"tool_cheats": "Cheats menu",
|
"tool_cheats": "Cheats menu",
|
||||||
"tool_change": "Change the Joy-Cons color",
|
"tool_change": "Change the Joy-Cons color",
|
||||||
"tool_change_procon": "Change the Pro controller color",
|
"tool_change_procon": "Change the Pro Controller color",
|
||||||
"tool_download": "Dowload payloads to ",
|
"tool_download": "Dowload payloads to ",
|
||||||
"tool_inject": "Inject payload",
|
"tool_inject": "Inject payload",
|
||||||
"tool_update": "Update the app (v",
|
"tool_update": "Update the app (v",
|
||||||
|
|
|
@ -64,6 +64,9 @@ ChangelogPage::ChangelogPage() : AppletFrame(true, true)
|
||||||
verTitles.push_back("menus/v1_4_1"_i18n );
|
verTitles.push_back("menus/v1_4_1"_i18n );
|
||||||
changes.push_back("menus/v1_4_1_text"_i18n );
|
changes.push_back("menus/v1_4_1_text"_i18n );
|
||||||
|
|
||||||
|
verTitles.push_back("menus/v1_4_2"_i18n );
|
||||||
|
changes.push_back("menus/v1_4_2_text"_i18n );
|
||||||
|
|
||||||
int nbVersions = verTitles.size();
|
int nbVersions = verTitles.size();
|
||||||
items.reserve(nbVersions);
|
items.reserve(nbVersions);
|
||||||
for(int i = nbVersions -1 ; i >= 0; i--){
|
for(int i = nbVersions -1 ; i >= 0; i--){
|
||||||
|
|
|
@ -25,28 +25,39 @@ PayloadPage::PayloadPage() : AppletFrame(true, true)
|
||||||
});
|
});
|
||||||
if(cfw == ams){
|
if(cfw == ams){
|
||||||
items[i]->registerAction("menus/payload_set"_i18n , brls::Key::X, [this, payload] {
|
items[i]->registerAction("menus/payload_set"_i18n , brls::Key::X, [this, payload] {
|
||||||
|
std::string res1;
|
||||||
if(R_SUCCEEDED(CopyFile(payload.c_str(), REBOOT_PAYLOAD_PATH))){
|
if(R_SUCCEEDED(CopyFile(payload.c_str(), REBOOT_PAYLOAD_PATH))){
|
||||||
brls::Dialog* dialog = new brls::Dialog("menus/payload_success"_i18n + payload + "menus/payload_to"_i18n + std::string(REBOOT_PAYLOAD_PATH) + "'.");
|
res1 += "menus/payload_success"_i18n + payload + "menus/payload_to"_i18n + std::string(REBOOT_PAYLOAD_PATH) + "'.";
|
||||||
brls::GenericEvent::Callback callback = [dialog](brls::View* view) {
|
|
||||||
dialog->close();
|
|
||||||
};
|
|
||||||
dialog->addButton("menus/payload_ok"_i18n , callback);
|
|
||||||
dialog->setCancelable(true);
|
|
||||||
dialog->open();
|
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
res1 += "Failed.";
|
||||||
|
}
|
||||||
|
brls::Dialog* dialog = new brls::Dialog(res1);
|
||||||
|
brls::GenericEvent::Callback callback = [dialog](brls::View* view) {
|
||||||
|
dialog->close();
|
||||||
|
};
|
||||||
|
dialog->addButton("menus/payload_ok"_i18n , callback);
|
||||||
|
dialog->setCancelable(true);
|
||||||
|
dialog->open();
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
items[i]->registerAction("menus/payload_set_up"_i18n , brls::Key::Y, [this, payload] {
|
items[i]->registerAction("menus/payload_set_up"_i18n , brls::Key::Y, [this, payload] {
|
||||||
|
std::string res2;
|
||||||
if(R_SUCCEEDED(CopyFile(payload.c_str(), UPDATE_BIN_PATH))){
|
if(R_SUCCEEDED(CopyFile(payload.c_str(), UPDATE_BIN_PATH))){
|
||||||
brls::Dialog* dialog = new brls::Dialog("menus/payload_success"_i18n + payload + "menus/payload_to"_i18n + std::string(UPDATE_BIN_PATH) + "'.");
|
res2 += "menus/payload_success"_i18n + payload + "menus/payload_to"_i18n + std::string(UPDATE_BIN_PATH) + "'.";
|
||||||
brls::GenericEvent::Callback callback = [dialog](brls::View* view) {
|
|
||||||
dialog->close();
|
|
||||||
};
|
|
||||||
dialog->addButton("menus/payload_ok"_i18n , callback);
|
|
||||||
dialog->setCancelable(true);
|
|
||||||
dialog->open();
|
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
res2 += "Failed.";
|
||||||
|
}
|
||||||
|
brls::Dialog* dialog = new brls::Dialog(res2);
|
||||||
|
brls::GenericEvent::Callback callback = [dialog](brls::View* view) {
|
||||||
|
dialog->close();
|
||||||
|
};
|
||||||
|
dialog->addButton("menus/payload_ok"_i18n , callback);
|
||||||
|
dialog->setCancelable(true);
|
||||||
|
dialog->open();
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
list->addView(items[i]);
|
list->addView(items[i]);
|
||||||
|
|
|
@ -300,8 +300,8 @@ Result CopyFile(const char src_path[FS_MAX_PATH], const char dest_path[FS_MAX_PA
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!std::filesystem::exists(dest_path))
|
std::filesystem::remove(dest_path);
|
||||||
fsFsCreateFile(fs, dest_path, size, 0);
|
fsFsCreateFile(fs, dest_path, size, 0);
|
||||||
|
|
||||||
ret = fsFsOpenFile(fs, dest_path, FsOpenMode_Write, &dest_handle);
|
ret = fsFsOpenFile(fs, dest_path, FsOpenMode_Write, &dest_handle);
|
||||||
if (R_FAILED(ret)){
|
if (R_FAILED(ret)){
|
||||||
|
|
Loading…
Add table
Reference in a new issue