Find file
Fetching contributors…
Cannot retrieve contributors at this time
41 lines (30 sloc) 1.16 KB
config.raw_apk = 'bin/WifiLock.apk'
# vars expected from .fabric:
# keystore, keyalias, storepass (optional)
def build():
# Right now we require $apk to exist.
# TODO: Lern how to use aapt to build without Eclipse!
# determine the version number
import subprocess, re
manifest = subprocess.Popen(
["aapt", "dump", "xmltree", config.raw_apk, "AndroidManifest.xml"],
version ='^\s*A: android:versionName\([^)]+\)="([^"]+)" \(Raw: "[^"]+"\)\s*$', manifest, re.M).groups()[0]
# add version number to file name
import os
base, ext = os.path.splitext(config.raw_apk)
config.target_apk = '%s-%s%s' % (base, version, ext)
local('cp $(raw_apk) $(target_apk)')
def sign():
local('jarsigner -verbose -storepass $(storepass) -keystore $(keystore) $(target_apk) $(keyalias)')
local('jarsigner -verify $(target_apk)')
def make():
# Create a release .apk version.
# Right now "sign" already does all the work.
def deploy():