| | 01-03-2012, 05:28 AM Thread Author #1
Playbook Update Server for windows
PLAYBOOK UPDATE SERVER
by CybrMage, and others.
v0.0.1 - January 3, 2012
v0.0.2 - January 3, 2012
v0.0.3 - January 7, 2012 - *** Important *** - please read changes before using!
v0.0.4 - January 12, 2012
** Use this software **
** AT YOUR OWN RISK! **
This is a preconfigured version of MicroApache 2.0.64+PHP 5.2.15, the Apache Group
web server as packaged by MicroApache - A Portable Apache Server for Windows.
The MicroApache distribution is a Win32 dinary distribution compiled from unmodified
Apache source code distributed by the Apache Group at Welcome to The Apache Software Foundation!.
The MicroApache distribution has been updataed to support HTTPS, using precompiled
binaries distrubuted with PHP v5.2.17, as ditributed by the PHP Group at PHP: Hypertext Preprocessor. The PHP distributed binaries contain software provided by the OpenSSL project, as distributed at OpenSSL: The Open Source toolkit for SSL/TLS. OpenSSL is based on the excellent SSLeay library developed by Eric A. Young and Tim J. Hudson.
The self signed certificate used was made available by aburrobb @ crackberry forums.
Licensing information can be found at:
Apache - Licenses
PHP - PHP: License Information
OpenSSL - OpenSSL: Source, License
This preconfigured Apache package provides a installation free webserver that is
configured to mimic the functionality of the upgrade server for a Playbook tablet
The update server script, cs.php, is based on the original script supplied by cmw,
creator of the DingleBerry Playbook rooting software. The script allows the unrestricted
upgrade and downgrade of a Playbook to ANY version of the Tablet OS, as long as you have, or can locate the firmware file (the qcfm.os.***** file).
Unlike the method of renaming the qcfm.os file and pasting it into the loader cache
directory after BBDM has downloaded it, once the you have configured the server, you can upgrade or downgrade your firmware to any version using BBDM v7.x without any intervention.
The firmware version manifest and the download manifest is automatically generated the the server during the update process, you you can even update the device with a partial copy of a firmware release, as long as you have the qcfm.os file for the firmware.
How to use
1) Install the server distribution.
Unzip the archive in a directory of your choice. It will create a directory named
"Playbook_Update_Server". In that folder, you will find a go.bat to start the server and
a stop.bat to stop the server, and various other files that the server relies on for
operation. You will also find a directory called "HTTP_ROOT", that the server uses as
its document root.
2) Locate and download the firmware for the playbook.
You can find the firmware at various locations on the internet in rar or zip format.
3) Extract the firmware files to the servers document directory.
In the document root directory ("HTTP_ROOT") you will find two additional directories,
"cs" and "playbook". The "cs" directory holds the file(s) that mimic the BB update server.
The "playbook" directory holds the files for each version of the firmware that will be
available for use. Inside the "playbook" directory, there is a directory for the firmware
versions that are currently available (These directories are empty at installation time, to
allow for a small download size). Copy the firmware files from the archive that you downloaded in step #2. For example, if you download the files for Tablet OS v22.214.171.12467, yoo would copy them to the "126.96.36.19967" directory. If you manage to find (or already have) a version that does not have an existing directory, simply create a new directory using the version number, and copy the firmware files into your new directory.
4) Configure your computer to redirect BBDM to your server.
The requests that BBDM makes to obtain the firmware version manifest (the versions that you can upgrade/downgrade to) must be redirected to you machine. This can be done by editing your systems hosts file:
On all currect versions of windows, this file is located in %systemroot%/system32/drivers/etc/. On most systems, this will translate to c:\windows\system32\drivers\etc\. Using notepad (NOTE: On Windows Vista and Windows 7 systems, you must run notepad as administrator), navigate to this directory and open the "host" file, then add the line:
Then save the file. If you already have BBDM running, you must shut it down and restart it for the change to take effect.
**NOTE: You must also shut down and restart your browser for it to notice thae change to the hosts file.
5) Start the server.
In the Playbook_Update_Server directory, locate and double click on the go.bat file to start the server.
6) Run BBDM and connect your device.
Run BBDM, connect your device, and you are ready to test your update server.
7) Test your server.
To test your server, initiate an update. If you prepared a version of Tablet OS that is newer that the version you have installed on your device and your server is working properly, you will be prompted for an upgrade as soon as your device connects to BBDM. If you are not prompted to update, start an update from the device menu.
Regardless you the version of tablet os that you installed into the update server, you will get a prompt that includes a "view other versions" button. Click on this button. You will be presented with a dialog that lists all versions of tablet os that you have installed on the update server. If, in the detail box, the description begins with "(LOCAL)", then you have the update server properly configured and can now upgrade or downgrade your device from your local files. If not, recheck you hosts file, the placement of your firmware file, and that the server is running(you will get a purple feather icon in your notification tray).
If you have created a directory under "playbook" and placed files in it and it does not appear in the list presented by BBDM, that indicated that you do not have a system firmware file in that directory. The system firmware file is REQUIRED and that requirement is enforced by BBDM and Tablet OS. *** YOU MUST HAVE A QCFM.OS FILE TO DO AN UPGRADE OR DOWNGRADE ***. Beyond that requirement, you may create a "custom" firmware directory with any with the qcfm.os file and any additional signed packages that you desire, and the cs.php file will automatically add the file to the download manifest provided to BBDM.
CHANGES - v0.0.4
ADDED - support for devices in "repair" mode.
There are two different versions of the official updates.
The "upgrade" firmware consists of a single large file (200 - 400MB) and many smaller ancilliary files and will upgrade a device that is functioning normally.
The "repair" firmware consists of a single very large file (approximately 900MB) that incorporates the system firmware and all system software, and will upgrade a device that will not boot.
A "repair" firmware will not upgrade a normal device and an "upgrade" firmware will not upgrade a device in "repair" mode.
The server has been updated so that it will handle and differentiate between the two versions of the firmware files. Not that this means that if you cache both versions of the firmware, your firmware directory will contain two "qcfm" files. When scanning the directories, the server will ignore the file that is not required for the upgrade type requested by BBDM.
CHANGES - v0.0.3
Changed - This version add some additional debugging text.
Changed - Added some additional error handing to improve reliability.
ADDED - Option (enabled by default) to check with the real servers for a version update.
ADDED - Cached download of firmware files
This new feature will check the rim server for the currently available version and will offer it to you if it is not already on stored on your system.
If the version available from the real server is NOT stored on your server, it will append a "99" to the version number.
IE: you have 188.8.131.5295 and 184.108.40.20669 installed on your playbook update server and you are not currently registered for the OS2 beta. You start the update server and BBDM and start an update. The script will find that 220.127.116.1167 is currently offered by the real servers, will customize it, and you will get a message that an updated version is available, and an offer to upgrade to "991.0.8 bundle 6067 (v18.104.22.16867.Platform v22.214.171.12467)". If you select this version, it will begin to download... BUT... the download is NOT coming directly from the real servers - It is being proxied from the upgrade server... and is cached on the upgrade server for your future use.
This means that when a new version of the firmware is released, and you upgrade using the "fake" server, you will not need to copy the files from the BBDM loader cache in order to have them available for future use.
Additionally, unlike the BBDM download of a firmware version, the download proxy function will not redownload files that have adready been fully cached. If your download of the firmware fails for whatever reason, you can restart the upgrade process and only those files which have not yet been fully cached will be downloaded. The script will
automatically create the appropriate directory for the cached files in the "HTTP_ROOT/playbook" directory of the server.
NOTE: If you only wish to cache the files of a new version without upgrading your device, start an upgrade and then disconnect your device once the download process begins. The upgrade process will continue and the upgrade will fail once all the files have been downloaded and cached.
The reason for adding 990 to the version number - due to the way that BBDM requests the upgrade, the only way for BBDM to see and request a customized version of the firmware is to give the firmware bundle a unique identifier.
This feature can be disabled by editing the HTTP_ROOT/cs/cs.php file and changing
$OPTIONS["CheckForRimUpdate"] = true; to $OPTIONS["CheckForRimUpdate"] = false;
CHANGES - v0.0.2
This version also adds some debugging to the cs.php script.
To make sure that the server is functioning correctly, and is finding your firmware files, open a browser and navigate to:
This will run the server script and output exactly the steps that the script is doing and the firmware versions that it finds and will be offered during an update.
2) http://127.0.0.1/cs/cs.php?bundleUpgradeRequest=(version number)
make sure that you replace (version number) with one of the versions that is display from the previous url output...
This will run the script and output which packages it finds in the firmware directory, which file is the System firmware file, and shows the resulting package manifest (although it does display it very badly... but we are being functional not pretty)
This will version that yo are redirecting the BB server to your local server. If it is redirected properly, you will see the local servers debug output. If it displays an error (can't find page, server not responding, etc), the hosts redirection is NOT working.
Troubleshooting (If changing the HOSTS file does not work for you)
1) Remove the cs.websl.blackberry.com entry from your hosts file, restart BBDM and then make sure that BBDM will offer you the current filmware, then cancel and exit BBDM.
2) Download Fiddler2 from HERE, and install it. Fiddler2 is a web debugging proxy... (I used it to help determine what BBDM is doing)....
3) Run Fiddler2... it will change your internet settings so that all HTTP and HTTPS traffic goes through it... Once it is running, on the menu bar, click "Tools" then "Fiddler options" then "HTTPS" and make sure that "Capture HTTPS CONNECTs" and "Decrypt HTTPS traffic" are checked, then click "OK".
4) Run BBDM, and again start an upgrade. Fiddler2 should then pop up a warning about a certificate error... select continue.... BBDM should then present you with the offer to upgrade....
5) Configure Fiddler2 to redirect traffic from the BB server to the local server. In Fiddler2, click on "Tools" then "HOSTS". In the dialog that appears, click on the checkbox at the top ("Enable remapping..."), then click in the white box and enter "127.0.0.1 cs.websl.blackberry.com", then click "SAVE". Fiddler2 will now redirect the traffic to the local server.
6) Go back to BBDM and start an upgrade... You should get a messagebox with the "View other versions" button... click the button... You should be shown the list of firwares that you have on your local server.
NOTE: Fiddler2 configures your machine to use an HTTP and HTTPS proxy (which Fiddler2 provides). If this is not something that you want, you may uninstall Fiddler2, and it will restore your machine to its normal configuration. Also, if your hosts file redirection is not working properly, despite being configured correctly, then you may have a problem with your systems TCP/IP system or configuration.
Resolving issues with the Windows hosts file (Windows ignores the hosts file)
1) The file attributes for the hosts file may be incorrect.
To fix the file attributes, run a command prompt as administrator and type:
ATTRIB +S %SystemRoot%\System32\drivers\etc\hosts
2) The hosts file may have been corrupted.
Although the contents of the hosts file may look ok when viewed in notepad (or another text editor), it may have characters that are confusing the TCP/IP statck, causing it to be ignored.
To fix this, make a note of any entries that you already have in the hosts file, then from a command prompt with administrator privileges, delete the hosts file and create a new hosts file. Don't forget to re-enter any host entries that you previously had and set the file permissions (as in item 1).
3) Your system may be configured to cache its DNS entries for a very long time.
To fix this, make any changes you need to the hosts file, open a command prompt as administrator and type:
This will force windows to reload the dns information from the hosts file.
4) If your system is configured to hide the file extension for known file type, the hosts file may actually be a txt file.
To determine if this is the case, open a command prompt as administrator, then type:
If it lists the hosts file as "hosts.txt", the fix it by typing:
ren hosts.txt hosts
Firmware download locations
v126.96.36.19985 - Multiupload #1 OR Rapidshare OR Multiupload #2
v188.8.131.5267 - currently available from the RIM. Copy the files from the loader cache directory. OR Multiupload (Recovery image)
v184.108.40.20669 - http://tinyurl.com/cy364dy (link provided by aburrobb @ crackberry forums) or Multiupload.com OR Rapidshare OR Multiupload
v220.127.116.1149 - currently available from RIM. Register your device for OS2 beta, upgrade and copy the files from the loader cache directory. OR cached by the upgrade server! OR Rapidshare OR Multiupload OR 115.com