Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Commit [139ad5] Maximize Restore History

Titanic rewrite, added tests, switched to using Content Provider

AlexanderR AlexanderR 2014-06-28

1 2 3 > >> (Page 1 of 3)
added AVAppTests
added AVAppTests/ant.properties
added AVAppTests/assets
added AVAppTests/project.properties
added AVAppTests/src
added AVAppTests/src/net
added AVAppTests/src/net/sf
added AVAppTests/src/net/sf/fakenames
added AVAppTests/src/net/sf/fakenames/avapp
added AVAppTests/src/net/sf/fakenames/avapp/GreeterTest.java
added AVAppTests/src/net/sf/fakenames/avapp/ScriptRunnerTest.java
added AVAppTests/src/net/sf/fakenames/avapp/SignatureScannerTest.java
added AVAppTests/src/net/sf/fakenames/avapp/VirusProviderTest.java
added assets/userdoc.html
added src/net/sf/fakenames/avapp/ScanActivity.java
added src/net/sf/fakenames/avapp/SelectionBuilder.java
added src/net/sf/fakenames/avapp/model/VirusProvider.java
changed AndroidManifest.xml
changed assets
changed assets/scripts
changed assets/scripts/apkscan.bsh
changed assets/scripts/sdscan.bsh
changed assets/scripts/vulnscan.bsh
changed jni
changed jni/binding
changed jni/binding/Android.mk
changed jni/binding/binding.c
changed res
changed res/layout
changed res/layout/about.xml
changed res/values
changed res/values/strings.xml
changed res/xml
changed res/xml/syncadapter.xml
changed src
changed src/net
changed src/net/sf
changed src/net/sf/fakenames
changed src/net/sf/fakenames/avapp
changed src/net/sf/fakenames/avapp/AVApp.java
changed src/net/sf/fakenames/avapp/AboutDialog.java
changed src/net/sf/fakenames/avapp/ApkInterceptor.java
changed src/net/sf/fakenames/avapp/Greeter.java
changed src/net/sf/fakenames/avapp/SDReceiver.java
changed src/net/sf/fakenames/avapp/ScriptResultReceiver.java
changed src/net/sf/fakenames/avapp/ScriptRunner.java
changed src/net/sf/fakenames/avapp/SignatureScanner.java
changed src/net/sf/fakenames/avapp/Utils.java
changed src/net/sf/fakenames/avapp/fragments
changed src/net/sf/fakenames/avapp/fragments/DetectionLog.java
changed src/net/sf/fakenames/avapp/fragments/ScriptList.java
changed src/net/sf/fakenames/avapp/fragments/ServiceControl.java
changed src/net/sf/fakenames/avapp/model
changed src/net/sf/fakenames/avapp/stubs
copied avdb.hdb -> AVAppTests/assets/avdb.hdb
copied eicar.txt -> AVAppTests/assets/eicar.txt
copied helloworld.bsh -> AVAppTests/assets/helloworld.bsh
copied src/net/sf/fakenames/avapp/BuiltinScripts.java -> AVAppTests/AndroidManifest.xml
copied src/net/sf/fakenames/avapp/DatabaseHelper.java -> AVAppTests/build.xml
copied src/net/sf/fakenames/avapp/model/ScriptInfo.java -> AVAppTests/src/net/sf/fakenames/avapp/InstrumentationTestRunner.java
copied src/net/sf/fakenames/avapp/model/VirusDetection.java -> src/net/sf/fakenames/avapp/model/VirusContract.java
copied src/net/sf/fakenames/avapp/stubs/StubProvider.java -> AVAppTests/proguard-project.txt
AVAppTests
Directory.
AVAppTests/ant.properties Diff Switch to side-by-side view
Loading...
AVAppTests/assets
Directory.
AVAppTests/project.properties Diff Switch to side-by-side view
Loading...
AVAppTests/src
Directory.
AVAppTests/src/net
Directory.
AVAppTests/src/net/sf/fakenames/avapp/GreeterTest.java Diff Switch to side-by-side view
Loading...
AVAppTests/src/net/sf/fakenames/avapp/ScriptRunnerTest.java Diff Switch to side-by-side view
Loading...
AVAppTests/src/net/sf/fakenames/avapp/SignatureScannerTest.java Diff Switch to side-by-side view
Loading...
AVAppTests/src/net/sf/fakenames/avapp/VirusProviderTest.java Diff Switch to side-by-side view
Loading...
assets/userdoc.html Diff Switch to side-by-side view
Loading...
src/net/sf/fakenames/avapp/ScanActivity.java Diff Switch to side-by-side view
Loading...
src/net/sf/fakenames/avapp/SelectionBuilder.java Diff Switch to side-by-side view
Loading...
src/net/sf/fakenames/avapp/model/VirusProvider.java Diff Switch to side-by-side view
Loading...
AndroidManifest.xml Diff Switch to side-by-side view
Loading...
assets
Directory.
assets/scripts
Directory.
assets/scripts/apkscan.bsh Diff Switch to side-by-side view
Loading...
assets/scripts/sdscan.bsh Diff Switch to side-by-side view
Loading...
assets/scripts/vulnscan.bsh Diff Switch to side-by-side view
Loading...
jni
Directory.
jni/binding
Directory.
jni/binding/Android.mk Diff Switch to side-by-side view
Loading...
jni/binding/binding.c Diff Switch to side-by-side view
Loading...
res
Directory.
res/layout
Directory.
res/layout/about.xml Diff Switch to side-by-side view
Loading...
res/values
Directory.
res/values/strings.xml Diff Switch to side-by-side view
Loading...
res/xml
Directory.
res/xml/syncadapter.xml Diff Switch to side-by-side view
Loading...
src
Directory.
src/net
Directory.
src/net/sf
Directory.
src/net/sf/fakenames/avapp/AVApp.java Diff Switch to side-by-side view
Loading...
src/net/sf/fakenames/avapp/AboutDialog.java Diff Switch to side-by-side view
Loading...
src/net/sf/fakenames/avapp/ApkInterceptor.java Diff Switch to side-by-side view
Loading...
src/net/sf/fakenames/avapp/Greeter.java Diff Switch to side-by-side view
Loading...
src/net/sf/fakenames/avapp/SDReceiver.java Diff Switch to side-by-side view
Loading...
src/net/sf/fakenames/avapp/ScriptResultReceiver.java Diff Switch to side-by-side view
Loading...
src/net/sf/fakenames/avapp/ScriptRunner.java Diff Switch to side-by-side view
Loading...
src/net/sf/fakenames/avapp/SignatureScanner.java Diff Switch to side-by-side view
Loading...
src/net/sf/fakenames/avapp/Utils.java Diff Switch to side-by-side view
Loading...
src/net/sf/fakenames/avapp/fragments/DetectionLog.java Diff Switch to side-by-side view
Loading...
src/net/sf/fakenames/avapp/fragments/ScriptList.java Diff Switch to side-by-side view
Loading...
src/net/sf/fakenames/avapp/fragments/ServiceControl.java Diff Switch to side-by-side view
Loading...
avdb.hdb to AVAppTests/assets/avdb.hdb
File was copied or renamed.
eicar.txt to AVAppTests/assets/eicar.txt
File was copied or renamed.
helloworld.bsh to AVAppTests/assets/helloworld.bsh
--- a/helloworld.bsh
+++ b/AVAppTests/assets/helloworld.bsh
@@ -1,7 +1,16 @@
-// helloworld
-// Привет, Мир
-// false
+/*
+helloworld
+Привет, Мир
+false
+*/
 
