Permalink
Browse files

initial version

  • Loading branch information...
ukanth committed Oct 29, 2012
1 parent c5a6af3 commit 47a9b692a06ffbb21ffd1fc2696b11c936081f7f
Showing with 4,047 additions and 0 deletions.
  1. +8 −0 .classpath
  2. +33 −0 .project
  3. +11 −0 Android.mk
  4. +83 −0 AndroidManifest.xml
  5. +14 −0 project.properties
  6. BIN res/drawable-hdpi/icon.png
  7. BIN res/drawable-hdpi/widget_off.png
  8. BIN res/drawable-hdpi/widget_on.png
  9. BIN res/drawable-ldpi/icon.png
  10. BIN res/drawable-ldpi/widget_off.png
  11. BIN res/drawable-ldpi/widget_on.png
  12. BIN res/drawable/apply.png
  13. BIN res/drawable/clear.png
  14. BIN res/drawable/clearlog.png
  15. BIN res/drawable/eth_3g.png
  16. BIN res/drawable/eth_wifi.png
  17. BIN res/drawable/exit.png
  18. BIN res/drawable/help.png
  19. BIN res/drawable/icon.png
  20. BIN res/drawable/lock.png
  21. BIN res/drawable/off.png
  22. BIN res/drawable/on.png
  23. BIN res/drawable/preferences.png
  24. BIN res/drawable/reload.png
  25. BIN res/drawable/roam.png
  26. BIN res/drawable/script.png
  27. BIN res/drawable/show.png
  28. BIN res/drawable/spinner.png
  29. +6 −0 res/drawable/widget_bg.xml
  30. BIN res/drawable/widget_bg_focus.png
  31. BIN res/drawable/widget_bg_pressed.png
  32. BIN res/drawable/widget_off.png
  33. BIN res/drawable/widget_on.png
  34. +22 −0 res/layout/customscript.xml
  35. +78 −0 res/layout/dialog_color_picker.xml
  36. +17 −0 res/layout/help_dialog.xml
  37. +45 −0 res/layout/listitem.xml
  38. +29 −0 res/layout/main.xml
  39. +15 −0 res/layout/onoff_widget.xml
  40. +11 −0 res/layout/pass_dialog.xml
  41. +8 −0 res/layout/preferences.xml
  42. BIN res/raw/busybox_g1
  43. BIN res/raw/iptables_armv5
  44. +7 −0 res/values/arrays.xml
  45. +94 −0 res/values/strings.xml
  46. +8 −0 res/xml/onoff_widget.xml
  47. +24 −0 res/xml/pref.xml
  48. +1,207 −0 src/dev/ukanth/ufirewall/Api.java
  49. +12 −0 src/dev/ukanth/ufirewall/Application.java
  50. +65 −0 src/dev/ukanth/ufirewall/BootBroadcast.java
  51. +26 −0 src/dev/ukanth/ufirewall/ConnectivityChangeReceiver.java
  52. +117 −0 src/dev/ukanth/ufirewall/CustomScriptActivity.java
  53. +41 −0 src/dev/ukanth/ufirewall/HelpDialog.java
  54. +970 −0 src/dev/ukanth/ufirewall/MainActivity.java
  55. +102 −0 src/dev/ukanth/ufirewall/PackageBroadcast.java
  56. +86 −0 src/dev/ukanth/ufirewall/PassDialog.java
  57. +16 −0 src/dev/ukanth/ufirewall/PrefsActivity.java
  58. +13 −0 src/dev/ukanth/ufirewall/ShutdownReceiver.java
  59. +117 −0 src/dev/ukanth/ufirewall/StatusWidget.java
  60. +128 −0 src/net/margaritov/preference/colorpicker/AlphaPatternDrawable.java
  61. +143 −0 src/net/margaritov/preference/colorpicker/ColorPickerDialog.java
  62. +171 −0 src/net/margaritov/preference/colorpicker/ColorPickerPanelView.java
  63. +320 −0 src/net/margaritov/preference/colorpicker/ColorPickerPreference.java
