Skip to content

Commit

Permalink
Search string specifically in MiiImageUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightkingale committed Jan 23, 2025
1 parent b5eda1c commit 68d8b79
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions source/backup.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <filesystem>
#include <sstream>
#include <string>

#include <coreinit/thread.h>

Expand Down Expand Up @@ -105,14 +107,23 @@ backup_account()
}

bool network_account_found = false;
if (content.find("nintendo") != std::string::npos) {
// Nintendo Network ID is linked to the account.
backup_path = NNID_BACKUP;
network_account_found = true;
} else if (content.find("pretendo") != std::string::npos) {
// Pretendo Network ID is linked to the account.
backup_path = PNID_BACKUP;
network_account_found = true;
std::istringstream file_contentstream(content);
std::string line;

while (std::getline(file_contentstream, line)) {
if (line.find("MiiImageUrl") != std::string::npos) {
if (line.find("nintendo") != std::string::npos) {
// Nintendo Network ID is linked to the account.
backup_path = NNID_BACKUP;
network_account_found = true;
break;
} else if (line.find("pretendo") != std::string::npos) {
// Pretendo Network ID is linked to the account.
backup_path = PNID_BACKUP;
network_account_found = true;
break;
}
}
}

if (!network_account_found) {
Expand Down

0 comments on commit 68d8b79

Please sign in to comment.