Permalink
Browse files

Updates apps, add SHA512 hashes for verification

Signed-off-by: James Christopher Adduono <jc@adduono.com>
  • Loading branch information...
jcadduono committed Feb 21, 2017
1 parent edb8f1a commit dce4364a3f94f52688c21c410fdd743b90c6ad12
Showing with 27 additions and 12 deletions.
  1. +27 −12 nethunter-installer/build.py
@@ -48,7 +48,7 @@ def download(url, file_name, verify_sha):

download_ok = False

if u.headers['Content-Length']:
if u.headers.get('Content-Length'):
file_size = int(u.headers['Content-Length'])
print('Downloading: %s (%s bytes)' % (os.path.basename(file_name), file_size))
else:
@@ -95,6 +95,8 @@ def download(url, file_name, verify_sha):
else:
download_ok = False
print('Hash mismatch!')
else:
print('Warning: No SHA512 hash specified for verification!')

if download_ok:
print('Download OK: ' + file_name)
@@ -128,23 +130,34 @@ def getdlpage(url):
if beta:
surl = getdlpage('https://download.chainfire.eu/supersu-beta')
else:
surl = getdlpage('https://download.chainfire.eu/1016/SuperSU/UPDATE-SuperSU-v2.79-20161211114519.zip')
surl = getdlpage('https://download.chainfire.eu/1021/SuperSU/SR3-SuperSU-v2.79-SR3-20170114223742.zip')

if surl:
download(surl + '?retrieve_file=1', suzip, False)
if beta:
download(surl + '?retrieve_file=1', suzip, False)
else:
download(surl + '?retrieve_file=1', suzip, '8d6b74477e66c548a0492dd6aa75b14e3eb682e26d3b14992bb163fc5c748b9348e8489aaa8da40821bd5849d1de186bdb563b8f9d43cb1fd5fed7e30c09d78b')
else:
abort('Could not retrieve download URL for SuperSU')

def allapps(forcedown):
apps = {
'Hackerskeyboard':'https://f-droid.org/repo/org.pocketworkstation.pckeyboard_1039003.apk',
'Drivedroid':'http://softwarebakery.com/apps/drivedroid/files/drivedroid-free-0.10.33.apk',
'OpenVPN':'https://f-droid.org/repo/de.blinkt.openvpn_144.apk',
'USBKeyboard':'https://github.com/pelya/android-keyboard-gadget/raw/master/USB-Keyboard.apk',
'RFAnalyzer':'https://github.com/demantz/RFAnalyzer/raw/master/RFAnalyzer.apk',
'Shodan':'https://github.com/PaulSec/Shodan.io-mobile-app/raw/master/io.shodan.app.apk',
'RouterKeygen':'https://github.com/routerkeygen/routerkeygenAndroid/releases/download/v3.15.0/routerkeygen-3-15-0.apk',
'cSploit':'https://github.com/cSploit/android/releases/download/v1.6.6-rc.2/cSploit-release.apk'
'Hackerskeyboard':
['https://f-droid.org/repo/org.pocketworkstation.pckeyboard_1039003.apk', '8c861c7540e6eeb006070d0f2d80134e75637066591d705b987e164c3fe87521ed694ac844c945eb74449aff8723ff039f793b2e3743aac73865f74bb248edf5'],
'Drivedroid':
['https://softwarebakery.com/apps/drivedroid/files/drivedroid-free-0.10.39.apk', 'f9db206642e783c478b9ba7a0fbee8a32b78cc6f919eb7a4fdf5e20dcc473e138917d043d3d17b15bd4e6b1fd202f422524085305b3658bd95903a346e8d1abc'],
'OpenVPN':
['https://f-droid.org/repo/de.blinkt.openvpn_145.apk', 'd7aba2038ce561c03e7763a71467d1423d0aea2747461651707e621312ae02538787b14eef669bf0100b2a7cb34361fbb2172f221db435126b13a5913dfc3907'],
'USBKeyboard': # Feb 3, 2015
['https://github.com/pelya/android-keyboard-gadget/raw/7ea69c684aa1/USB-Keyboard.apk', '18bced7b339a67c48fe31698cb54063bce8f3dd9f7d7f23d9e5c619697e8da5ab08312cf9a2fa0e3f445a584485db23d1e4c27e3ffc1448551bbaf486ccb11e9'],
'RFAnalyzer':
['https://github.com/demantz/RFAnalyzer/raw/version_1_13/RFAnalyzer.apk', '7793438b6fbe7288a0ca86de900f5f4e607168de8c97229d08d901c2424b0192bf9dc894f66439f59510c10fa26a26319a1b0d8ea276f6af927cebf677138230'],
'Shodan':
['https://github.com/PaulSec/Shodan.io-mobile-app/raw/v0.0.3-new/io.shodan.app.apk', 'a2ff39d8e7a86d8e0a14368fd278fb03212999b309bc102d39f76ff69ca2a373d3d62a95cea6dbee761ae81ff3daaf83846e49e8ccbf0760276d825493d08652'],
'RouterKeygen':
['https://github.com/routerkeygen/routerkeygenAndroid/releases/download/v3.15.0/routerkeygen-3-15-0.apk', '95fba11539597eced9f3347f627bf3b24c9abc3c7e039ae1552a9c42c8c70ce362720dc401b85b9faac080d64e67bf594625f80472a492baf676dbe93822fc9e'],
'cSploit':
['https://github.com/cSploit/android/releases/download/v1.6.6-rc.2/cSploit-release.apk', 'b841c4376836bcc9d23fbc18b40eed70e08018e8eebc6d2d0abad59da63e4b325ffe4d8a4bd36107af63ed20a59c6648d6c4bd1264044267c86693744b15fa75'],
}

app_path = os.path.join('update', 'data', 'app')
@@ -155,6 +168,8 @@ def allapps(forcedown):
for key, value in apps.iteritems():
apk_name = key + '.apk'
apk_path = os.path.join(app_path, apk_name)
apk_url = value[0]
apk_hash = value[1] if len(value) == 2 else False

# For force redownload, remove previous APK
if os.path.isfile(apk_path):
@@ -165,7 +180,7 @@ def allapps(forcedown):

# Only download apk if we don't have it already
if not os.path.isfile(apk_path):
download(value, apk_path, False)
download(apk_url, apk_path, apk_hash)

print('Finished downloading all apps')

0 comments on commit dce4364

Please sign in to comment.