Skip to content

Commit

Permalink
Merge pull request #315 from TheRadziu/master
Browse files Browse the repository at this point in the history
Updated pkgj to v0.52
  • Loading branch information
TheRadziu committed Dec 17, 2019
2 parents 557a5cc + 0680b1a commit 8c4a1b2
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 26 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,18 @@
# Changelog

## 0.52

What's new:

- Added NoNpDrm check on boot. If NoNpDrm plugin is not properly loaded, user will be notified, which should limit user caused issues.
- Reworked diagnostics to properly detect reF00D plugin and added support for 0syscall6.
- Refined HTTPS related error message to inform user to use iTLS-Enso to fix HTTPS related issues.

Bug fixes:

- Removed (offline) proxy gate in default comppack_url in favor of iTLS-Enso.
- Fixed 'compitibility' typos.

## 0.51

Bug fixes:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -23,7 +23,7 @@ set(CMAKE_CXX_STANDARD 17)

set(VITA_APP_NAME "PKGj")
set(VITA_TITLEID "PKGJ00000")
set(VITA_VERSION "0.51")
set(VITA_VERSION "0.52")

option(PKGI_ENABLE_LOGGING "enables debug logging over udp multicast" OFF)

Expand Down
15 changes: 10 additions & 5 deletions README.md
Expand Up @@ -4,10 +4,9 @@

This homebrew allows to download & unpack pkg file directly on Vita together with your [NoNpDrm][] fake license.

# This project is unmaintained
# This project is now a community project

This project is now unmaintained, there are still a few bugs. I won't be working
on it anymore, if anyone wants to fork it, they are encouraged to do so.
This project is now a community project, meaning there is no main dev to work on it, any pull requests are welcome.

# Features

Expand Down Expand Up @@ -38,7 +37,7 @@ Press left or right button to move page up or down.

# Configuration

pkgj can be configured through `ux0:pkgj/config.txt` or `ur0:pkgj/config.txt`.
pkgj is shipped with valid default URLs. If you wish to change some settings, they can be configured through `ux0:pkgj/config.txt` or `ur0:pkgj/config.txt`.

| Option | Description |
| --- | --- |
Expand All @@ -57,7 +56,8 @@ pkgj can be configured through `ux0:pkgj/config.txt` or `ur0:pkgj/config.txt`.

1. Where to remove interrupted/failed downloads to free up the space(Only PSV Updates/PSX/PSP games)?

In `ux0:pkgj` folder - each download will be in separate folder by its title id. Simply delete the folder & resume file.
In case of PSV content: Simply remove queued download in your livearea. If that doesn't work for any reason, you can always delete folder within `ux0:bgdl/t/` - each download will be in separate folder by the order in which they were queued.
For everything else: `ux0:pkgj` folder - each download will be in separate folder by its title id. Simply delete the folder & resume file.

2. Download speed is too slow!

Expand Down Expand Up @@ -114,6 +114,11 @@ pkgj can be configured through `ux0:pkgj/config.txt` or `ur0:pkgj/config.txt`.
8. I'VE ADDED THE PSM URL TO THE CONFIG AND THERES NO MENU OPTION!!

Please read this Q&A carefully

9. I'm getting HttpError: sceHttpSendRequest failed error when trying to refresh!

Vita consoles on firmwares 3.60-3.65 do not support TLS 1.2 that some website force on users.
In order to fix the issue simply install [iTLS-Enso](https://github.com/SKGleba/iTLS-Enso).

# Building

Expand Down
1 change: 1 addition & 0 deletions cross.cmake
@@ -1,6 +1,7 @@
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi")

set(VITA_MKSFOEX_FLAGS "${VITA_MKSFOEX_FLAGS} -d PARENTAL_LEVEL=1")
set(VITA_MAKE_FSELF_FLAGS "${VITA_MAKE_FSELF_FLAGS} -a 0x2800000000000001")

function(add_assets target)
set(result)
Expand Down
16 changes: 7 additions & 9 deletions src/config.cpp
Expand Up @@ -46,15 +46,13 @@ static constexpr char default_psm_games_url[] = {
0x6d, 0x2f, 0x74, 0x73, 0x76, 0x2f, 0x50, 0x53, 0x4d, 0x5f, 0x47,
0x41, 0x4d, 0x45, 0x53, 0x2e, 0x74, 0x73, 0x76, 0x00};
static constexpr char default_comppack_url[] = {
0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x70, 0x72, 0x6f, 0x78,
0x79, 0x2e, 0x6e, 0x6f, 0x70, 0x61, 0x79, 0x73, 0x74, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x74, 0x74,
0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x6f, 0x70, 0x61, 0x79, 0x73,
0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x70, 0x6f,
0x73, 0x2f, 0x6e, 0x70, 0x73, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61,
0x74, 0x69, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x73, 0x2f, 0x72, 0x61,
0x77, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x00};
0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x6c,
0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x6f, 0x70, 0x61,
0x79, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65,
0x70, 0x6f, 0x73, 0x2f, 0x6e, 0x70, 0x73, 0x5f, 0x63, 0x6f, 0x6d,
0x70, 0x61, 0x74, 0x69, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x73, 0x2f,
0x72, 0x61, 0x77, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2f,
0x00};

