From 0604eb2ba03c3f408027236e5cb42c65d7dd7ef8 Mon Sep 17 00:00:00 2001 From: n8fr8 Date: Sun, 6 May 2012 22:47:34 -0400 Subject: [PATCH] updated makefile to fix issues resources - moved jtorctrl.jar to jtorctl.jar for consistency with source library - make assets now zips up tor binary and renames to .mp3 extension to handle issues with older Android devices breaking when trying to decompress a large file. By naming mp3, there is no attempt to decompress. --- .classpath | 2 +- external/Makefile | 39 +++++++++++++++++++++++++-------------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/.classpath b/.classpath index 37d42de0..d2c46be7 100644 --- a/.classpath +++ b/.classpath @@ -3,7 +3,7 @@ - + diff --git a/external/Makefile b/external/Makefile index ff420c69..8639a08b 100644 --- a/external/Makefile +++ b/external/Makefile @@ -187,7 +187,7 @@ obfsproxy-clean: # privoxy -privoxy/Makefile: +privoxy/config.log: cd privoxy && \ autoheader cd privoxy && \ @@ -199,7 +199,7 @@ privoxy/Makefile: ./configure \ --host=arm-linux-eabi --disable-pthread -privoxy-build-stamp: privoxy/Makefile +privoxy-build-stamp: privoxy/config.log $(MAKE) -C privoxy touch privoxy-build-stamp @@ -219,34 +219,45 @@ privoxy-clean: #------------------------------------------------------------------------------# # JTorControl library -jtorctrl: +jtorctl/bin/jtorctl.jar: test -d jtorctl/bin || mkdir jtorctl/bin cd jtorctl && \ javac net/freehaven/tor/control/TorControlConnection.java -d bin cd jtorctl/bin && \ - jar cvf jtorctrl.jar * - cp jtorctl/bin/jtorctrl.jar bin + jar cvf jtorctl.jar * -jtorctrl-clean: - -rm bin/jtorctrl.jar +jtorctl-build-stamp: jtorctl/bin/jtorctl.jar + touch jtorctl-build-stamp + +jtorctl: jtorctl-build-stamp + test -d bin || mkdir bin + cp jtorctl/bin/jtorctl.jar bin + +jtorctl-clean: + -rm -rf jtorctl/bin + -rm jtorctl-build-stamp #------------------------------------------------------------------------------# -# cleanup, cleanup, put the toys away -assets: tor privoxy jtorctrl obfsproxy +#create and clean assets: FYI - tor is stored as a ZIP file with an mp3 extension +#in order to stop Android OS (older devices) from trying to compress/decompress it +#this is related to a bug in compression of assets and resources > 1MB + +assets: tor privoxy jtorctl obfsproxy install -d ../res/raw install -d ../libs - install bin/tor ../res/raw install bin/privoxy ../res/raw install bin/obfsproxy ../res/raw - install bin/jtorctrl.jar ../libs + install bin/jtorctl.jar ../libs + cd bin && \ + zip ../../res/raw/tor.mp3 tor assets-clean: - -rm ../res/raw/tor + -rm ../res/raw/tor.mp3 -rm ../res/raw/privoxy - -rm ../libs/jtorctrl.jar + -rm ../libs/jtorctl.jar -rm ../res/raw/obfsproxy #------------------------------------------------------------------------------# # cleanup, cleanup, put the toys away -clean: openssl-static-clean libevent-clean tor-clean privoxy-clean jtorctrl-clean assets-clean +clean: openssl-static-clean libevent-clean tor-clean privoxy-clean jtorctl-clean assets-clean