+import android.os.Bundle;
 import android.util.Log;
 
+int parameter = ((Bundle)_bundle).getInt("test extra");
+
 Log.e("script", "It works!");
+
+Thread.sleep(parameter);
+
+((Bundle)_bundle).putInt("test extra", ++parameter);
src/net/sf/fakenames/avapp/BuiltinScripts.java to AVAppTests/AndroidManifest.xml
--- a/src/net/sf/fakenames/avapp/BuiltinScripts.java
+++ b/AVAppTests/AndroidManifest.xml
@@ -1,34 +1,21 @@
-package net.sf.fakenames.avapp;
-
-import net.sf.fakenames.avapp.model.ScriptInfo;
-
-import java.util.LinkedHashMap;
-
-/**
- * Created by uniqa on 31.05.14.
- */
-public class BuiltinScripts
-{
-    private static LinkedHashMap<String, ScriptInfo> scriptInfo = new LinkedHashMap<>();
-    static
-    {
-        scriptInfo.put("apkscan", new ScriptInfo("apkscan", "Проверка приложений", false));
-        scriptInfo.put("updatedb", new ScriptInfo("updatedb", "Обновление базы", false));
-        scriptInfo.put("sdscan", new ScriptInfo("sdscan", "Проверка SD карты", false));
-        scriptInfo.put("vulnscan", new ScriptInfo("vulnscan", "Поиск уязвимостей", false));
-    }
-
-    /**
-     * We don't have time to parse all builtin scripts upon every launch!
-     * @return
-     */
-    static LinkedHashMap<String, ScriptInfo> get()
-    {
-        return scriptInfo;
-    }
-
-    static int size()
-    {
-        return scriptInfo.size();
-    }
-}
+<?xml version="1.0" encoding="utf-8"?>
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+          package="net.sf.fakenames.avapp.tests"
+          android:versionCode="1"
+          android:versionName="1.0">
+    <!-- We add an application tag here just so that we can indicate that
+         this package needs to link against the android.test library,
+         which is needed when building test cases. -->
+    <application>
+        <uses-library android:name="android.test.runner"/>
+    </application>
+    <!--
+    This declares that this application uses the instrumentation test runner targeting
+    the package of net.sf.fakenames.avapp.  To run the tests use the command:
+    "adb shell am instrument -w net.sf.fakenames.avapp.tests/android.test.InstrumentationTestRunner"
+    -->
+    <instrumentation android:name="net.sf.fakenames.avapp.InstrumentationTestRunner"
+                     android:targetPackage="net.sf.fakenames.avapp"
+                     android:label="Tests for net.sf.fakenames.avapp"/>
+</manifest>
src/net/sf/fakenames/avapp/DatabaseHelper.java to AVAppTests/build.xml
--- a/src/net/sf/fakenames/avapp/DatabaseHelper.java
+++ b/AVAppTests/build.xml
@@ -1,99 +1,92 @@
-package net.sf.fakenames.avapp;
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="AVAppTests" default="help">
 
