[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [orbot/master] removed whispersys stuff for now
commit e6d65dbae92e19ab34ee10e468812bd106b92051
Author: Nathan Freitas <nathan@xxxxxxxxxxx>
Date: Wed Jan 25 20:06:09 2012 -0500
removed whispersys stuff for now
---
libs/whispercore.jar | Bin 9849 -> 0 bytes
.../torproject/android/service/WhisperManager.java | 93 --------------------
2 files changed, 0 insertions(+), 93 deletions(-)
diff --git a/libs/whispercore.jar b/libs/whispercore.jar
deleted file mode 100644
index 914e033..0000000
Binary files a/libs/whispercore.jar and /dev/null differ
diff --git a/src/org/torproject/android/service/WhisperManager.java b/src/org/torproject/android/service/WhisperManager.java
deleted file mode 100644
index d858af3..0000000
--- a/src/org/torproject/android/service/WhisperManager.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package org.torproject.android.service;
-
-import android.content.ContentValues;
-import android.content.Context;
-import android.database.Cursor;
-import android.net.Uri;
-import android.util.Log;
-
-import com.whispersys.providers.Netfilter;
-
-/*
- * Supports interaction with private APIs provided by WhisperSystems SDK
- */
-public class WhisperManager {
-
-
- Context context;
-
-
- public boolean isWhisperCore ()
- {
- boolean result = false;
-
- Cursor cursor = null;
- Uri uri = Uri.withAppendedPath(Netfilter.Filter.CONTENT_URI, Netfilter.Filter.Chains.OUTPUT);
-
- try {
- cursor = context.getContentResolver().query(uri, null, null, null, null);
- cursor.moveToFirst();
- result = true;
- }
- catch (Exception e)
- {
- result = false;
- }
-
- return result;
- }
- /*
- * Usage
- The Netfilter provider allows you to query, update, insert, or delete rules from a chain of a table. Callers must provide a CONTENT_URI which specifies the chain of the table they would like to query or modify.
-
- To query and print the INPUT rules for the filter table, for instance, would look like this:
- */
-
- public void query ()
- {
- Cursor cursor = null;
- Uri uri = Uri.withAppendedPath(Netfilter.Filter.CONTENT_URI, Netfilter.Filter.Chains.OUTPUT);
-
- try {
- cursor = context.getContentResolver().query(uri, null, null, null, null);
-
- while (cursor.moveToNext())
- for (int i=0;i<cursor.getColumnCount();i++)
- Log.w("TestApp", "Column: " + cursor.getColumnName(i) + " , value: " + cursor.getString(i));
- } finally {
- if (cursor != null)
- cursor.close();
- }
- }
-
- /*
- To append a rule that dropped all UDP traffic to the end of the OUTPUT chain would look like this:
- */
-
- public void append ()
- {
- Uri uri = Uri.withAppendedPath(Netfilter.Filter.CONTENT_URI,
- Netfilter.Filter.Chains.OUTPUT);
- ContentValues values = new ContentValues();
- values.put(Netfilter.Filter.TARGET, Netfilter.Targets.DROP);
- values.put(Netfilter.Filter.PROTOCOL, Netfilter.Protocols.UDP);
-
- context.getContentResolver().insert(uri, values);
- }
-
- /*
- iptables rule indexes start at 1. To insert the same rule in the first position of the OUTPUT chain, rather than appending it to the end of the chain, would look like this:
- */
- public void insert ()
- {
- Uri uri = Uri.withAppendedPath(Netfilter.Filter.CONTENT_URI,
- Netfilter.Filter.Chains.OUTPUT);
- ContentValues values = new ContentValues();
- values.put(Netfilter.Filter.TARGET, Netfilter.Targets.DROP);
- values.put(Netfilter.Filter.PROTOCOL, Netfilter.Protocols.UDP);
- values.put(Netfilter.Filter.ROW_ID, 1);
-
- context.getContentResolver().insert(uri, values);
- }
-}
-
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits