Skip to content

Instantly share code, notes, and snippets.

@shakalaca
Created March 3, 2015 14:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shakalaca/8c4c414df0afa4c69b8f to your computer and use it in GitHub Desktop.
Save shakalaca/8c4c414df0afa4c69b8f to your computer and use it in GitHub Desktop.
Build applypatch
#!/bin/sh
# if you do not want to fetch source again ..
DO_NOT_FETCH=1
cd src
if [ -z "$DO_NOT_FETCH" ]; then
BRANCH=android-4.4.4_r2
#BRANCH=android-4.3_r3
git clone https://android.googlesource.com/platform/system/core
cd core; git checkout -b $BRANCH $BRANCH; cd ..
git clone https://android.googlesource.com/platform/external/bzip2
cd bzip2; git checkout -b $BRANCH $BRANCH; cd ..
git clone https://android.googlesource.com/platform/external/zlib
cd zlib; git checkout -b $BRANCH $BRANCH; cd ..
git clone https://android.googlesource.com/platform/bootable/recovery
cd recovery; git checkout -b $BRANCH $BRANCH; cd ..
fi
cd zlib/src
gcc -O3 -DUSE_MMAP -I.. \
-c adler32.c compress.c crc32.c deflate.c gzclose.c gzlib.c gzread.c \
gzwrite.c infback.c inflate.c inftrees.c inffast.c trees.c uncompr.c \
zutil.c
ar rcs libz.a *.o
cd ../..
cd bzip2
gcc -O3 -DUSE_MMAP \
-c blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c
ar rcs libbz.a *.o
cd ..
cd core/libmincrypt
gcc -c rsa.c sha.c sha256.c -I ../include
ar rcs libmincrypt.a *.o
cd ../..
cd recovery/applypatch
gcc -I ../../core/include -I .. \
-o applypatch \
../minelf/Retouch.c main.c applypatch.c bsdiff.c freecache.c imgpatch.c utils.c bspatch.c \
../../core/libmincrypt/libmincrypt.a \
../../zlib/src/libz.a \
../../bzip2/libbz.a
cd ../..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment