diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ca3cbc8..dc75911b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ project(VitaShell) include("${VITASDK}/share/vita.cmake" REQUIRED) set(VITA_APP_NAME "VitaShell") set(VITA_TITLEID "VITASHELL") -set(VITA_VERSION "01.60") +set(VITA_VERSION "01.61") # Flags and includes set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3 -Wno-unused-variable -Wno-unused-but-set-variable -fno-lto") diff --git a/README.md b/README.md index ab21e089..1f1964fc 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,18 @@ VitaShell is an alternative replacement of the PS Vita's LiveArea. It offers you a file manager, package installer, built-in FTP and much more. This homebrew was an entry of the Revitalize PS Vita homebrew competition and won the first prize. HENkaku's molecularShell is also based on VitaShell. +### Donation ### +In case you want to support my work on the vita, you can always spend me some beer. Any cent is highly appreciated: goo.gl/uAIPIY + ### How to use an USB flash drive as Memory Card on a PS TV ### - Format your USB flash drive as exFAT or FAT32. - Launch VitaShell and press /\ in the 'home' section. - Select 'Mount uma0:' and attach your USB flash drive. You can now copy stuff from/to your USB stick. -- Once 'uma0:' is listed under the partitions, press /\ again and choose 'Mount USB ux0:'. +- Once 'uma0:' is listed under the partitions, press /\ again and choose 'Mount USB ux0:'. This will copy important apps like VitaShell, molecularShell, and other files. - Your USB flash drive is now acting as a Memory Card. - To sync all your apps on your USB flash drive, press /\ and choose 'Refresh livearea'. This will NOT refresh PSP games. - If you wish to revert the patch, press /\ and select 'Umount USB ux0:'. +- Note that this patch is only temporary and you need to redo the procedure everytime you launch your PS TV. ### Customization ### You can customize those files: @@ -102,6 +106,11 @@ Be sure you pull request your customized design or language file there. * sakya for Lightmp3 * Everybody who contributed on vitasdk +### Changelog 1.61 ### +- Fixed database corruption crash by inheriting 'calendar', 'mms' and 'mtp' when mounting USB ux0:. +- Fixed bug where insufficent memory dialog appeared on uma0:. +- Fixed bug where pressing triangle crashed if unsafe mode was disabled. + ### Changelog 1.60 ### - Added ability to mount uma0: and ability to use uma0: as ux0:. - Added ability to mount game card as usb device. diff --git a/init.c b/init.c index 344c8dce..a95d1d3a 100644 --- a/init.c +++ b/init.c @@ -147,6 +147,8 @@ char henkaku_config_path[32]; int is_safe_mode = 0, is_molecular_shell = 0; +SceUID kernel_modid = -1, user_modid = -1; + // System params int language = 0, enter_button = 0, date_format = 0, time_format = 0; @@ -379,8 +381,8 @@ void initVitaShell() { installDefaultFiles(); // Load modules - taiLoadStartKernelModule("ux0:VitaShell/module/kernel.skprx", 0, NULL, 0); - sceKernelLoadStartModule("ux0:VitaShell/module/user.suprx", 0, NULL, 0, NULL, NULL); + kernel_modid = taiLoadStartKernelModule("ux0:VitaShell/module/kernel.skprx", 0, NULL, 0); + user_modid = sceKernelLoadStartModule("ux0:VitaShell/module/user.suprx", 0, NULL, 0, NULL, NULL); } void finishVitaShell() { diff --git a/init.h b/init.h index 68ba8c27..879042ce 100644 --- a/init.h +++ b/init.h @@ -28,6 +28,8 @@ extern char henkaku_config_path[32]; extern int is_safe_mode, is_molecular_shell; +extern SceUID kernel_modid, user_modid; + extern int language, enter_button, date_format, time_format; typedef struct { diff --git a/io_process.c b/io_process.c index bf5c9816..0ebf19b8 100644 --- a/io_process.c +++ b/io_process.c @@ -272,7 +272,7 @@ int copy_thread(SceSize args_size, CopyArguments *args) { } // Check memory card free space - if (checkMemoryCardFreeSpace(size)) + if (checkMemoryCardFreeSpace(args->file_list->path, size)) goto EXIT; // Update thread @@ -560,7 +560,7 @@ int export_thread(SceSize args_size, ExportArguments *args) { } // Check memory card free space - if (checkMemoryCardFreeSpace(size)) + if (checkMemoryCardFreeSpace("ux0:", size)) goto EXIT; // Update thread diff --git a/main.c b/main.c index 9be2c441..1587d12e 100644 --- a/main.c +++ b/main.c @@ -43,12 +43,6 @@ #include "archiveRAR.h" #include "usb.h" -/* - TODO: - - Theme manager - - PFS bypass -*/ - int _newlib_heap_size_user = 128 * 1024 * 1024; // Dialog step @@ -1625,7 +1619,10 @@ int main(int argc, const char *argv[]) { // Remount uma0: remount(0xF00); - // Copy back iconlayout.ini + // Copy back important files + copyPath("uma0:calendar", "ux0:calendar", NULL); + copyPath("uma0:mms", "ux0:mms", NULL); + copyPath("uma0:mtp", "ux0:mtp", NULL); copyPath("uma0:iconlayout.ini", "ux0:iconlayout.ini", NULL); infoDialog(language_container[USB_UX0_UMOUNTED]); diff --git a/main.h b/main.h index 1d58f64f..7e20ef42 100644 --- a/main.h +++ b/main.h @@ -79,7 +79,7 @@ // VitaShell version major.minor #define VITASHELL_VERSION_MAJOR 0x01 -#define VITASHELL_VERSION_MINOR 0x60 +#define VITASHELL_VERSION_MINOR 0x61 #define VITASHELL_VERSION ((VITASHELL_VERSION_MAJOR << 0x18) | (VITASHELL_VERSION_MINOR << 0x10)) diff --git a/main_context.c b/main_context.c index ebef3f44..ff3bd250 100644 --- a/main_context.c +++ b/main_context.c @@ -207,7 +207,7 @@ void setContextMenuHomeVisibilities() { menu_home_entries[MENU_HOME_ENTRY_MOUNT_USB_UX0].visibility = CTX_INVISIBLE; } - if (shellUserIsUx0Redirected() == 1) { + if ((kernel_modid >= 0 || kernel_modid == 0x8002D013) && user_modid >= 0 && shellUserIsUx0Redirected() == 1) { menu_home_entries[MENU_HOME_ENTRY_MOUNT_UMA0].visibility = CTX_INVISIBLE; menu_home_entries[MENU_HOME_ENTRY_MOUNT_USB_UX0].visibility = CTX_INVISIBLE; } else { diff --git a/makezip.c b/makezip.c index 8f0728c4..9f829a9e 100644 --- a/makezip.c +++ b/makezip.c @@ -282,7 +282,7 @@ int compress_thread(SceSize args_size, CompressArguments *args) { // Check memory card free space double guessed_size = (double)size * 0.7f; - if (checkMemoryCardFreeSpace((uint64_t)guessed_size)) + if (checkMemoryCardFreeSpace(args->path, (uint64_t)guessed_size)) goto EXIT; // Update thread diff --git a/package_installer.c b/package_installer.c index 28755b32..508dc206 100644 --- a/package_installer.c +++ b/package_installer.c @@ -348,7 +348,7 @@ int install_thread(SceSize args_size, InstallArguments *args) { getArchivePathInfo(src_path, &size, &folders, &files); // Check memory card free space - if (checkMemoryCardFreeSpace(size)) + if (checkMemoryCardFreeSpace(PACKAGE_DIR, size)) goto EXIT; // Update thread diff --git a/pkg/sce_sys/livearea/contents/template.xml b/pkg/sce_sys/livearea/contents/template.xml index 12cd1988..d4ca0f2e 100644 --- a/pkg/sce_sys/livearea/contents/template.xml +++ b/pkg/sce_sys/livearea/contents/template.xml @@ -28,7 +28,7 @@ - v1.60 + v1.61 diff --git a/resources/changeinfo.txt b/resources/changeinfo.txt index 063f7e87..279d5f11 100644 --- a/resources/changeinfo.txt +++ b/resources/changeinfo.txt @@ -247,4 +247,11 @@ - Made control smoother.
]]> + + +- Fixed bug where insufficent memory dialog appeared on uma0:.
+- Fixed bug where pressing triangle crashed if unsafe mode was disabled.
+ ]]> +
diff --git a/usb.c b/usb.c index 77c22394..49f12401 100644 --- a/usb.c +++ b/usb.c @@ -66,6 +66,9 @@ int mountUsbUx0() { sceIoMkdir("uma0:temp/app_work/MLCL00001/rec", 0006); // Copy important files + copyPath("ux0:calendar", "uma0:calendar", NULL); + copyPath("ux0:mms", "uma0:mms", NULL); + copyPath("ux0:mtp", "uma0:mtp", NULL); copyPath("ux0:temp/app_work/MLCL00001/rec/config.bin", "uma0:temp/app_work/MLCL00001/rec/config.bin", NULL); copyPath("ux0:iconlayout.ini", "uma0:iconlayout.ini", NULL); copyPath("ux0:id.dat", "uma0:id.dat", NULL); diff --git a/utils.c b/utils.c index ad2670cd..b93818b0 100644 --- a/utils.c +++ b/utils.c @@ -17,6 +17,7 @@ */ #include "main.h" +#include "init.h" #include "file.h" #include "message_dialog.h" #include "uncommon_dialog.h" @@ -86,15 +87,35 @@ void infoDialog(const char *msg, ...) { setDialogStep(DIALOG_STEP_INFO); } -int checkMemoryCardFreeSpace(uint64_t size) { - uint64_t free_size = 0, max_size = 0; - sceAppMgrGetDevInfo("ux0:", &max_size, &free_size); +int checkMemoryCardFreeSpace(const char *path, uint64_t size) { + char device[8]; + uint64_t free_size = 0, max_size = 0, extra_space = 0; + + char *p = strchr(path, ':'); + if (p) { + strncpy(device, path, p-path+1); + device[p-path+1] = '\0'; + } + + if (strcmp(device, "ux0:") == 0) { + extra_space = 40 * 1024 * 1024; + } + + if (is_safe_mode) { + sceAppMgrGetDevInfo(device, &max_size, &free_size); + } else { + SceIoDevInfo info; + memset(&info, 0, sizeof(SceIoDevInfo)); + sceIoDevctl(device, 0x3001, NULL, 0, &info, sizeof(SceIoDevInfo)); + free_size = info.free_size; + max_size = info.max_size; + } - if (size >= (free_size + (40 * 1024 * 1024))) { + if (size >= (free_size + extra_space)) { closeWaitDialog(); char size_string[16]; - getSizeString(size_string, size - (free_size + (40 * 1024 * 1024))); + getSizeString(size_string, size - (free_size + extra_space)); infoDialog(language_container[NO_SPACE_ERROR], size_string); return 1; diff --git a/utils.h b/utils.h index c18af8b8..42542bdc 100644 --- a/utils.h +++ b/utils.h @@ -57,7 +57,7 @@ void closeWaitDialog(); void errorDialog(int error); void infoDialog(const char *msg, ...); -int checkMemoryCardFreeSpace(uint64_t size); +int checkMemoryCardFreeSpace(const char *path, uint64_t size); void initPowerTickThread(); void powerLock();