Here is a Step by Step Guide to Create a Safari Extension With OpenShift PaaS as Server as Backend. In Client-Server Model, Safari Extension is on Client. OpenShift PaaS is the main important thing, what it will do, depends on you. We only gave you an idea to build a sort of middleware so that your users can install on their Mac to connect with the server – that is OpenShift PaaS. This involves reverse engineering. That reverse engineering is intended for learning faster. You are not an Apple developer, your interest is around OpenShift PaaS or rather the servers. If you read too much about Apple related guides, you will frankly waste a huge time.
Table of Contents |
Difference Between Free Software Development and Warez Development
---
This is primitive form of reverse engineering. If you give me the server where latest Nginx Plus (non-Free software) is running, I can convert it to Free Software and give you a deb
installation. There is no source code – the work is from the binary files. It is not Warez development, Warez usually nulls the disturbing part but never gives the way to exactly do the same on the distributed nulled software by the end user. You can not re-null a cracked Microsoft Windows as end user unless you are the hacker. That nulled software or Warez is as bad as the original non-Free Software. This basic primitive form of reverse engineering on this guide is for faster understanding without reading anything. Apple eventually controls the development – you can install our final modified development and check the URL of us – it is not directly thecustomizewindows.com
. There is a short link against the URL for extreme level of tracking plus the extensions has ways to track the user – OS X is not a Free Software. We are doing kid’s game on the world of reverse engineering. We are only understanding the needed structure. For real reverse engineering works like making latest Nginx Plus a Free Software, we follow many precautions – using various IP, control the unknown flow of data via physical switch, router, using the standard tools etc. If a malware function remains, it can become a bomb. That is why, Free Softwares are freshly written. There is huge difference between developing Warez and Free Software. There is no meaning of running reverse engineering Nginx Plus, because corresponding Free Software actually exists, developing it is more time saving. This lecture is to circumvent the legal troubles which can be raised by the non-Free softwares. RedHat OpenShift, RedHat, Apple, New York Times are not related to these works. These are meant for educational purpose only. We do not encourage copying or distributing other’s creative works.
If you use OpenShift PaaS, instead on main web server; it can bypass the security risks including DDoS on your IaaS. A minimum experience of coding as hobbyist programmer can create a great stuff.
Create a Safari Extension : The Reverse Engineering
Unless you are professionally working, you practically need not to work from absolute zero. There are thousands of Safari Extensions on this Earth which are working nicely. Download some of your choice respecting the copyright part. Reverse Engineering will help you to do it faster than from an absolute scratch work. We will create a valid non-functioning Safari Extension named The Customize Windows.safariextz
from fully-working well known Safari Extension The New York Times.safariextz
. So, install The New York Times
Safari Extension first to understand what it does. All are located at :
1 | ~/Library/Safari/Extensions/ |
simply open Terminal or iTerm2 or right click on Finder and click Go To Folder...
and either cd
to location ~/Library/Safari/Extensions/
or go from command line.
This reverse engineering is strictly for educational purpose only. These safari extensions are of .xar
format and we can use the same commands like we do with tar
. To extract The New York Times.safariextz
, you simply need to run this kind of command :
1 | xar -xzvf 'The New York Times.safariextz' |
this is exactly like extracting latest tar ball of WordPress :
1 | tar -xzvf latest.tar.gz |
Now do a ls
. A directory will be created with the name The New York Times.safariextension
.cd
to it and do a ls
. You will find these files there :
1 2 3 | Icon-100.png Info.plist bar.html refresh.png Icon-32.png Settings.plist bar.js styles.css Icon-48.png app.js global.html t.png |
If you open and read them, you need not to have to read hundreds of documents. Info.plist
will be hugely modified. Others are for functions and decoration. For example, if you run :
1 | cat Settings.plist |
you can see the content. Simple.
Create a Safari Extension : Become a Safari Developer
Search the web with Become a Safari Developer
and you will see Apple is inviting you. Become a Safari Developer. It is Free of cost. Then go to the Safari Extension Certificate Utility on their webpage and follow the instructions to create a certificate request file using your Mac’s Keychain Access tool. Everything is written there. These are only things you have to read from their website.
Create a Safari Extension : Packaging Part
Your Safari should have a Develop option. If you click it, you will get an option menu where Show Extension Builder
is present. Click without hesitation. It will bring the Extension Builder. Very easy GUI tool. Fill up the fields up to the point you can understand. In our case, a directory was created on desktop named TCW.safariextension
. Except the Info.plist
file, copy all the files from the directory (not the extension) The New York Times.safariextension
to this directory. Now cd
to The New York Times.safariextension
directory and open Info.plist
with nano or vi. Open another window of iTerm2 or Terminal and cd to TCW.safariextension
. Change these lines :
1 2 3 4 5 6 7 8 | <key>Author</key> <string>Abhishek Ghosh</string> <key>Builder Version</key> <string>10600.5.17</string> <key>CFBundleDisplayName</key> <string>The Customize Windows</string> <key>CFBundleIdentifier</key> <string>com.yourcompany.tcw</string> |
of the Info.plist
from which you are copying (it was New York Times’ Safari Extension in our case) taking the corresponding data from your newly created Info.plist
file by Apple’s Extension Builder tool. That Info.plist
has been created in TCW.safariextension
when we worked when you followed the initial lines of this subheader – Fill up the fields up to the point you can understand.
Packaging is not for now, you have to modify a huge. Basically you are using this Safari Extension as a framework. You need not have to read how many icons of what resolution are needed like boring stuffs. You can package from extension builder tool and install to test at this step.
Create a Safari Extension : Understanding the Function of Server/ RedHat OpenShift PaaS
This is the practical work part. New York Times, on this App uses JSON for each category. They have manifest file on server located at :
1 | http://www.nytimes.com/features/extensions/safari/index.plist |
wget
it and change it. That reference is given at Info.plist
file :
1 2 3 4 | <key>Update Manifest URL</key> <string>https://thecustomizewindows.com/features/extensions/safari/index.plist</string> <key>Website</key> <string>https://thecustomizewindows.com</string> |
Obviously, we have changed it on above example but we have no index.plist
on server as it is purely an example of development, not for deployment. We will use our own methods like you might change the path. From this point the work of OpenShift PaaS starts. We wrote “https://thecustomizewindows.com/…” but you’ll use your URL of OpenShift PaaS. Extra stuffs to change are at Settings.plist
file.
You will see that on the Extension Builder tool, you are getting option for Global Page File
and other stuffs. You are using both the GUI tool and Command Line. The example application or its modified form is pretty simple. It just gives a way to learn. But you need to create the backend on OpenShift PaaS from your knowledge.