This repository has been archived by the owner on Nov 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathfirst_boot.c
50 lines (40 loc) · 1.57 KB
/
first_boot.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
VitaShell
Copyright (C) 2015-2017, TheFloW
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 of the License, 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. If not, see <http://www.gnu.org/licenses/>.
*/
#include "main.h"
#include "file.h"
#include "message_dialog.h"
#include "language.h"
#include "utils.h"
void check_first_boot(void) {
if (!is_molecular_shell) {
return;
}
// HENkaku first boot path (ux0:temp/app_work/MLCL00001/rec/first_boot.bin)
char mount_point[16];
memset(mount_point, 0, sizeof(mount_point));
sceAppMgrWorkDirMountById(207, vitashell_titleid, mount_point);
char henkaku_first_boot_path[32];
sprintf(henkaku_first_boot_path, "%s/first_boot.bin", mount_point);
uint32_t not_first_boot = 0;
ReadFile(henkaku_first_boot_path, ¬_first_boot, sizeof(not_first_boot));
if (is_safe_mode && !not_first_boot && dialog_step == DIALOG_STEP_NONE) {
infoDialog(language_container[HENKAKU_FIRST_BOOT_MESSAGE]);
not_first_boot = 1;
} else if (!is_safe_mode) {
not_first_boot = 1;
}
WriteFile(henkaku_first_boot_path, ¬_first_boot, sizeof(not_first_boot));
sceAppMgrUmount(mount_point);
}