-import java.sql.SQLException;
+    <!-- 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"/>
 
-import android.content.Context;
-import android.database.sqlite.SQLiteDatabase;
-import android.util.Log;
+    <!-- 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:
 
-import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper;
-import com.j256.ormlite.dao.Dao;
-import com.j256.ormlite.dao.RuntimeExceptionDao;
-import com.j256.ormlite.support.ConnectionSource;
-import com.j256.ormlite.table.TableUtils;
-import net.sf.fakenames.avapp.model.VirusDetection;
+         source.dir
+             The name of the source directory. Default is 'src'.
+         out.dir
+             The name of the output directory. Default is 'bin'.
 
-/**
- * Database helper class used to manage the creation and upgrading of your database. This class also usually provides
- * the DAOs used by the other classes.
- */
-public class DatabaseHelper extends OrmLiteSqliteOpenHelper
-{
-    // name of the database file for your application -- change to something appropriate for your app
-    private static final String DATABASE_NAME = "avapp.db";
-    // any time you make changes to your database objects, you may have to increase the database version
-    private static final int DATABASE_VERSION = 1;
+         For other overridable properties, look at the beginning of the rules
+         files in the SDK, at tools/ant/build.xml
 
-    // the DAO object we use to access the SimpleData table
-    private Dao<VirusDetection, Integer> simpleDao = null;
-    private RuntimeExceptionDao<VirusDetection, Integer> simpleRuntimeDao = null;
+         Properties related to the SDK location or the project target should
+         be updated using the 'android' tool with the 'update' action.
 
-    public DatabaseHelper(Context context)
-    {
-        super(context, DATABASE_NAME, null, DATABASE_VERSION);
-    }
+         This file is an integral part of the build system for your
+         application and should be checked into Version Control Systems.
 
-    /**
-     * This is called when the database is first created. Usually you should call createTable statements here to create
-     * the tables that will store your data.
-     */
-    @Override
-    public void onCreate(SQLiteDatabase db, ConnectionSource connectionSource)
-    {
-        try
-        {
-            Log.i(DatabaseHelper.class.getName(), "onCreate");
-            TableUtils.createTable(connectionSource, VirusDetection.class);
-        }
-        catch (SQLException e)
-        {
-            Log.e(DatabaseHelper.class.getName(), "Can't create database", e);
-            throw new RuntimeException(e);
-        }
-    }
+         -->
+    <property file="ant.properties"/>
 
-    /**
-     * This is called when your application is upgraded and it has a higher version number. This allows you to adjust
-     * the various data to match the new version number.
-     */
-    @Override
-    public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int oldVersion, int newVersion)
-    {
-        try
-        {
-            Log.i(DatabaseHelper.class.getName(), "onUpgrade");
-            TableUtils.dropTable(connectionSource, VirusDetection.class, true);
-            // after we drop the old databases, we create the new ones
-            onCreate(db, connectionSource);
-        }
-        catch (SQLException e)
-        {
-            Log.e(DatabaseHelper.class.getName(), "Can't drop databases", e);
-            throw new RuntimeException(e);
-        }
-    }
+    <!-- if sdk.dir was not set from one of the property file, then
+         get it from the ANDROID_HOME env var.
+         This must be done before we load project.properties since
+         the proguard config can use sdk.dir -->
+    <property environment="env"/>
+    <condition property="sdk.dir" value="${env.ANDROID_HOME}">
+        <isset property="env.ANDROID_HOME"/>
+    </condition>
 
