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