Compare commits

...

58 Commits

Author SHA1 Message Date
n8fr8 e822160b00 udpate gradle depend version to 0.3.4.8-2 2018-10-11 23:10:09 -04:00
n8fr8 b0e62e58cc updated torrc defaults 2018-10-11 23:09:32 -04:00
n8fr8 43b10491a1 updated bridges 2018-10-11 23:08:38 -04:00
n8fr8 c4cf800488 update build files 2018-10-11 16:51:11 -04:00
n8fr8 0417acf570 update version string to 0.3.4.8-openssl1.0.2p-1 for 2nd release of 0.3.4.8 2018-10-11 16:50:58 -04:00
n8fr8 ff7ecbdba9 update version for gradle lib 2018-10-11 09:27:52 -04:00
n8fr8 3e8e5ace65 update armeabi-v7a binary for 0.3.4.8 2018-10-07 09:40:12 -04:00
n8fr8 0fda8f7779 update x86 binary for 0.3.4.8 2018-10-07 09:35:31 -04:00
n8fr8 6548d3630b update tor binary to 0.3.4.8 w/o dirauth module 2018-10-07 08:55:14 -04:00
n8fr8 d1ee65a795 fixes #7 disable dirauth support for tor client only mode 2018-10-07 08:53:38 -04:00
n8fr8 a2fba85a5b update tor binary to 0.3.4.8 2018-10-07 08:45:09 -04:00
n8fr8 6ef0a45050 update to 0.3.4.8 2018-10-04 11:31:32 -04:00
n8fr8 b82b6a4cb1 update tor binary to tor-0.3.4.7-rc 2018-09-30 18:34:56 -04:00
n8fr8 de522e2ec8 tor-0.3.4.7-rc 2018-09-30 18:34:33 -04:00
n8fr8 0756d058f7 set to libevent 2.0.10-stable 2018-09-30 18:33:21 -04:00
n8fr8 b98cad65d4 set to master for libevent 2018-09-30 14:31:08 -04:00
n8fr8 cd678980f9 remove amazon meek bridge 2018-09-30 14:26:41 -04:00
n8fr8 8a66040c4f updated resource string to 0.3.4.8-openssl1.0.2p 2018-09-13 06:09:05 -04:00
n8fr8 75bd78b287 update gradle archive versioning 2018-09-12 17:14:07 -04:00
n8fr8 fa1ed5505d update Makefile to add specific NDK versioning for openssl 2018-09-12 17:11:31 -04:00
n8fr8 84ab10731c update tor to 0.3.4.8 2018-09-12 17:11:25 -04:00
n8fr8 63656611dc update binaries 2018-09-12 17:09:35 -04:00
n8fr8 84d7745cde update binary constants to trigger upgrade 2018-09-05 21:35:54 -04:00
n8fr8 b0e2d4e63b update library to version 34700 2018-09-05 21:34:25 -04:00
n8fr8 e97d5a1016 update binaries for tor-0.3.4.7-rc 2018-09-05 21:26:20 -04:00
n8fr8 0ba24f8ca4 update tor to tor-0.3.4.7-rc 2018-09-05 21:07:07 -04:00
n8fr8 93663355fa update to ensure compression libs are included in binary 2018-09-05 21:06:09 -04:00
n8fr8 63723e06ef update to 0.3.3.5-rc-3 2018-05-14 12:29:12 -04:00
n8fr8 ae61770960 update loader to handle zipped entries in a zip file (like tor.so in the APK) 2018-05-14 12:28:39 -04:00
n8fr8 45ecbcb298 update gradle build to 0.3.3.5-rc-2 2018-05-14 11:35:36 -04:00
n8fr8 d2342ed7ec add split APK support to the sample 2018-05-14 11:27:01 -04:00
n8fr8 549fb14077 update native loader code 2018-05-14 11:17:14 -04:00
n8fr8 5366016c86 add armeabi-v7a optimized build 2018-05-14 11:17:06 -04:00
n8fr8 de630b45cb add simple sample app 2018-05-14 10:38:29 -04:00
n8fr8 292dcda8e0 add additional ways to load native binaries from native libs 2018-05-14 10:38:10 -04:00
n8fr8 87efd233e5 update gradle version to force refetch 0.3.3.5-rc-1 2018-05-12 00:10:41 -04:00
n8fr8 ff59b5595f updating display string to 0.3.3.5-openssl1.0.2o 2018-05-12 00:05:36 -04:00
n8fr8 9e428e1e09 update archive build version to 0.3.3.5-rc 2018-05-11 23:56:50 -04:00
n8fr8 a46fd778b5 update gradle 2018-05-11 23:55:42 -04:00
n8fr8 db82e6b889 update tor binaries 2018-05-11 23:55:31 -04:00
n8fr8 7a9cbe8fc7 update gradle to 3.1.2 2018-05-11 23:54:59 -04:00
n8fr8 d364a5493c update tor to 0.3.3.5-rc 2018-05-11 23:54:37 -04:00
n8fr8 988a87c8ef upload maven build to 0.3.2.10-dev 2018-05-09 13:03:56 -04:00
n8fr8 51c7a076a5 update makefile to copy into proper native lib location 2018-05-09 12:53:26 -04:00
n8fr8 1b1f64d376 update to use faux .so shared library method for loading tor binary 2018-05-09 12:47:25 -04:00
n8fr8 9abac285db update deploy gradle for 0.3.2.10 2018-04-21 22:14:52 -04:00
n8fr8 808f9594f5 update tor x86 to 0.3.2.10 2018-04-21 22:09:25 -04:00
n8fr8 810eafd6e5 update tor 0.3.2.10 2018-04-21 22:01:26 -04:00
n8fr8 c0bca9f762 Merge branch 'master' of https://github.com/n8fr8/tor-android 2018-04-21 21:46:17 -04:00
Nathan Freitas 9897c1208e
Merge pull request #4 from Unpublished/remove_polipo
remove polipo
2018-04-20 00:20:08 -04:00
Nathan Freitas d194eb8064
Merge pull request #3 from Unpublished/a_few_updates
A few updates
2018-04-20 00:19:57 -04:00
Unpublished 97990103aa update tor to 0.3.2.10, OpenSSL to 1.0.2o and libevent to latest 2.0.* branch 2018-04-02 18:46:45 +02:00
Unpublished 8383c1abbc remove polipo 2018-03-16 17:56:33 +01:00
Unpublished d43fbf96b9 update geoip files to Tor Browser 7.5.1 2018-03-16 10:27:14 +01:00
Unpublished 99eb75aeaf update gradle to 4.5.1
includes speed and memory usage improvements
2018-03-16 10:24:18 +01:00
Unpublished 5e0169d762 remove useless stuff and update android gradle plugin to 3.0.1
put google() on top (google recommends it that way)
2018-03-16 10:24:08 +01:00
n8fr8 93f5239bea update library build to 0.3.1.9b 2018-01-03 22:55:37 -05:00
n8fr8 57ba718e75 update gradle build to 3191 0.3.1.9b
update geoip files (fixes issue with install on some devices)
ensure tor binaries are updated to 0.3.1.9
2018-01-03 22:51:22 -05:00
61 changed files with 17605 additions and 9840 deletions

