forked from rainux/com.google.android.inputmethod.pinyin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·38 lines (30 loc) · 855 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
package_name='Google_Pinyin_IME_v1.3.4_MOD_v3'
package_apk=$package_name.apk
rm -rf dist
# Pre-smali the sources cause we're using a newer version of smali
echo Checking whether sources has changed...
for file in $(find smali -type f)
do
if [[ $file -nt classes.dex ]]
then
rm -rf classes.dex
echo Smaling...
smali -o classes.dex smali
break
fi
done
apktool build . dist/$package_apk
echo Rebuilding apk file without compression to avoid issue on Arch Linux...
pushd dist > /dev/null
unzip -q $package_apk -d $package_name
rm -rf $package_apk
pushd $package_name > /dev/null
zip -0 -q -r ../$package_apk .
popd > /dev/null
echo Signing apk file...
signapk $package_apk
mv $package_name.signed.apk $package_apk
echo Installing apk file via adb...
adb install -r $package_apk
popd > /dev/null