Merge pull request #5274 from dannysmyda/5588-add-id-attribute

5588 add id attribute to contacts in message parsers
This commit is contained in:
Richard Cordovano
2019-09-26 14:14:07 -04:00
committed by GitHub
6 changed files with 25 additions and 41 deletions
@@ -29,12 +29,10 @@ class TskContactsParser(ResultSetIterator):
def __init__(self, result_set):
super(TskContactsParser, self).__init__(result_set)
self._DEFAULT_VALUE = ""
self._DEFAULT_ACCOUNT_ADDRESS = None
def get_account_name(self):
return self._DEFAULT_VALUE
def get_contact_name(self):
return self._DEFAULT_VALUE
def get_account_address(self):
return self._DEFAULT_ACCOUNT_ADDRESS
def get_phone(self):
return self._DEFAULT_VALUE
+4 -6
View File
@@ -142,8 +142,7 @@ class LineAnalyzer(general.AndroidComponentAnalyzer):
contacts_parser = LineContactsParser(contacts_db)
while contacts_parser.next():
helper.addContact(
contacts_parser.get_account_name(),
contacts_parser.get_contact_name(),
contacts_parser.get_account_address(),
contacts_parser.get_phone(),
contacts_parser.get_home_phone(),
contacts_parser.get_mobile_phone(),
@@ -341,11 +340,10 @@ class LineContactsParser(TskContactsParser):
"""
)
)
def get_account_name(self):
return self.result_set.getString("m_id")
def get_contact_name(self):
return self.result_set.getString("server_name")
def get_account_address(self):
return Account.Address(self.result_set.getString("m_id"),
self.result_set.getString("server_name"))
class LineMessagesParser(TskMessagesParser):
"""
+4 -7
View File
@@ -151,8 +151,7 @@ class SkypeAnalyzer(general.AndroidComponentAnalyzer):
contacts_parser = SkypeContactsParser(skype_db)
while contacts_parser.next():
helper.addContact(
contacts_parser.get_account_name(),
contacts_parser.get_contact_name(),
contacts_parser.get_account_address(),
contacts_parser.get_phone(),
contacts_parser.get_home_phone(),
contacts_parser.get_mobile_phone(),
@@ -362,11 +361,9 @@ class SkypeContactsParser(TskContactsParser):
)
)
def get_account_name(self):
return self.result_set.getString("entry_id")
def get_contact_name(self):
return self.result_set.getString("name")
def get_account_address(self):
return Account.Address(self.result_set.getString("entry_id"),
self.result_set.getString("name"))
class SkypeMessagesParser(TskMessagesParser):
"""
+5 -8
View File
@@ -108,8 +108,7 @@ class TextNowAnalyzer(general.AndroidComponentAnalyzer):
contacts_parser = TextNowContactsParser(textnow_db)
while contacts_parser.next():
helper.addContact(
contacts_parser.get_account_name(),
contacts_parser.get_contact_name(),
contacts_parser.get_account_address(),
contacts_parser.get_phone(),
contacts_parser.get_home_phone(),
contacts_parser.get_mobile_phone(),
@@ -267,12 +266,10 @@ class TextNowContactsParser(TskContactsParser):
)
)
def get_account_name(self):
return self.result_set.getString("number")
def get_contact_name(self):
return self.result_set.getString("name")
def get_account_address(self):
return Account.Address(self.result_set.getString("number"),
self.result_set.getString("name"))
def get_phone(self):
return self.result_set.getString("number")
+4 -7
View File
@@ -116,8 +116,7 @@ class ViberAnalyzer(general.AndroidComponentAnalyzer):
contacts_parser = ViberContactsParser(contacts_db)
while contacts_parser.next():
helper.addContact(
contacts_parser.get_account_name(),
contacts_parser.get_contact_name(),
contacts_parser.get_account_address(),
contacts_parser.get_phone(),
contacts_parser.get_home_phone(),
contacts_parser.get_mobile_phone(),
@@ -273,11 +272,9 @@ class ViberContactsParser(TskContactsParser):
)
)
def get_account_name(self):
return self.result_set.getString("number")
def get_contact_name(self):
return self.result_set.getString("name")
def get_account_address(self):
return Account.Address(self.result_set.getString("number"),
self.result_set.getString("name"))
def get_phone(self):
return self.result_set.getString("number")
+5 -8
View File
@@ -170,8 +170,7 @@ class WhatsAppAnalyzer(general.AndroidComponentAnalyzer):
contacts_parser = WhatsAppContactsParser(contacts_db)
while contacts_parser.next():
helper.addContact(
contacts_parser.get_account_name(),
contacts_parser.get_contact_name(),
contacts_parser.get_account_address(),
contacts_parser.get_phone(),
contacts_parser.get_home_phone(),
contacts_parser.get_mobile_phone(),
@@ -410,12 +409,10 @@ class WhatsAppContactsParser(TskContactsParser):
"""
)
)
def get_account_name(self):
return self.result_set.getString("jid")
def get_contact_name(self):
return self.result_set.getString("name")
def get_account_address(self):
return Account.Address(self.result_set.getString("jid"),
self.result_set.getString("name"))
def get_phone(self):
return self.result_set.getString("number")