Skip to content

Commit 838cd2e

Browse files
committed
automation
1 parent e763f41 commit 838cd2e

2 files changed

Lines changed: 88 additions & 8 deletions

File tree

utility/apk_build

Lines changed: 86 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# Apktool Build Script
44
# Author: Tommy Nguyen [tommytomatoe]
5-
# Version: b-0.91
6-
# Date: July 08, 2011
5+
# Version: 1.0.3
6+
# Date: October 05, 2011
77
# Contact: tommytomatoe@gmail.com
88

99
# Setting Loop Variable
@@ -192,19 +192,101 @@ do_it_m ()
192192
cd $d
193193
for c in *.apk
194194
do
195-
mv -v $c original_apps/
195+
echo "Moving $c to original_apps"
196+
mv -f $c original_apps/
196197
done
197198
cd $d/Projects
198199
for c in `ls | grep -vE '(.apk|original|decompressed|new_apps)'`
199200
do
200-
cp -v $c/dist/*.apk ../new_apps_unsigned/
201+
echo "Moving $c to new_apps_unsigned"
202+
cp $c/dist/*.apk ../new_apps_unsigned/
201203
done
202204
if [[ "$LOG" = "true" ]] ; then
203205
echo
204206
echo "Please check build_log for apk with errors"
205207
fi
208+
echo
209+
load_dot
210+
echo
211+
echo -n "Would you like to auto-inject META-INF at this time? [Y/n] "
212+
read -s -n 1 ans
213+
case $ans in
214+
n|N) echo ; echo ; echo "Cancelling META-INF injection" ;;
215+
*) echo ; sign_it_sys;;
216+
esac
217+
echo
218+
load_dot
219+
echo
220+
echo -n "Would you like to auto-zipalign at this time? [Y/n] "
221+
read -s -n 1 ans
222+
case $ans in
223+
n|N) echo ; echo ; echo "Cancelling zipalignment" ;;
224+
*) echo ; zipo ;;
225+
esac
226+
}
227+
228+
sign_it_sys ()
229+
{ if ! [[ -s $d/new_apps_unsigned ]] ; then
230+
mkdir $d/new_apps_unsigned
231+
fi
232+
echo
233+
echo "This will auto-inject the original META-INF into the new apks"
234+
echo
235+
echo "Please place unsigned apks inside mod-here-multi/new_apps_unsigned"
236+
if ! [[ -s $d/original_META-INF ]] ; then
237+
echo "You did not extract the META-INF during the decomple process."
238+
enter
239+
exit
240+
fi
241+
echo
242+
load_dot
243+
echo
244+
if ! [[ -s $d/new_apps_Signed ]] ; then
245+
echo 'Creating new folder "new_apps_Signed"'
246+
mkdir $d/new_apps_Signed
247+
fi
248+
cd $d/new_apps_unsigned
249+
cp -f * $d/new_apps_Signed
250+
cd $d/new_apps_unsigned/
251+
for a in *.apk ; do
252+
echo
253+
echo "Preparing to auto-inject singature for $a"
254+
cd $d/original_META-INF/$a-META-INF
255+
zip $d/new_apps_Signed/$a META-INF/*
256+
echo "done with $a"
257+
done
206258
}
207259

260+
zipo ()
261+
{
262+
if [[ -s $d/temp ]] ; then
263+
echo &>/dev/null
264+
else
265+
mkdir $d/temp
266+
fi
267+
cd $d/new_apps_Signed
268+
echo
269+
echo "Preparing to zipalign `ls | grep -c .apk` apk files"
270+
echo
271+
load_dot
272+
echo
273+
for z in *.apk ; do
274+
zipalign -fv 4 $z $d/temp/$z
275+
mv -f $d/temp/$z $d/new_apps_Signed
276+
done
277+
rm -r $d/temp
278+
echo
279+
load_dot
280+
clear
281+
echo
282+
cd $d/new_apps_Signed
283+
echo "Successfully zipaligned `for F in *.apk ; do zipalign -cv 4 $F ; done | grep -c "Verification succesful"` apk files. Congrats!"
284+
echo "Failed to zipalign `for F in *.apk ; do zipalign -cv 4 $F ; done | grep -c "Verification FAILED"` apk files."
285+
echo
286+
echo "Find new apks in new_apps_Signed"
287+
}
288+
289+
208290
one_time ()
209291
{ echo
210292
echo

utility/apk_dec

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# Apktool Decode Script Linux
44
# Author: Tommy Nguyen [tommytomatoe]
5-
# Version: 1.0.1
6-
# Date: July 20, 2011
5+
# Version: 1.0.3
6+
# Date: October 05, 2011
77
# Contact: tommytomatoe@gmail.com
88

99
# Setting Loop Variable
@@ -106,7 +106,6 @@ decode ()
106106
else
107107
clear
108108
echo "Android Utility did not find a valid apk file"
109-
enter
110109
fi
111110
enter
112111
}
@@ -153,7 +152,6 @@ decode_m ()
153152
echo
154153
clear
155154
echo "Android Utility did not find a valid apk file"
156-
enter
157155
fi
158156
enter
159157
}

0 commit comments

Comments
 (0)