Skip to content

Commit

Permalink
adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
bucanero committed Dec 6, 2023
1 parent f27d5a3 commit 64f230d
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 16 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,9 @@ jobs:
run: make install

- name: Install zip
working-directory: oosdk_libraries/libzip-1.9.2
run: |
curl -sL https://libzip.org/download/libzip-1.9.2.tar.gz | tar xz -C ./
cd libzip-1.9.2
cmake --toolchain ../SDL-PS4/cmake/openorbis.cmake -DBUILD_SHARED=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TOOLS=OFF -DBUILD_REGRESS=OFF -DBUILD_DOC=OFF -DENABLE_LZMA=OFF -DENABLE_ZSTD=OFF -DENABLE_MBEDTLS=OFF .
cmake --toolchain ../../SDL-PS4/cmake/openorbis.cmake -DBUILD_SHARED=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TOOLS=OFF -DBUILD_REGRESS=OFF -DBUILD_DOC=OFF -DENABLE_LZMA=OFF -DENABLE_ZSTD=OFF -DENABLE_MBEDTLS=OFF .
make
cp zipconf.h ${OO_PS4_TOOLCHAIN}/include/zipconf.h
cp lib/zip.h ${OO_PS4_TOOLCHAIN}/include/zip.h
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

[![Downloads][img_downloads]][app_downloads] [![Release][img_latest]][app_latest] [![License][img_license]][app_license]
[![Build app package](https://github.com/bucanero/apollo-ps4/actions/workflows/build.yml/badge.svg)](https://github.com/bucanero/apollo-ps4/actions/workflows/build.yml)
[![Twitter](https://img.shields.io/twitter/follow/dparrino?label=Follow)](https://twitter.com/dparrino)

**Apollo Save Tool** is an application to manage save-game files on the PlayStation 4.

This homebrew app allows you to download, unlock, patch and resign save-game files directly on your PS4.

![image](./docs/screenshots/screenshot-main.jpg)

**Comments, ideas, suggestions?** You can contact [me](https://github.com/bucanero/) on [Twitter](https://twitter.com/dparrino) and on [my website](http://www.bucanero.com.ar/).
**Comments, ideas, suggestions?** You can [contact me](https://github.com/bucanero/) on [Twitter](https://twitter.com/dparrino) and on [my website](http://www.bucanero.com.ar/).

# Features

Expand Down Expand Up @@ -127,7 +128,7 @@ You need to have installed:
- [Apollo](https://github.com/bucanero/apollo-lib) library
- [polarSSL](https://github.com/bucanero/oosdk_libraries/tree/master/polarssl-1.3.9) library
- [cURL](https://github.com/bucanero/oosdk_libraries/tree/master/curl-7.64.1) library
- [Zip](https://github.com/bucanero/zip) library
- [libZip](https://github.com/bucanero/oosdk_libraries/tree/master/libzip-1.9.2) library
- [SDL2](https://github.com/PacBrew/SDL/tree/ps4) library
- [libJbc](https://github.com/bucanero/ps4-libjbc) library
- [Mini-XML](https://github.com/bucanero/mxml) library
Expand Down
Binary file modified assets/audio/background_music.mp3
Binary file not shown.
5 changes: 3 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

[![Downloads][img_downloads]][app_downloads] [![Release][img_latest]][app_latest] [![License][img_license]][app_license]
[![Build app package](https://github.com/bucanero/apollo-ps4/actions/workflows/build.yml/badge.svg)](https://github.com/bucanero/apollo-ps4/actions/workflows/build.yml)
[![Twitter](https://img.shields.io/twitter/follow/dparrino?label=Follow)](https://twitter.com/dparrino)

**Apollo Save Tool** is an application to manage save-game files on the PlayStation 4.

This homebrew app allows you to download, unlock, patch and resign save-game files directly on your PS4.

![image](./screenshots/screenshot-main.jpg)

**Comments, ideas, suggestions?** You can contact [me](https://github.com/bucanero/) on [Twitter](https://twitter.com/dparrino) and on [my website](http://www.bucanero.com.ar/).
**Comments, ideas, suggestions?** You can [contact me](https://github.com/bucanero/) on [Twitter](https://twitter.com/dparrino) and on [my website](http://www.bucanero.com.ar/).

# Features

Expand Down Expand Up @@ -116,7 +117,7 @@ You need to have installed:
- [Apollo](https://github.com/bucanero/apollo-lib) library
- [polarSSL](https://github.com/bucanero/oosdk_libraries/tree/master/polarssl-1.3.9) library
- [cURL](https://github.com/bucanero/oosdk_libraries/tree/master/curl-7.64.1) library
- [Zip](https://github.com/bucanero/zip) library
- [libZip](https://github.com/bucanero/oosdk_libraries/tree/master/libzip-1.9.2) library
- [SDL2](https://github.com/PacBrew/SDL/tree/ps4) library
- [libJbc](https://github.com/bucanero/ps4-libjbc) library
- [Mini-XML](https://github.com/bucanero/mxml) library
Expand Down
6 changes: 3 additions & 3 deletions source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ static int LoadTextures_Menu(void)

static int LoadSounds(void* data)
{
uint8_t* play_audio = data;
drmp3 wav;

// Decode a mp3 file to play
Expand All @@ -339,7 +338,7 @@ static int LoadSounds(void* data)
// Play the song in a loop
while (!close_app)
{
if (*play_audio == 0)
if (!apollo_config.music)
{
usleep(0x1000);
continue;
Expand Down Expand Up @@ -448,6 +447,7 @@ static void registerSpecialChars(void)
static void terminate(void)
{
LOG("Exiting...");
sceAudioOutClose(audio);
// Unload loaded libraries
if (unpatch_SceShellCore())
notify_popup("cxml://psnotification/tex_default_icon_notification", "PS4 Save patches removed from memory");
Expand Down Expand Up @@ -620,7 +620,7 @@ s32 main(s32 argc, const char* argv[])
update_callback(!apollo_config.update);

// Start BGM audio thread
SDL_CreateThread(&LoadSounds, "audio_thread", &apollo_config.music);
SDL_CreateThread(&LoadSounds, "audio_thread", NULL);

#ifndef APOLLO_ENABLE_LOGGING
Draw_MainMenu_Ani();
Expand Down
2 changes: 1 addition & 1 deletion source/menu_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ static void doPatchMenu(void)
list_node_t* node;

for (node = list_head(selected_entry->codes); (code = list_get(node)); node = list_next(node))
if (wildcard_match_icase(code->name, "*(REQUIRED)*"))
if (wildcard_match_icase(code->name, "*(REQUIRED)*") && code->options_count == 0)
code->activated = 1;
}
/*
Expand Down
21 changes: 16 additions & 5 deletions source/zip_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ int extract_7zip(const char* fpath, const char* dest_path)
init_progress_bar("Extracting files...");

// Extract 7-Zip archive contents
ret = Extract7zFileEx(fpath, dest_path, &callback_7z, 0x10000);
ret = Extract7zFileEx(fpath, dest_path, &callback_7z, 0x40000);
end_progress_bar();

return (ret == SUCCESS);
Expand All @@ -196,14 +196,15 @@ int extract_7zip(const char* fpath, const char* dest_path)
int extract_rar(const char* rarFilePath, const char* dstPath)
{
int err = 0;
uint64_t progress = 0, numFiles = 0;
HANDLE hArcData; //Archive Handle
struct RAROpenArchiveDataEx rarOpenArchiveData;
struct RARHeaderDataEx rarHeaderData;

memset(&rarOpenArchiveData, 0, sizeof(rarOpenArchiveData));
memset(&rarHeaderData, 0, sizeof(rarHeaderData));
rarOpenArchiveData.ArcName = (char*) rarFilePath;
rarOpenArchiveData.OpenMode = RAR_OM_EXTRACT;
rarOpenArchiveData.OpenMode = RAR_OM_LIST;

hArcData = RAROpenArchiveEx(&rarOpenArchiveData);
if (rarOpenArchiveData.OpenResult != ERAR_SUCCESS)
Expand All @@ -212,24 +213,34 @@ int extract_rar(const char* rarFilePath, const char* dstPath)
return 0;
}

while (RARReadHeaderEx(hArcData, &rarHeaderData) == ERAR_SUCCESS)
{
if (RARProcessFile(hArcData, RAR_SKIP, NULL, NULL) == ERAR_SUCCESS)
numFiles++;
}

RARCloseArchive(hArcData);
rarOpenArchiveData.OpenMode = RAR_OM_EXTRACT;
hArcData = RAROpenArchiveEx(&rarOpenArchiveData);

LOG("UnRAR Extract %s to '%s'...", rarFilePath, dstPath);
init_progress_bar("Extracting files...");

while (RARReadHeaderEx(hArcData, &rarHeaderData) == ERAR_SUCCESS)
{
LOG("Extracting '%s' (%ld bytes)", rarHeaderData.FileName, rarHeaderData.UnpSize + (((uint64_t)rarHeaderData.UnpSizeHigh) << 32));
update_progress_bar(0, 1, rarHeaderData.FileName);
update_progress_bar(progress++, numFiles, rarHeaderData.FileName);

if (RARProcessFile(hArcData, RAR_EXTRACT, (char*) dstPath, NULL) != ERAR_SUCCESS)
{
err++;
LOG("ERROR: UnRAR Extract Failed!");
continue;
}
update_progress_bar(1, 1, rarHeaderData.FileName);
update_progress_bar(progress, numFiles, rarHeaderData.FileName);
}
end_progress_bar();

RARCloseArchive(hArcData);
return (err == 0);
return (err == ERAR_SUCCESS);
}

0 comments on commit 64f230d

Please sign in to comment.