forked from Mirror/SafeB9SInstaller
parent
2d6def3c08
commit
07207a2fb6
6
Makefile
6
Makefile
@ -25,11 +25,11 @@ INCLUDES := source source/common source/font source/fs source/crypto source/fatf
|
||||
#---------------------------------------------------------------------------------
|
||||
# options for code generation
|
||||
#---------------------------------------------------------------------------------
|
||||
ARCH := -mthumb -mthumb-interwork -flto
|
||||
ARCH := -mthumb -mthumb-interwork
|
||||
|
||||
CFLAGS := -g -Wall -Wextra -Wpedantic -Wcast-align -Wno-main -O2\
|
||||
-march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -std=gnu11\
|
||||
$(ARCH)
|
||||
-fno-builtin-memcpy $(ARCH) -fdata-sections -ffunction-sections
|
||||
|
||||
CFLAGS += $(INCLUDE) -DARM9
|
||||
|
||||
@ -53,7 +53,7 @@ endif
|
||||
|
||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
||||
|
||||
ASFLAGS := -g $(ARCH)
|
||||
ASFLAGS := -g -mcpu=arm946e-s $(ARCH)
|
||||
LDFLAGS = -T../link.ld -nostartfiles -g $(ARCH) -Wl,-Map,$(TARGET).map
|
||||
|
||||
LIBS :=
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "validator.h"
|
||||
#include "unittype.h"
|
||||
#include "nand.h"
|
||||
#include "sdmmc.h"
|
||||
#include "ui.h"
|
||||
#include "qff.h"
|
||||
#include "hid.h"
|
||||
@ -17,6 +18,8 @@
|
||||
#define NAME_FIRMBACKUP INPUT_PATH "/firm%lu_enc.bak"
|
||||
#define NAME_SECTORBACKUP INPUT_PATH "/sector0x96_enc.bak"
|
||||
|
||||
#define MAX_STAGE2_SIZE 0x89A00
|
||||
|
||||
#define STATUS_GREY -1
|
||||
#define STATUS_GREEN 0
|
||||
#define STATUS_YELLOW 1
|
||||
@ -279,6 +282,11 @@ u32 SafeB9SInstaller(void) {
|
||||
ShowInstallerStatus();
|
||||
}
|
||||
if (ret != 0) break;
|
||||
uint8_t emptyStage2[MAX_STAGE2_SIZE]={0};
|
||||
// Uninstall a9lh stage 2 always if firm flashed ok
|
||||
// This prevents false positives in the event of cfw uninstall
|
||||
ret = sdmmc_nand_writesectors(0x5C000, MAX_STAGE2_SIZE / 0x200, emptyStage2);
|
||||
if (ret != 0) break;
|
||||
if ((IS_A9LH && !IS_SIGHAX)) {
|
||||
snprintf(msgInstall, 64, "0x96 revert...");
|
||||
ShowInstallerStatus();
|
||||
|
Loading…
x
Reference in New Issue
Block a user