View
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry kind="output" path="bin/classes"/>
+</classpath>
View
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>AFWall</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
View
@@ -0,0 +1,11 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := Droidwall
+LOCAL_CERTIFICATE := platform
+
+include $(BUILD_PACKAGE)
View
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="dev.ukanth.ufirewall"
+ android:versionCode="100"
+ android:versionName="1.0.0" >
+
+ <uses-sdk
+ android:minSdkVersion="7"
+ android:targetSdkVersion="16" />
+
+ <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+ <uses-permission android:name="android.permission.DEVICE_POWER" />
+
+
+ <application
+ android:icon="@drawable/icon"
+ android:label="@string/app_name"
+ android:theme="@style/Theme.Sherlock" >
+ <activity
+ android:name=".MainActivity"
+ android:label="@string/app_name" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ <activity
+ android:name="dev.ukanth.ufirewall.PrefsActivity"
+ android:theme="@android:style/Theme.Black.NoTitleBar" >
+ </activity>
+ <activity android:name=".CustomScriptActivity" />
+
+ <receiver
+ android:name="BootBroadcast"
+ android:permission="android.permission.RECEIVE_BOOT_COMPLETED" >
+ <intent-filter>
+ <action android:name="android.intent.action.BOOT_COMPLETED" >
+ </action>
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name=".ShutdownReceiver">
+ <intent-filter>
+ <action android:name="android.intent.action.ACTION_SHUTDOWN" />
+ <action android:name="android.intent.action.QUICKBOOT_POWEROFF" />
+ </intent-filter>
+ </receiver>
+ <receiver android:name="PackageBroadcast" >
+ <intent-filter>
+ <action android:name="android.intent.action.PACKAGE_ADDED" />
+ <action android:name="android.intent.action.PACKAGE_REMOVED" />
+
+ <data android:scheme="package" />
+ </intent-filter>
+ </receiver>
+
+ <receiver android:name="ConnectivityChangeReceiver" >
+ <intent-filter>
+ <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
+ </intent-filter>
+ </receiver>
+ <receiver android:name="StatusWidget" >
+ <meta-data
+ android:name="android.appwidget.provider"
+ android:resource="@xml/onoff_widget" />
+
+ <intent-filter>
+ <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
+ <action android:name="com.googlecode.droidwall.intent.action.STATUS_CHANGED" />
+ <action android:name="com.googlecode.droidwall.intent.action.TOGGLE_REQUEST" />
+ </intent-filter>
+ </receiver>
+ </application>
+
+ <supports-screens
+ android:anyDensity="true"
+ android:largeScreens="true"
+ android:normalScreens="true"
+ android:smallScreens="true" />
+
+</manifest>
View
@@ -0,0 +1,14 @@
+# 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,
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-16
+android.library.reference.1=../ActionBarSherlock
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true" android:drawable="@drawable/widget_bg_pressed" />
+ <item android:state_focused="true" android:state_enabled="true" android:drawable="@drawable/widget_bg_focus" />
+</selector>
Binary file not shown.
Binary file not shown.
View
Diff not rendered.
View
Diff not rendered.
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+ <TextView android:id="@+id/customscript_link" android:text="@string/custom_script_info" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:textSize="22px"/>
+ <EditText android:id="@+id/customscript" android:layout_width="fill_parent" android:inputType="textMultiLine" android:layout_height="wrap_content" android:minLines="4" android:maxLines="4" android:gravity="top" android:scrollbars="horizontal|vertical">
+ <requestFocus></requestFocus>
+ </EditText>
+ <TextView android:text="@string/custom_script2_info" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:textSize="22px"/>
+ <EditText android:id="@+id/customscript2" android:layout_width="fill_parent" android:inputType="textMultiLine" android:layout_height="wrap_content" android:minLines="4" android:maxLines="4" android:gravity="top" android:scrollbars="horizontal|vertical">
+ </EditText>
+ <LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:gravity="center_horizontal">
+ <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/customscript_ok" android:text="@android:string/ok" android:minWidth="100px"></Button>
+ <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/customscript_cancel" android:text="@android:string/cancel" android:minWidth="100px"></Button>
+ </LinearLayout>
+ </LinearLayout>
+</ScrollView>
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 Daniel Nilsson
+
+ 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.
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingLeft="5dp"
+ android:paddingRight="5dp"
+ android:orientation="vertical">
+
+ <net.margaritov.preference.colorpicker.ColorPickerView
+ android:id="@+id/color_picker_view"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:tag="portrait"
+ android:layerType="software"
+ />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Press on Color to apply"
+ android:gravity="left"
+ android:layout_marginLeft="6dp"
+ android:layout_marginRight="6dp"
+ android:layout_marginBottom="5dp"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ />
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="40dp"
+ android:orientation="horizontal"
+ android:layout_below="@id/color_picker_view"
+ android:layout_marginBottom="10dp">
+
+ <net.margaritov.preference.colorpicker.ColorPickerPanelView
+ android:id="@+id/old_color_panel"
+ android:layout_width="0px"
+ android:layout_height="fill_parent"
+ android:layout_weight="0.5"
+ />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:text=""
+ android:textSize="20sp"
+ android:gravity="center"
+ android:layout_marginLeft="10dp"
+ android:layout_marginRight="10dp"
+ />
+
+ <net.margaritov.preference.colorpicker.ColorPickerPanelView
+ android:id="@+id/new_color_panel"
+ android:layout_width="0px"
+ android:layout_height="wrap_content"
+ android:layout_weight="0.5"
+ />
+
+ </LinearLayout>
+
+</LinearLayout>
View
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent" android:layout_height="wrap_content">
+ <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent" android:layout_height="fill_parent">
+ <!--
+ <LinearLayout android:layout_width="fill_parent"
+ android:layout_height="fill_parent" android:orientation="vertical">
+ <TextView android:id="@+id/help_dialog_disclaimer"
+ android:layout_height="fill_parent" android:layout_width="fill_parent"
+ android:padding="6dip" /> -->
+ <TextView android:layout_height="fill_parent"
+ android:layout_width="fill_parent" android:text="@string/help_dialog_text"
+ android:padding="6dip" />
+ <!-- </LinearLayout> -->
+ </ScrollView>
+</FrameLayout>
View
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:baselineAligned="true"
+ android:orientation="horizontal"
+ android:paddingBottom="2dip"
+ android:paddingTop="2dip" >
+
+ <ImageView
+ android:id="@+id/itemicon"
+ android:layout_width="34dip"
+ android:layout_height="34dip">
+ </ImageView>
+
+ <CheckBox
+ android:id="@+id/itemcheck_wifi"
+ android:layout_width="34dip"
+ android:layout_height="34dip"
+ android:padding="0px" >
+ </CheckBox>
+
+ <CheckBox
+ android:id="@+id/itemcheck_3g"
+ android:layout_width="34dip"
+ android:layout_height="34dip"
+ android:padding="0px" >
+ </CheckBox>
+
+ <CheckBox
+ android:id="@+id/itemcheck_roam"
+ android:layout_width="34dip"
+ android:layout_height="34dip"
+ android:padding="0px" >
+ </CheckBox>
+
+ <TextView
+ android:id="@+id/itemtext"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:paddingLeft="5dip"
+ android:text="@string/empty" >
+ </TextView>
+ </LinearLayout>
View
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:duplicateParentState="false">
+ <View android:layout_width="fill_parent" android:layout_height="1px" android:background="#FFFFFFFF" />
+ <ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/list"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawSelectorOnTop="false"
+ android:scrollbarAlwaysDrawVerticalTrack="true"
+ />
+ <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="6px">
+ <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/label_mode" android:text="@string/mode" android:textSize="22px" android:clickable="true"></TextView>
+ <ImageView
+ android:src="@drawable/spinner"
+ android:layout_width="12dip"
+ android:layout_height="18dip">
+ </ImageView>
+ </LinearLayout>
+ <View android:layout_width="fill_parent" android:layout_height="1px" android:background="#FFFFFFFF" />
+ <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="0px">
+ <View android:layout_width="34dip" android:layout_height="fill_parent"/>
+ <ImageView android:layout_width="34dip" android:layout_height="wrap_content" android:id="@+id/img_wifi" android:src="@drawable/eth_wifi" android:clickable="true"></ImageView>
+ <ImageView android:layout_width="34dip" android:layout_height="wrap_content" android:id="@+id/img_3g" android:src="@drawable/eth_3g" android:clickable="true"></ImageView>
+ <ImageView android:layout_width="34dip" android:layout_height="wrap_content" android:id="@+id/img_roam" android:src="@drawable/roam" android:clickable="true"></ImageView>
+ <ImageView android:layout_width="34dip" android:layout_height="wrap_content" android:id="@+id/img_reset" android:src="@drawable/clear" android:clickable="true"></ImageView>
+ </LinearLayout>
+
+ <ListView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/listview"></ListView>
+
+</LinearLayout>
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/main"
+ android:layout_width="40dip"
+ android:layout_height="40dip"
+ android:gravity="center">
+
+ <ImageButton
+ android:id="@+id/widgetCanvas"
+ android:layout_width="40dip"
+ android:layout_height="40dip"
+ android:background="@drawable/widget_bg"
+ android:layout_gravity="center_horizontal"
+ />
+</LinearLayout>
View
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:duplicateParentState="false">
+<TextView android:layout_height="wrap_content" android:id="@+id/pass_message" android:layout_width="fill_parent" android:gravity="center_horizontal|center" android:textSize="25px" android:text="@string/enternewpass" android:paddingLeft="5px" android:paddingRight="5px"></TextView>
+<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="15px">
+<EditText android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/pass_input" android:inputType="textPassword"></EditText>
+</LinearLayout>
+<LinearLayout android:layout_height="wrap_content" android:layout_width="fill_parent" android:gravity="center_horizontal">
+<Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/pass_ok" android:text="@android:string/ok" android:minWidth="70px"></Button>
+<Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@android:string/cancel" android:minWidth="70px" android:id="@+id/pass_cancel"></Button>
+</LinearLayout>
+</LinearLayout>
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/list"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:drawSelectorOnTop="false"
+ android:scrollbarAlwaysDrawVerticalTrack="true"
+ />
View
Binary file not shown.
View
Binary file not shown.
Oops, something went wrong.

0 comments on commit 47a9b69

Please sign in to comment.