Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 270 lines (214 sloc) 7.979 kb
f3b47f46 »
2012-08-25 Initial release
1 #!/bin/bash
2 # _____ ______ __ _
3 # /\ | __ \| ____| / _| |
4 # / \ | |__) | |__ ___ ___ | |_| |_
5 # / /\ \ | _ /| __| / __|/ _ \| _| __|
6 # / ____ \| | \ \| |____\__ \ (_) | | | |_
7 # /_/ \_\_| \_\______|___/\___/|_| \__|
8 # | | | |
9 # _ _ _ __ __| | __ _| |_ ___ _ __
10 # | | | | '_ \ / _` |/ _` | __/ _ \ '__|
11 # | |_| | |_) | (_| | (_| | || __/ |
12 # \__,_| .__/ \__,_|\__,_|\__\___|_|
13 # | |
14 # |_|
15 #
16 # by xanda
17 # https://github.com/xanda/AREsoft-updater
18 #
19 # version: 0.1
20 # release date: 25 August 2012
21 # changelogs:
22 # * 0.1 - 25 August 2012 - Initial release
23 #
24 # WTFPL - Do What The Fuck You Want To Public License
25 # ===================================================
26 # This program is free software. It comes without any warranty, to
27 # the extent permitted by applicable law. You can redistribute it
28 # and/or modify it under the terms of the Do What The Fuck You Want
29 # To Public License, Version 2, as published by Sam Hocevar. See
30 # http://sam.zoy.org/wtfpl/COPYING for more details.
31
32
33 #========
34 # Header
35 #========
36
37 echo ""
38 echo "AREsoft-updater v0.1 by xanda"
39 echo "https://github.com/xanda/AREsoft-updater"
40 echo ""
41 echo ""
42
43
44
45 #================
46 # Check for curl
47 #================
48
49 whichCurl=`which curl`
50
51 if [ "$whichCurl" != "/usr/bin/curl" ];
52 then
53 echo "===============ERROR================"
54 echo " ERROR! curl is not installed"
55 echo " Please install curl by typing:"
56 echo " sudo apt-get install curl"
57 echo "===============DONE=================" && exit 1
58 fi
59
60
61
62 #===================
63 # Update androguard
64 #===================
65
66 echo "===================================="
67 echo "Checking androguard for new update"
68 cd ~/tools/androguard/
69 hg pull && hg update
70 echo "===============DONE================="
71 echo ""
72
73
74
75 #=====================
76 # Update apkinspector
77 #=====================
78
79 echo "===================================="
80 echo "Checking apkinspector for new update"
81 echo "kindly ignore 'No such file or directory' warning"
82 cd ~/tools/apkinspector/
036b1f30 »
2012-09-11 apkinspector code repo now contain both git and hg
83 isGit=`ls .git | wc -l`
84 if [ "$isGit" == "0" ];
f3b47f46 »
2012-08-25 Initial release
85 then
86 echo "Migrating to the new Git repo"
87 cd ~/tools/
88 rm -rf apkinspector/
89 git clone https://code.google.com/p/apkinspector/
90 fi
91 cd ~/tools/apkinspector/
92 git pull
93 echo "===============DONE================="
94 echo ""
95
96
97
98 #=====================
99 # Update AXMLPrinter2
100 #=====================
101
102 echo "===================================="
103 echo "Checking AXMLPrinter2 for new update"
104 cd ~/tools/axmlprinter
105 md5AXMLPrinter2_local=`sha1sum AXMLPrinter2.jar | cut -d ' ' -f 1`
106 md5AXMLPrinter2_remote=`curl -s "http://code.google.com/p/android4me/downloads/detail?name=AXMLPrinter2.jar" | grep SHA1 | cut -d ' ' -f 7`
107
108 if [ "$md5AXMLPrinter2_local" != "$md5AXMLPrinter2_remote" ];
109 then
110 echo "Update found! Updating..."
111 rm AXMLPrinter2.jar
112 wget http://android4me.googlecode.com/files/AXMLPrinter2.jar
113 fi
114 echo "===============DONE================="
115 echo ""
116
117
118
119 #================
120 # Update apktool
121 #================
122
123 echo "===================================="
124 echo "Checking apktool for new update"
125 cd ~/tools/apktool
126 currentApktool=`java -jar apktool.jar | grep "Apktool v" | cut -d ' ' -f 2 | sed 's/v//g'`
127
128 newerApktool=`curl -s http://code.google.com/p/android-apktool/downloads/list | grep apktool | grep -v -E '\-install\-' | grep 'android-apktool.googlecode.com/files' | cut -d '"' -f 2 | sed 's/\/\///g' | grep -v $currentApktool`
129
130 if [ "$newerApktool" != "" ];
131 then
132 echo "Update found! Updating..."
133 rm apktool.jar
134 wget $newerApktool
135 tar xjf *.tar.bz2
136 rm *.tar.bz2
137 fi
138 echo "===============DONE================="
139 echo ""
140
141
142
143 #============
144 # Update ded
145 #============
146
147 echo "===================================="
148 echo "Checking ded for new update"
149 cd ~/tools/ded
150 latestDed=`curl -s http://siis.cse.psu.edu/ded/downloads.html | grep 'downloads/linux/ded-' | grep -v launcher | cut -d '"' -f 2 | cut -d '/' -f 3`
151
152 #get jasmin latest version
153 latestJasmin=`curl -s http://siis.cse.psu.edu/ded/downloads.html | grep 'downloads/jasminclasses-' | cut -d '"' -f 2 | cut -d '/' -f 2`
154
155 Ded=`ls $latestDed`
156 Jasmin=`ls $latestJasmin`
157
158 if [ "$Ded" != "$latestDed" ];
159 then
160 echo "Update found! Updating ded..."
161 delDED=`ls | grep ded- | grep -v ded-script`
162 rm $delDED
163 dedURLs=`curl -s http://siis.cse.psu.edu/ded/downloads.html | grep -E 'ded-|ded-launcher-' | grep -v -E 'Mac|ded-script' | cut -d '"' -f 2 | sed 's/downloads/http:\/\/siis.cse.psu.edu\/ded\/downloads/g'`
164 wget $dedURLs
165 fi
166
167 if [ "$Jasmin" != "$latestJasmin" ];
168 then
169 echo "Update found! Updating jasminclasses..."
170 rm jasminclasses-*
171 jasminURL=`curl -s http://siis.cse.psu.edu/ded/downloads.html | grep -E 'jasminclasses' | cut -d '"' -f 2 | sed 's/downloads/http:\/\/siis.cse.psu.edu\/ded\/downloads/g'`
172 wget $jasminURL
173 fi
174 echo "===============DONE================="
175 echo ""
176
177
178
179 #===============
180 # Update dex2jar
181 #===============
182
183 echo "===================================="
184 echo "Checking dex2jar for new update"
185 cd ~/tools/dex2jar/
186 latestdex2jarURL=`curl -s http://code.google.com/p/dex2jar/downloads/list | grep "dex2jar.googlecode.com" | grep -v ".zip" | cut -d '"' -f 2 | sed 's/\/\///g'`
187 latestdex2jar=`echo $latestdex2jarURL | cut -d '-' -f 2 | sed 's/.tar.gz//g'`
188 localdex2jar=`bash d2j-dex2jar.sh | grep version | cut -d ',' -f 2 | cut -d '-' -f 2`
189 if [ "$localdex2jar" != "$latestdex2jar" ];
190 then
191 echo "Update found! Updating..."
192 cd ..
193 rm -rf dex2jar
194 wget $latestdex2jarURL
195 tar xfz dex2jar*.tar.gz
196 rm dex2jar*.tar.gz
197 mv dex2jar-* dex2jar
198 fi
199 echo "===============DONE================="
200 echo ""
201
202
203
204 #==============================
205 # Update Droidbox & APIMonitor
206 #==============================
207
208 echo "===================================="
209 echo "Checking Droidbox for new update"
210 echo "Unable to detect local installed version of Droidbox and APIMonitor."
211 read -p "Update anyway? (y/n)"
212 [[ "$REPLY" == [yY] ]] && {
213 latestDroidboxURL=`curl -s https://code.google.com/p/droidbox/downloads/list | grep "droidbox.googlecode.com" | grep DroidBox | cut -d '"' -f 2 | sed 's/\/\///g' | head -1`
214 latestAPIMonitorURL=`curl -s https://code.google.com/p/droidbox/downloads/list | grep "droidbox.googlecode.com" | grep APIMonitor | cut -d '"' -f 2 | sed 's/\/\///g' | head -1`
215
216 cd ~/tools/
217 rm -rf droidbox
218
219 wget $latestDroidboxURL
220 tar xfz DroidBox*.tar.gz
221 rm DroidBox*.tar.gz
222 mv DroidBox* droidbox
223
224 wget $latestAPIMonitorURL
225 tar xfz APIMonitor*.tar.gz
226 rm APIMonitor*.tar.gz
227 mv APIMonitor* droidbox/
228 }
229 echo "===============DONE================="
230 echo ""
231
232
233
234 #==============
235 # Update smali
236 #==============
237
238 echo "===================================="
239 echo "Checking smali for new update"
240 cd ~/tools/smali
241 localsmali=`java -jar smali*.jar -v | grep smali | cut -d ' ' -f 2`
242 latestsmali=`curl -s http://code.google.com/p/smali/downloads/list | grep smali.googlecode.com | grep .jar | cut -d '"' -f 2 | head -1 | cut -d '-' -f 2 | sed 's/.jar//g'`
243 latestsmaliURL=`curl -s http://code.google.com/p/smali/downloads/list | grep smali.googlecode.com | cut -d '"' -f 2 | sed 's/\/\///g'`
244
245 if [ "$localsmali" != "$latestsmali" ];
246 then
247 echo "Update found! Updating..."
248 rm *
249 wget $latestsmaliURL
250 fi
251 echo "===============DONE================="
252 echo ""
253
254
255
256 #==============================
257 # Check PATH for platform-tools
258 #==============================
259
260 pathPlatformTools=`cat /home/android/.bashrc | grep platform-tools`
261 if [ "$pathPlatformTools" == "" ];
262 then
263 echo "===================================="
264 echo "Android SDK platform-tools is not in yout PATH"
265 echo "Patching your .batchrc ..."
266 echo "export PATH=\${PATH}:/home/android/tools/android/android-sdk-linux_x86/platform-tools" >> /home/android/.bashrc
267 echo "===============DONE================="
268 echo ""
269 fi
Something went wrong with that request. Please try again.