Forums

How to Setup a Homebrew Source for PKGi

0x199
14-11-2020
Member since 05-10-2017
4 threads

Now that the Cydia-like homebrew created by theorywrong is released to the public, anyone can setup a "Source". A Source is basically a repo where the client (PKGi) downloads data from.

In this tutorial I will explain how you can easily setup a Source server for PKGi. Note: PKGi or PKGi-Server-PHP are NOT intended for piracy.

A few days ago I've made a simple PHP class for those that want to get their homebrew server setup. This class is ultimately lightweight and useful for those that don't want to get into the advanced bits of setting up a server. Even if you're looking to automate your website (for example, by using a database), this class can easily be used.

That being said, let's get started!

Prepare your repo

First things first, download the files from the PKGi-Server-PHP GitHub repo.

Once downloaded, extract the files into a folder. This folder must be on a already running webserver (we're going to run a PHP script later on, that's why).

Add the following directories to the directory you just created:

pkgs/
refs/
icons/

Give your repo a name

Create the following file: info.json

Edit info.json and add the following data to it: { "name": "My homebrew server" } where you change My homebrew server to your repo name.

Give your repo a logo

In this folder, add a repo logo. You can do this by adding a PNG image with the name logo.png.

Prepare your homebrew

Upload your homebrew to pkgs/ and rename it to a unique ID. For this tutorial we'll use ID 1 (example path: pkgs/1.pkg). Very original.

Upload the desired homebrew icon in PNG format to icons/, this time also with the unique ID that we chose for our PKG file (example path: icons/1.png).

Generate the homebrew JSON file

The homebrew is installed on the console using the official PS4 installer. This installer requires certain values in order to install PKG files properly. TheoryWrong has made a script to generate these values. We'll be using this script to generate a JSON for our homebrew.

Add the generate_refs.php PHP script to your folder and run it. You will need to add the id parameter, the ID parameter being the homebrew ID we assigned earlier. This will generate the required JSON file and it will output it in the refs/ folder. Don't forget to delete the PHP script after you're done, it is not meant to be used by others!

Upload all the files to your server, and you can then access and install homebrews right from PKGi (do not rename packages.php, this is what PKGi is looking for).

Here's an example of our own Source:

Pretty cool, right? Enjoy!

0x199 vexi haytada appreciates this post