diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b85129..cc8b9e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,25 @@ All notable changes to the `apollo-ps4` project will be documented in this file. ## [Unreleased]() +## [v1.3.0](https://github.com/bucanero/apollo-ps4/releases/tag/v1.3.0) - 2022-12-14 + +### Added + +* New Save Wizard codes +* Add save-game sorting options +* Add database rebuild tools + * Rebuild `app.db` + * Rebuild DLC database `addcont.db` + * Fix missing "Delete" option in XMB +* Add database backup/restore +* Download Online DB save-games to HDD +* Load external saves from HDD (`/data/fakeusb/`) + +### Changes + +* Updated networking code to `libcurl`+`polarssl` (TLS 1.2) +* Improved Pad control handling + ## [v1.2.2](https://github.com/bucanero/apollo-ps4/releases/tag/v1.2.2) - 2022-11-05 ### Changes diff --git a/Makefile b/Makefile index 75005ce..aee6023 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Package metadata. TITLE := Apollo Save Tool -VERSION := 01.22 +VERSION := 01.30 TITLE_ID := APOL00004 CONTENT_ID := IV0000-APOL00004_00-APOLLO0000000PS4 diff --git a/README.md b/README.md index b81eb3a..8e42e97 100644 --- a/README.md +++ b/README.md @@ -54,12 +54,17 @@ On first run, the application will detect and setup the required user settings. | PS4 | Folder | |-----|--------| -| **USB saves** | your saves must be placed on `/mnt/usbX/PS4/APOLLO/`. | +| **USB saves** | your decrypted saves must be placed on `/mnt/usbX/PS4/APOLLO/`. | | **USB saves** | encrypted saves must be placed on `/mnt/usbX/PS4/SAVEDATA//`. | +| **External saves (HDD)** | your decrypted saves must be placed on `/data/fakeusb/PS4/APOLLO/`. | +| **External saves (HDD)** | encrypted saves must be placed on `/data/fakeusb/PS4/SAVEDATA//`. | | **HDD saves** | files will be scanned from the hard disk, based on the current `User ID`. | ## Offline Account activation +To activate an account offline, go to the `User Tools` menu, and select `Activate PS4 Accounts`. +By default the local account will be activated with an auto-generated `account-id` value. + ### Custom account-id settings For the offline account activation, if you want to override the auto-generated ID used by Apollo, you can define your own `account-id` values using the `owners.xml` file. @@ -138,11 +143,12 @@ You need to have installed: - [Open Orbis SDK](https://github.com/OpenOrbis/OpenOrbis-PS4-Toolchain/) - [Apollo](https://github.com/bucanero/apollo-lib) library - [polarSSL](https://github.com/bucanero/oosdk_libraries/tree/master/polarssl-1.3.9) library +- [libcurl](https://github.com/bucanero/oosdk_libraries/tree/master/curl-7.64.1) library - [Zip](https://github.com/bucanero/zip) 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 -- [dbglogger](https://github.com/bucanero/dbglogger) library (required for debug logging) +- [dbglogger](https://github.com/bucanero/dbglogger) library Run `make` to create a release build. If you want to include the latest save patches in your `.pkg` file, run `make createzip`. diff --git a/docs/README.md b/docs/README.md index 61a7425..f0d334d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -54,12 +54,17 @@ On first run, the application will detect and setup the required user settings. | PS4 | Folder | |-----|--------| -| **USB saves** | your saves must be placed on `/mnt/usbX/PS4/APOLLO/`. | +| **USB saves** | your decrypted saves must be placed on `/mnt/usbX/PS4/APOLLO/`. | | **USB saves** | encrypted saves must be placed on `/mnt/usbX/PS4/SAVEDATA//`. | +| **External saves (HDD)** | your decrypted saves must be placed on `/data/fakeusb/PS4/APOLLO/`. | +| **External saves (HDD)** | encrypted saves must be placed on `/data/fakeusb/PS4/SAVEDATA//`. | | **HDD saves** | files will be scanned from the hard disk, based on the current `User ID`. | ## Offline Account activation +To activate an account offline, go to the `User Tools` menu, and select `Activate PS4 Accounts`. +By default the local account will be activated with an auto-generated `account-id` value. + ### Custom account-id settings For the offline account activation, if you want to override the auto-generated ID used by Apollo, you can define your own `account-id` values using the `owners.xml` file. @@ -121,15 +126,15 @@ Currently, the list of available games and files is limited, but the project aim # Credits -* [Bucanero](http://www.bucanero.com.ar/): Project developer +* [Bucanero](http://www.bucanero.com.ar/): [Project developer](https://github.com/bucanero) -### PS3 version credits +## Acknowledgments * [Dnawrkshp](https://github.com/Dnawrkshp/): [Artemis PS3](https://github.com/Dnawrkshp/ArtemisPS3) * [Berion](https://www.psx-place.com/members/berion.1431/): GUI design -* [flatz](https://github.com/flatz): [SFO/PFD tools](https://github.com/bucanero/pfd_sfo_tools/) +* [flatz](https://github.com/flatz): [SFO tools](https://github.com/bucanero/pfd_sfo_tools/) * [aldostools](https://aldostools.org/): [Bruteforce Save Data](https://bruteforcesavedata.forumms.net/) -* [aluigi](http://aluigi.org): [offzip/packzip](http://aluigi.altervista.org/mytoolz.htm) +* [Nobody/Wild Light](https://github.com/nobodo): [Background music track](https://github.com/bucanero/apollo-vita/blob/main/data/haiku.s3m) # Building @@ -138,16 +143,17 @@ You need to have installed: - [Open Orbis SDK](https://github.com/OpenOrbis/OpenOrbis-PS4-Toolchain/) - [Apollo](https://github.com/bucanero/apollo-lib) library - [polarSSL](https://github.com/bucanero/oosdk_libraries/tree/master/polarssl-1.3.9) library +- [libcurl](https://github.com/bucanero/oosdk_libraries/tree/master/curl-7.64.1) library - [Zip](https://github.com/bucanero/zip) 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 -- [dbglogger](https://github.com/bucanero/dbglogger) library (required for debug logging) +- [dbglogger](https://github.com/bucanero/dbglogger) library Run `make` to create a release build. If you want to include the latest save patches in your `.pkg` file, run `make createzip`. -You can also set the `PS3LOAD` environment variable to the PS3 IP address: `export PS3LOAD=tcp:x.x.x.x`. -This will allow you to use `make run` and send `apollo-ps3.self` directly to the [PS3Load listener](https://github.com/bucanero/ps3loadx). +You can also set the `PS3LOAD` environment variable to your PS4 IP address: `export PS3LOAD=tcp:x.x.x.x`. +This will allow you to use a [ps3load client](https://github.com/bucanero/ps4load/tree/main/client) and send the `eboot.bin` directly to the [PS4Load listener](https://github.com/bucanero/ps4load). To enable debug logging, build Apollo Save Tool with `make DEBUGLOG=1`. The application will send debug messages to UDP multicast address `239.255.0.100:30000`. To receive them you can use [socat][] on your computer: @@ -156,10 +162,10 @@ UDP multicast address `239.255.0.100:30000`. To receive them you can use [socat] # License -[Apollo Save Tool](https://github.com/bucanero/apollo-ps4/) (PS4) - Copyright (C) 2020-2022 Damian Parrino +[Apollo Save Tool](https://github.com/bucanero/apollo-ps4/) (PS4) - Copyright (C) 2020-2022 [Damian Parrino](https://twitter.com/dparrino) This program is free software: you can redistribute it and/or modify -it under the terms of the [GNU General Public License](https://github.com/bucanero/apollo-ps4/LICENSE) as published by +it under the terms of the [GNU General Public License][app_license] as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/source/settings.c b/source/settings.c index e2f459c..312940f 100644 --- a/source/settings.c +++ b/source/settings.c @@ -86,18 +86,19 @@ void clearcache_callback(int sel) show_message("Local cache folder cleaned:\n" APOLLO_LOCAL_CACHE); } -void unzip_app_data(const char* zip_file) +void upd_appdata_callback(int sel) { - if (extract_zip(zip_file, APOLLO_DATA_PATH)) - show_message("Successfully installed local application data"); + int i; - unlink_secure(zip_file); -} + if (!http_download(ONLINE_PATCH_URL, "archive/refs/heads/main.zip", APOLLO_LOCAL_CACHE "appdata.zip", 1)) + show_message("Error! Can't download data update file!"); -void upd_appdata_callback(int sel) -{ - if (http_download(ONLINE_URL, "PS4/ps4appdata.zip", APOLLO_LOCAL_CACHE "appdata.zip", 1)) - unzip_app_data(APOLLO_LOCAL_CACHE "appdata.zip"); + if ((i = extract_update_zip(APOLLO_LOCAL_CACHE "appdata.zip", APOLLO_DATA_PATH)) > 0) + show_message("Successfully updated %d save patch files!", i); + else + show_message("Error! Can't extract data update file!"); + + unlink_secure(APOLLO_LOCAL_CACHE "appdata.zip"); } void update_callback(int sel) diff --git a/source/sfo.c b/source/sfo.c index 7fa4efd..80a8e65 100644 --- a/source/sfo.c +++ b/source/sfo.c @@ -373,7 +373,7 @@ int patch_sfo(const char *in_file_path, sfo_patch_t* patches) { return -1; } -// sfo_patch_lock(sfo, patches->flags); + sfo_patch_titleid(sfo); sfo_patch_account(sfo, patches->account_id); sfo_patch_user_id(sfo, patches->user_id); // sfo_patch_psid(sfo, patches->psid); diff --git a/source/zip_util.c b/source/zip_util.c index d8244e8..c99f05e 100644 --- a/source/zip_util.c +++ b/source/zip_util.c @@ -95,7 +95,7 @@ int extract_zip(const char* zip_file, const char* dest_path) progress[1] = zip_entries_total(archive); zip_close(archive); - LOG("Extracting ZIP (%lu) to <%s>...", progress[1], dest_path); + LOG("Extracting %s (%lu) to <%s>...", zip_file, progress[1], dest_path); init_progress_bar("Extracting files..."); ret = zip_extract(zip_file, dest_path, on_extract_entry, progress); @@ -104,6 +104,40 @@ int extract_zip(const char* zip_file, const char* dest_path) return (ret == SUCCESS); } +int extract_update_zip(const char* zip_file, const char* dest_path) +{ + int n, ret = 0; + char fpath[256]; + const char *name; + struct zip_t *zip = zip_open(zip_file, ZIP_DEFAULT_COMPRESSION_LEVEL, 'r'); + + if (!zip) + return 0; + + n = zip_entries_total(zip); + init_progress_bar("Extracting files..."); + + for (int i = 0; i < n; ++i) + { + zip_entry_openbyindex(zip, i); + name = strchr(zip_entry_name(zip), '/'); + + if (!zip_entry_isdir(zip) && name && (strncmp(name, "/PS4/", 5) == 0)) + { + snprintf(fpath, sizeof(fpath), "%s%s", dest_path, name + 5); + LOG("Extracting %s", fpath); + update_progress_bar(i, n, "Extracting files..."); + ret += (zip_entry_fread(zip, fpath) == SUCCESS); + } + zip_entry_close(zip); + } + + end_progress_bar(); + zip_close(zip); + + return (ret); +} + void callback_7z(const char* fileName, unsigned long fileSize, unsigned fileNum, unsigned numFiles) { LOG("Extracted: %s (%ld bytes)", fileName, fileSize); @@ -164,11 +198,3 @@ int extract_rar(const char* rarFilePath, const char* dstPath) RARCloseArchive(hArcData); return (err == 0); } - -// --- workaround to fix an Open Orbis SDK linking issue with __clock_gettime() -#include -int __clock_gettime(clockid_t clock_id, struct timespec *tp) -{ - return clock_gettime(clock_id, tp); -} -// --- to be removed