4
.gitmodules vendored
View File

@ -10,10 +10,6 @@
path = external/openssl
url = https://github.com/openssl/openssl.git
ignore = dirty
[submodule "external/polipo"]
path = external/polipo
url = https://github.com/jech/polipo.git
ignore = dirty
[submodule "external/zstd"]
path = external/zstd
url = https://github.com/facebook/zstd.git

2
BUILD
View File

@ -8,8 +8,6 @@ Orbot includes, in the external directory, git repo submodules of:
- LibEvent
- JTorControl: The Tor Control Library for Java
The Orbot repo also includes the Polipo source code of a recent stable release.
Please install the following prerequisites (instructions for each follows):
ant: http://ant.apache.org/
Android Native Dev Kit or NDK (for C/C++ code):

1373
CHANGELOG

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.android.tools.build:gradle:3.2.0'
}
}
allprojects {
repositories {
jcenter()
google()
jcenter()
}
}

51
external/Makefile vendored
View File

@ -28,6 +28,7 @@ endif
# Android NDK setup
ANDROID_NDK_HOME ?= /opt/android-ndk
ANDROID_NDK ?= $(ANDROID_NDK_HOME)
NDK_PLATFORM_LEVEL ?= 16
NDK_TOOLCHAIN_VERSION=4.9
APP_ABI ?= armeabi
@ -42,6 +43,7 @@ endif
ifneq ($(filter arm64%, $(APP_ABI)),)
NDK_ABI := arm64
endif
NDK_SYSROOT=$(ANDROID_NDK_HOME)/platforms/android-$(NDK_PLATFORM_LEVEL)/arch-$(NDK_ABI)
NDK_UNAME := $(shell uname -s | tr '[A-Z]' '[a-z]')
ifneq ($(filter mips%, $(NDK_ABI)),)
@ -103,8 +105,7 @@ endif
libevent libevent-clean \
lzma lzma-clean \
zstd zstd-clean \
tor tor-clean \
polipo polipo-clean
tor tor-clean
all: assets
@ -126,10 +127,9 @@ ifneq ($(filter mips%, $(NDK_ABI)),)
OPENSSL_CONF_FLAG+=-D_MIPS_SZLONG=32 -D__MIPSEL__
endif
endif
lib/libcrypto.a:
cd openssl && \
./Configure android -DL_ENDIAN $(OPENSSL_CONF_FLAG) && \
./Configure android -D__ANDROID_API__=$(NDK_PLATFORM_LEVEL) -DL_ENDIAN $(OPENSSL_CONF_FLAG) && \
make CC="$(CC)" ANDROID_DEV=$(NDK_SYSROOT)/usr depend && \
make CC="$(CC)" ANDROID_DEV=$(NDK_SYSROOT)/usr build_libs
@ -137,7 +137,7 @@ lib/libssl.a:
cp config.sub openssl
cp config.guess openssl
cd openssl && \
./Configure android -DL_ENDIAN $(OPENSSL_CONF_FLAG) && \
./Configure android -D__ANDROID_API__=$(NDK_PLATFORM_LEVEL) -DL_ENDIAN $(OPENSSL_CONF_FLAG) && \
make CC="$(CC)" ANDROID_DEV=$(NDK_SYSROOT)/usr depend && \
make CC="$(CC)" ANDROID_DEV=$(NDK_SYSROOT)/usr build_libs
@ -255,14 +255,14 @@ tor/Makefile: tor/configure
cp config.sub tor
cp config.guess tor
cd tor && \
CC="$(CC)" AR="$(AR)" RANLIB=$(RANLIB) CFLAGS="$(CFLAGS) -D_FORTIFY_SOURCE=2 -fwrapv -fno-strict-aliasing -fno-strict-overflow" LDFLAGS="$(LDFLAGS)" \
CC="$(CC)" AR="$(AR)" RANLIB=$(RANLIB) PKG_CONFIG_PATH="$(EXTERNAL_ROOT)/lib/pkgconfig" CFLAGS="$(CFLAGS) -D_FORTIFY_SOURCE=2 -fwrapv -fno-strict-aliasing -fno-strict-overflow" LDFLAGS="$(LDFLAGS)" \
LIBS="-L$(EXTERNAL_ROOT)/lib" CFLAGS="-I$(EXTERNAL_ROOT)/include -I$(EXTERNAL_ROOT)/include/event2" \
./configure \
--host=$(HOST) \
--disable-asciidoc \
--enable-static-libevent --with-libevent-dir=$(EXTERNAL_ROOT) \
--enable-static-openssl --with-openssl-dir=$(EXTERNAL_ROOT) \
--disable-linker-hardening --disable-gcc-hardening --disable-tool-name-check --disable-systemd
--disable-linker-hardening --disable-gcc-hardening --disable-tool-name-check --disable-systemd --disable-module-dirauth
tor-build-stamp: tor/Makefile
$(MAKE) -C tor all-am
@ -281,45 +281,22 @@ tor-clean:
git reset HEAD --hard
#------------------------------------------------------------------------------#
# polipo
#create and clean assets: FYI - tor is stored as a ZIP file with an so extension
#in the libs directly, so it is handled like a shared library for local installation
polipo-build-stamp:
CC="$(CC)" CFLAGS="$(PIEFLAGS)" LDFLAGS="$(PIEFLAGS)" $(MAKE) -C polipo
touch polipo-build-stamp
polipo: polipo-build-stamp
test -d bin || mkdir bin
cp polipo/polipo bin
polipo-clean:
$(MAKE) -C polipo clean
-rm -f polipo/polipo
-rm -f bin/polipo
-rm -f polipo-build-stamp
#------------------------------------------------------------------------------#
#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 polipo
install -d ../tor-android-binary/src/main/assets/$(APP_ABI)
-$(STRIP) bin/polipo
-zip ../tor-android-binary/src/main/assets/$(APP_ABI)/polipo.mp3 bin/polipo
assets: tor
install -d ../tor-android-binary/src/main/libs/$(APP_ABI)
-$(STRIP) bin/tor
-zip ../tor-android-binary/src/main/assets/$(APP_ABI)/tor.mp3 bin/tor
-zip ../tor-android-binary/src/main/libs/$(APP_ABI)/tor.so bin/tor
assets-clean:
-rm ../tor-android-binary/src/main/assets/$(APP_ABI)/polipo.mp3
-rm ../tor-android-binary/src/main/assets/$(APP_ABI)/tor.mp3
-rm ../tor-android-binary/src/main/libs/$(APP_ABI)/tor.so
#------------------------------------------------------------------------------#
# cleanup, cleanup, put the toys away
##clean: openssl-clean libevent-clean tor-clean polipo-clean assets-clean
clean: openssl-clean libevent-clean lzma-clean zstd-clean tor-clean polipo-clean
clean: openssl-clean libevent-clean lzma-clean zstd-clean tor-clean
#------------------------------------------------------------------------------#
# debugging stuff

2
external/libevent vendored

@ -1 +1 @@
Subproject commit c51b159cff9f5e86696f5b9a4c6f517276056258
Subproject commit 90ae4c5013032158bafad41279823d90eec4d206

2
external/openssl vendored

@ -1 +1 @@
Subproject commit 081314d07705aa58912845c213a48414d8f616a9
Subproject commit e71ebf275da66dfd601c92e0e80a35114c32f6f8

1
external/polipo vendored

@ -1 +0,0 @@
Subproject commit bdbc1603d05801205dcf47898c9f07dbcfc6febf

2
external/tor vendored

@ -1 +1 @@
Subproject commit 727d3f1b5e6eeda721339151e3cd49ffa7efbb29
Subproject commit da95b91355248ad8f3a6aa6733cc6d24915f59ce

View File

@ -6,12 +6,12 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Mon Jun 20 21:44:59 EDT 2016
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
android.useDeprecatedNdk=true
aar.deployPath=/media/n8fr8/nate128/dev/repos/gpmaven

Binary file not shown.

View File

@ -1,6 +1,6 @@
#Tue Oct 31 09:37:18 EDT 2017
#Thu Oct 11 16:49:15 EDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

100
gradlew vendored
View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
##############################################################################
##
@ -6,42 +6,6 @@
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
@ -60,6 +24,46 @@ cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@ -85,7 +89,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@ -150,11 +154,19 @@ if $cygwin ; then
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

14
gradlew.bat vendored
View File

@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
@ -46,10 +46,9 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line

View File

@ -1,37 +0,0 @@
#!/bin/bash
# bash is required because we need bash's printf to guarantee a cross-platform
# timestamp format.
set -e
set -x
if [ -z $ANDROID_HOME ]; then
if [ -e ~/.android/bashrc-ant-build ]; then
. ~/.android/bashrc-ant-build
else
echo "ANDROID_HOME must be set!"
exit
fi
fi
if [ -z $ANDROID_NDK_HOME ]; then
if which ndk-build 2>&1 /dev/null; then
ANDROID_NDK_HOME=`which ndk-build | sed 's,/ndk-build,,'`
else
echo "ANDROID_NDK_HOME not set and 'ndk-build' not in PATH"
exit
fi
fi
# reset version code/name to current date
versionCodeDate=`date +%s`
versionNameDate=`date +%Y-%m-%d_%H.%M.%S`
sed -i \
-e "s,android:versionCode=\"[0-9][0-9]*\",android:versionCode=\"$versionCodeDate\"," \
-e "s,android:versionName=\"\([^\"][^\"]*\)\",android:versionName=\"\1.$versionNameDate\"," \
AndroidManifest.xml
ndk-build
make -C external
./setup-ant

View File

@ -1,103 +0,0 @@
#!/bin/bash
# bash is required because we need bash's printf to guarantee a cross-platform
# timestamp format.
set -e
set -x
# make sure we're on a signed tag that matches the version name
versionName=`sed -n 's,.*versionName="\([^"]*\)".*,\1,p' AndroidManifest.xml`
describe=`git describe`
if [ $versionName != $describe ]; then
echo "WARNING: building $describe, which is not the latest release ($versionName)"
else
# make a clearer warning above by putting this here
set +x
echo ""
echo ""
echo "Checking git tag signature for release build:"
gpg --list-key 9F0FE587374BBE81 || gpg --recv-key 9F0FE587374BBE81
gpg --list-key E9E28DEA00AA5556 || gpg --recv-key E9E28DEA00AA5556
gpg --list-key A801183E69B37AA9 || gpg --recv-key A801183E69B37AA9
git tag -v $versionName
echo ""
echo ""
set -x
fi
if [ -z $ANDROID_HOME ]; then
if [ -e ~/.android/bashrc-ant-build ]; then
. ~/.android/bashrc-ant-build
else
echo "ANDROID_HOME must be set!"
exit
fi
fi
if [ -z $ANDROID_NDK_HOME ]; then
if which ndk-build 2>&1 /dev/null; then
ANDROID_NDK_HOME=`which ndk-build | sed 's,/ndk-build,,'`
else
echo "ANDROID_NDK_HOME not set and 'ndk-build' not in PATH"
exit
fi
fi
projectroot=`pwd`
projectname=`sed -n 's,.*name="app_name">\(.*\)<.*,\1,p' app/src/main/res/values/strings.xml`
# standardize timezone to reduce build differences
export TZ=UTC
TIMESTAMP=`printf '%(%Y-%m-%d %H:%M:%S)T' \
$(git log -n1 --format=format:%at)`
git reset --hard
git clean -fdx
git submodule foreach git reset --hard
git submodule foreach git clean -fdx
git submodule sync
git submodule foreach git submodule sync
git submodule update --init --recursive
if [ -e ~/.android/ant.properties ]; then
cp ~/.android/ant.properties $projectroot/
else
echo "skipping release ant.properties"
fi
cd $projectroot/orbotservice/src/main
faketime "$TIMESTAMP" $ANDROID_NDK_HOME/ndk-build
cd $projectroot
#clean, build, clean and build!
make -C external clean
APP_ABI=armeabi faketime "$TIMESTAMP" make -C external
#make -C external clean
#APP_ABI=x86 faketime "$TIMESTAMP" make -C external
./gradlew assembleRelease
#./setup-ant
#ant release
#apk=$projectroot/bin/$projectname-v$describe.apk
apk=$projectroot/app/build/outputs/apk/app-release-unsigned.apk
# standardize timestamps in ZIP headers, requires strip-nondeterminism 0.014
if which strip-nondeterminism > /dev/null; then
strip-nondeterminism -t zip -T $(git log -n1 --format=format:%at) $apk
fi
# echo the checksum to build logs
sha256sum $apk
if which gpg > /dev/null; then
if [ -z "`gpg --list-secret-keys`" ]; then
echo "No GPG secret keys found, not signing APK"
else
gpg --armor --detach-sign $apk
fi
else
echo "gpg not found, not signing APK"
fi

View File

@ -10,3 +10,4 @@
# Project target.
target=android-16
aar.deployPath=/media/n8fr8/nate128/dev/repos/gpmaven/

1
sampletorapp/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

62
sampletorapp/build.gradle Normal file
View File

@ -0,0 +1,62 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "org.torproject.android.sample"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
splits {
// Configures multiple APKs based on ABI. This helps keep the size down, since PT binaries can be large.
abi {
// Enables building multiple APKs per ABI.
enable true
// By default all ABIs are included, so use reset() and include to specify that we only
// want APKs for x86 and x86_64.
// Resets the list of ABIs that Gradle should create APKs for to none.
reset()
// Specifies a list of ABIs that Gradle should create APKs for.
include "x86", "armeabi", "armeabi-v7a"
// Specifies that we do not want to also generate a universal APK that includes all ABIs.
universalApk true
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation project(':tor-android-binary')
}

21
sampletorapp/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@ -0,0 +1,26 @@
package org.torproject.android.sample;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("org.torproject.android.sample", appContext.getPackageName());
}
}

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.torproject.android.sample">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".sampleTorActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -0,0 +1,41 @@
package org.torproject.android.sample;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;
import org.torproject.android.binary.TorResourceInstaller;
import java.io.IOException;
import java.util.concurrent.TimeoutException;
public class sampleTorActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample_tor);
try {
boolean success = new TorResourceInstaller(this,getFilesDir()).installResources();
String message = "Tor install success? " + success;
((TextView)findViewById(R.id.lblStatus)).setText(message);
} catch (IOException e) {
e.printStackTrace();
((TextView)findViewById(R.id.lblStatus)).setText(e.getMessage());
} catch (TimeoutException e) {
e.printStackTrace();
}
}
public void doTorThings ()
{
//please see this project: https://github.com/thaliproject/Tor_Onion_Proxy_Library/
}
}

View File

@ -0,0 +1,34 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>

View File

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillColor="#26A69A"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
</vector>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".sampleTorActivity">
<TextView
android:id="@+id/lblStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>

View File

@ -0,0 +1,3 @@
<resources>
<string name="app_name">SampleTorApp</string>
</resources>

View File

@ -0,0 +1,11 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>

View File

@ -0,0 +1,17 @@
package org.torproject.android.sample;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

View File

@ -1 +1 @@
include ':tor-android-binary'
include ':tor-android-binary', ':sampletorapp'

View File

@ -1,21 +1,22 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
compileSdkVersion 27
buildToolsVersion '28.0.2'
/**
sourceSets {
main {
jni.srcDirs = []
}
}
}**/
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
versionCode 319
versionName "0.3.1.9"
targetSdkVersion 27
versionCode 34700
versionName "0.3.4.7-rc"
}
buildTypes {
@ -27,10 +28,7 @@ android {
}
dependencies {
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.jrummyapps:android-shell:1.0.1'
compile fileTree(dir: 'libs', include: ['*.jar','*.so'])
testCompile 'junit:junit:4.12'
implementation fileTree(dir: 'libs', include: ['*.so'])
}
apply plugin: 'maven'
@ -42,7 +40,7 @@ uploadArchives {
pom.project {
groupId 'org.torproject'
artifactId 'tor-android-binary'
version "0.3.1.9a"
version "0.3.4.8-2"
}
}
}

View File

@ -1,13 +0,0 @@
package org.torproject.android.service;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}

View File

