# Path: IApp.py
# class IApp(object):
#     '''
#     classdocs
#     '''
#     name = "Unknown"
#     cname = "Unknown"
#     databases = {}
#     known = False
#     dummyRE = type(re.compile("nfi"))
#     version = [-1]
#     
#     def get_versions(self):
#         return self.version
#     
#     def has_defaultversion(self):
#         if IDeviceVersion.DEFAULT_VERSION in self.version:
#             return True
#         return False
#     
#     def has_version(self,appversion):
#         if appversion in self.version:
#             return True
#         return False
#     
#     def get_packagename(self):
#         return self.name
#     
#     def get_canonicalname(self):
#         return self.cname
#     
#     def get_files(self):
#         return self.databases
#     
#     def get_file_info(self, dbname):
#         if len(self.databases) == 0:
#             return None
#         for thisdbname,defn in self.databases.iteritems():
#             if type(thisdbname) == type("str"):
#                 if thisdbname == dbname:
#                     return defn
#             elif type(thisdbname) == self.dummyRE:
#                 if thisdbname.match(dbname) != None:
#                     return defn
#         return None
#     
#     def set_packagename(self, name):
#         self.name = name
#     
#     def __init__(self):
#         return
# 
# class KnownTable(object):
#     name = None
#     sql = None
#     converter = None
#     knownfields = None
#     def __init__(self, table_name, parse_sql, converter=None, knownfields=None ):
#         self.name = table_name
#         self.sql = parse_sql
#         self.converter = converter
#         self.knownfields = knownfields
# 
# class DataTypes(object):
#     EMPTY = 0
#     DATA = 1
#     TEXT = 2
#     DATE = 3


from IApp import IApp, KnownTable, DataTypes
import ConvertUtils
    databases = { 
        "contacts2.db": [ 
            KnownTable("_sync_state", None, None, {"data": DataTypes.DATA}),
            KnownTable("data", None, None, { "data15": DataTypes.DATA }),
            KnownTable("contacts", None,
                {"contact_last_updated_timestamp": ConvertUtils.JsToUnix, #18
                 "last_time_contacted": ConvertUtils.JsToUnix}, #15
                {"contact_last_updated_timestamp": DataTypes.DATE,
                 "last_time_contacted": DataTypes.DATE}),
            KnownTable("deleted_contacts", None, #18
                {"contact_deleted_timestamp":ConvertUtils.JsToUnix},
                {"contact_deleted_timestamp": DataTypes.DATE}),
            KnownTable("raw_contacts", None,
                {"last_time_contacted": ConvertUtils.JsToUnix}, #15 
                {"last_time_contacted": DataTypes.DATE}),
            KnownTable("calls", None,
                {"date":ConvertUtils.JsToUnix},
                {"date": DataTypes.DATE}),
            KnownTable("data_usage_stat", None, 
                {"last_time_used":ConvertUtils.JsToUnix}, 
                {"last_time_contacted": DataTypes.DATE}),
            KnownTable("view_raw_contacts", None,
                {"last_time_contacted":ConvertUtils.JsToUnix},
                {"last_time_contacted": DataTypes.DATE}),
            KnownTable("view_contacts", None,
                {"last_time_contacted":ConvertUtils.JsToUnix},
                {"last_time_contacted": DataTypes.DATE}),
            KnownTable("view_entities", None,
                {"contact_last_updated_timestamp":ConvertUtils.JsToUnix},
                {"contact_last_updated_timestamp": DataTypes.DATE}),

# Path: IApp.py
# class IApp(object):
#     '''
#     classdocs
#     '''
#     name = "Unknown"
#     cname = "Unknown"
#     databases = {}
#     known = False
#     dummyRE = type(re.compile("nfi"))
#     version = [-1]
#     
#     def get_versions(self):
#         return self.version
#     
#     def has_defaultversion(self):
#         if IDeviceVersion.DEFAULT_VERSION in self.version:
#             return True
#         return False
#     
#     def has_version(self,appversion):
#         if appversion in self.version:
#             return True
#         return False
#     
#     def get_packagename(self):
#         return self.name
#     
#     def get_canonicalname(self):
#         return self.cname
#     
#     def get_files(self):
#         return self.databases
#     
#     def get_file_info(self, dbname):
#         if len(self.databases) == 0:
#             return None
#         for thisdbname,defn in self.databases.iteritems():
#             if type(thisdbname) == type("str"):
#                 if thisdbname == dbname:
#                     return defn
#             elif type(thisdbname) == self.dummyRE:
#                 if thisdbname.match(dbname) != None:
#                     return defn
#         return None
#     
#     def set_packagename(self, name):
#         self.name = name
#     
#     def __init__(self):
#         return
# 
# class KnownTable(object):
#     name = None
#     sql = None
#     converter = None
#     knownfields = None
#     def __init__(self, table_name, parse_sql, converter=None, knownfields=None ):
#         self.name = table_name
#         self.sql = parse_sql
#         self.converter = converter
#         self.knownfields = knownfields
# 
# class DataTypes(object):
#     EMPTY = 0
#     DATA = 1
#     TEXT = 2
#     DATE = 3


# Path: AndroidApps/com_android_providers_contacts.py
from IApp import IApp, KnownTable, DataTypes
import ConvertUtils

    databases = { 
        "contacts2.db": [ 
            KnownTable("_sync_state", None, None, {"data": DataTypes.DATA}),
            KnownTable("data", None, None, { "data15": DataTypes.DATA }),
            KnownTable("contacts", None,
                {"contact_last_updated_timestamp": ConvertUtils.JsToUnix, #18
                 "last_time_contacted": ConvertUtils.JsToUnix}, #15
                {"contact_last_updated_timestamp": DataTypes.DATE,
                 "last_time_contacted": DataTypes.DATE}),
            KnownTable("deleted_contacts", None, #18
                {"contact_deleted_timestamp":ConvertUtils.JsToUnix},
                {"contact_deleted_timestamp": DataTypes.DATE}),
            KnownTable("raw_contacts", None,
                {"last_time_contacted": ConvertUtils.JsToUnix}, #15 
                {"last_time_contacted": DataTypes.DATE}),
            KnownTable("calls", None,
                {"date":ConvertUtils.JsToUnix},
                {"date": DataTypes.DATE}),
            KnownTable("data_usage_stat", None, 
                {"last_time_used":ConvertUtils.JsToUnix}, 
                {"last_time_contacted": DataTypes.DATE}),
            KnownTable("view_raw_contacts", None,
                {"last_time_contacted":ConvertUtils.JsToUnix},
                {"last_time_contacted": DataTypes.DATE}),
            KnownTable("view_contacts", None,
                {"last_time_contacted":ConvertUtils.JsToUnix},
                {"last_time_contacted": DataTypes.DATE}),
            KnownTable("view_entities", None,
                {"contact_last_updated_timestamp":ConvertUtils.JsToUnix},
                {"contact_last_updated_timestamp": DataTypes.DATE}),

            KnownTable("view_data_usage_stat", None,