├── assets ├── fork ├── olsrd ├── wifi ├── busybox ├── olsrd_mini.so.0.1 ├── olsrd_tas.so.0.1 ├── olsrd_bmf.so.1.7.0 ├── olsrd_pgraph.so.1.1 ├── olsrd_secure.so.0.6 ├── olsrd_txtinfo.so.0.1 ├── olsrd_dot_draw.so.0.3 ├── olsrd_httpinfo.so.0.1 ├── olsrd_jsoninfo.so.0.0 ├── olsrd_watchdog.so.0.1 ├── olsrd_arprefresh.so.0.1 ├── olsrd_dyn_gw_plain.so.0.4 ├── olsrd_nameservice.so.0.3 ├── su_c ├── stop_olsrd ├── do_stop_olsrd ├── del-fake-default-route ├── do_del-fake-default-route ├── script_aria ├── script_samsung ├── su_c_fork ├── script_hero ├── run └── olsrd.conf ├── libs ├── Shell.jar ├── jackson-core-asl-1.9.7.jar └── jackson-mapper-asl-1.9.7.jar ├── src └── net │ └── commotionwireless │ ├── olsrinfo │ └── meshtether │ ├── ToggleReceiver.java │ ├── MACPreference.java │ ├── IPPreference.java │ ├── MeshIPPreference.java │ ├── SettingsActivity.java │ ├── Util.java │ ├── NativeHelper.java │ ├── LinksActivity.java │ ├── InfoActivity.java │ ├── MeshTetherApp.java │ ├── StatusActivity.java │ └── MeshService.java ├── res ├── drawable-hdpi │ ├── upload.png │ ├── download.png │ ├── other_route.png │ ├── barnacle_error.png │ ├── comlogo_sm_off.png │ ├── comlogo_sm_on.png │ ├── default_route.png │ ├── ic_tab_selected_recent.png │ ├── ic_tab_selected_starred.png │ ├── ic_tab_unselected_recent.png │ ├── ic_tab_unselected_starred.png │ ├── ic_tab_selected_friends_list.png │ └── ic_tab_unselected_friends_list.png ├── drawable-ldpi │ ├── upload.png │ ├── download.png │ ├── other_route.png │ ├── comlogo_sm_off.png │ ├── comlogo_sm_on.png │ └── default_route.png ├── drawable-mdpi │ ├── upload.png │ ├── download.png │ ├── other_route.png │ ├── comlogo_sm_off.png │ ├── comlogo_sm_on.png │ ├── default_route.png │ ├── ic_tab_selected_recent.png │ ├── ic_tab_selected_starred.png │ ├── ic_tab_unselected_recent.png │ ├── ic_tab_unselected_starred.png │ ├── ic_tab_selected_friends_list.png │ └── ic_tab_unselected_friends_list.png ├── drawable-xhdpi │ ├── download.png │ ├── upload.png │ ├── comlogo_sm_on.png │ └── comlogo_sm_off.png ├── drawable │ ├── row_background.xml │ ├── ic_tab_recent.xml │ ├── ic_tab_starred.xml │ └── ic_tab_contacts.xml ├── layout │ ├── traffic.xml │ ├── main.xml │ ├── inforow.xml │ ├── tabhost.xml │ ├── control.xml │ └── linkrow.xml ├── menu │ └── main.xml ├── layout-land │ ├── main.xml │ └── control.xml ├── xml │ └── preferences.xml └── values │ └── strings.xml ├── jni └── Application.mk ├── native ├── Android.mk ├── wifi │ ├── hardware_legacy_stub.c │ ├── Android.mk │ ├── hardware_legacy_stub.h │ ├── main.cc │ ├── wifi.hh │ ├── init.hh │ └── iwctl.hh └── include │ ├── log.hh │ ├── properties.hh │ ├── config.hh │ └── ifctl.hh ├── .gitignore ├── .gitmodules ├── .settings └── org.eclipse.cdt.core.prefs ├── project.properties ├── .classpath ├── .project ├── README.md ├── AndroidManifest.xml └── external └── Makefile /assets/fork: -------------------------------------------------------------------------------- 1 | ../external/shell-fork/fork -------------------------------------------------------------------------------- /assets/olsrd: -------------------------------------------------------------------------------- 1 | ../external/olsrd/olsrd -------------------------------------------------------------------------------- /assets/wifi: -------------------------------------------------------------------------------- 1 | ../native/libs/armeabi/wifi -------------------------------------------------------------------------------- /assets/busybox: -------------------------------------------------------------------------------- 1 | ../external/busybox/busybox -------------------------------------------------------------------------------- /libs/Shell.jar: -------------------------------------------------------------------------------- 1 | ../external/shell-fork/Shell.jar -------------------------------------------------------------------------------- /assets/olsrd_mini.so.0.1: -------------------------------------------------------------------------------- 1 | ../external/olsrd/lib/mini/olsrd_mini.so.0.1 -------------------------------------------------------------------------------- /assets/olsrd_tas.so.0.1: -------------------------------------------------------------------------------- 1 | ../external/olsrd/lib/tas/olsrd_tas.so.0.1 -------------------------------------------------------------------------------- /assets/olsrd_bmf.so.1.7.0: -------------------------------------------------------------------------------- 1 | ../external/olsrd/lib/bmf/olsrd_bmf.so.1.7.0 -------------------------------------------------------------------------------- /assets/olsrd_pgraph.so.1.1: -------------------------------------------------------------------------------- 1 | ../external/olsrd/lib/pgraph/olsrd_pgraph.so.1.1 -------------------------------------------------------------------------------- /assets/olsrd_secure.so.0.6: -------------------------------------------------------------------------------- 1 | ../external/olsrd/lib/secure/olsrd_secure.so.0.6 -------------------------------------------------------------------------------- /assets/olsrd_txtinfo.so.0.1: -------------------------------------------------------------------------------- 1 | ../external/olsrd/lib/txtinfo/olsrd_txtinfo.so.0.1 -------------------------------------------------------------------------------- /assets/olsrd_dot_draw.so.0.3: -------------------------------------------------------------------------------- 1 | ../external/olsrd/lib/dot_draw/olsrd_dot_draw.so.0.3 -------------------------------------------------------------------------------- /assets/olsrd_httpinfo.so.0.1: -------------------------------------------------------------------------------- 1 | ../external/olsrd/lib/httpinfo/olsrd_httpinfo.so.0.1 -------------------------------------------------------------------------------- /assets/olsrd_jsoninfo.so.0.0: -------------------------------------------------------------------------------- 1 | ../external/olsrd/lib/jsoninfo/olsrd_jsoninfo.so.0.0 -------------------------------------------------------------------------------- /assets/olsrd_watchdog.so.0.1: -------------------------------------------------------------------------------- 1 | ../external/olsrd/lib/watchdog/olsrd_watchdog.so.0.1 -------------------------------------------------------------------------------- /assets/olsrd_arprefresh.so.0.1: -------------------------------------------------------------------------------- 1 | ../external/olsrd/lib/arprefresh/olsrd_arprefresh.so.0.1 -------------------------------------------------------------------------------- /assets/olsrd_dyn_gw_plain.so.0.4: -------------------------------------------------------------------------------- 1 | ../external/olsrd/lib/dyn_gw_plain/olsrd_dyn_gw_plain.so.0.4 -------------------------------------------------------------------------------- /assets/olsrd_nameservice.so.0.3: -------------------------------------------------------------------------------- 1 | ../external/olsrd/lib/nameservice/olsrd_nameservice.so.0.3 -------------------------------------------------------------------------------- /src/net/commotionwireless/olsrinfo: -------------------------------------------------------------------------------- 1 | ../../../external/olsrinfo/src/net/commotionwireless/olsrinfo/ -------------------------------------------------------------------------------- /res/drawable-hdpi/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-hdpi/upload.png -------------------------------------------------------------------------------- /res/drawable-ldpi/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-ldpi/upload.png -------------------------------------------------------------------------------- /res/drawable-mdpi/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-mdpi/upload.png -------------------------------------------------------------------------------- /libs/jackson-core-asl-1.9.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/libs/jackson-core-asl-1.9.7.jar -------------------------------------------------------------------------------- /res/drawable-hdpi/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-hdpi/download.png -------------------------------------------------------------------------------- /res/drawable-ldpi/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-ldpi/download.png -------------------------------------------------------------------------------- /res/drawable-mdpi/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-mdpi/download.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-xhdpi/download.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-xhdpi/upload.png -------------------------------------------------------------------------------- /libs/jackson-mapper-asl-1.9.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/libs/jackson-mapper-asl-1.9.7.jar -------------------------------------------------------------------------------- /res/drawable-hdpi/other_route.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-hdpi/other_route.png -------------------------------------------------------------------------------- /res/drawable-ldpi/other_route.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-ldpi/other_route.png -------------------------------------------------------------------------------- /res/drawable-mdpi/other_route.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-mdpi/other_route.png -------------------------------------------------------------------------------- /res/drawable-hdpi/barnacle_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-hdpi/barnacle_error.png -------------------------------------------------------------------------------- /res/drawable-hdpi/comlogo_sm_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-hdpi/comlogo_sm_off.png -------------------------------------------------------------------------------- /res/drawable-hdpi/comlogo_sm_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-hdpi/comlogo_sm_on.png -------------------------------------------------------------------------------- /res/drawable-hdpi/default_route.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-hdpi/default_route.png -------------------------------------------------------------------------------- /res/drawable-ldpi/comlogo_sm_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-ldpi/comlogo_sm_off.png -------------------------------------------------------------------------------- /res/drawable-ldpi/comlogo_sm_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-ldpi/comlogo_sm_on.png -------------------------------------------------------------------------------- /res/drawable-ldpi/default_route.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-ldpi/default_route.png -------------------------------------------------------------------------------- /res/drawable-mdpi/comlogo_sm_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-mdpi/comlogo_sm_off.png -------------------------------------------------------------------------------- /res/drawable-mdpi/comlogo_sm_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-mdpi/comlogo_sm_on.png -------------------------------------------------------------------------------- /res/drawable-mdpi/default_route.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-mdpi/default_route.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/comlogo_sm_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-xhdpi/comlogo_sm_on.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/comlogo_sm_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-xhdpi/comlogo_sm_off.png -------------------------------------------------------------------------------- /jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_PROJECT_PATH := $(call my-dir)/../native 2 | APP_BUILD_SCRIPT := $(APP_PROJECT_PATH)/Android.mk 3 | APP_MODULES := wifi 4 | -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_tab_selected_recent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-hdpi/ic_tab_selected_recent.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_tab_selected_starred.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-hdpi/ic_tab_selected_starred.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_tab_unselected_recent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-hdpi/ic_tab_unselected_recent.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_tab_selected_recent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-mdpi/ic_tab_selected_recent.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_tab_selected_starred.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-mdpi/ic_tab_selected_starred.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_tab_unselected_recent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-mdpi/ic_tab_unselected_recent.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_tab_unselected_starred.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-hdpi/ic_tab_unselected_starred.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_tab_unselected_starred.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-mdpi/ic_tab_unselected_starred.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_tab_selected_friends_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-hdpi/ic_tab_selected_friends_list.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_tab_selected_friends_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-mdpi/ic_tab_selected_friends_list.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_tab_unselected_friends_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-hdpi/ic_tab_unselected_friends_list.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_tab_unselected_friends_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opentechinstitute/commotion-android/HEAD/res/drawable-mdpi/ic_tab_unselected_friends_list.png -------------------------------------------------------------------------------- /assets/su_c: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | # calling 'su -c' from Java doesn't work so we use a helper script 4 | 5 | # exec su -c ${1:-${brncl_path}/run} 6 | exec ${1:-${brncl_path}/run} 7 | -------------------------------------------------------------------------------- /assets/stop_olsrd: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # main runner (process manager) for barnacle, root required 3 | 4 | : ${brncl_path:=.} 5 | 6 | export brncl_path 7 | 8 | su -c ${brncl_path}/do_stop_olsrd 9 | -------------------------------------------------------------------------------- /native/Android.mk: -------------------------------------------------------------------------------- 1 | 2 | include $(all-subdir-makefiles) 3 | 4 | # redirect stdout to stderr otherwise make eats it 5 | # TODO this also runs when 'ndk-build clean' is called... 6 | #MAKE_EXTERNAL_LOG := $(shell make -C external 1>&2) 7 | -------------------------------------------------------------------------------- /assets/do_stop_olsrd: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # main runner (process manager) for barnacle, root required 3 | 4 | : ${brncl_path:=.} 5 | 6 | export brncl_path 7 | 8 | kill -15 `cat $brncl_path/../app_log/olsrd.pid` 9 | 10 | $brncl_path/killall olsrd 11 | -------------------------------------------------------------------------------- /assets/del-fake-default-route: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | # horrible hack to work around the hack of telling Android that our gateway is our own IP 4 | # calling 'su -c' from Java doesn't work so we use a helper script 5 | 6 | exec "${brncl_path}/do_del-fake-default-route" 7 | -------------------------------------------------------------------------------- /assets/do_del-fake-default-route: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | # horrible hack to work around the hack of telling Android that our gateway is our own IP 4 | 5 | : ${brncl_if_lan:="`getprop wifi.interface`"} 6 | 7 | sleep 15 8 | ${brncl_path}/ip route del default via ${brncl_adhoc_ip} dev $brncl_if_lan 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | gen/ 3 | obj/ 4 | native/TAGS 5 | native/libs/armeabi/libhardware_legacy.so 6 | native/libs/armeabi/wifi 7 | external/olsrd-build-stamp 8 | external/fork-timestamp 9 | external/shell-jar-timestamp 10 | # ant files generated by 'android update' 11 | build.xml 12 | local.properties 13 | proguard-project.txt 14 | -------------------------------------------------------------------------------- /assets/script_aria: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | set -e 4 | 5 | MODULE=/system/lib/modules/bcm4329.ko 6 | FIRMWARE=/sdcard/fw_bcm4329.bin 7 | 8 | load() { 9 | ls > /dev/null 2>&1 $FIRMWARE || ( echo >&2 "aria: $FIRMWARE not found!" ; exit ) 10 | insmod $MODULE firmware_path=$FIRMWARE 11 | } 12 | 13 | unload() { 14 | rmmod $MODULE 15 | } 16 | 17 | $1 18 | -------------------------------------------------------------------------------- /assets/script_samsung: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # NOT TESTED! 3 | 4 | set -e 5 | 6 | MODULE=/lib/modules/dhd.ko 7 | FIRMWARE=/etc/rtecdc.bin 8 | 9 | load() { 10 | ls > /dev/null 2>&1 $FIRMWARE || ( echo 2>&1 "samsung: $FIRMWARE not found!" ; exit ) 11 | insmod $MODULE firmware_path=$FIRMWARE nvram_path=/etc/nvram.txt 12 | } 13 | 14 | unload() { 15 | rmmod $MODULE 16 | } 17 | 18 | $1 19 | 20 | 21 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "external/olsrd"] 2 | path = external/olsrd 3 | url = http://olsr.org/git/olsrd.git 4 | [submodule "external/olsrinfo"] 5 | path = external/olsrinfo 6 | url = https://github.com/guardianproject/OlsrInfo.git 7 | [submodule "external/busybox"] 8 | path = external/busybox 9 | url = git://busybox.net/busybox.git 10 | [submodule "external/shell-fork"] 11 | path = external/shell-fork 12 | url = https://github.com/opentechinstitute/shell-fork 13 | -------------------------------------------------------------------------------- /native/wifi/hardware_legacy_stub.c: -------------------------------------------------------------------------------- 1 | #include "hardware_legacy_stub.h" 2 | int wifi_load_driver() { return -1; } 3 | int wifi_unload_driver() { return -1; } 4 | int wifi_start_supplicant() { return -1; } 5 | int wifi_stop_supplicant() { return -1; } 6 | int wifi_connect_to_supplicant() { return -1; } 7 | void wifi_close_supplicant_connection() { } 8 | int wifi_wait_for_event(char *buf, size_t len) { return -1; } 9 | int wifi_command(const char *command, char *reply, size_t *reply_len) { return -1; } 10 | -------------------------------------------------------------------------------- /.settings/org.eclipse.cdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Thu May 31 17:19:38 EDT 2012 2 | eclipse.preferences.version=1 3 | environment/project/com.android.toolchain.gcc.779378330/NDK_BASE/delimiter=\: 4 | environment/project/com.android.toolchain.gcc.779378330/NDK_BASE/operation=append 5 | environment/project/com.android.toolchain.gcc.779378330/NDK_BASE/value=/usr/local/android-ndk 6 | environment/project/com.android.toolchain.gcc.779378330/append=true 7 | environment/project/com.android.toolchain.gcc.779378330/appendContributed=true 8 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Indicates whether an apk should be generated for each density. 11 | split.density=false 12 | # Project target. 13 | target=android-8 14 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /assets/su_c_fork: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # 3 | # calling 'su -c' from Java doesn't work so we use a helper script 4 | 5 | # set defaults 6 | : ${brncl_adhoc_ip:="172.29.5.1"} 7 | : ${brncl_adhoc_netmask:="255.255.0.0"} 8 | : ${brncl_if_lan:="`getprop wifi.interface`"} 9 | : ${brncl_path:=.} 10 | : ${olsrd_conf_path:=olsrd.conf} 11 | 12 | # for init.rc parsing 13 | : ${brncl_hardware:="`getprop ro.hardware`"} 14 | 15 | export brncl_adhoc_ip 16 | export brncl_adhoc_netmask 17 | export brncl_if_lan 18 | export brncl_path 19 | export olsrd_conf_path 20 | export brncl_hardware 21 | 22 | exec su -c "${1:-${brncl_path}/fork}" 23 | -------------------------------------------------------------------------------- /native/wifi/Android.mk: -------------------------------------------------------------------------------- 1 | 2 | LOCAL_PATH := $(call my-dir) 3 | 4 | # libhardware_legacy stub 5 | include $(CLEAR_VARS) 6 | 7 | LOCAL_MODULE := libhardware_legacy 8 | LOCAL_SRC_FILES := hardware_legacy_stub.c 9 | 10 | include $(BUILD_SHARED_LIBRARY) 11 | 12 | # the main binary 13 | 14 | include $(CLEAR_VARS) 15 | 16 | LOCAL_MODULE := wifi 17 | 18 | LOCAL_SRC_FILES := main.cc 19 | LOCAL_CPP_EXTENSION := .cc 20 | LOCAL_CFLAGS := -Wall -Wextra -Werror -Wno-delete-non-virtual-dtor -O3 21 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include 22 | 23 | LOCAL_SHARED_LIBRARIES := libhardware_legacy 24 | LOCAL_LDLIBS := -llog 25 | 26 | include $(BUILD_EXECUTABLE) 27 | -------------------------------------------------------------------------------- /assets/script_hero: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | set -e 3 | 4 | CHANNEL=${brncl_lan_channel:-1} 5 | SSID="$brncl_lan_essid" 6 | INIFILE=adhoc.ini 7 | MODULE=/system/lib/modules/wlan.ko 8 | 9 | load() { 10 | cat > $INIFILE <> $INIFILE 18 | 19 | echo "hero: Loading wifi driver..." 20 | insmod $MODULE 21 | 22 | echo "hero: Initializing driver..." 23 | wlan_loader -f /system/etc/wifi/Fw1251r1c.bin -e /proc/calibration -i $INIFILE 24 | } 25 | 26 | unload() { 27 | rmmod $MODULE 28 | } 29 | 30 | $1 31 | -------------------------------------------------------------------------------- /native/wifi/hardware_legacy_stub.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This just provides stubs to build against. The actual functions 3 | * are provided by a vendor supplied library for interfacing with the 4 | * wifi hardware. This build system does build a 5 | * libhardware_legacy.so, but this is only for linking against, it is 6 | * not deployed at all, since we expect every Android device to 7 | * already have libhardware_legacy.so installed. 8 | */ 9 | 10 | #include 11 | int wifi_load_driver(); 12 | int wifi_unload_driver(); 13 | int wifi_start_supplicant(); 14 | int wifi_stop_supplicant(); 15 | int wifi_connect_to_supplicant(); 16 | void wifi_close_supplicant_connection(); 17 | int wifi_wait_for_event(char *buf, size_t len); 18 | int wifi_command(const char *command, char *reply, size_t *reply_len); 19 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | CommotionMeshTether 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /assets/run: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | # main runner (process manager) for barnacle, root required 3 | 4 | # log environment for debugging 5 | set > $brncl_path/../app_log/environment.log 2>&1 6 | 7 | # zero out debug log so it doesn't get huge 8 | echo "" > $brncl_path/../app_log/olsrd.log 2>&1 9 | 10 | 11 | cd $brncl_path 12 | 13 | # load the driver 14 | # NOTE: Android's shell is ash and there is no "test" or "[" 15 | : ${brncl_lan_script:=wifi} 16 | 17 | ./$brncl_lan_script load 18 | 19 | # necessary hack for HTC phones 20 | type ip >/dev/null 2>&1 && ip route del table gprs default >/dev/null 2>&1 21 | 22 | # ifconfig $brncl_if_lan $brncl_adhoc_ip netmask $brncl_adhoc_netmask up 23 | ./wifi config 24 | 25 | # Xperia X10 running Gingerbread needs extra time for wifi config to finish 26 | sleep 1 27 | 28 | # run olsrd 29 | (./olsrd -f "${olsrd_conf_path}" -i $brncl_if_lan > $brncl_path/../app_log/olsrd.log 2>&1) & 30 | echo `ps | ./grep '[o]lsrd' | ./awk '{print $2;}'` > $brncl_path/../app_log/olsrd.pid 31 | 32 | # the association loop 33 | ./wifi assoc 34 | 35 | # cleanup 36 | ./wifi unload 37 | -------------------------------------------------------------------------------- /res/drawable/row_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 26 | 27 | -------------------------------------------------------------------------------- /res/drawable/ic_tab_recent.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /res/drawable/ic_tab_starred.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /res/drawable/ic_tab_contacts.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /res/layout/traffic.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 19 | 20 | 21 | 32 | 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![alt tag](http://img.shields.io/badge/maintainer-hawkinswnaf-blue.svg)](https://github.com/hawkinswnaf) 2 | Commotion Mesh Tether 3 | ==================== 4 | 5 | Commotion Mesh Tether is a combination of tools to provide OLSR mesh networking 6 | over wifi on an Android phone. It handles setting up the wifi into ad-hoc 7 | mode, setting up the IP address, and running the olsrd program. 8 | 9 | It was originally based on the Barnacle Wifi Tether app. 10 | 11 | https://code.commotionwireless.net/projects/commotion-android/ 12 | 13 | How to build 14 | ------------ 15 | 16 | Prerequisites: 17 | 1) Android NDK r4 or above 18 | 2) Eclipse and ADT plugin 19 | 3) sudo apt-get install bison flex make sed junit4 20 | 21 | To build native components, run these commands in the root directory of this 22 | project (i.e. /path/to/commotion-android): 23 | 24 | git submodule init 25 | git submodule update 26 | make -C external/ 27 | ndk-build 28 | 29 | To build the Android app, import the existing project into Eclipse and export 30 | an .apk file. If you ran the NDK build after already having the project in 31 | Eclipse, you'll need to refresh the project for Eclipse to see the new files. 32 | To do that, right-click on the project, and select "Refresh". 33 | -------------------------------------------------------------------------------- /assets/olsrd.conf: -------------------------------------------------------------------------------- 1 | 2 | DebugLevel 0 3 | ClearScreen no 4 | IpVersion 4 5 | AllowNoInt yes 6 | 7 | # the mesh interface is specified at run time by the Java app using the -i flag 8 | InterfaceDefaults 9 | { 10 | Ip4Broadcast 255.255.255.255 11 | HelloInterval 6.0 12 | HelloValidityTime 600.0 13 | TcInterval 0.5 14 | TcValidityTime 300.0 15 | MidInterval 10.0 16 | MidValidityTime 300.0 17 | HnaInterval 10.0 18 | HnaValidityTime 300.0 19 | } 20 | 21 | UseHysteresis no 22 | LinkQualityFishEye 0 23 | LinkQualityAlgorithm "etx_ffeth" 24 | LinkQualityLevel 2 25 | Pollrate 0.1 26 | 27 | TcRedundancy 2 28 | MprCoverage 5 29 | 30 | Willingness 3 31 | 32 | 33 | IpcConnect 34 | { 35 | MaxConnections 0 36 | } 37 | 38 | LoadPlugin "/data/data/net.commotionwireless.meshtether/app_bin/olsrd_jsoninfo.so.0.0" 39 | { 40 | PlParam "port" "9090" 41 | PlParam "accept" "0.0.0.0" 42 | } 43 | 44 | #LoadPlugin "/data/data/net.commotionwireless.meshtether/app_bin/olsrd_httpinfo.so.0.1" 45 | #{ 46 | # PlParam "Port" "8080" 47 | # PlParam "Net" "0.0.0.0 0.0.0.0" 48 | #} 49 | 50 | #LoadPlugin "/data/data/net.commotionwireless.meshtether/app_bin/olsrd_txtinfo.so.0.1" 51 | #{ 52 | # PlParam "port" "2006" 53 | # PlParam "accept" "0.0.0.0" 54 | #} 55 | 56 | -------------------------------------------------------------------------------- /src/net/commotionwireless/meshtether/ToggleReceiver.java: -------------------------------------------------------------------------------- 1 | package net.commotionwireless.meshtether; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.util.Log; 7 | 8 | public class ToggleReceiver extends BroadcastReceiver { 9 | final static String TAG = "ToggleReceiver"; 10 | @Override 11 | public void onReceive(Context context, Intent intent) { 12 | Log.d(TAG, "onReceive " + intent.getAction()); 13 | if (MeshTetherApp.ACTION_TOGGLE.equals(intent.getAction())) { 14 | // potential race conditions, but they are benign 15 | MeshService service = MeshService.singleton; 16 | //Log.d(TAG, "service " + ((service == null) ? "null" : "present")); 17 | if (service != null) { 18 | if (!intent.getBooleanExtra("start", false)) { 19 | Log.d(TAG, "stop"); 20 | service.stopRequest(); 21 | } 22 | } else { 23 | if (intent.getBooleanExtra("start", true)) { 24 | Log.d(TAG, "start"); 25 | context.startService(new Intent(context, MeshService.class)); 26 | } 27 | } 28 | } else if (MeshTetherApp.ACTION_CHECK.equals(intent.getAction())) { 29 | // FIXME: this is the most inefficient way of finding out the state 30 | MeshService service = MeshService.singleton; 31 | int state = (service != null) ? service.getState() : MeshService.STATE_STOPPED; 32 | MeshTetherApp.broadcastState(context, state); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /native/include/log.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Barnacle Wifi Tether 3 | * Copyright (C) 2010 by Szymon Jakubczak 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef INCLUDED_LOG_HH 20 | #define INCLUDED_LOG_HH 21 | 22 | #include 23 | #include 24 | 25 | #ifndef TAG 26 | #define TAG 27 | #endif 28 | 29 | #define ERR(...) { fprintf(stderr, TAG __VA_ARGS__); fflush(stderr); } 30 | #define LOG(...) { flock(1, LOCK_EX); fprintf(stdout, TAG __VA_ARGS__); fflush(stdout); flock(1, LOCK_UN); } 31 | 32 | #ifdef __ANDROID__ 33 | extern "C" { 34 | #include 35 | } 36 | 37 | #define LOG_LEVEL ANDROID_LOG_DEBUG 38 | #define DBG(...) __android_log_print(LOG_LEVEL, "barnacle", TAG __VA_ARGS__) 39 | #else 40 | #define DBG LOG 41 | 42 | #endif 43 | 44 | #endif // INCLUDED_LOG_HH 45 | -------------------------------------------------------------------------------- /res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 25 | 26 | 30 | 31 | 34 | 35 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /res/layout-land/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 29 | 30 | 37 | 38 | -------------------------------------------------------------------------------- /res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 23 | 24 | 29 | 30 | 36 | 37 | 41 | 42 | -------------------------------------------------------------------------------- /res/layout/inforow.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 24 | 25 | 31 | 32 | 40 | 41 | -------------------------------------------------------------------------------- /res/layout/tabhost.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 23 | 24 | 28 | 29 | 33 | 34 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /res/layout/control.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 25 | 26 |