├── resources └── base.apk ├── whatever.keystore ├── package.json ├── index.sh ├── LICENSE └── README.md /resources/base.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/node-on-mobile/androidify/HEAD/resources/base.apk -------------------------------------------------------------------------------- /whatever.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/node-on-mobile/androidify/HEAD/whatever.keystore -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "androidify", 3 | "description": "convert html/javascript files into an android app", 4 | "version": "1.0.0", 5 | "homepage": "https://github.com/dominictarr/androidify", 6 | "repository": { 7 | "type": "git", 8 | "url": "git://github.com/dominictarr/androidify.git" 9 | }, 10 | "bin": "./index.sh", 11 | "scripts": { 12 | "test": "set -e; for t in test/*.js; do node $t; done" 13 | }, 14 | "author": "'Dominic Tarr' (http://dominictarr.com)", 15 | "license": "MIT" 16 | } 17 | 18 | -------------------------------------------------------------------------------- /index.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -e 4 | 5 | SRC_DIR=$(dirname $(readlink -e $BASH_SOURCE)) 6 | 7 | echo $SRC_DIR 8 | 9 | APP_DIR=$PWD 10 | 11 | TMP_DIR=/tmp/`date +%s`/app 12 | 13 | #echo $SRC_DIR $APP_DIR $TMP_DIR 14 | 15 | mkdir -p $TMP_DIR 16 | 17 | cd $TMP_DIR 18 | 19 | echo $TMP_DIR 20 | 21 | unzip $SRC_DIR/resources/base.apk 22 | 23 | # clear old app html data 24 | rm -rf assets/www/* 25 | # clear old certs 26 | rm META-INF/*.RSA 27 | rm META-INF/*.SF 28 | 29 | echo cp -R $APP_DIR/ ./assets/www/ 30 | 31 | cp -R $APP_DIR/* ./assets/www/ 32 | zip -r app.apk . 33 | echo $TMP_DIR/app.apk 34 | 35 | ls $TMP_DIR 36 | 37 | #ls $SRC_DIR 38 | 39 | #cd $SRC_DIR 40 | jarsigner -verbose -keystore $SRC_DIR/whatever.keystore app.apk -storepass whatever whatever 41 | 42 | cp app.apk $APP_DIR 43 | 44 | echo created app.apk 45 | echo run: adb install app.apk 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 'Dominic Tarr' 2 | 3 | Permission is hereby granted, free of charge, 4 | to any person obtaining a copy of this software and 5 | associated documentation files (the "Software"), to 6 | deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, 8 | merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom 10 | the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 20 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # androidify 2 | 3 | android dev the simple way. take a set of html files, 4 | and turn them into an apk with one command. Proof of Concept. 5 | 6 | ## motivation 7 | 8 | dabbling occasionally in android dev... is a massive pain in the butt! 9 | why can't it just be easy? why do I have to install massive SDKs 10 | and all that crap? Since I only want to build my app with 11 | web tech, why isn't it as easy as creating a web site? 12 | 13 | write some HTML and javascript, then hit deploy? 14 | 15 | Then I had an idea: instead of recompiling the stupid java app 16 | from scratch every time (and requiring the enormous android sdk) 17 | just use a prebuilt apk, replace the text files, repack and resign. 18 | 19 | Turns out, this was surprisingly easy. 20 | 21 | ## installation 22 | 23 | `npm install androidify -g` 24 | 25 | Almost, you'll also need to have java, to get the `jarsigner` 26 | command, and `adb` command to deploy your app. 27 | 28 | * ubuntu/debian: `sudo apt-get install default-jre android-tools-adb` 29 | * archlinux: `sudo pacman -S jre8-openjdk-headless android-tools` 30 | * osx: `brew cask install java android-platform-tools` 31 | 32 | and put your phone into developer mode (depends on your phone) 33 | 34 | ## usage 35 | 36 | ``` 37 | mkdir hello 38 | echo '

HELLO

' > index.html 39 | androidify #will output app.apk 40 | adb install app.apk # will send it to your device. 41 | ``` 42 | 43 | A new app called "Hello World" will appear. 44 | 45 | I havn't figured out how to change the name yet. 46 | So, it's called "Hello World" no matter what. 47 | 48 | ## signing 49 | 50 | The apps are selfsigned, which is basically meaningless, 51 | so I just checked the key it in. My phone doesn't complain 52 | about this, maybe because it's in developer mode? 53 | 54 | ## thanks 55 | 56 | This is made an old `hello world.apk` i found at 57 | 58 | [simplificator/phonegap-helloworld](https://github.com/simplificator/phonegap-helloworld/) 59 | 60 | ## License 61 | 62 | MIT 63 | 64 | --------------------------------------------------------------------------------