static char* skipnonws(char* text, char* end)
{
Expand Down
22 changes: 13 additions & 9 deletions src/gameview.cpp
Expand Up @@ -194,14 +194,17 @@ void GameView::printDiagnostic()
{
if (!_comppack_versions.present)
{
if (!_refood_present)
printError(
"- Your firmware is too old to play this game, you "
"must install the compatibility pack or reF00D");
else
if (_refood_present)
ImGui::Text(
"- This game will work thanks to reF00D, install the "
"compatibility packs for faster game boot times");
else if (_0syscall6_present)
ImGui::Text(
"- This game will work thanks to 0syscall6");
else
printError(
"- Your firmware is too old to play this game, you "
"must install the compatibility pack, reF00D, or 0syscall6");
}
}
else
Expand All @@ -224,9 +227,9 @@ void GameView::printDiagnostic()

if (_comppack_versions.base.empty() && !_comppack_versions.patch.empty())
printError(
"- You have installed an update compitibility pack without "
"- You have installed an update compatibility pack without "
"installing the base pack, install the base pack first and "
"reinstall the update compitibility pack.");
"reinstall the update compatibility pack.");

std::string comppack_version;
if (!_comppack_versions.patch.empty())
Expand All @@ -239,7 +242,7 @@ void GameView::printDiagnostic()
printError(
"- The version of the game does not match the installed "
"compatibility pack. If you have updated the game, also "
"install the update compitibility pack.");
"install the update compatibility pack.");

if (_item->presence == PresenceInstalled &&
comppack_version > _game_version)
Expand Down Expand Up @@ -270,7 +273,8 @@ std::string GameView::get_min_system_version()
void GameView::refresh()
{
LOGF("refreshing gameview");
_refood_present = pkgi_file_exists("ur0:tai/keys.bin");
_refood_present = pkgi_is_module_present("ref00d");
_0syscall6_present = pkgi_is_module_present("0syscall6");
_game_version = pkgi_get_game_version(_item->titleid);
_comppack_versions = pkgi_get_comppack_versions(_item->titleid);
}
Expand Down
1 change: 1 addition & 0 deletions src/gameview.hpp
Expand Up @@ -41,6 +41,7 @@ class GameView
std::optional<CompPackDatabase::Item> _patch_comppack;

bool _refood_present;
bool _0syscall6_present;
std::string _game_version;
CompPackVersion _comppack_versions;

Expand Down
2 changes: 2 additions & 0 deletions src/pkgi.hpp
Expand Up @@ -118,3 +118,5 @@ int pkgi_text_height(const char* text);
class Downloader;
struct DbItem;
void pkgi_start_download(Downloader& downloader, const DbItem& item);

bool pkgi_is_module_present(const char* module_name);
7 changes: 7 additions & 0 deletions src/update.cpp
Expand Up @@ -72,6 +72,13 @@ void update_thread()
{
try
{
if (!pkgi_is_module_present("NoNpDrm"))
pkgi_dialog_error("NoNpDrm not found. Games cannot be installed or played.");

while (pkgi_dialog_is_open()) {
pkgi_sleep(20);
}

LOGF("checking latest pkgi version at {}", PKGJ_UPDATE_URL_VERSION);

VitaHttp http;
Expand Down
6 changes: 6 additions & 0 deletions src/vita.cpp
Expand Up @@ -48,6 +48,7 @@ extern "C"
extern "C"
{
int _newlib_heap_size_user = 128 * 1024 * 1024;
extern SceUID _vshKernelSearchModuleByName(const char *name, SceUInt64 *unk);
}

static vita2d_pgf* g_font;
Expand Down Expand Up @@ -832,3 +833,8 @@ std::string pkgi_get_system_version()
}();
return version;
}

bool pkgi_is_module_present(const char* module_name) {
SceUInt64 unk;
return _vshKernelSearchModuleByName(module_name, &unk) >= 0;
}
4 changes: 2 additions & 2 deletions src/vitahttp.cpp
Expand Up @@ -115,8 +115,8 @@ void VitaHttp::start(const std::string& url, uint64_t offset)
"sceHttpSendRequest failed: {:#08x}\n{}",
static_cast<uint32_t>(err),
static_cast<uint32_t>(err) == 0x80431075
? "HTTPS URLs may not be supported on your "
"device.\nTry with HTTP."
? "HTTPS TLS 1.2 URLs are not supported on your "
"device.\nPlease install iTLS-Enso to fix this error."
: "");

http->used = 1;
Expand Down

0 comments on commit 8c4a1b2

Please sign in to comment.