@ -1,22 +1,4 @@
obfs4 154.35.22.10:15937 8FB9F4319E89E5C6223052AA525A192AFBC85D55 cert=GGGS1TX4R81m3r0HBl79wKy1OtPPNR2CZUIrHjkRg65Vc2VR8fOyo64f9kmT1UAFG7j0HQ iat-mode=0
obfs4 198.245.60.50:443 752CF7825B3B9EA6A98C83AC41F7099D67007EA5 cert=xpmQtKUqQ/6v5X7ijgYE/f03+l2/EuQ1dexjyUhh16wQlu/cpXUGalmhDIlhuiQPNEKmKw iat-mode=0
obfs4 192.99.11.54:443 7B126FAB960E5AC6A629C729434FF84FB5074EC2 cert=VW5f8+IBUWpPFxF+rsiVy2wXkyTQG7vEd+rHeN2jV5LIDNu8wMNEOqZXPwHdwMVEBdqXEw iat-mode=0
obfs4 109.105.109.165:10527 8DFCD8FB3285E855F5A55EDDA35696C743ABFC4E cert=Bvg/itxeL4TWKLP6N1MaQzSOC6tcRIBv6q57DYAZc3b2AzuM+/TfB7mqTFEfXILCjEwzVA iat-mode=1
obfs4 83.212.101.3:50002 A09D536DD1752D542E1FBB3C9CE4449D51298239 cert=lPRQ/MXdD1t5SRZ9MquYQNT9m5DV757jtdXdlePmRCudUU9CFUOX1Tm7/meFSyPOsud7Cw iat-mode=0
obfs4 109.105.109.147:13764 BBB28DF0F201E706BE564EFE690FE9577DD8386D cert=KfMQN/tNMFdda61hMgpiMI7pbwU1T+wxjTulYnfw+4sgvG0zSH7N7fwT10BI8MUdAD7iJA iat-mode=2
obfs4 154.35.22.11:16488 A832D176ECD5C7C6B58825AE22FC4C90FA249637 cert=YPbQqXPiqTUBfjGFLpm9JYEFTBvnzEJDKJxXG5Sxzrr/v2qrhGU4Jls9lHjLAhqpXaEfZw iat-mode=0
obfs4 154.35.22.12:80 00DC6C4FA49A65BD1472993CF6730D54F11E0DBB cert=N86E9hKXXXVz6G7w2z8wFfhIDztDAzZ/3poxVePHEYjbKDWzjkRDccFMAnhK75fc65pYSg iat-mode=0
obfs4 154.35.22.13:443 FE7840FE1E21FE0A0639ED176EDA00A3ECA1E34D cert=fKnzxr+m+jWXXQGCaXe4f2gGoPXMzbL+bTBbXMYXuK0tMotd+nXyS33y2mONZWU29l81CA iat-mode=0
obfs4 154.35.22.10:80 8FB9F4319E89E5C6223052AA525A192AFBC85D55 cert=GGGS1TX4R81m3r0HBl79wKy1OtPPNR2CZUIrHjkRg65Vc2VR8fOyo64f9kmT1UAFG7j0HQ iat-mode=0
obfs4 154.35.22.10:443 8FB9F4319E89E5C6223052AA525A192AFBC85D55 cert=GGGS1TX4R81m3r0HBl79wKy1OtPPNR2CZUIrHjkRg65Vc2VR8fOyo64f9kmT1UAFG7j0HQ iat-mode=0
obfs4 154.35.22.11:443 A832D176ECD5C7C6B58825AE22FC4C90FA249637 cert=YPbQqXPiqTUBfjGFLpm9JYEFTBvnzEJDKJxXG5Sxzrr/v2qrhGU4Jls9lHjLAhqpXaEfZw iat-mode=0
obfs4 154.35.22.11:80 A832D176ECD5C7C6B58825AE22FC4C90FA249637 cert=YPbQqXPiqTUBfjGFLpm9JYEFTBvnzEJDKJxXG5Sxzrr/v2qrhGU4Jls9lHjLAhqpXaEfZw iat-mode=0
obfs4 154.35.22.9:12166 C73ADBAC8ADFDBF0FC0F3F4E8091C0107D093716 cert=gEGKc5WN/bSjFa6UkG9hOcft1tuK+cV8hbZ0H6cqXiMPLqSbCh2Q3PHe5OOr6oMVORhoJA iat-mode=0
obfs4 154.35.22.9:80 C73ADBAC8ADFDBF0FC0F3F4E8091C0107D093716 cert=gEGKc5WN/bSjFa6UkG9hOcft1tuK+cV8hbZ0H6cqXiMPLqSbCh2Q3PHe5OOr6oMVORhoJA iat-mode=0
obfs4 154.35.22.9:443 C73ADBAC8ADFDBF0FC0F3F4E8091C0107D093716 cert=gEGKc5WN/bSjFa6UkG9hOcft1tuK+cV8hbZ0H6cqXiMPLqSbCh2Q3PHe5OOr6oMVORhoJA iat-mode=0
obfs4 154.35.22.12:4304 00DC6C4FA49A65BD1472993CF6730D54F11E0DBB cert=N86E9hKXXXVz6G7w2z8wFfhIDztDAzZ/3poxVePHEYjbKDWzjkRDccFMAnhK75fc65pYSg iat-mode=0
obfs4 154.35.22.13:16815 FE7840FE1E21FE0A0639ED176EDA00A3ECA1E34D cert=fKnzxr+m+jWXXQGCaXe4f2gGoPXMzbL+bTBbXMYXuK0tMotd+nXyS33y2mONZWU29l81CA iat-mode=0
obfs4 192.95.36.142:443 CDF2E852BF539B82BD10E27E9115A31734E378C2 cert=qUVQ0srL1JI/vO6V6m/24anYXiJD3QP2HgzUKQtQ7GRqqUvs7P+tG43RtAqdhLOALP7DJQ iat-mode=1
obfs4 85.17.30.79:443 FC259A04A328A07FED1413E9FC6526530D9FD87A cert=RutxZlu8BtyP+y0NX7bAVD41+J/qXNhHUrKjFkRSdiBAhIHIQLhKQ2HxESAKZprn/lR3KA iat-mode=0
meek_lite 0.0.2.0:1 B9E7141C594AF25699E0079C1F0146F409495296 url=https://d2cly7j4zqgua7.cloudfront.net/ front=a0.awsstatic.com
obfs4 78.215.187.186:45675 AE907EE5FAA5D0D27E0C83EFA6ADF8E79FCC0FF1 cert=/TRjMo+RinKaixARMjMtZZBhystaBe+aDaapPrbiITFtWx3M/AJcvpjHjO54tJqLd1+IWQ iat-mode=0
obfs4 107.160.7.24:443 7A0904F6D182B81BEFE0DEDAFEC974494672627B cert=a5/IlZMnDvb8d92LTHMfsBIgL7QlDLPiXiLwe85uedC80mGD0QerygzmsWnMEdwG9ER9Eg iat-mode=0
obfs4 79.136.160.201:46501 66AC975BF7CB429D057AE07FC0312C57D61BAEC1 cert=dCtn9Ya8z+R8YQikdWgC3XTAt58z5Apnm95QHrJwnhFSdnphPPEz+NMm6OawWc2srKLjJg iat-mode=0
meek_lite 0.0.2.0:2 97700DFE9F483596DDA6264C4D7DF7641E1E39CE url=https://meek.azureedge.net/ front=ajax.aspnetcdn.com

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +0,0 @@
proxyAddress = "127.0.0.1"
proxyPort = 8118
allowedClients = 127.0.0.1
allowedPorts = 1-65535
proxyName = "127.0.0.1"
cacheIsShared = false
socksParentProxy = "127.0.0.1:9050"
socksProxyType = socks5
diskCacheRoot = ""
localDocumentRoot = ""
disableLocalInterface = true
disableConfiguration = true
dnsUseGethostbyname = yes
disableVia = true
censoredHeaders = from,accept-language,x-pad,link
censorReferer = maybe
maxConnectionAge = 5m
maxConnectionRequests = 120
serverMaxSlots = 8
serverSlots = 2
tunnelAllowedPorts = 1-65535
chunkHighMark = 512000
objectHighMark = 128

