Skip to content

Commit

Permalink
Added taihen config reload
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOfficialFloW committed Nov 28, 2016
1 parent 7f687d1 commit 051497c
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 17 deletions.
14 changes: 6 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ RESOURCES_BIN := $(foreach dir,$(RESOURCES), $(wildcard $(dir)/*.bin))
OBJS += $(RESOURCES_PNG:.png=.o) $(RESOURCES_TXT:.txt=.o) $(RESOURCES_BIN:.bin=.o)

LIBS = -lvorbisfile -lvorbis -logg -lftpvita -lvita2d -lpng -ljpeg -lz -lm -lc -lonig \
-lSceAppMgr_stub -lSceAppUtil_stub -lSceCommonDialog_stub \
-lSceCtrl_stub -lSceDisplay_stub -lSceGxm_stub -lSceIme_stub \
-lSceHttp_stub -lSceMusicExport_stub -lSceNet_stub -lSceNetCtl_stub \
-lSceSsl_stub -lSceSysmodule_stub -lScePhotoExport_stub -lScePower_stub \
-lScePgf_stub libpromoter/libScePromoterUtil_stub.a \
-lSceAudio_stub -lSceAudiodec_stub -lSceTouch_stub -lSceShellSvc_stub \
-lHENkaku_stub
-lSceAppMgr_stub -lSceAppUtil_stub -lSceAudio_stub -lSceAudiodec_stub \
-lSceCommonDialog_stub -lSceCtrl_stub -lSceDisplay_stub -lSceGxm_stub -lSceIme_stub \
-lSceHttp_stub -lSceMusicExport_stub -lSceNet_stub -lSceNetCtl_stub -lSceShellSvc_stub \
-lSceSsl_stub -lSceSysmodule_stub -lScePhotoExport_stub -lScePower_stub -lScePgf_stub \
-lSceTouch_stub -ltaihen_stub libHENkaku_stub.a libpromoter/libScePromoterUtil_stub.a

PREFIX = arm-vita-eabi
CC = $(PREFIX)-gcc
Expand All @@ -47,7 +45,7 @@ eboot.bin: $(TARGET).velf
vita-make-fself $< $@

%.velf: %.elf
vita-elf-create $< $@ libpromoter/promoterutil.json
vita-elf-create $< $@

$(TARGET).elf: $(OBJS)
$(CC) $(CFLAGS) $^ $(LIBS) -o $@
Expand Down
3 changes: 3 additions & 0 deletions language.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ void loadLanguage(int id) {
LANGUAGE_ENTRY(HENKAKU_ENABLE_VERSION_SPOOFING),
LANGUAGE_ENTRY(HENKAKU_SPOOFED_VERSION),
LANGUAGE_ENTRY(HENKAKU_RESTORE_DEFAULT_SETTINGS),
LANGUAGE_ENTRY(HENKAKU_RELOAD_CONFIG),
LANGUAGE_ENTRY(HENKAKU_RESTORE_DEFAULT_MESSAGE),
LANGUAGE_ENTRY(HENKAKU_RELOAD_CONFIG_MESSAGE),
LANGUAGE_ENTRY(HENKAKU_UNSAFE_HOMEBREW_MESSAGE),

// VitaShell settings
Expand Down
3 changes: 3 additions & 0 deletions language.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ enum LanguageContainer {
HENKAKU_ENABLE_VERSION_SPOOFING,
HENKAKU_SPOOFED_VERSION,
HENKAKU_RESTORE_DEFAULT_SETTINGS,
HENKAKU_RELOAD_CONFIG,
HENKAKU_RESTORE_DEFAULT_MESSAGE,
HENKAKU_RELOAD_CONFIG_MESSAGE,
HENKAKU_UNSAFE_HOMEBREW_MESSAGE,

// VitaShell settings
Expand Down
41 changes: 32 additions & 9 deletions libpromoter/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
TARGET_LIB=libScePromoterUtil_stub.a
ARCH ?= arm-vita-eabi
AS = $(ARCH)-as
AR = $(ARCH)-ar
RANLIB = $(ARCH)-ranlib

$(TARGET_LIB): promoterutil.json
-rm -rf build_lib
mkdir build_lib
vita-libs-gen $< build_lib
cd build_lib && make
mv build_lib/$(TARGET_LIB) $(TARGET_LIB)
rm -rf build_lib
TARGETS = libScePromoterUtil_stub.a

ScePromoterUtil_OBJS = ScePromoterUtil_ScePromoterUtil_scePromoterUtilityInit.o ScePromoterUtil_ScePromoterUtil_scePromoterUtilityExit.o ScePromoterUtil_ScePromoterUtil_scePromoterUtilityDeletePkg.o ScePromoterUtil_ScePromoterUtil_scePromoterUtilityUpdateLiveArea.o ScePromoterUtil_ScePromoterUtil_scePromoterUtilityPromotePkg.o ScePromoterUtil_ScePromoterUtil_scePromoterUtilityPromotePkgWithRif.o ScePromoterUtil_ScePromoterUtil_scePromoterUtilityGetState.o ScePromoterUtil_ScePromoterUtil_scePromoterUtilityGetResult.o
SceKernel_OBJS =
ALL_OBJS=

all: $(TARGETS)

define LIBRARY_template
$(1): $$($(1:lib%_stub.a=%)_OBJS)
ALL_OBJS += $$($(1:lib%_stub.a=%)_OBJS)
endef

$(foreach library,$(TARGETS),$(eval $(call LIBRARY_template,$(library))))

all: $(TARGETS)

install: $(TARGETS)
cp $(TARGETS) $(VITASDK)/arm-vita-eabi/lib

clean:
rm $(TARGET_LIB)

rm -f $(TARGETS) $(ALL_OBJS)

$(TARGETS):
$(AR) cru $@ $?
$(RANLIB) $@

%.o: %.S
$(AS) $< -o $@
Binary file modified libpromoter/libScePromoterUtil_stub.a
Binary file not shown.
3 changes: 3 additions & 0 deletions resources/english_us.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ HENKAKU_ENABLE_UNSAFE_HOMEBREW = "Enable unsafe homebrew"
HENKAKU_ENABLE_VERSION_SPOOFING = "Enable version spoofing"
HENKAKU_SPOOFED_VERSION = "Spoofed version"
HENKAKU_RESTORE_DEFAULT_SETTINGS = "Restore default settings"
HENKAKU_RELOAD_CONFIG = "Reload taiHEN config.txt"
HENKAKU_RESTORE_DEFAULT_MESSAGE = "Default settings has been successfully restored."
HENKAKU_RELOAD_CONFIG_MESSAGE = "taiHEN config.txt has been successfully reloaded."
HENKAKU_UNSAFE_HOMEBREW_MESSAGE = "Unsafe homebrews can damage your device\permanently, if they are misused, misconfigured,\or malicious.\\Please take caution when installing them."

# VitaShell settings
Expand Down
10 changes: 10 additions & 0 deletions settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
- Display battery percentage
*/

void taihenReloadConfig();
void henkakuRestoreDefaultSettings();
void rebootDevice();
void shutdownDevice();
Expand All @@ -72,6 +73,7 @@ SettingsMenuOption henkaku_settings[] = {
{ HENKAKU_ENABLE_VERSION_SPOOFING, SETTINGS_OPTION_TYPE_BOOLEAN, NULL, NULL, 0, &henkaku_config.use_spoofed_version },
{ HENKAKU_SPOOFED_VERSION, SETTINGS_OPTION_TYPE_STRING, NULL, spoofed_version, sizeof(spoofed_version) - 1, NULL },
{ HENKAKU_RESTORE_DEFAULT_SETTINGS, SETTINGS_OPTION_TYPE_CALLBACK, (void *)henkakuRestoreDefaultSettings, NULL, 0, NULL },
{ HENKAKU_RELOAD_CONFIG, SETTINGS_OPTION_TYPE_CALLBACK, (void *)taihenReloadConfig, NULL, 0, NULL },
};

SettingsMenuOption main_settings[] = {
Expand Down Expand Up @@ -135,6 +137,14 @@ void henkakuRestoreDefaultSettings() {
henkaku_config.use_psn_spoofing = 1;
henkaku_config.use_spoofed_version = 1;
strcpy(spoofed_version, HENKAKU_DEFAULT_VERSION_STRING);
changed = 1;

infoDialog(language_container[HENKAKU_RESTORE_DEFAULT_MESSAGE]);
}

void taihenReloadConfig() {
taiReloadConfig();
infoDialog(language_container[HENKAKU_RELOAD_CONFIG_MESSAGE]);
}

void initSettingsMenu() {
Expand Down

0 comments on commit 051497c

Please sign in to comment.