| 111 | } |
| 112 | |
| 113 | Result EditUserIcon(const u8 *jpg, const size_t size) { |
| 114 | AccountProfile prof; |
| 115 | auto rc = accountGetProfile(&prof, g_SelectedUser); |
| 116 | if(R_SUCCEEDED(rc)) { |
| 117 | AccountProfileBase prof_base = {}; |
| 118 | AccountUserData user_data = {}; |
| 119 | rc = accountProfileGet(&prof, &user_data, &prof_base); |
| 120 | if(R_SUCCEEDED(rc)) { |
| 121 | AccountExtProfileEditor editor; |
| 122 | rc = accountextGetProfileEditor(g_SelectedUser, &editor); |
| 123 | if(R_SUCCEEDED(rc)) { |
| 124 | rc = accountextProfileEditorStoreWithImage(&editor, &prof_base, &user_data, jpg, size); |
| 125 | if(R_SUCCEEDED(rc)) { |
| 126 | const auto icon_path = GetExportedUserIcon(); |
| 127 | auto sd_exp = fs::GetSdCardExplorer(); |
| 128 | sd_exp->DeleteFile(icon_path); |
| 129 | sd_exp->WriteFile(icon_path, jpg, size); |
| 130 | } |
| 131 | accountextProfileEditorClose(&editor); |
| 132 | } |
| 133 | } |
| 134 | accountProfileClose(&prof); |
| 135 | } |
| 136 | return rc; |
| 137 | } |
| 138 | |
| 139 | void ExportSelectedUserIcon() { |
| 140 | AccountProfile prof; |
no test coverage detected