View File

@ -1,8 +1,8 @@
RunAsDaemon 1
AvoidDiskWrites 1
AvoidDiskWrites 0
ControlPort auto
SOCKSPort 0
DNSPort 0
TransPort 0
CookieAuthentication 1
DisableNetwork 1
DisableNetwork 1

View File

@ -0,0 +1,122 @@
package org.torproject.android.binary;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.os.Build;
import android.util.Log;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
public class NativeLoader {
private final static String LIB_NAME = "tor";
private final static String LIB_SO_NAME = "tor.so";
private final static String TAG = "TorNativeLoader";
private static boolean loadFromZip(Context context, File destLocalFile, String folder) {
ZipFile zipFile = null;
ZipInputStream stream = null;
try {
zipFile = new ZipFile(context.getApplicationInfo().sourceDir);
ZipEntry entry = zipFile.getEntry("lib/" + folder + "/" + LIB_SO_NAME);
if (entry == null) {
throw new Exception("Unable to find file in apk:" + "lib/" + folder + "/" + LIB_NAME);
}
//how we wrap this in another stream because the native .so is zipped itself
stream = new ZipInputStream(zipFile.getInputStream(entry));
ZipEntry ze = stream.getNextEntry();
OutputStream out = new FileOutputStream(destLocalFile);
byte[] buf = new byte[4096];
int len;
while ((len = stream.read(buf)) > 0) {
Thread.yield();
out.write(buf, 0, len);
}
out.close();
if (Build.VERSION.SDK_INT >= 9) {
destLocalFile.setReadable(true, false);
destLocalFile.setExecutable(true, false);
destLocalFile.setWritable(true);
}
return true;
} catch (Exception e) {
Log.e(TAG, e.getMessage());
} finally {
if (stream != null) {
try {
stream.close();
} catch (Exception e) {
Log.e(TAG, e.getMessage());
}
}
if (zipFile != null) {
try {
zipFile.close();
} catch (Exception e) {
Log.e(TAG, e.getMessage());
}
}
}
return false;
}
public static synchronized boolean initNativeLibs(Context context, File destLocalFile) {
try {
String folder = null;
try {
if (Build.CPU_ABI.equalsIgnoreCase("armeabi-v7a")) {
folder = "armeabi-v7a";
}
else if (Build.CPU_ABI.equalsIgnoreCase("armeabi")) {
folder = "armeabi";
} else if (Build.CPU_ABI.equalsIgnoreCase("x86")) {
folder = "x86";
} else if (Build.CPU_ABI.equalsIgnoreCase("mips")) {
folder = "mips";
} else {
folder = "armeabi";
//FileLog.e("tmessages", "Unsupported arch: " + Build.CPU_ABI);
}
} catch (Exception e) {
// FileLog.e("tmessages", e);
Log.e(TAG, e.getMessage(),e);
folder = "armeabi";
}
String javaArch = System.getProperty("os.arch");
if (javaArch != null && javaArch.contains("686")) {
folder = "x86";
}
if (loadFromZip(context, destLocalFile, folder)) {
return true;
}
} catch (Throwable e) {
Log.e(TAG, e.getMessage(),e);
}
return false;
}
}

View File

