From 051497c94e7ba71f89f43c99dd7185946f6d69f1 Mon Sep 17 00:00:00 2001 From: TheFloW Date: Mon, 28 Nov 2016 21:35:38 +0100 Subject: [PATCH] Added taihen config reload --- Makefile | 14 ++++----- language.c | 3 ++ language.h | 3 ++ libpromoter/Makefile | 41 ++++++++++++++++++++------ libpromoter/libScePromoterUtil_stub.a | Bin 7202 -> 7312 bytes resources/english_us.txt | 3 ++ settings.c | 10 +++++++ 7 files changed, 57 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index e3ff72dd..b26b1b90 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 $@ diff --git a/language.c b/language.c index b10eb807..e66cc9a4 100644 --- a/language.c +++ b/language.c @@ -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 diff --git a/language.h b/language.h index a71fd726..f01ac067 100644 --- a/language.h +++ b/language.h @@ -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 diff --git a/libpromoter/Makefile b/libpromoter/Makefile index d26d0f09..fa0a00f3 100644 --- a/libpromoter/Makefile +++ b/libpromoter/Makefile @@ -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 $@ diff --git a/libpromoter/libScePromoterUtil_stub.a b/libpromoter/libScePromoterUtil_stub.a index 426fe02cf539532c62006179d825c892b0510ad3..283de5aadd22a04833085e9f39128919be05bcb6 100644 GIT binary patch literal 7312 zcmeI1&1(}u6u@6hzY;uDMMYccRs#*Fn{2vGB1kb{D}@$9OYvf{n|5lJrcKOFN(zb! z#k1f);K_?e#gk`2k6yfZ^Xj39M-RTq?qoNcT{cMzjmti|nU8&McA58n^Jcb_x0UKf zaW!!0f>A8IQ;`)bO7L79NWj4J`TlvC`_%61HFA#eBlvhk1*Q8NrLc8&=^jUK6Zh2p^Bd zmR0XE-dN*GSaQ9@3|}Mlh(8H7-p1Cx_=b%}eht`Q@%7)cAxS(DG~n=LL*|LbJ8wME z0rbopiQ4>A->}i#-auaf666kmYYsWVo;$9%=x{~`h=6~9dI(`%1JiW9Vf?s zCizBxz4Hwx{6k}(WRhU71#q@erzay6pBcTq`F{1P4+t;w7B3_3N4hD;ze<@-Kh=TcI#%gvDX5Po4{U^dflm>Y)_>0N*5;WYcC{8**?U1G8`5d-G=A%)DP-COdUYZ?CS; zNUH2FxuTXWi(7GJX2VuCIP?*K=K8^&})G7TY%9I0A~*X#(n^d9|2rE zW3H0Lc5AamNqdDFO@r>uZ5b3!itiD+Om#{ERMp);i@T&rC|TTi9AM(i8LV8{Zs0`o z#tx~piT+pX`vzTKGS&k6pubDR>@+EWdVCX|9qL6&*_)24CN2B-=h1QgP+T_8F$&a73qg;8s`UVc=pOp!e>qM^` zkT{RcL9GHq(r{%YksbiW+}osj9Vu-*`=T$o^(*^rU}Z9LG`AwwV|w;v{Oex zWobdtDQz3|4kf0~i9QT-iLHryZm-2N;_IDq`XwDzuYOlij}I*9*YCPB9-sFP^5?Mf z!rQk|fMacQ`64zZIfIn@$M%!Y$<$4(3#{Q3-jC4%E<~C^<`q)rGpi}AZ0^M| zmiSZA4)XqJKuB1nCPjsYZ}ivu7!CHZ@hB1z4VSwjkFTRkbfWoRp@FAqP;+@-hUkxo z=<~z7%)>7+BE(08(D}i-0H`_5mmvD1L5n;;sGZrTF&e~2! Kh5H8uNPhqwd{K`8 diff --git a/resources/english_us.txt b/resources/english_us.txt index 42fc7712..286cb241 100644 --- a/resources/english_us.txt +++ b/resources/english_us.txt @@ -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 diff --git a/settings.c b/settings.c index 35638ac2..c0041abe 100644 --- a/settings.c +++ b/settings.c @@ -48,6 +48,7 @@ - Display battery percentage */ +void taihenReloadConfig(); void henkakuRestoreDefaultSettings(); void rebootDevice(); void shutdownDevice(); @@ -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[] = { @@ -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() {