Skip to content

Commit

Permalink
merge from googlecode
Browse files Browse the repository at this point in the history
  • Loading branch information
madeye committed Jan 27, 2012
0 parents commit 3fd3cd0
Show file tree
Hide file tree
Showing 98 changed files with 12,164 additions and 0 deletions.
62 changes: 62 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.proxydroid"
android:versionCode="42"
android:versionName="2.5.0" >

<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="15" />

<uses-permission android:name="android.permission.INTERNET" >
</uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" >
</uses-permission>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" >
</uses-permission>
<uses-permission android:name="android.permission.VIBRATE" />

<application
android:icon="@drawable/icon"
android:label="@string/app_name" >
<activity
android:name="ProxyDroid"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".AppManager"
android:label="@string/app_name" />
<activity
android:name=".BypassListActivity"
android:label="@string/app_name" />
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />

<service
android:name="ProxyDroidService"
android:enabled="true" />

<receiver android:name=".ConnectivityBroadcastReceiver" >
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
</receiver>
<receiver android:name="ProxyDroidWidgetProvider" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="org.proxydroid.ProxyDroidWidgetProvider.PROXY_SWITCH_ACTION" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/proxydroid_appwidget_provider" />
</receiver>
</application>

</manifest>
6 changes: 6 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--- BUILD ---

Create "local.properties" with your android sdk configuration, like this:
sdk.dir=C:\\Program Files\\Android\\android-sdk-windows

Run ant under this directory.
Binary file added assets/cntlm
Binary file not shown.
Binary file added assets/iptables
Binary file not shown.
143 changes: 143 additions & 0 deletions assets/proxy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
#!/system/bin/sh

DIR=/data/data/org.proxydroid
type=$2
host=$3
port=$4
auth=$5
user=$6
pass=$7

PATH=$DIR:$PATH

case $1 in
start)

echo "
base {
log_debug = off;
log_info = off;
log = stderr;
daemon = on;
redirector = iptables;
}
" >$DIR/redsocks.conf

case $type in
http)
case $auth in
true)
echo "
redsocks {
local_ip = 127.0.0.1;
local_port = 8123;
ip = $host;
port = $port;
type = http-relay;
login = \"$user\";
password = \"$pass\";
}
redsocks {
local_ip = 127.0.0.1;
local_port = 8124;
ip = $host;
port = $port;
type = http-connect;
login = \"$user\";
password = \"$pass\";
}
" >>$DIR/redsocks.conf
;;
false)
echo "
redsocks {
local_ip = 127.0.0.1;
local_port = 8123;
ip = $host;
port = $port;
type = http-relay;
}
redsocks {
local_ip = 127.0.0.1;
local_port = 8124;
ip = $host;
port = $port;
type = http-connect;
}
" >>$DIR/redsocks.conf
;;
esac
;;
socks5)
case $auth in
true)
echo "
redsocks {
local_ip = 127.0.0.1;
local_port = 8123;
ip = $host;
port = $port;
type = socks5;
login = \"$user\";
password = \"$pass\";
}
" >>$DIR/redsocks.conf
;;
false)
echo "
redsocks {
local_ip = 127.0.0.1;
local_port = 8123;
ip = $host;
port = $port;
type = socks5;
}
" >>$DIR/redsocks.conf
;;
esac
;;
socks4)
case $auth in
true)
echo "
redsocks {
local_ip = 127.0.0.1;
local_port = 8123;
ip = $host;
port = $port;
type = socks4;
login = \"$user\";
password = \"$pass\";
}
" >>$DIR/redsocks.conf
;;
false)
echo "
redsocks {
local_ip = 127.0.0.1;
local_port = 8123;
ip = $host;
port = $port;
type = socks4;
}
" >>$DIR/redsocks.conf
;;
esac
;;
esac

$DIR/redsocks -p $DIR/redsocks.pid -c $DIR/redsocks.conf
;;
stop)

killall -9 redsocks
killall -9 cntlm
killall -9 stunnel
killall -9 tproxy

kill -9 `cat $DIR/redsocks.pid`

rm $DIR/redsocks.pid

rm $DIR/redsocks.conf
esac
Binary file added assets/redsocks
Binary file not shown.
Binary file added assets/stunnel
Binary file not shown.
Binary file added assets/tproxy
Binary file not shown.
92 changes: 92 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="proxydroid" default="all">

<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />

<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />

<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />

<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
unless="sdk.dir"
/>

<target name="all" depends="clean,release">
<echo>Get a package with the version name ${version-name} </echo>
<exec executable="mv" failonerror="true">
<arg value="${out.final.file}" />
<arg value="bin/${ant.project.name}-${version-name}.apk" />
</exec>
</target>

<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<!--
<target name="-pre-build">
</target>
<target name="-pre-compile">
</target>
/* This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir} */
<target name="-post-compile">
</target>
-->

<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />

</project>
12 changes: 12 additions & 0 deletions default.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.

# Project target.
target=android-8
proguard.config=proguard.cfg
32 changes: 32 additions & 0 deletions jni/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# This makefile supplies the rules for building a library of JNI code for
# use by our example of how to bundle a shared library with an APK.

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

# This is the target being built.
LOCAL_MODULE:= libexec

# All of the source files that we will compile.
LOCAL_SRC_FILES:= \
termExec.cpp

LOCAL_LDLIBS := -ldl -llog

include $(BUILD_SHARED_LIBRARY)
2 changes: 2 additions & 0 deletions jni/Application.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Build both ARMv5TE and x86 machine code.
APP_ABI := armeabi
Loading

0 comments on commit 3fd3cd0

Please sign in to comment.