-    /**
-     * Returns the RuntimeExceptionDao (Database Access Object) version of a Dao for our SimpleData class. It will
-     * create it or just give the cached value. RuntimeExceptionDao only through RuntimeExceptions.
-     */
-    public RuntimeExceptionDao<VirusDetection, Integer> getVirusDetectionDao()
-    {
-        if (simpleRuntimeDao == null)
-        {
-            simpleRuntimeDao = getRuntimeExceptionDao(VirusDetection.class);
-        }
-        return simpleRuntimeDao;
-    }
+    <!-- The project.properties file is created and updated by the 'android'
+         tool, as well as ADT.
 
-    /**
-     * Close the database connections and clear any cached DAOs.
-     */
-    @Override
-    public void close()
-    {
-        super.close();
-        simpleDao = null;
-        simpleRuntimeDao = null;
-    }
-}+         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 the ANDROID_HOME environment variable."
+            unless="sdk.dir"
+            />
+
+    <!--
+        Import per project custom build rules if present at the root of the project.
+        This is the place to put custom intermediary targets such as:
+            -pre-build
+            -pre-compile
+            -post-compile (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})
+            -post-package
+            -post-build
+            -pre-clean
+    -->
+    <import file="custom_rules.xml" optional="true"/>
+
+    <!-- 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>
src/net/sf/fakenames/avapp/model/ScriptInfo.java to AVAppTests/src/net/sf/fakenames/avapp/InstrumentationTestRunner.java
--- a/src/net/sf/fakenames/avapp/model/ScriptInfo.java
+++ b/AVAppTests/src/net/sf/fakenames/avapp/InstrumentationTestRunner.java
@@ -1,82 +1,70 @@
-package net.sf.fakenames.avapp.model;
+package net.sf.fakenames.avapp;
 
-import java.io.Serializable;
+import android.annotation.TargetApi;
+import android.os.Build;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.channels.Channels;
+import java.nio.channels.ReadableByteChannel;
+import java.nio.channels.WritableByteChannel;
 
 /**
- * Contains information about a single script
+ * Created by uniqa on 28.06.14.
  */
-public class ScriptInfo implements Serializable
+@TargetApi(Build.VERSION_CODES.FROYO)
+public class InstrumentationTestRunner extends android.test.InstrumentationTestRunner
 {
-    private String name;
-    private String desc;
-    private boolean builtin;
-    private boolean sheduled;
+    static final String TEST_SCRIPT = "helloworld";
+    static final String TEST_VIRUS = "eicar";
+    static final String TEST_DB = "avdb.hdb";
+    static final String TEST_SCRIPT_DESC = "������������, ������";
+    static final String TEST_VIRUS_DESC = "eicar.txt";
+    static File testScriptFile;
+    static File testVirusFile;
+    static File testDb;
 
-    public ScriptInfo() {}
+    @Override
+    public void onStart()
+    {
+        final File tempDir = getContext().getExternalCacheDir();
 
-    public ScriptInfo(String name, String desc, boolean sheduled, boolean... builtin)
-    {
-        this.name = name;
-        this.desc = desc;
-        this.sheduled = sheduled;
-        this.builtin = builtin.length == 0 ? true : builtin[0];
-    }
+        assetsCopy(TEST_SCRIPT + ".bsh", testScriptFile = new File(tempDir, TEST_SCRIPT));
+        assetsCopy(TEST_VIRUS + ".txt", testVirusFile = new File(tempDir, TEST_VIRUS + ".bin"));
+        assetsCopy(TEST_DB, testDb = new File(tempDir, TEST_DB));
 
-    public String getName()
-    {
-        return name;
-    }
-
-    public void setName(String name)
-    {
-        this.name = name;
-    }
-
-    public String getDesc()
-    {
-        return desc;
-    }
-
-    public void setDesc(String desc)
-    {
-        this.desc = desc;
-    }
-
-    public boolean isSheduled()
-    {
-        return sheduled;
-    }
-
-    public void setSheduled(boolean isSheduled)
-    {
-        this.sheduled = isSheduled;
-    }
-
-    public boolean isBuiltin()
-    {
-        return builtin;
-    }
-
-    public void setBuiltin(boolean builtin)
-    {
-        this.builtin = builtin;
+        super.onStart();
     }
 
     @Override
-    public int hashCode()
+    public void onDestroy()
     {
-        return name.hashCode();
+        testScriptFile.delete();
+        testVirusFile.delete();
+        testDb.delete();
+
+        super.onDestroy();
     }
 
-    @Override
-    public boolean equals(Object o)
+    private void assetsCopy(String name, File dest)
     {
-        return o instanceof ScriptInfo && name.equals(((ScriptInfo) o).getName());
-    }
-
-    @Override
-    public String toString()
-    {
-        return getDesc();
+        ReadableByteChannel testScriptSource = null;
+        WritableByteChannel testScriptDest = null;
+        try
+        {
+            testScriptSource = Channels.newChannel(getContext().getAssets().open(name));
+            testScriptDest = new FileOutputStream(dest).getChannel();
+            Utils.fastChannelCopy(testScriptSource, testScriptDest);
+        }
+        catch (IOException unexpected)
+        {
+            throw new IllegalStateException(unexpected);
+        }
+        finally
+        {
+            Utils.shut(testScriptDest);
+            Utils.shut(testScriptSource);
+        }
     }
 }
src/net/sf/fakenames/avapp/model/VirusDetection.java to src/net/sf/fakenames/avapp/model/VirusContract.java
--- a/src/net/sf/fakenames/avapp/model/VirusDetection.java
+++ b/src/net/sf/fakenames/avapp/model/VirusContract.java
@@ -1,94 +1,118 @@
 package net.sf.fakenames.avapp.model;
 
-import android.os.Parcel;
-import android.os.Parcelable;
-import com.j256.ormlite.field.DatabaseField;
-
-import java.io.Serializable;
-import java.text.SimpleDateFormat;
+import android.content.ContentResolver;
+import android.net.Uri;
+import android.provider.BaseColumns;
 
 /**
  * Created by uniqa on 03.06.14.
  */
-public class VirusDetection implements Parcelable
+public final class VirusContract
 {
-    /**
-     * The item is already removed or otherwise inaccessible
-     */
-    public static final int URGENCY_INVALID = 0;
-    /**
-     * The item was successfully taken care of manually or by applying rules
-     */
-    public static final int URGENCY_LOW = 1;
-    /**
-     * The item still awaits user's attention
-     */
-    public static final int URGENCY_HIGH = 2;
+    public static final String AUTHORITY = "net.sf.fakenames.avapp.provider";
 
-    public static final String COLUMN_DATE = "when";
+    public static final Uri AUTHORITY_URI = Uri.parse("content://" + AUTHORITY);
 
-    @DatabaseField
-    public String filePath;
-    @DatabaseField
-    public String signature;
-    @DatabaseField(columnName=COLUMN_DATE, id=true)
-    public long when = System.currentTimeMillis();
-    @DatabaseField
-    public int urgency = URGENCY_HIGH;
+    public static final class Detection implements BaseColumns
+    {
+        static final String TABLE_NAME = "detections";
 
-    public VirusDetection() {}
+        public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, TABLE_NAME);
 
-    public VirusDetection(String filePath, String signature)
-    {
-        this.filePath = filePath;
-        this.signature = signature;
+        /**
+         * The MIME type of {@link #CONTENT_URI} providing a directory of
+         * detection records.
+         */
+        public static final String CONTENT_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE + "/vnd.droidquarantine.detection";
+
+        /**
+         * The MIME type of a {@link #CONTENT_URI} subdirectory of a single detection event.
+         */
+        public static final String CONTENT_ITEM_TYPE = ContentResolver.CURSOR_ITEM_BASE_TYPE + "/vnd.droidquarantine.detection";
+
+        /**
+         * type: String
+         */
+        public static final String FILE_URI = "file_uri";
+        /**
+         * type: String
+         */
+        public static final String DETECTION_SIGNATURE = "signature";
+        /**
+         * type: int
+         */
+        public static final String DETECTION_URGENCY = "urgency";
+        /**
+         * type: long
+         */
+        public static final String DETECTION_DATE = "detected_when";
+
+        /**
+         * The item is already removed or otherwise inaccessible
+         */
+        public static final int URGENCY_INVALID = 0;
+        /**
+         * The item was successfully taken care of manually or by applying rules
+         */
+        public static final int URGENCY_LOW = 1;
+        /**
+         * The item still awaits user's attention
+         */
+        public static final int URGENCY_HIGH = 2;
+
+        /**
+         * Parameter, passed to delete operations
+         */
+        public static final String ACTION = "action";
+
+        /**
+         * The files, corresponding to threat, should be removed
+         */
+        public static final int REMOVE_FILE              = 0x00000001;
+
+        /**
+         * The files, corresponding to threat, should be copied to the quarantine
+         */
+        public static final int QUARANTINE_FILE          = 0x00000002;
     }
 
-    @Override
-    public String toString()
+    public static final class ScriptInfo implements BaseColumns
     {
-        StringBuilder sb = new StringBuilder();
-        if (urgency == URGENCY_INVALID)
-            sb.append("(invalid) ");
-        sb.append(signature);
-        sb.append(", ").append(filePath);
-        SimpleDateFormat dateFormatter = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss.S");
-        sb.append(", ").append("when=").append(dateFormatter.format(when));
-        return sb.toString();
+        static final String TABLE_NAME = "scripts";
+
+        public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, TABLE_NAME);
+
+        /**
+         * The MIME type of {@link #CONTENT_URI} providing a directory of installed script modules.
+         */
+        public static final String CONTENT_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE + "/vnd.droidquarantine.script";
+
+        /**
+         * The MIME type of a {@link #CONTENT_URI} subdirectory of a single script.
+         */
+        public static final String CONTENT_ITEM_TYPE = ContentResolver.CURSOR_ITEM_BASE_TYPE + "/vnd.droidquarantine.script";
+
+        /**
+         * type: String
+         */
+        public static final String SCRIPT_NAME = "name";
+        /**
+         * type: String
+         */
+        public static final String SCRIPT_DESC = "desc";
+        /**
+         * type: boolean
+         */
+        public static final String BUILTIN = "builtin";
+        /**
+         * type: boolean
+         */
+        public static final String SHEDULED = "shedule";
+
+        public static final String INSTALL_FROM = "from";
+
+        private ScriptInfo() {}
     }
 
-    @Override
-    public int describeContents()
-    {
-        return 0;
-    }
-
-    @Override
-    public void writeToParcel(Parcel dest, int flags)
-    {
-        dest.writeString(filePath);
-        dest.writeString(signature);
-        dest.writeLong(when);
-        dest.writeInt(urgency);
-    }
-
-    public static final Parcelable.Creator<VirusDetection> CREATOR = new Creator<VirusDetection>()
-    {
-        @Override
-        public VirusDetection createFromParcel(Parcel source)
-        {
-            VirusDetection result = new VirusDetection();
-            result.filePath = source.readString();
-            result.signature = source.readString();
-            result.when = source.readLong();
-            result.urgency = source.readInt();
-            return result;
-        }
-
-        @Override
-        public VirusDetection[] newArray(int size)
-        {
-            return new VirusDetection[size];
-        }
-    };
+    private VirusContract() {}
 }
src/net/sf/fakenames/avapp/stubs/StubProvider.java to AVAppTests/proguard-project.txt
--- a/src/net/sf/fakenames/avapp/stubs/StubProvider.java
+++ b/AVAppTests/proguard-project.txt
@@ -1,72 +1,20 @@
-package net.sf.fakenames.avapp.stubs;
+# To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
 
-import android.content.ContentProvider;
-import android.content.ContentValues;
-import android.database.Cursor;
-import android.net.Uri;
+# Add any project specific keep options here:
 
-/*
- * Define an implementation of ContentProvider that stubs out
- * all methods
- */
-public class StubProvider extends ContentProvider
-{
-    /*
-     * Always return true, indicating that the
-     * provider loaded correctly.
-     */
-    @Override
-    public boolean onCreate() {
-        return true;
-    }
-    /*
-     * Return an empty String for MIME type
-     */
-    public String getType() {
-        return new String();
-    }
-    /*
-     * query() always returns no results
-     *
-     */
-    @Override
-    public Cursor query(
-            Uri uri,
-            String[] projection,
-            String selection,
-            String[] selectionArgs,
-            String sortOrder) {
-        return null;
-    }
-
-    @Override
-    public String getType(Uri uri)
-    {
-        return new String();
-    }
-
-    /*
-     * insert() always returns null (no URI)
-     */
-    @Override
-    public Uri insert(Uri uri, ContentValues values) {
-        return null;
-    }
-    /*
-     * delete() always returns "no rows affected" (0)
-     */
-    @Override
-    public int delete(Uri uri, String selection, String[] selectionArgs) {
-        return 0;
-    }
-    /*
-     * update() always returns "no rows affected" (0)
-     */
-    public int update(
-            Uri uri,
-            ContentValues values,
-            String selection,
-            String[] selectionArgs) {
-        return 0;
-    }
-}+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
1 2 3 > >> (Page 1 of 3)