Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finished "Refresh LiveArea" function rework, added patches support #515

Merged
merged 11 commits into from
Nov 22, 2018
Prev Previous commit
Next Next commit
Removed rest of the debug prints, feature is now fully functional
  • Loading branch information
TheRadziu authored Nov 20, 2018
commit 24bd5ad3830b1cf22630c8b2f536f0916407c98a
18 changes: 4 additions & 14 deletions refresh.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 106,13 @@ int refreshNeeded(const char *app_path, const char* content_type)

// Check if patch for installed app exists
else if (strcmp(content_type, "patch") == 0) {
if (!checkAppExist(titleid)) {
debugPrintf("GAMEID: %s is not installed and does not need patch promotion", titleid);
if (!checkAppExist(titleid))
return 0;
}
if (checkFileExist(sfo_path)) {
snprintf(appmeta_path, MAX_PATH_LENGTH, "ux0:appmeta/%s", titleid);
pfsUmount();
if(pfsMount(appmeta_path)<0) {
debugPrintf("pfsMount failed!");
pfsUmount();
if(pfsMount(appmeta_path)<0)
return 0;
}
//Now read it
snprintf(appmeta_param, MAX_PATH_LENGTH, "ux0:appmeta/%s/param.sfo", titleid);
int sfo_size = allocateReadFile(appmeta_param, &sfo_buffer);
Expand All @@ -126,11 122,8 @@ int refreshNeeded(const char *app_path, const char* content_type)
getSfoString(sfo_buffer, "APP_VER", promoted_appver, sizeof(promoted_appver));
pfsUmount();
//Finally compare it
debugPrintf("GAMEID: %s | APP_VER: %s | APPMETA_VER: %s | SFO_SIZE: %x\n", titleid, appver, promoted_appver);
if (strcmp(appver, promoted_appver) == 0) {
debugPrintf("Appver and metaappver are the same! Skipping promotion!\n");
if (strcmp(appver, promoted_appver) == 0)
return 0;
}
}
}
return 1;
Expand Down Expand Up @@ -169,7 162,6 @@ int refreshApp(const char *app_path)

// Promote vita app/vita dlc/vita patch (if needed)
res = promoteApp(app_path);
debugPrintf("promoteApp: %s\n", app_path);
return (res < 0) ? res : 1;
}

Expand Down Expand Up @@ -315,8 307,6 @@ void patch_callback(void* data, const char* dir, const char* subdir)
{
refresh_data_t *refresh_data = (refresh_data_t*)data;
char path[MAX_PATH_LENGTH];

debugPrintf("patch_callback_path: %s/%s\n", dir, subdir);

if (refresh_data->refresh_pass) {
snprintf(path, MAX_PATH_LENGTH, "%s/%s", dir, subdir);
Expand Down