Skip to content

Commit 64f230d

Browse files
committed
adjustments
1 parent f27d5a3 commit 64f230d

File tree

7 files changed

+28
-16
lines changed

7 files changed

+28
-16
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,9 @@ jobs:
123123
run: make install
124124

125125
- name: Install zip
126+
working-directory: oosdk_libraries/libzip-1.9.2
126127
run: |
127-
curl -sL https://libzip.org/download/libzip-1.9.2.tar.gz | tar xz -C ./
128-
cd libzip-1.9.2
129-
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 .
128+
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 .
130129
make
131130
cp zipconf.h ${OO_PS4_TOOLCHAIN}/include/zipconf.h
132131
cp lib/zip.h ${OO_PS4_TOOLCHAIN}/include/zip.h

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
[![Downloads][img_downloads]][app_downloads] [![Release][img_latest]][app_latest] [![License][img_license]][app_license]
44
[![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)
5+
[![Twitter](https://img.shields.io/twitter/follow/dparrino?label=Follow)](https://twitter.com/dparrino)
56

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

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

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

12-
**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/).
13+
**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/).
1314

1415
# Features
1516

@@ -127,7 +128,7 @@ You need to have installed:
127128
- [Apollo](https://github.com/bucanero/apollo-lib) library
128129
- [polarSSL](https://github.com/bucanero/oosdk_libraries/tree/master/polarssl-1.3.9) library
129130
- [cURL](https://github.com/bucanero/oosdk_libraries/tree/master/curl-7.64.1) library
130-
- [Zip](https://github.com/bucanero/zip) library
131+
- [libZip](https://github.com/bucanero/oosdk_libraries/tree/master/libzip-1.9.2) library
131132
- [SDL2](https://github.com/PacBrew/SDL/tree/ps4) library
132133
- [libJbc](https://github.com/bucanero/ps4-libjbc) library
133134
- [Mini-XML](https://github.com/bucanero/mxml) library

assets/audio/background_music.mp3

1.88 MB
Binary file not shown.

docs/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
[![Downloads][img_downloads]][app_downloads] [![Release][img_latest]][app_latest] [![License][img_license]][app_license]
44
[![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)
5+
[![Twitter](https://img.shields.io/twitter/follow/dparrino?label=Follow)](https://twitter.com/dparrino)
56

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

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

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

12-
**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/).
13+
**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/).
1314

1415
# Features
1516

@@ -116,7 +117,7 @@ You need to have installed:
116117
- [Apollo](https://github.com/bucanero/apollo-lib) library
117118
- [polarSSL](https://github.com/bucanero/oosdk_libraries/tree/master/polarssl-1.3.9) library
118119
- [cURL](https://github.com/bucanero/oosdk_libraries/tree/master/curl-7.64.1) library
119-
- [Zip](https://github.com/bucanero/zip) library
120+
- [libZip](https://github.com/bucanero/oosdk_libraries/tree/master/libzip-1.9.2) library
120121
- [SDL2](https://github.com/PacBrew/SDL/tree/ps4) library
121122
- [libJbc](https://github.com/bucanero/ps4-libjbc) library
122123
- [Mini-XML](https://github.com/bucanero/mxml) library

source/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ static int LoadTextures_Menu(void)
323323

324324
static int LoadSounds(void* data)
325325
{
326-
uint8_t* play_audio = data;
327326
drmp3 wav;
328327

329328
// Decode a mp3 file to play
@@ -339,7 +338,7 @@ static int LoadSounds(void* data)
339338
// Play the song in a loop
340339
while (!close_app)
341340
{
342-
if (*play_audio == 0)
341+
if (!apollo_config.music)
343342
{
344343
usleep(0x1000);
345344
continue;
@@ -448,6 +447,7 @@ static void registerSpecialChars(void)
448447
static void terminate(void)
449448
{
450449
LOG("Exiting...");
450+
sceAudioOutClose(audio);
451451
// Unload loaded libraries
452452
if (unpatch_SceShellCore())
453453
notify_popup("cxml://psnotification/tex_default_icon_notification", "PS4 Save patches removed from memory");
@@ -620,7 +620,7 @@ s32 main(s32 argc, const char* argv[])
620620
update_callback(!apollo_config.update);
621621

622622
// Start BGM audio thread
623-
SDL_CreateThread(&LoadSounds, "audio_thread", &apollo_config.music);
623+
SDL_CreateThread(&LoadSounds, "audio_thread", NULL);
624624

625625
#ifndef APOLLO_ENABLE_LOGGING
626626
Draw_MainMenu_Ani();

source/menu_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ static void doPatchMenu(void)
685685
list_node_t* node;
686686

687687
for (node = list_head(selected_entry->codes); (code = list_get(node)); node = list_next(node))
688-
if (wildcard_match_icase(code->name, "*(REQUIRED)*"))
688+
if (wildcard_match_icase(code->name, "*(REQUIRED)*") && code->options_count == 0)
689689
code->activated = 1;
690690
}
691691
/*

source/zip_util.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ int extract_7zip(const char* fpath, const char* dest_path)
187187
init_progress_bar("Extracting files...");
188188

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

193193
return (ret == SUCCESS);
@@ -196,14 +196,15 @@ int extract_7zip(const char* fpath, const char* dest_path)
196196
int extract_rar(const char* rarFilePath, const char* dstPath)
197197
{
198198
int err = 0;
199+
uint64_t progress = 0, numFiles = 0;
199200
HANDLE hArcData; //Archive Handle
200201
struct RAROpenArchiveDataEx rarOpenArchiveData;
201202
struct RARHeaderDataEx rarHeaderData;
202203

203204
memset(&rarOpenArchiveData, 0, sizeof(rarOpenArchiveData));
204205
memset(&rarHeaderData, 0, sizeof(rarHeaderData));
205206
rarOpenArchiveData.ArcName = (char*) rarFilePath;
206-
rarOpenArchiveData.OpenMode = RAR_OM_EXTRACT;
207+
rarOpenArchiveData.OpenMode = RAR_OM_LIST;
207208

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

216+
while (RARReadHeaderEx(hArcData, &rarHeaderData) == ERAR_SUCCESS)
217+
{
218+
if (RARProcessFile(hArcData, RAR_SKIP, NULL, NULL) == ERAR_SUCCESS)
219+
numFiles++;
220+
}
221+
222+
RARCloseArchive(hArcData);
223+
rarOpenArchiveData.OpenMode = RAR_OM_EXTRACT;
224+
hArcData = RAROpenArchiveEx(&rarOpenArchiveData);
225+
215226
LOG("UnRAR Extract %s to '%s'...", rarFilePath, dstPath);
216227
init_progress_bar("Extracting files...");
217228

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

223234
if (RARProcessFile(hArcData, RAR_EXTRACT, (char*) dstPath, NULL) != ERAR_SUCCESS)
224235
{
225236
err++;
226237
LOG("ERROR: UnRAR Extract Failed!");
227238
continue;
228239
}
229-
update_progress_bar(1, 1, rarHeaderData.FileName);
240+
update_progress_bar(progress, numFiles, rarHeaderData.FileName);
230241
}
231242
end_progress_bar();
232243

233244
RARCloseArchive(hArcData);
234-
return (err == 0);
245+
return (err == ERAR_SUCCESS);
235246
}

0 commit comments

Comments
 (0)