@ -3,21 +3,20 @@
package org.torproject.android.binary;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.StringBufferInputStream;
import java.util.concurrent.TimeoutException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.os.Build;
import android.util.Log;
@ -35,7 +34,7 @@ public class TorResourceInstaller implements TorServiceConstants {
this.context = context;
}
public void deleteDirectory(File file) {
private void deleteDirectory(File file) {
if( file.exists() ) {
if (file.isDirectory()) {
File[] files = file.listFiles();
@ -52,50 +51,56 @@ public class TorResourceInstaller implements TorServiceConstants {
file.delete();
}
}
private final static String MP3_EXT = ".mp3";
//
/*
* Extract the Tor resources from the APK file using ZIP
*/
public boolean installResources () throws IOException, TimeoutException
{
InputStream is;
File outFile;
String cpuPath = "armeabi";
if (Build.CPU_ABI.contains("x86"))
cpuPath = "x86";
File fileTorLocalFile = new File(installFolder, TOR_ASSET_KEY);
deleteDirectory(installFolder);
installFolder.mkdirs();
is = context.getAssets().open(COMMON_ASSET_KEY + TORRC_ASSET_KEY);
outFile = new File(installFolder, TORRC_ASSET_KEY);
streamToFile(is,outFile, false, false);
is = context.getAssets().open(COMMON_ASSET_KEY + POLIPOCONFIG_ASSET_KEY);
outFile = new File(installFolder, POLIPOCONFIG_ASSET_KEY);
streamToFile(is,outFile, false, false);
is = context.getAssets().open(cpuPath + '/' + TOR_ASSET_KEY + MP3_EXT);
outFile = new File(installFolder, TOR_ASSET_KEY);
streamToFile(is,outFile, false, true);
setExecutable(outFile);
is = context.getAssets().open(cpuPath + '/' + POLIPO_ASSET_KEY + MP3_EXT);
outFile = new File(installFolder, POLIPO_ASSET_KEY);
streamToFile(is,outFile, false, true);
setExecutable(outFile);
installGeoIP();
return true;
assetToFile(COMMON_ASSET_KEY + TORRC_ASSET_KEY, TORRC_ASSET_KEY, false, false);
File fileNativeDir = new File(getNativeLibraryDir(context));
Log.d(TAG,"listing native files");
listf(fileNativeDir.getAbsolutePath());
File fileNativeBin = new File(getNativeLibraryDir(context),TOR_ASSET_KEY + ".so");
if (!fileNativeBin.exists())
{
if (getNativeLibraryDir(context).endsWith("arm")) {
fileNativeBin = new File(getNativeLibraryDir(context)+"eabi", TOR_ASSET_KEY + ".so");
}
}
if (fileNativeBin.exists()) {
InputStream is = new FileInputStream(fileNativeBin);
streamToFile(is, fileTorLocalFile, false, true);
setExecutable(fileTorLocalFile);
return fileTorLocalFile.exists() && fileTorLocalFile.canExecute();
}
else
{
//let's try another approach
return NativeLoader.initNativeLibs(context,fileTorLocalFile);
}
}
// Return Full path to the directory where native JNI libraries are stored.
private static String getNativeLibraryDir(Context context) {
ApplicationInfo appInfo = context.getApplicationInfo();
return appInfo.nativeLibraryDir;
}
public boolean updateTorConfigCustom (File fileTorRcCustom, String extraLines) throws IOException, FileNotFoundException, TimeoutException
{
if (fileTorRcCustom.exists())
@ -113,64 +118,38 @@ public class TorResourceInstaller implements TorServiceConstants {
return true;
}
public boolean updatePolipoConfig (File filePolipo, String extraLines) throws IOException, FileNotFoundException, TimeoutException
{
InputStream is;
is = context.getAssets().open(COMMON_ASSET_KEY + POLIPOCONFIG_ASSET_KEY);
streamToFile(is,filePolipo, false, false);
if (extraLines != null && extraLines.length() > 0)
{
StringBufferInputStream sbis = new StringBufferInputStream('\n' + extraLines + '\n');
streamToFile(sbis,filePolipo,true,false);
}
return true;
}
public boolean installPolipoConf () throws IOException, FileNotFoundException, TimeoutException
{
InputStream is;
File outFile;
is = context.getAssets().open(COMMON_ASSET_KEY + POLIPOCONFIG_ASSET_KEY);
outFile = new File(installFolder, POLIPOCONFIG_ASSET_KEY);
streamToFile(is,outFile, false, false);
return true;
}
/*
* Extract the Tor binary from the APK file using ZIP
*/
private boolean installGeoIP () throws IOException
{
InputStream is;
File outFile;
outFile = new File(installFolder, GEOIP_ASSET_KEY);
is = context.getAssets().open(COMMON_ASSET_KEY + GEOIP_ASSET_KEY);
streamToFile(is, outFile, false, false);
is = context.getAssets().open(COMMON_ASSET_KEY + GEOIP6_ASSET_KEY);
outFile = new File(installFolder, GEOIP6_ASSET_KEY);
streamToFile(is, outFile, false, false);
assetToFile(COMMON_ASSET_KEY + GEOIP_ASSET_KEY, GEOIP_ASSET_KEY, false, false);
assetToFile(COMMON_ASSET_KEY + GEOIP6_ASSET_KEY, GEOIP6_ASSET_KEY, false, false);
return true;
}
/*
* Reads file from assetPath/assetKey writes it to the install folder
*/
private void assetToFile(String assetPath, String assetKey, boolean isZipped, boolean isExecutable) throws IOException {
InputStream is = context.getAssets().open(assetPath);
File outFile = new File(installFolder, assetKey);
streamToFile(is, outFile, false, isZipped);
if (isExecutable) {
setExecutable(outFile);
}
}
/*
* Write the inputstream contents to the file
*/
public static boolean streamToFile(InputStream stm, File outFile, boolean append, boolean zip) throws IOException
private static boolean streamToFile(InputStream stm, File outFile, boolean append, boolean zip) throws IOException
{
byte[] buffer = new byte[FILE_WRITE_BUFFER_SIZE];
@ -215,4 +194,22 @@ public class TorResourceInstaller implements TorServiceConstants {
fileBin.setWritable(true, true);
}
private static File[] listf(String directoryName) {
// .............list file
File directory = new File(directoryName);
// get all the files from a directory
File[] fList = directory.listFiles();
for (File file : fList) {
if (file.isFile()) {
Log.d(TAG,file.getAbsolutePath());
} else if (file.isDirectory()) {
listf(file.getAbsolutePath());
}
}
return fList;
}
}

View File

@ -14,19 +14,12 @@ public interface TorServiceConstants {
String COMMON_ASSET_KEY = "common/";
//privoxy
String POLIPO_ASSET_KEY = "polipo";
//privoxy.config
String POLIPOCONFIG_ASSET_KEY = "torpolipo.conf";
//geoip data file asset key
String GEOIP_ASSET_KEY = "geoip";
String GEOIP6_ASSET_KEY = "geoip6";
int FILE_WRITE_BUFFER_SIZE = 1024;
String BINARY_TOR_VERSION = "0.3.1.9-openssl1.0.2k";
String BINARY_TOR_VERSION = "0.3.4.8-openssl1.0.2p-1";
}

View File

@ -0,0 +1 @@
libs

Binary file not shown.

Binary file not shown.

Binary file not shown.