How To Make A Complete Cydia Repo! Full Tutorial + FREE!
Posted 27 August 2012 - 04:43 PM
NOTE - Not for BEGINNERS!!!
~Mac OS X 10.7.2 or Virtual Machine Running Mac OS X 10.7.2 (Find Downloads Elsewhere)
~xCode or Notepad++
~DS_Store Cleaner 1.6
~Server with MySQL hosting, 000webhost or HostGator!
~iFile on Your Jailbroken iDevice
~Some HTML Knowledge
After installing all the requirements, we can start the actual process of creating your very own Cydia Repo!
Step 1 - Setting Up Your Server!
You now need to set up your server on a site such as 000webhost, or HostGator. HostGator is where you may need to pay so I just went with the free deal on 000webhost. Make sure that your server provides PHP scripting and MySQL databases. Once you have registered your server, login with your info and then go to your cPanel. Once you are there, you want to click on SUBDOMAINS. Create a subdomain called whatever you want (ex. cydia or repo). So in the end, your subdomain will look like this, ex. cydia.yourdomainname.com. If you are given this option, make the Document Root /repo.
Step 2 - Loading Packages On Your Repo!
Now you want to download this ZIP File which has all of the folders and files needed to set up your cydia repo. Extract the contents and place the initialsetup.zip file and the repo folder on your desktop. Next, in cPanel click on FILE MANAGER. Open your repo.[domainname] subdomainâ€™s root directory (usually /public_html/ by default, unless you have changed it to /repo/ as described in the previous step of this tutorial). Once you have open your root directory click on UPLOAD in the top bar menu. Then press the button CHOOSE FILE and select initialsetup.zip from your desktop. It should upload quickly. Once done, close the tab to return to the File Manager. You should be able to see the zipped file within the root directory. Now highlight initialsetup.zip by clicking on it once, and click EXTRACT in the top bar menu. Once extracted, your root directory should contain cgi-bin, depictions, and files folders, as well as the download.php, en_US.gz, index.html (or .php), and initialsetup.zip files. You can delete initialsetup.zip now â€“ it has served its purpose. The repo folder on your desktop will be a mirror image of your root directory online. It is helpful to keep it on your desktop to conveniently upload (and reupload) files to your server.
The last thing you need to do right now is to make your Cydia icon which will be the icon displayed next to your repo on the Sources page in Cydia. The Cydia icon needs to be a 64Ã—64 px PNG file and saved as CydiaIcon.png (CaPiTaLiZaTiOn matters; this applies to this whole tutorial). Place it within the repo folder and upload it to your server root directory in the same way you did with the initialsetup.zip file.
Step 3 - Making your first package
I have built the basic structure of your first Cydia package. It is a folder called Repo-Icon within the _extras_ folder and will be a package that installs your Cydia section(s) repo icon(s). These are icon(s) for different Sections (e.g. tweaks, themes, etc) for packages hosted on your repo. Move the Repo-Icon folder to your desktop. If you open it you will see that it contains 2 folders: DEBIAN and Applications. As you will see, every Cydia package (or .deb file) in its uncompressed state is a folder containing a DEBIAN folder and â€œpath to filesâ€ folder(s). What do I mean by the â€œpath to filesâ€ folder(s)? This is where iFile (the most useful app/tweak on a jailbroken iPhone) comes in. iFile operates like Finder on your Mac, giving you a way to navigate through all the files and folders on your iPhone. The â€œpath to filesâ€ represents the path you have to take to get to the directory where you want the new files installed. In our case, we want to install the section repo icon(s) files in /Applications/Cydia.app/Sections/[here]. Therefore, the â€œpath to filesâ€ will be an Application folder, within which will be a Cydia.app folder, within which will be a Sections folder, within which you will place your repo icon image file(s). Note that to open the Cydia.app folder you need to right-click on it and selaecting Show Package Contents. The repo icon image needs to be a 64Ã—64 px PNG file (you can use the same icon as for CydiaIcon.png) and saved as the name you decide to call your section. If the name of the section is longer than one word place an underscore in between words (e.g. My_Themes.png). Place it within the Sections folder. I decided to keep my repo simple (perhaps you might want to do the same) and all my packages are within the TouchTweaks Section, therefore my only repo icon image file is called TouchTweaks.png. In summary, the â€œpath to filesâ€ for kr1sis.png will be /Applications/Cydia.app/Sections/TouchTweaks.png. Other â€œpath to filesâ€ you might find helpful include (but are not limited to):
Cydia apps: /Applications/[NameOfApplication].app/â€¦
Winterboard themes: /Library/Themes/[NameOfTheme].theme/â€¦
Zeppelin logos: /Library/Zeppelin/[NameOfZeppelin]/â€¦
The other folder in Repo-Icon is called DEBIAN. It contains a file called control. Letâ€™s open the control file with TextEdit:
As you can see, it is a list with different properties of the package. Lets review them one by one as it is important that you do not make any mistakes.
Package: is the name of your package as Cydia will store it (e.g. com.thf.repo-icon). Keep it simple, keep it lower case.
Name: is the name of your package as it will appear to other users in Cydia (e.g. Icon for THF Repository).
Version: usually start with 1.0. If you update a package later, make sure the new version is higher that previous so it appears at the top of Changes in Cydia.
Architecture: always iphoneos-arm. DO NOT CHANGE.
Description: is the description of the package (e.g. This is a setup package for the thf Repository).
Maintainer: is you or whoever owns the repo. Add your email between < > (e.g. thf <email@example.com>).
Author: is whoever made the package. Again, add email between < > (e.g. thf <firstname.lastname@example.org>).
Section: is the Section your package should be placed in (e.g. TouchTweaks; as discussed above, I only have one Section).
Priority: always extra.
Depiction: is a link to a browsing window that will be inserted between the Author and Package Details parts on a package page in Cydia (e.g. http://cydia.thf.com....repoicons.html). This is why package pages in different repositories (BigBoss, ModMyi, etc) look differently. I will describe to you later in this tutorial how to make depictions.
Installed-Size: is the size in bytes of the package when it is decompressed (e.g. 10377). It only takes the â€œpath to filesâ€ folder(s) into account so the easiest method to determine the size is to right-click on the Applications folder, select Get Info, and bam! you got it. One last thing, but very IMPORTANT: after you type in the size, press RETURN and finish on a new line. Only then save your file as control (without any extensions such as .txt or .rtf).
Ok, so by now you should have a completed, uncompressed package in folder Repo-Icon on your desktop. It should have this â€œpackage treeâ€ structure:
The next thing you need to do is clean your folder of .DS_Store files. What are they? They are invisible files that are created automatically within folders every time you open a folder with Finder. They contain information regarding each folderâ€™s View Options. They are harmless but can interfere or corrupt a transfer or upload of packages between your server and Cydia. You can easily remove them with a Mac app called DS_Store Cleaner available for download here. Once installed, open it. You will see a pop up window with the text Drag Folders Here. Just do as it says with the Repo-Icon folder from your desktop, andâ€¦
You are now ready to compress your package. To do this open Terminal and enter the following two commands (press RETURN after each one):
If everything is well, following the second command you should receive an output message with 3 or 4 warnings, but the most important thing is that the file Repo-Icon.deb appears on your desktop. Congratulations, you have just made your first package. Move it into the files folder (inside your repo folder). It is probably a good idea to make yourself a folder where you will keep all the uncompressed packages (e.g. the Repo-Icon folder) so that in the future you can easily modify them if necessary. Alternatively, you can decompress a .deb file by entering the following command in Terminal (make sure the .deb file is on your desktop beforehand):
This will create 3 new files on your desktop: debian-binary (which you can immediately delete along with the original .deb file), control.tar.gz, and data.tar.gz. These last two files can be uncompressed by double-click. It will contain all the original files, however should you want to recompress them, you will need to rearrange them into the â€œpackage treeâ€ structure (as described above) as well as DS_Store clean them beforehand. You may want to include a package into your repository whose .deb file you have downloaded from a source outside of Cydia. You can place it directly into the files folder or uncompress and recompress them (donâ€™t forget the DS_Store clean) if you want to modify its contents. This might seem like a very lengthy process, but it has been so because you are only learning how to do it. With time, it will become quick and easy.
Step 4 - Preparing your Repository for Cydia
At this time, there should be only one folder on your desktop: repo. Clean up around it so you donâ€™t make any mistakes (donâ€™t hate me because I sound like your mother). What you need to do next is open your repo folder and place the Finder window somewhere in the corner so you can see what is happening within it. Then, open Terminal and enter the following commands:
You will receive a warning message but if you look carefully, a new file will appear inside your repo folder: Packages. Continue with the following commands:
Another new file will appear: Packages.bz2. Next command:
This transforms the Packages file into Packages.gz. Since we need the Packages file in the repo folder, we have to reenter the same command as before:
Next you need to open Release with TextEdit. Similarily to control, it is a list with different properties, but this time of the repository.
Origin: is the name of your repo as Cydia will display it in Sources (e.g. TouchHackerFreak).
Label: same as Origin (e.g. TouchHackerFreak).
Suite: always stable. DO NOT CHANGE.
Version: always 1.0. DO NOT CHANGE.
Codename: is the name of your repo as Cydia will register it. I suggested you make it the same as [yourcompany] in the control file (e.g. THF).
Architecture: always iphoneos-arm. DO NOT CHANGE.
Components: always main. DO NOT CHANGE.
Description: this appears at the very bottom of your package page in Cydia (e.g. Email me if you have any questions or want to report a bug).
MD5Sum: is the fun part. It is a a 32-character long code that you need to generate for each of your Package, Package.gz, and Package.bz2 files. Go to http://www.hashemall.com to hash your files. Once the site opens first you need to choose the ALGORITHM MD5 and then press the button CHOOSE FILE. Select Packages in your repo folder.
Then click on HASH THIS FILE > and several seconds later (0.007 seconds is a slight exaggeration) you will be provided with a hash code:
Copy and paste the code onto the first column 32 asterisks in the row that ends with Packages. Next right-click on the Packages file within the repo folder and choose Get Info. Look at the size of the file (in bytes):
Copy and paste the size onto the second column 3 asterisks in the row that ends with Packages. Now repeat these steps for the Packages.gz and Packages.bz2 files. In the end, the Release file should look like this:
Save it. Now your repository is almost ready, just one last thingâ€¦ Open Terminal and enter commands:
Then just type the following:
Type 3 then hit RETURN
Type 1024 then hit RETURN
Type 0 then hit RETURN
Type y then hit RETURN
Type your name then hit RETURN
Type your email then hit RETURN
Type the name of your repo then hit RETURN
Type o then hit RETURN
Type a good passphrase (I suggest you use the same as the password on your Mac) then hit RETURN. Repeat this as prompted.
This generates a key (what does it open? Please donâ€™t ask me, I donâ€™t know). Next you need to write the following commands:
Type your passphrase. You will notice the appearance of another file in the repo folder: Release.gpg. This time, you are officially done. All that you must do at this time is upload all your newly made files onto the corresponding folders on your server. At this stage your root directory should have the following structure (note that the cgi-bin folder and index.html file are often present when you set up your server account, do not delete or modify them):
Now the moment you have been waiting forâ€¦ Open Cydia, go to Manage, open Sources, press on Edit, then Add, and enter [repo.domainname]. If all has been properly installed, Cydia will star downloading your package Repo-Icon and make it available in your repo. Give yourself a good pat on the backâ€¦ You did it! If you open the Repo-Icon package page now, a large chunk of it will be missing since you havenâ€™t yet made a depiction page. No worries though, I will now show you how to make them.
Step 5 - Creating Your Depiction!
A depiction refers to the segment of the package page which can contain a banner, description tab, download counter tab, link to screenshots, and link to a URL. Cydia also adds a version tab and Filesystem contents tab (which is the exact â€œpackage treeâ€ structure).
First make a banner image. It needs to be a 300px-wide PNG file. In order for it to look well aligned, add a transparent zone with a height of 17px above your image. Save it as banner.png and place it within the images folder (inside the depictions folder).
Next you will need to make a depiction .php file for each package in your repo. In order to make such a file you first need to decide whether or not you want a link to screenshots to be displayed. If not, use xCode to open _Depiction.php from the _extras_ folder. If you do want a link to screenshots, open _Depiction_SS.php instead.
For now, modify the entries that are highlighted:
(1) Description of App (the easiest way to do this is to copy and paste the Description line from the control file),
(2) change [NameOfPackage].deb to the name of the .deb file associated with this depiction,
(3) change [NameOfPackage].htm to the same as (2) but with .htm extension (notice that this line will be absent in the _Depiction.php file as there will not be any link to screenshots displayed), and
(4) change [yourwebsiteURL] to a link to your website if you have one. Save the file as [NameOfPackage].php and place it inside the depictions folder. Make sure the name of the .php file corresponds exactly to the one in the Depiction line of the control file (for example Repo-Icon.php).
If you have chosen to link your depiction to screenshots (using _Depiction_SS.php as a template), then place your .png images inside the screenshots folder which is within the depictions folder. I recommend a width of 300px (and height of 450px if you want to preserve the iPhone screen proportions) for the images. Save them as [NameOfPackage]1.png, [NameOfPackage]2.png, etc. Then use Xcode to open _Screenshots.htm from your _extras_ folder.
Modify the entries that are highlighted:
(1) App Name (I recommend to make it the same as in the Name line in the control file), and
(2) change [NameOfPackage]1.png, [NameOfPackage]2.png, etc to the names of the screenshot image files. If there are less or more than 3 screenshot images, delete or add lines, but make sure that the last line finishes with a </div> instead of <br>. Save the file as [NameOfPackage].htm and place it inside the screenshots folder (within the depictions folder). Make sure the name of the .htm file corresponds exactly to the one modified in
(3) in the _Depiction_SS.php file as explained above (e.g. Repo-Icon.htm).
Step 6 - Setting up the Cydia Package Download Counter
One of the last thing that I want to show you is how to make your package page show an download counter. First you need to open the cPanel on your server. Find and click MySQL DATABASES. Within MySQL Databases create a new database by writing a name (e.g. thf_repodb) and pressing on CREATE DATABASE. Once you receive confirmation, press on GO BACK. Next add a new user by writing a name (e.g. thf_user), generating a password (e.g. thfpassword), and pressing on CREATE USER. Go back. Finally add your user to your database by selecting a user and a database, and pressing on ADD. Go back. Return to cPanel and find and click phpMyADMIN. Press once on your MySQL databaseâ€™s name in the menu on the left side. Now press on IMPORT in the top bar menu. Press the CHOOSE FILE button and select the createtable.sql file which is within your _extras_ folder. Once your .sql file is uploaded, use xCode or Notepad++ to open the connect.php file
Change yourusername, yourpassword, and yourdatabase to the username, password, and name of database that you just created (e.g. thf_user, thfpassword, and thf_repodb). Next, open the counter.php file, find out what is the time difference between your timezone and CST, and change â€˜xâ€™ (in both places) to that time difference (include â€˜-â€™ if negative value; e.g. San Francisco: â€¦ NOW()+INTERVAL -2 HOUR â€¦)
Now upload the modified files connect.php and counter.php as well as the htaccess file from the _extras_ folder to your root directory on your server. Once uploaded, highlight htaccess by clicking on it once, and click RENAME in the top bar menu. Change the name to .htaccess (i.e. add a â€˜.â€™ in front of the name). The file may disappear from your root directory as files whose names start with a â€˜.â€™ are hidden files (remember the .DS_Store files?)
You are now DONE! At this point you probably feel like your brain is totally overloaded and you start to wonder whether having a Cydia repository was worth all of this hassle. But do not despair. The hard part is over. From now on, all you have to do is add or update packages in your repository and I will summarise the process to you in the next step of the tutorial.
Credit: the original code for the download counter was written by damar1st. Please visit his website http://damarist.de.
Step 7 - Adding and Updating Packages in your Cydia Repository
-Make sure the folder repo is on your desktop.
Â» ADDING AND UPDATING PACKAGE IN REPOSITORY Â«
1) If updating a previously created .deb file, place it on your desktop and uncompress it by opening Terminal:
|ar -x [NameOfPackage].deb
2) Create New [NameOfPackage] folder on the desktop
3) Insert â€œpath to filesâ€ folder(s) inside the [NameOfPackage] folder
4) Create New DEBIAN folder inside the [NameOfPackage] folder
5) Use _control file (inside the _extras_ folder) as template to make a new control file, or modify the one obtained by uncompressing the .deb file. Save it inside the DEBIAN folder
6) Clean .DS_Store files from the [NameOfPackage] folder with DS_Store Cleaner
7) Open Terminal:
|dpkg -b [NameOfPackage]
8) Place [NameOfPackage].deb inside the files folder
Â» UPDATING REPOSITORY ON CYDIA Â«
9) Delete files Packages, Packages.gz, Packages.bz2, and Release.gpg
10) Open Terminal:
|dpkg-scanpackages files / > Packages
|bzip2 -fks Packages
|gzip -f Packages
|dpkg-scanpackages files / > Packages
11) Update MD5Sums in the Release file (http://www.hashemall.com, remember to select MD5 algorithm)
12) Open Terminal:
|gpg -abs -o Release.gpg Release
|passphrase = â€˜??? should be same as Mac if you listened to my adviceâ€™
13) Use the _Depiction.php (no screenshots) or _Depiction_SS.php (with screenshots) file (both inside the _extras_ folder) as template to make a new [NameOfPackage].php file. Save it inside the depictions folder
14) If you chose to add screenshots, use the _Screenshots.htm file as template to make a new [NameOfPackage].htm file. Save it inside the screenshots folder. Add screenshot image files as [NameOfPackage]1.png, [NameOfPackage]2.png, etc to the same folder
15) Upload files to the root directory on your server (make sure to tick â€˜Overwrite existing filesâ€™ before CHOOSE FILE): [NameOfPackage].deb, Packages, Packages.bz2, Packages.gz, Release, Release.gpg, [NameOfPackage].php, [NameOfPackage].htm, [NameOfPackage]1.png, [NameOfPackage]2.png, etcâ€¦
For your convenience, I have included a file copy of this summary inside the _extras_ folder (adding new deb.txt).
Sorry for less screenshots, couldnt upload!
I hope this was helpful and you now own your very own Cydia repo. Please do not hesitate to contact me with feedback, comments, bug reports, or demands for further clarifications.
Posted 27 August 2012 - 05:28 PM
Posted 28 August 2012 - 12:50 AM
Posted 28 August 2012 - 12:53 AM
It's just as hard as intels.
Posted 28 August 2012 - 12:56 AM
Posted 28 August 2012 - 01:01 AM
Ok went through it, hope its easier for you all to read.
Posted 28 August 2012 - 03:25 AM
You said it worked in lion but i jumped the gun and updated to mountain lion, so im wondering if they allow this to work still?
Posted 28 August 2012 - 04:58 PM
Posted 28 August 2012 - 05:15 PM
Posted 29 August 2012 - 02:56 AM
Yeah but the thing is, Sull, that this was the way I got used to from the beginning. I also know many other ways, just stuck to this though.
That's a weird method of checking MD5 Hash. You can simply type md5 and drag your file into terminal, press enter and your presented with your MD5 Hash. If your on Linux you would use md5sum
Posted 30 August 2012 - 09:36 AM
Posted 30 August 2012 - 10:13 AM
Already did it on AMD, snow leopard.
Mac vm can only run on intel. It's real hard for it to work on amd.
Used the hazard boot disk. Choose no bootloaders, choose 2 of those at the top, choose the middle kernal
and choose the package AMD.
Posted 30 August 2012 - 04:02 PM
Posted 30 August 2012 - 04:41 PM
Yeah not possible as far as now, but in the future, I hope that someone creates a program because I changed up my depiction, you can check it out HERE and this is complete with a border and everything! I also made a template of it so that it would take less time to make a new one!
Thanks a ton for this tutorial, even though I already setup mine . Awsome work. What I would really like is a dynamically generated depiction page based on info in the control file, do you recon that is possible?
Posted 30 August 2012 - 05:50 PM
Haha Hazard is so laggy. I hated it. Couldn't even run PwnageTool properly. Had a bunch of bugs for me. Probably because my PC doesn't have one of the motherboards that are 100% compatible.
My problem that is i cant run applications >