- Operating system Ubuntu 14.04 or above is preferred
- Android SDK for linux
- Apache and PHP installed
- SendGrid PHP library configured.
- Python 2.7 or 3.4 installed
- Python-Firebase interface
- Recommended: A server with 2GB RAM, 4 Core CPU and 40GB of storage space is recommended
- index.html A html file which can server as the landing page for your server.
- runPy.php A php script that will launch python script by taking input from index.html.
- appgenserver.py A python script containg commands to compile and generate the app
- clone.sh A bash script used for cloning the source code for android app onto the server.
- buildApk.sh A bash script used for initiating the app's build and signing it once the app has been generated.
- email.php A php script used to send the email containing the generated app as an attachment.
- upload.php A php script that will upload the json zip that is chosen by the user into a unique folder based on his timestamp.
api.php A php script that serves as an API and handles incoming requests to the server. - copyapk.sh A bash script that will copy the generated and signed apk to the release folder in
public-html
of the server.
- Navigate to server's
/var/www/
and install the Android SDK here. - You can do that by following this thread on stackoverflow.
- Edit the .bashrc file located in /root to reference to the SDK you have just installed
To do this, type in nano /root/.bashrc
and press enter.
Navigae to the bottom of the file that opens and add following code there
export ANDROID_HOME=/var/www/android-sdk-linux
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
- Download the template app icon that is to be used during compilation if user hasn't provided us with any logo.
sudo apt-get install wget
wget image_link_here
- Move all the files mentioned in the
scripts
folder (ExceptrunPy.php
,upload.php
andindex.html
) into/root/scripts
. - Move
runPy.php
,upload.php
, andindex.html
to/var/www/html
- Install and setup JAVA on your machine.
- Next, install PHP.This can be done by simply writing
sudo apt-get install php
in your terminal.
Now modify the maximum upload limit of php to atleast500MB
. (Default is 2MB) - Mdify your sudoers list to allow www-data to run the runPy.php script as root You can do this by typing the following command
sudo visudo
and hitting enter
Next scroll to the bottom of the file and addwww-data ALL = NOPASSWD: /var/www/html/runPy.php
- Create a firebase account and add your API key to index.html
Navigate to your Account and then create a new project (Name it whatever you want)
Open this newly created project and click the Pink colored button saying "Add Firebase to your web app"
Copy the code listed there and paste it to index.html Also add your server's IP address to trusted sources in the Firebase console by clicking on Add Domain - Create another folder in your public-html named
api
and move contents of the folderapi
here. - The sender's address, message title and the body of email is defined in
conig.json
insideapk-generator/scripts
. Changing this will affect the email that is sent.
Term | Meaning |
---|---|
Build Server | Backend which generates the app when your details are submitted on the app-generator website |
Script | Executable files containing code which help in compiling the app |
Root User | User who is currently accessing the build server directly |
www-data | Public user who accesses the server via the webpage |
Terminal | Tool for accessing the computer remotely |
Sendgrid | Tool used for sending the email from terminal to the user |
var/www | Your server's public directory (Anyone can read the stuff placed here) |
Firebase | An online data storage service used for storing the data input by the user and later retrieving it at the server |