diff --git a/CMakeLists.txt b/CMakeLists.txt index b6a45d81..2ca3cbc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,18 @@ FUNCTION(ADD_RESOURCES out_var) SET(${out_var} "${result}" PARENT_SCOPE) ENDFUNCTION() -file(GLOB res_files RELATIVE ${CMAKE_SOURCE_DIR} resources/*.png resources/*.txt resources/*.bin resources/*.suprx resources/*.skprx) +file(GLOB res_files RELATIVE + ${CMAKE_SOURCE_DIR} + resources/default/*.png + resources/default/*.txt + resources/electron/*.png + resources/electron/*.txt + resources/*.png + resources/*.txt + resources/*.bin + resources/*.suprx + resources/*.skprx +) add_resources(vitashell_res ${res_files}) add_executable(VitaShell diff --git a/README.md b/README.md index 10975b03..ab21e089 100644 --- a/README.md +++ b/README.md @@ -3,36 +3,45 @@ 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. +### 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:'. +- 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:'. + ### Customization ### You can customize those files: - **colors.txt**: All colors adjustable +- **archive_icon.png**: Archive icon +- **audio_icon.png**: Audio icon +- **battery.png**: Battery border icon +- **battery_bar_charge.png**: Charging battery bar +- **battery_bar_green.png**: Green battery bar +- **battery_bar_red.png**: Red battery bar +- **bg_audioplayer.png**: Background for audio player - **bg_browser.png**: Background for file browser - **bg_hexeditor.png**: Background for hex editor -- **bg_texteditor.png**: Background for text editor - **bg_photoviewer.png**: Background for photo viewer -- **bg_audioplayer.png**: Background for audio player -- **settings.png**: Background for settings -- **wallpaper.png**: Wallpaper -- **dialog.png**: Dialog menu image (Can be any size. This image file will be stretched by VitaShell to fit the dialog box. Suggestion: Don't use motives, as it will not look good with wrong proportion). +- **bg_texteditor.png**: Background for text editor - **context.png**: Context menu image (Can be any size. Suggestion: It will look great if you add alpha channel to your image). - **context_more.png**: Context menu more image (Can be any size. Suggestion: It will look great if you add alpha channel to your image). -- **battery.png**: Battery border icon -- **battery_bar_green.png**: Green battery bar -- **battery_bar_red.png**: Red battery bar -- **battery_bar_charge.png**: Charging battery bar -- **ftp.png**: Ftp icon -- **audio_icon.png**: Audio icon -- **archive_icon.png**: Archive icon +- **cover.png**: Default album cover +- **dialog.png**: Dialog menu image (Can be any size. This image file will be stretched by VitaShell to fit the dialog box. Suggestion: Don't use motives, as it will not look good with wrong proportion). +- **fastforward.png**: Fastforward icon +- **fastrewind.png**: Fastrewind icon - **file_icon.png**: File icon - **folder_icon.png**: Folder icon +- **ftp.png**: Ftp icon - **image_icon.png**: Image icon +- **pause.png**: Pause icon +- **play.png**: Play icon +- **settings.png**: Background for settings - **sfo_icon.png**: SFO icon - **text_icon.png**: Text icon -- **cover.png**: Default album cover -- **play.png**: Play icon -- **pause.png**: Pause icon -- **fastforward.png**: Fastforward icon -- **fastrewind.png**: Fastrewind icon +- **wallpaper.png**: Wallpaper **Theme setting:** VitaShell will load the theme that is set in **'ux0:VitaShell/theme/theme.txt'** (THEME_NAME = "YOUR_THEME_NAME") @@ -99,6 +108,8 @@ Be sure you pull request your customized design or language file there. - Added possibility to refresh the livearea. - Added scrolling text for long filenames. - Added 'Sort by' option to context menu (R trigger combo removed). +- Added 'Electron' theme by Acemad, the winner of the VitaShell theme contest. +- Added theme selector. - Improved property dialog animation. - Fixed text editor bugs. - Fixed bug where USB cable wasn't recognized. diff --git a/init.c b/init.c index 50797981..344c8dce 100644 --- a/init.c +++ b/init.c @@ -24,33 +24,60 @@ #include "audio/vita_audio.h" -INCLUDE_EXTERN_RESOURCE(folder_icon_png); -INCLUDE_EXTERN_RESOURCE(file_icon_png); -INCLUDE_EXTERN_RESOURCE(archive_icon_png); -INCLUDE_EXTERN_RESOURCE(image_icon_png); -INCLUDE_EXTERN_RESOURCE(audio_icon_png); -INCLUDE_EXTERN_RESOURCE(sfo_icon_png); -INCLUDE_EXTERN_RESOURCE(text_icon_png); -INCLUDE_EXTERN_RESOURCE(ftp_png); -INCLUDE_EXTERN_RESOURCE(battery_png); -INCLUDE_EXTERN_RESOURCE(battery_bar_red_png); -INCLUDE_EXTERN_RESOURCE(battery_bar_green_png); -INCLUDE_EXTERN_RESOURCE(battery_bar_charge_png); - -INCLUDE_EXTERN_RESOURCE(cover_png); -INCLUDE_EXTERN_RESOURCE(play_png); -INCLUDE_EXTERN_RESOURCE(pause_png); -INCLUDE_EXTERN_RESOURCE(fastforward_png); -INCLUDE_EXTERN_RESOURCE(fastrewind_png); +INCLUDE_EXTERN_RESOURCE(english_us_txt); INCLUDE_EXTERN_RESOURCE(theme_txt); -INCLUDE_EXTERN_RESOURCE(colors_txt); -INCLUDE_EXTERN_RESOURCE(english_us_txt); + +INCLUDE_EXTERN_RESOURCE(default_colors_txt); +INCLUDE_EXTERN_RESOURCE(default_archive_icon_png); +INCLUDE_EXTERN_RESOURCE(default_audio_icon_png); +INCLUDE_EXTERN_RESOURCE(default_battery_bar_charge_png); +INCLUDE_EXTERN_RESOURCE(default_battery_bar_green_png); +INCLUDE_EXTERN_RESOURCE(default_battery_bar_red_png); +INCLUDE_EXTERN_RESOURCE(default_battery_png); +INCLUDE_EXTERN_RESOURCE(default_cover_png); +INCLUDE_EXTERN_RESOURCE(default_fastforward_png); +INCLUDE_EXTERN_RESOURCE(default_fastrewind_png); +INCLUDE_EXTERN_RESOURCE(default_file_icon_png); +INCLUDE_EXTERN_RESOURCE(default_folder_icon_png); +INCLUDE_EXTERN_RESOURCE(default_ftp_png); +INCLUDE_EXTERN_RESOURCE(default_image_icon_png); +INCLUDE_EXTERN_RESOURCE(default_pause_png); +INCLUDE_EXTERN_RESOURCE(default_play_png); +INCLUDE_EXTERN_RESOURCE(default_sfo_icon_png); +INCLUDE_EXTERN_RESOURCE(default_text_icon_png); + +INCLUDE_EXTERN_RESOURCE(electron_colors_txt); +INCLUDE_EXTERN_RESOURCE(electron_archive_icon_png); +INCLUDE_EXTERN_RESOURCE(electron_audio_icon_png); +INCLUDE_EXTERN_RESOURCE(electron_battery_bar_charge_png); +INCLUDE_EXTERN_RESOURCE(electron_battery_bar_green_png); +INCLUDE_EXTERN_RESOURCE(electron_battery_bar_red_png); +INCLUDE_EXTERN_RESOURCE(electron_battery_png); +INCLUDE_EXTERN_RESOURCE(electron_bg_audioplayer_png); +INCLUDE_EXTERN_RESOURCE(electron_bg_browser_png); +INCLUDE_EXTERN_RESOURCE(electron_bg_hexeditor_png); +INCLUDE_EXTERN_RESOURCE(electron_bg_photoviewer_png); +INCLUDE_EXTERN_RESOURCE(electron_bg_texteditor_png); +INCLUDE_EXTERN_RESOURCE(electron_context_png); +INCLUDE_EXTERN_RESOURCE(electron_context_more_png); +INCLUDE_EXTERN_RESOURCE(electron_cover_png); +INCLUDE_EXTERN_RESOURCE(electron_dialog_png); +INCLUDE_EXTERN_RESOURCE(electron_fastforward_png); +INCLUDE_EXTERN_RESOURCE(electron_fastrewind_png); +INCLUDE_EXTERN_RESOURCE(electron_file_icon_png); +INCLUDE_EXTERN_RESOURCE(electron_folder_icon_png); +INCLUDE_EXTERN_RESOURCE(electron_ftp_png); +INCLUDE_EXTERN_RESOURCE(electron_image_icon_png); +INCLUDE_EXTERN_RESOURCE(electron_pause_png); +INCLUDE_EXTERN_RESOURCE(electron_play_png); +INCLUDE_EXTERN_RESOURCE(electron_sfo_icon_png); +INCLUDE_EXTERN_RESOURCE(electron_text_icon_png); INCLUDE_EXTERN_RESOURCE(user_suprx); INCLUDE_EXTERN_RESOURCE(usbdevice_skprx); -// INCLUDE_EXTERN_RESOURCE(kernel_skprx); -// INCLUDE_EXTERN_RESOURCE(umass_skprx); +INCLUDE_EXTERN_RESOURCE(kernel_skprx); +INCLUDE_EXTERN_RESOURCE(umass_skprx); INCLUDE_EXTERN_RESOURCE(changeinfo_txt); @@ -60,29 +87,57 @@ static DefaultFile default_files[] = { DEFAULT_FILE("ux0:VitaShell/language/english_us.txt", english_us_txt, 0), DEFAULT_FILE("ux0:VitaShell/theme/theme.txt", theme_txt, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/colors.txt", colors_txt, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/folder_icon.png", folder_icon_png, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/file_icon.png", file_icon_png, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/archive_icon.png", archive_icon_png, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/image_icon.png", image_icon_png, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/audio_icon.png", audio_icon_png, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/sfo_icon.png", sfo_icon_png, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/text_icon.png", text_icon_png, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/ftp.png", ftp_png, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/battery.png", battery_png, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/battery_bar_red.png", battery_bar_red_png, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/battery_bar_green.png", battery_bar_green_png, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/battery_bar_charge.png", battery_bar_charge_png, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/cover.png", cover_png, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/play.png", play_png, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/pause.png", pause_png, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/fastforward.png", fastforward_png, 0), - DEFAULT_FILE("ux0:VitaShell/theme/Default/fastrewind.png", fastrewind_png, 0), + + DEFAULT_FILE("ux0:VitaShell/theme/Default/colors.txt", default_colors_txt, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/archive_icon.png", default_archive_icon_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/audio_icon.png", default_audio_icon_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/battery.png", default_battery_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/battery_bar_charge.png", default_battery_bar_charge_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/battery_bar_green.png", default_battery_bar_green_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/battery_bar_red.png", default_battery_bar_red_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/cover.png", default_cover_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/fastforward.png", default_fastforward_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/fastrewind.png", default_fastrewind_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/file_icon.png", default_file_icon_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/folder_icon.png", default_folder_icon_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/ftp.png", default_ftp_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/image_icon.png", default_image_icon_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/pause.png", default_pause_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/play.png", default_play_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/sfo_icon.png", default_sfo_icon_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Default/text_icon.png", default_text_icon_png, 0), + + DEFAULT_FILE("ux0:VitaShell/theme/Electron/colors.txt", electron_colors_txt, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/archive_icon.png", electron_archive_icon_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/audio_icon.png", electron_audio_icon_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/battery.png", electron_battery_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/battery_bar_charge.png", electron_battery_bar_charge_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/battery_bar_green.png", electron_battery_bar_green_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/battery_bar_red.png", electron_battery_bar_red_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/bg_audioplayer.png", electron_bg_audioplayer_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/bg_browser.png", electron_bg_browser_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/bg_hexeditor.png", electron_bg_hexeditor_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/bg_photoviewer.png", electron_bg_photoviewer_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/bg_texteditor.png", electron_bg_texteditor_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/context.png", electron_context_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/context_more.png", electron_context_more_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/cover.png", electron_cover_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/dialog.png", electron_dialog_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/fastforward.png", electron_fastforward_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/fastrewind.png", electron_fastrewind_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/file_icon.png", electron_file_icon_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/folder_icon.png", electron_folder_icon_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/ftp.png", electron_ftp_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/image_icon.png", electron_image_icon_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/pause.png", electron_pause_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/play.png", electron_play_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/sfo_icon.png", electron_sfo_icon_png, 0), + DEFAULT_FILE("ux0:VitaShell/theme/Electron/text_icon.png", electron_text_icon_png, 0), DEFAULT_FILE("ux0:VitaShell/module/user.suprx", user_suprx, 1), DEFAULT_FILE("ux0:VitaShell/module/usbdevice.skprx", usbdevice_skprx, 1), - // DEFAULT_FILE("ux0:VitaShell/module/kernel.skprx", kernel_skprx, 1), - // DEFAULT_FILE("ux0:VitaShell/module/umass.skprx", umass_skprx, 1), + DEFAULT_FILE("ux0:VitaShell/module/kernel.skprx", kernel_skprx, 1), + DEFAULT_FILE("ux0:VitaShell/module/umass.skprx", umass_skprx, 1), DEFAULT_FILE("ux0:patch/VITASHELL/sce_sys/changeinfo/changeinfo.xml", changeinfo_txt, 1), }; @@ -244,6 +299,7 @@ void installDefaultFiles() { sceIoMkdir("ux0:VitaShell/module", 0777); sceIoMkdir("ux0:VitaShell/theme", 0777); sceIoMkdir("ux0:VitaShell/theme/Default", 0777); + sceIoMkdir("ux0:VitaShell/theme/Electron", 0777); sceIoMkdir("ux0:patch", 0006); sceIoMkdir("ux0:patch/VITASHELL", 0006); diff --git a/modules/kernel/CMakeLists.txt b/modules/kernel/CMakeLists.txt new file mode 100644 index 00000000..473419dd --- /dev/null +++ b/modules/kernel/CMakeLists.txt @@ -0,0 +1,48 @@ +cmake_minimum_required(VERSION 2.8) + +if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) + if(DEFINED ENV{VITASDK}) + set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file") + else() + message(FATAL_ERROR "Please define VITASDK to point to your SDK path!") + endif() +endif() + +project(kernel) +include("${VITASDK}/share/vita.cmake" REQUIRED) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-q -Wall -O3 -nostdlib") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions") + +add_executable(kernel + main.c +) + +target_link_libraries(kernel + SceIofilemgrForDriver_stub + SceSysclibForDriver_stub + SceSysmemForDriver_stub + SceModulemgrForKernel_stub + SceModulemgrForDriver_stub + SceThreadmgrForDriver_stub + taihenForKernel_stub + taihenModuleUtils_stub +) + +vita_create_self(kernel.skprx kernel CONFIG exports.yml UNSAFE) + +vita_create_stubs(stubs kernel ${CMAKE_SOURCE_DIR}/exports.yml KERNEL) + +install(DIRECTORY ${CMAKE_BINARY_DIR}/stubs/ + DESTINATION lib + FILES_MATCHING PATTERN "*.a" +) + +install(FILES vitashell_kernel.h + DESTINATION include +) + +add_custom_target(copy + COMMAND cp kernel.skprx ../../../resources/kernel.skprx + DEPENDS kernel.skprx +) \ No newline at end of file diff --git a/modules/kernel/exports.yml b/modules/kernel/exports.yml new file mode 100644 index 00000000..d4d62344 --- /dev/null +++ b/modules/kernel/exports.yml @@ -0,0 +1,15 @@ +VitaShellKernel: + attributes: 0 + version: + major: 1 + minor: 0 + main: + start: module_start + stop: module_stop + modules: + VitaShellKernelLibrary: + syscall: true + functions: + - shellKernelIsUx0Redirected + - shellKernelRedirectUx0 + - shellKernelUnredirectUx0 \ No newline at end of file diff --git a/modules/kernel/main.c b/modules/kernel/main.c new file mode 100644 index 00000000..264409b0 --- /dev/null +++ b/modules/kernel/main.c @@ -0,0 +1,173 @@ +/* + 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 . +*/ + +#include +#include +#include +#include + +#include +#include + +#include + +#define MOUNT_POINT_ID 0x800 + +int module_get_offset(SceUID pid, SceUID modid, int segidx, size_t offset, uintptr_t *addr); + +typedef struct { + const char *dev; + const char *dev2; + const char *blkdev; + const char *blkdev2; + int id; +} SceIoDevice; + +typedef struct { + int id; + const char *dev_unix; + int unk; + int dev_major; + int dev_minor; + const char *dev_filesystem; + int unk2; + SceIoDevice *dev; + int unk3; + SceIoDevice *dev2; + int unk4; + int unk5; + int unk6; + int unk7; +} SceIoMountPoint; + +static SceIoDevice uma_ux0_dev = { "ux0:", "exfatux0", "sdstor0:uma-pp-act-a", "sdstor0:uma-lp-act-entire", MOUNT_POINT_ID }; + +static SceIoMountPoint *(* sceIoFindMountPoint)(int id) = NULL; + +static SceIoDevice *ori_dev = NULL, *ori_dev2 = NULL; + +static SceUID hookid = -1; + +static tai_hook_ref_t ksceSysrootIsSafeModeRef; + +static int ksceSysrootIsSafeModePatched() { + return 1; +} + +int shellKernelIsUx0Redirected() { + uint32_t state; + ENTER_SYSCALL(state); + + SceIoMountPoint *mount = sceIoFindMountPoint(MOUNT_POINT_ID); + if (!mount) { + EXIT_SYSCALL(state); + return -1; + } + + if (mount->dev == &uma_ux0_dev && mount->dev2 == &uma_ux0_dev) { + EXIT_SYSCALL(state); + return 1; + } + + EXIT_SYSCALL(state); + return 0; +} + +int shellKernelRedirectUx0() { + uint32_t state; + ENTER_SYSCALL(state); + + SceIoMountPoint *mount = sceIoFindMountPoint(MOUNT_POINT_ID); + if (!mount) { + EXIT_SYSCALL(state); + return -1; + } + + if (mount->dev != &uma_ux0_dev && mount->dev2 != &uma_ux0_dev) { + ori_dev = mount->dev; + ori_dev2 = mount->dev2; + } + + mount->dev = &uma_ux0_dev; + mount->dev2 = &uma_ux0_dev; + + EXIT_SYSCALL(state); + return 0; +} + +int shellKernelUnredirectUx0() { + uint32_t state; + ENTER_SYSCALL(state); + + SceIoMountPoint *mount = sceIoFindMountPoint(MOUNT_POINT_ID); + if (!mount) { + EXIT_SYSCALL(state); + return -1; + } + + if (ori_dev && ori_dev2) { + mount->dev = ori_dev; + mount->dev2 = ori_dev2; + + ori_dev = NULL; + ori_dev2 = NULL; + } + + EXIT_SYSCALL(state); + return 0; +} + +void _start() __attribute__ ((weak, alias("module_start"))); +int module_start(SceSize args, void *argp) { + // Get tai module info + tai_module_info_t info; + info.size = sizeof(tai_module_info_t); + if (taiGetModuleInfoForKernel(KERNEL_PID, "SceIofilemgr", &info) < 0) + return SCE_KERNEL_START_SUCCESS; + + // Get important function + module_get_offset(KERNEL_PID, info.modid, 0, 0x138C1, (uintptr_t *)&sceIoFindMountPoint); + + // Fake safe mode so that SceUsbMass can be loaded + hookid = taiHookFunctionExportForKernel(KERNEL_PID, &ksceSysrootIsSafeModeRef, "SceSysmem", 0x2ED7F97A, 0x834439A7, ksceSysrootIsSafeModePatched); + if (hookid < 0) + return SCE_KERNEL_START_SUCCESS; + + // Load SceUsbMass + SceUID modid = ksceKernelLoadStartModule("ux0:VitaShell/module/umass.skprx", 0, NULL, 0, NULL, NULL); + + // Release patch + taiHookReleaseForKernel(hookid, ksceSysrootIsSafeModeRef); + hookid = -1; + + // Check result + if (modid < 0) + return SCE_KERNEL_START_SUCCESS; + + // Fake safe mode in SceUsbServ + hookid = taiHookFunctionImportForKernel(KERNEL_PID, &ksceSysrootIsSafeModeRef, "SceUsbServ", 0x2ED7F97A, 0x834439A7, ksceSysrootIsSafeModePatched); + + return SCE_KERNEL_START_SUCCESS; +} + +int module_stop(SceSize args, void *argp) { + if (hookid >= 0) + taiHookReleaseForKernel(hookid, ksceSysrootIsSafeModeRef); + + return SCE_KERNEL_STOP_SUCCESS; +} \ No newline at end of file diff --git a/modules/kernel/vitashell_kernel.h b/modules/kernel/vitashell_kernel.h new file mode 100644 index 00000000..2ec0ae9b --- /dev/null +++ b/modules/kernel/vitashell_kernel.h @@ -0,0 +1,26 @@ +/* + 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 . +*/ + +#ifndef __VITASHELL_KERNEL_H__ +#define __VITASHELL_KERNEL_H__ + +int shellKernelIsUx0Redirected(); +int shellKernelRedirectUx0(); +int shellKernelUnredirectUx0(); + +#endif \ No newline at end of file diff --git a/resources/changeinfo.txt b/resources/changeinfo.txt index ea0bb7d2..063f7e87 100644 --- a/resources/changeinfo.txt +++ b/resources/changeinfo.txt @@ -228,4 +228,23 @@ - Updated to newest libftpvita.
]]> + + +- Added ability to mount game card as usb device.
+- Added possibility to refresh the livearea.
+- Added scrolling text for long filenames.
+- Added 'Sort by' option to context menu (R trigger combo removed).
+- Added 'Electron' theme by Acemad, the winner of the VitaShell theme contest.
+- Added theme selector.
+- Improved property dialog animation.
+- Fixed text editor bugs.
+- Fixed bug where USB cable wasn't recognized.
+- Fixed bug where VitaShell left to livearea after deleting the updater.
+- Removed battery icon in status bar for PSTV.
+- File statistics are now inherited when copying.
+- I/O operations speed will now be showed in KB/s.
+- Made control smoother.
+ ]]> +
diff --git a/resources/archive_icon.png b/resources/default/archive_icon.png similarity index 100% rename from resources/archive_icon.png rename to resources/default/archive_icon.png diff --git a/resources/audio_icon.png b/resources/default/audio_icon.png similarity index 100% rename from resources/audio_icon.png rename to resources/default/audio_icon.png diff --git a/resources/battery.png b/resources/default/battery.png similarity index 100% rename from resources/battery.png rename to resources/default/battery.png diff --git a/resources/battery_bar_charge.png b/resources/default/battery_bar_charge.png similarity index 100% rename from resources/battery_bar_charge.png rename to resources/default/battery_bar_charge.png diff --git a/resources/battery_bar_green.png b/resources/default/battery_bar_green.png similarity index 100% rename from resources/battery_bar_green.png rename to resources/default/battery_bar_green.png diff --git a/resources/battery_bar_red.png b/resources/default/battery_bar_red.png similarity index 100% rename from resources/battery_bar_red.png rename to resources/default/battery_bar_red.png diff --git a/resources/colors.txt b/resources/default/colors.txt similarity index 100% rename from resources/colors.txt rename to resources/default/colors.txt diff --git a/resources/cover.png b/resources/default/cover.png similarity index 100% rename from resources/cover.png rename to resources/default/cover.png diff --git a/resources/fastforward.png b/resources/default/fastforward.png similarity index 100% rename from resources/fastforward.png rename to resources/default/fastforward.png diff --git a/resources/fastrewind.png b/resources/default/fastrewind.png similarity index 100% rename from resources/fastrewind.png rename to resources/default/fastrewind.png diff --git a/resources/file_icon.png b/resources/default/file_icon.png similarity index 100% rename from resources/file_icon.png rename to resources/default/file_icon.png diff --git a/resources/folder_icon.png b/resources/default/folder_icon.png similarity index 100% rename from resources/folder_icon.png rename to resources/default/folder_icon.png diff --git a/resources/ftp.png b/resources/default/ftp.png similarity index 100% rename from resources/ftp.png rename to resources/default/ftp.png diff --git a/resources/image_icon.png b/resources/default/image_icon.png similarity index 100% rename from resources/image_icon.png rename to resources/default/image_icon.png diff --git a/resources/pause.png b/resources/default/pause.png similarity index 100% rename from resources/pause.png rename to resources/default/pause.png diff --git a/resources/play.png b/resources/default/play.png similarity index 100% rename from resources/play.png rename to resources/default/play.png diff --git a/resources/sfo_icon.png b/resources/default/sfo_icon.png similarity index 100% rename from resources/sfo_icon.png rename to resources/default/sfo_icon.png diff --git a/resources/stop.png b/resources/default/stop.png similarity index 100% rename from resources/stop.png rename to resources/default/stop.png diff --git a/resources/text_icon.png b/resources/default/text_icon.png similarity index 100% rename from resources/text_icon.png rename to resources/default/text_icon.png diff --git a/resources/electron/archive_icon.png b/resources/electron/archive_icon.png new file mode 100644 index 00000000..2031cbb0 Binary files /dev/null and b/resources/electron/archive_icon.png differ diff --git a/resources/electron/audio_icon.png b/resources/electron/audio_icon.png new file mode 100644 index 00000000..7a4a6dab Binary files /dev/null and b/resources/electron/audio_icon.png differ diff --git a/resources/electron/battery.png b/resources/electron/battery.png new file mode 100644 index 00000000..6d0104f0 Binary files /dev/null and b/resources/electron/battery.png differ diff --git a/resources/electron/battery_bar_charge.png b/resources/electron/battery_bar_charge.png new file mode 100644 index 00000000..6910ed8f Binary files /dev/null and b/resources/electron/battery_bar_charge.png differ diff --git a/resources/electron/battery_bar_green.png b/resources/electron/battery_bar_green.png new file mode 100644 index 00000000..e112ed7f Binary files /dev/null and b/resources/electron/battery_bar_green.png differ diff --git a/resources/electron/battery_bar_red.png b/resources/electron/battery_bar_red.png new file mode 100644 index 00000000..380f8c18 Binary files /dev/null and b/resources/electron/battery_bar_red.png differ diff --git a/resources/electron/bg_audioplayer.png b/resources/electron/bg_audioplayer.png new file mode 100644 index 00000000..84dd47c8 Binary files /dev/null and b/resources/electron/bg_audioplayer.png differ diff --git a/resources/electron/bg_browser.png b/resources/electron/bg_browser.png new file mode 100644 index 00000000..b9428e2b Binary files /dev/null and b/resources/electron/bg_browser.png differ diff --git a/resources/electron/bg_hexeditor.png b/resources/electron/bg_hexeditor.png new file mode 100644 index 00000000..d5e5a9d8 Binary files /dev/null and b/resources/electron/bg_hexeditor.png differ diff --git a/resources/electron/bg_photoviewer.png b/resources/electron/bg_photoviewer.png new file mode 100644 index 00000000..0bba7e5e Binary files /dev/null and b/resources/electron/bg_photoviewer.png differ diff --git a/resources/electron/bg_texteditor.png b/resources/electron/bg_texteditor.png new file mode 100644 index 00000000..1e2fff85 Binary files /dev/null and b/resources/electron/bg_texteditor.png differ diff --git a/resources/electron/colors.txt b/resources/electron/colors.txt new file mode 100644 index 00000000..9c452df0 --- /dev/null +++ b/resources/electron/colors.txt @@ -0,0 +1,60 @@ +# VitaShell colors file for Electron theme + +# Shell colors +TITLE_COLOR = 0xFFFFF9D4 +PATH_COLOR = 0xFFFFCBAB +DATE_TIME_COLOR = 0xFFFFF9D4 + +# Settings colors +SETTINGS_MENU_COLOR = 0xE0AD683C +SETTINGS_MENU_FOCUS_COLOR = 0x6FF5A878 +SETTINGS_MENU_TITLE_COLOR = 0xFFFFF9D4 +SETTINGS_MENU_ITEM_COLOR = 0xFFFFC29E +SETTINGS_MENU_OPTION_COLOR = 0xFF7CFF24 + +# File browser colors +FOCUS_COLOR = 0xFF7CFF24 +FILE_COLOR = 0xFFD4CDA5 +SFO_COLOR = 0xFFD4CDA5 +TXT_COLOR = 0xFFD4CDA5 +FOLDER_COLOR = 0xFFDBAA8C +IMAGE_COLOR = 0xFFD190CB +ARCHIVE_COLOR = 0xFFCFBF59 +SCROLL_BAR_COLOR = 0x80FFD0B5 +SCROLL_BAR_BG_COLOR = 0x007F7F7F +MARKED_COLOR = 0x4FF5A878 + +# Context menu colors +CONTEXT_MENU_TEXT_COLOR = 0xFFD4CB99 +CONTEXT_MENU_FOCUS_COLOR = 0xFF7CFF24 +INVISIBLE_COLOR = 0xFFB07E39 + +# Dialog colors +DIALOG_COLOR = 0xFFD4CB99 +PROGRESS_BAR_COLOR = 0xFFAAE300 +PROGRESS_BAR_BG_COLOR = 0xFFE08E31 + +# Hex editor colors +HEX_COLOR = 0xFFFFF9D4 +HEX_OFFSET_COLOR = 0xFFDBAA8C +HEX_NIBBLE_COLOR = 0xFF639FFF + +# Text editor colors +TEXT_COLOR = 0xFFFFF9D4 +TEXT_FOCUS_COLOR = 0xFFEBD334 +TEXT_LINE_NUMBER_COLOR = 0xFFDBAA8C +TEXT_LINE_NUMBER_COLOR_FOCUS = 0xFF7CFF24 +TEXT_HIGHLIGHT_COLOR = 0xFF80F5FF + +# Photo viewer colors +PHOTO_ZOOM_COLOR = 0xFFFFF9D4 + +# Audio player colors +AUDIO_INFO_ASSIGN = 0xFFDBAA8C +AUDIO_INFO = 0xFFFFF9D4 +AUDIO_SPEED = 0xFFFFF9D4 +AUDIO_TIME_CURRENT = 0xFFBBE000 +AUDIO_TIME_SLASH = 0xFFFFF9D4 +AUDIO_TIME_TOTAL = 0xFFFFF9D4 +AUDIO_TIME_BAR = 0xFFFFEBCF +AUDIO_TIME_BAR_BG = 0x90BBE000 diff --git a/resources/electron/context.png b/resources/electron/context.png new file mode 100644 index 00000000..33e37a5b Binary files /dev/null and b/resources/electron/context.png differ diff --git a/resources/electron/context_more.png b/resources/electron/context_more.png new file mode 100644 index 00000000..0e8567ab Binary files /dev/null and b/resources/electron/context_more.png differ diff --git a/resources/electron/cover.png b/resources/electron/cover.png new file mode 100644 index 00000000..13a4861d Binary files /dev/null and b/resources/electron/cover.png differ diff --git a/resources/electron/dialog.png b/resources/electron/dialog.png new file mode 100644 index 00000000..57530cc3 Binary files /dev/null and b/resources/electron/dialog.png differ diff --git a/resources/electron/fastforward.png b/resources/electron/fastforward.png new file mode 100644 index 00000000..b512f336 Binary files /dev/null and b/resources/electron/fastforward.png differ diff --git a/resources/electron/fastrewind.png b/resources/electron/fastrewind.png new file mode 100644 index 00000000..d3e351c8 Binary files /dev/null and b/resources/electron/fastrewind.png differ diff --git a/resources/electron/file_icon.png b/resources/electron/file_icon.png new file mode 100644 index 00000000..d0a35e49 Binary files /dev/null and b/resources/electron/file_icon.png differ diff --git a/resources/electron/folder_icon.png b/resources/electron/folder_icon.png new file mode 100644 index 00000000..adbc21da Binary files /dev/null and b/resources/electron/folder_icon.png differ diff --git a/resources/electron/ftp.png b/resources/electron/ftp.png new file mode 100644 index 00000000..45545c5c Binary files /dev/null and b/resources/electron/ftp.png differ diff --git a/resources/electron/image_icon.png b/resources/electron/image_icon.png new file mode 100644 index 00000000..f5465180 Binary files /dev/null and b/resources/electron/image_icon.png differ diff --git a/resources/electron/pause.png b/resources/electron/pause.png new file mode 100644 index 00000000..3ccd809d Binary files /dev/null and b/resources/electron/pause.png differ diff --git a/resources/electron/play.png b/resources/electron/play.png new file mode 100644 index 00000000..dd3a6611 Binary files /dev/null and b/resources/electron/play.png differ diff --git a/resources/electron/sfo_icon.png b/resources/electron/sfo_icon.png new file mode 100644 index 00000000..95e51291 Binary files /dev/null and b/resources/electron/sfo_icon.png differ diff --git a/resources/electron/text_icon.png b/resources/electron/text_icon.png new file mode 100644 index 00000000..3e1f318e Binary files /dev/null and b/resources/electron/text_icon.png differ diff --git a/resources/kernel.skprx b/resources/kernel.skprx new file mode 100644 index 00000000..25c157dc Binary files /dev/null and b/resources/kernel.skprx differ diff --git a/resources/umass.skprx b/resources/umass.skprx new file mode 100644 index 00000000..ce2e5cfb Binary files /dev/null and b/resources/umass.skprx differ diff --git a/theme.c b/theme.c index 1ac0b6ef..b836b64f 100644 --- a/theme.c +++ b/theme.c @@ -23,27 +23,24 @@ #include "theme.h" #include "utils.h" -INCLUDE_EXTERN_RESOURCE(colors_txt); -INCLUDE_EXTERN_RESOURCE(colors_txt_size); - -INCLUDE_EXTERN_RESOURCE(folder_icon_png); -INCLUDE_EXTERN_RESOURCE(file_icon_png); -INCLUDE_EXTERN_RESOURCE(archive_icon_png); -INCLUDE_EXTERN_RESOURCE(image_icon_png); -INCLUDE_EXTERN_RESOURCE(audio_icon_png); -INCLUDE_EXTERN_RESOURCE(sfo_icon_png); -INCLUDE_EXTERN_RESOURCE(text_icon_png); -INCLUDE_EXTERN_RESOURCE(ftp_png); -INCLUDE_EXTERN_RESOURCE(battery_png); -INCLUDE_EXTERN_RESOURCE(battery_bar_red_png); -INCLUDE_EXTERN_RESOURCE(battery_bar_green_png); -INCLUDE_EXTERN_RESOURCE(battery_bar_charge_png); - -INCLUDE_EXTERN_RESOURCE(cover_png); -INCLUDE_EXTERN_RESOURCE(play_png); -INCLUDE_EXTERN_RESOURCE(pause_png); -INCLUDE_EXTERN_RESOURCE(fastforward_png); -INCLUDE_EXTERN_RESOURCE(fastrewind_png); +INCLUDE_EXTERN_RESOURCE(default_colors_txt); +INCLUDE_EXTERN_RESOURCE(default_archive_icon_png); +INCLUDE_EXTERN_RESOURCE(default_audio_icon_png); +INCLUDE_EXTERN_RESOURCE(default_battery_bar_charge_png); +INCLUDE_EXTERN_RESOURCE(default_battery_bar_green_png); +INCLUDE_EXTERN_RESOURCE(default_battery_bar_red_png); +INCLUDE_EXTERN_RESOURCE(default_battery_png); +INCLUDE_EXTERN_RESOURCE(default_cover_png); +INCLUDE_EXTERN_RESOURCE(default_fastforward_png); +INCLUDE_EXTERN_RESOURCE(default_fastrewind_png); +INCLUDE_EXTERN_RESOURCE(default_file_icon_png); +INCLUDE_EXTERN_RESOURCE(default_folder_icon_png); +INCLUDE_EXTERN_RESOURCE(default_ftp_png); +INCLUDE_EXTERN_RESOURCE(default_image_icon_png); +INCLUDE_EXTERN_RESOURCE(default_pause_png); +INCLUDE_EXTERN_RESOURCE(default_play_png); +INCLUDE_EXTERN_RESOURCE(default_sfo_icon_png); +INCLUDE_EXTERN_RESOURCE(default_text_icon_png); // Shell colors int BACKGROUND_COLOR; @@ -127,32 +124,32 @@ typedef struct { } ThemeImage; ThemeImage theme_images[] = { - { "folder_icon.png", &_binary_resources_folder_icon_png_start, &folder_icon }, - { "file_icon.png", &_binary_resources_file_icon_png_start, &file_icon }, - { "archive_icon.png", &_binary_resources_archive_icon_png_start, &archive_icon }, - { "image_icon.png", &_binary_resources_image_icon_png_start, &image_icon }, - { "audio_icon.png", &_binary_resources_audio_icon_png_start, &audio_icon }, - { "sfo_icon.png", &_binary_resources_sfo_icon_png_start, &sfo_icon }, - { "text_icon.png", &_binary_resources_text_icon_png_start, &text_icon }, - { "ftp.png", &_binary_resources_ftp_png_start, &ftp_image }, - { "dialog.png", NULL, &dialog_image }, - { "context.png", NULL, &context_image }, - { "context_more.png", NULL, &context_more_image }, - { "settings.png", NULL, &settings_image }, - { "battery.png", &_binary_resources_battery_png_start, &battery_image }, - { "battery_bar_red.png", &_binary_resources_battery_bar_red_png_start, &battery_bar_red_image }, - { "battery_bar_green.png", &_binary_resources_battery_bar_green_png_start, &battery_bar_green_image }, - { "battery_bar_charge.png", &_binary_resources_battery_bar_charge_png_start, &battery_bar_charge_image }, + { "archive_icon.png", &_binary_resources_default_archive_icon_png_start, &archive_icon }, + { "audio_icon.png", &_binary_resources_default_audio_icon_png_start, &audio_icon }, + { "battery.png", &_binary_resources_default_battery_png_start, &battery_image }, + { "battery_bar_charge.png", &_binary_resources_default_battery_bar_charge_png_start, &battery_bar_charge_image }, + { "battery_bar_green.png", &_binary_resources_default_battery_bar_green_png_start, &battery_bar_green_image }, + { "battery_bar_red.png", &_binary_resources_default_battery_bar_red_png_start, &battery_bar_red_image }, + { "bg_audioplayer.png", NULL, &bg_audio_image }, { "bg_browser.png", NULL, &bg_browser_image }, { "bg_hexeditor.png", NULL, &bg_hex_image }, - { "bg_texteditor.png", NULL, &bg_text_image }, { "bg_photoviewer.png", NULL, &bg_photo_image }, - { "bg_audioplayer.png", NULL, &bg_audio_image }, - { "cover.png", &_binary_resources_cover_png_start, &cover_image }, - { "play.png", &_binary_resources_play_png_start, &play_image }, - { "pause.png", &_binary_resources_pause_png_start, &pause_image }, - { "fastforward.png", &_binary_resources_fastforward_png_start, &fastforward_image }, - { "fastrewind.png", &_binary_resources_fastrewind_png_start, &fastrewind_image }, + { "bg_texteditor.png", NULL, &bg_text_image }, + { "context.png", NULL, &context_image }, + { "context_more.png", NULL, &context_more_image }, + { "cover.png", &_binary_resources_default_cover_png_start, &cover_image }, + { "dialog.png", NULL, &dialog_image }, + { "fastforward.png", &_binary_resources_default_fastforward_png_start, &fastforward_image }, + { "fastrewind.png", &_binary_resources_default_fastrewind_png_start, &fastrewind_image }, + { "file_icon.png", &_binary_resources_default_file_icon_png_start, &file_icon }, + { "folder_icon.png", &_binary_resources_default_folder_icon_png_start, &folder_icon }, + { "ftp.png", &_binary_resources_default_ftp_png_start, &ftp_image }, + { "image_icon.png", &_binary_resources_default_image_icon_png_start, &image_icon }, + { "pause.png", &_binary_resources_default_pause_png_start, &pause_image }, + { "play.png", &_binary_resources_default_play_png_start, &play_image }, + { "settings.png", NULL, &settings_image }, + { "sfo_icon.png", &_binary_resources_default_sfo_icon_png_start, &sfo_icon }, + { "text_icon.png", &_binary_resources_default_text_icon_png_start, &text_icon }, { "wallpaper.png", NULL, &wallpaper_image }, }; @@ -228,7 +225,7 @@ void loadTheme() { int i; // Load default config file - readConfigBuffer(&_binary_resources_colors_txt_start, (int)&_binary_resources_colors_txt_size, colors_entries, sizeof(colors_entries) / sizeof(ConfigEntry)); + readConfigBuffer(&_binary_resources_default_colors_txt_start, (int)&_binary_resources_default_colors_txt_size, colors_entries, sizeof(colors_entries) / sizeof(ConfigEntry)); // Load custom config file if (use_custom_config) {