Skip to content

Commit e373d77

Browse files
Compress final binaries with upx ( https://github.com/upx/upx )
1 parent 9d4f336 commit e373d77

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

build_android.sh

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,24 +70,45 @@ for build_type in $APP/app/.externalNativeBuild/cmake/*; do
7070
mkdir $build_type_and_abi/built/sample_pdfs
7171
fi
7272
cp -v $BASEDIR/test/browser_tests/*.pdf $build_type_and_abi/built/sample_pdfs/
73-
FINAL_TAR=$build_type_and_abi/${build_type_string}-${abi_string}-pdf2htmlEX.tar
74-
tar -cf $FINAL_TAR --directory $build_type_and_abi built
75-
tar --list -f $FINAL_TAR
76-
echo "$FINAL_TAR is ready!"
7773
done
7874
done
7975

8076
echo ""
8177
echo ""
8278

83-
# Print a list of available .tar's, because the previous messages will be lost behind a wall of text
79+
# Pack pdf2htmlEX binaries with UPX
80+
8481
for build_type in $APP/app/.externalNativeBuild/cmake/*; do
8582
build_type_string=$(basename ${build_type})
8683
for build_type_and_abi in $build_type/*; do
8784
abi_string=$(basename ${build_type_and_abi})
85+
86+
COMPILED_BINARY=$build_type_and_abi/built/bin/pdf2htmlEX
87+
PACKED_BINARY=$build_type_and_abi/built/bin/pdf2htmlEX-compressed
88+
upx --ultra-brute --8mib-ram -o $PACKED_BINARY $COMPILED_BINARY
89+
upx -t $PACKED_BINARY
90+
8891
FINAL_TAR=$build_type_and_abi/${build_type_string}-${abi_string}-pdf2htmlEX.tar
8992
if [ -f "${FINAL_TAR}" ]; then
9093
echo "$FINAL_TAR is ready!"
9194
fi
95+
96+
ls -lha $build_type_and_abi/built/bin/pdf2htmlEX
97+
done
98+
done
99+
100+
echo ""
101+
echo ""
102+
103+
# Compress binaries and other files into .tar's
104+
for build_type in $APP/app/.externalNativeBuild/cmake/*; do
105+
build_type_string=$(basename ${build_type})
106+
for build_type_and_abi in $build_type/*; do
107+
abi_string=$(basename ${build_type_and_abi})
108+
109+
FINAL_TAR=$build_type_and_abi/${build_type_string}-${abi_string}-pdf2htmlEX.tar
110+
tar -cf $FINAL_TAR --directory $build_type_and_abi built
111+
tar --list -f $FINAL_TAR
112+
echo "$FINAL_TAR is ready!"
92113
done
93114
done

0 commit comments

Comments
 (0)