def get_bio_changes(self): logging.info("Get Biography Changes...") db = os.path.join(self.internal_cache_path, "databases", "tinder-3.db") database = Database(db) biography_changes = [] bio_list = database.execute_query( "select old_bio, bio, timestamp from profile_change_bio order by timestamp" ) for entry in bio_list: bio_change = {} bio_change["old"] = entry[0] bio_change["new"] = entry[1] bio_change["createdtime"] = entry[3] timeline_event = {} timeline_event["old"] = bio_change["old"] timeline_event["new"] = bio_change["new"] self.timeline.add(bio_change["createdtime"], "AF_user", timeline_event) biography_changes.append(bio_change) logging.info("{} biography change(s) found".format( len(biography_changes))) return biography_changes
def get_credit_cards(self): logging.info("Getting User credit cards...") db = os.path.join(self.internal_cache_path, "app_webview", "Default", "Web Data") database = Database(db) cards_list = [] cards = database.execute_query( "select name_on_card, expiration_month, expiration_year, card_number_encrypted, date_modified, origin, use_count, use_date from credit_cards;" ) for entry in cards: card = {} card["name"] = entry[0] card["expiration_date"] = "{}/{}".format(entry[1], entry[2]) card["card_number_encrypted"] = str(entry[3]) card["date_modified"] = str(entry[4]) card["origin"] = str(entry[5]) card["use_count"] = entry[6] card["use_date"] = str(entry[7]) timeline_event = {} timeline_event["name"] = card["name"] self.timeline.add(card["use_date"], "AF_creditcard", timeline_event) cards_list.append(card) logging.info("{} credit cards found".format(len(cards_list))) return cards_list
def get_user_messages(self): logging.info("Getting User Messages...") db = os.path.join(self.internal_cache_path, "databases", "tinder-3.db") database = Database(db) messages_list = [] messages = database.execute_query( "select message_to_id, message_from_id , message_text, message_sent_date/1000 as message_sent_date, case when message_is_liked = 0 then 'Not liked' when message_is_liked = 1 then 'Liked' else message_is_liked end, case when message_is_seen = 0 then 'Not seen' when message_is_seen = 1 then 'Seen' else message_is_seen end, message_delivery_status from message_view order by message_sent_date;" ) #getting messages from conversations for entry in messages: message = {} message["to"] = entry[0] message["from"] = entry[1] message["message"] = entry[2] message["created_time"] = entry[3] message["is_liked"] = str(entry[4]) message["is_seen"] = str(entry[5]) message["delivery_status"] = str(entry[6]).lower() messages_list.append(message) timeline_event = {} timeline_event["from"] = message["from"] timeline_event["to"] = message["to"] timeline_event["message"] = message["message"] self.timeline.add(message["created_time"], "AF_message", timeline_event) logging.info("{} messages found".format(len(messages_list))) return messages_list
def get_user_matches(self): logging.info("Getting User Matches...") matches = [] db = os.path.join(self.internal_cache_path, "databases", "tinder-3.db") database = Database(db) results = database.execute_query( "select match_id, match_creation_date/1000 , match_last_activity_date, match_person_id, match_person_name, match_person_bio, match_person_birth_date/1000, case when match_is_blocked = 1 then 'Blocked' when match_is_blocked = 0 then 'Not Blocked ' else 'Invalid' end from match_view;" ) for entry in results: match = {} match["id"] = entry[0] match["creation_date"] = entry[1] match["last_activity_date"] = entry[2] match["person_id"] = entry[3] match["person_name"] = entry[4] match["person_bio"] = entry[5] match["person_bithdate"] = entry[6] match["is_blocked"] = entry[7] matches.append(match) timeline_event = {} timeline_event["person_id"] = match["person_id"] timeline_event["person_name"] = match["person_name"] timeline_event["is_blocked"] = match["is_blocked"] self.timeline.add(match["creation_date"], "AF_relation", timeline_event) logging.info("{} matches found".format(len(matches))) return matches
def get_videos(self): logging.info("Getting Videos...") videos = [] db = os.path.join(self.internal_cache_path, "databases", "video.db") database = Database(db) results = database.execute_query( "select key, extra from video_http_header_t") for entry in results: video = {} video["key"] = entry[0] dump = json.loads(entry[1]) for line in dump["responseHeaders"].splitlines(): if 'Last-Modified:' in line: video["last_modified"] = Utils.date_parser( line.split(": ")[1], "%a, %d %b %Y %H:%M:%S %Z") timeline_event = {} timeline_event["video"] = video["key"] self.timeline.add(video["last_modified"], "video", timeline_event) break self.media.add( os.path.join("internal", "cache", "cache", video["key"])) videos.append(video) logging.info("{} video(s) found".format(len(videos))) return videos
def get_user_uniqueid_by_id(self, uid): db = os.path.join(self.internal_cache_path, "databases", "db_im_xx") database = Database(db) name = database.execute_query("select UNIQUE_ID from SIMPLE_USER where uid={}".format(uid)) if name: name = name[0][0] else: name = None return name
def get_last_session(self): logging.info("Getting last session...") session = [] relevant_keys = [ "device", "name", "status", "ab_sdk_version", "storage_available_internal_size", "storage_available_external_size", "app_storage_size", "brand", "page", "request_method", "is_first", "duration", "is_first", "rip", "duration", "author_id", "access2", "video_duration", "video_quality", "access", "page_uid", "previous_page", "enter_method", "enter_page", "key_word", "search_keyword", "next_tab", "search_type", "play_duration", "content", "manufacturer", "os_version" ] db = os.path.join(self.internal_cache_path, "databases", "ss_app_log.db") database = Database(db) results = database.execute_query( "select tag, ext_json, datetime(timestamp/1000, 'unixepoch', 'localtime'), session_id from event order by timestamp" ) for entry in results: session_entry = {} session_entry["action"] = entry[0] body_dump = json.loads(entry[1]) session_entry["time"] = Utils.date_parser(entry[2], "%Y-%m-%d %H:%M:%S") session_entry["session_id"] = entry[3] timeline_event = {} timeline_event["action"] = session_entry["action"] self.timeline.add(session_entry["time"], "AF_system", timeline_event) session.append(session_entry) #json body parser body = {} for key, value in body_dump.items(): if key in relevant_keys: body[key] = value session_entry["body"] = body logging.info("{} entrys found".format(len(results))) return session
def get_user_photos(self): logging.info("Get User Photos...") db = os.path.join(self.internal_cache_path, "databases", "tinder-3.db").encode('utf-8') database = Database(db) photos_list = database.execute_query("select image_uri from profile_media;") user_photos =[] for photo in photos_list: user_photos.append(photo[0]) self.media.add(photo[0], True) logging.info("{} photo(s) found".format(len(photos_list))) return user_photos
def get_open_events(self): logging.info("Get application open events...") open_events=[] db = os.path.join(self.internal_cache_path, "databases", "TIKTOK.db") database = Database(db) results = database.execute_query("select open_time/1000 from app_open;") for event in results: open_events.append(event[0]) timeline_event = {} timeline_event["event"]= "Open Application" self.timeline.add(event[0],"AF_system", timeline_event) return open_events
def get_locations(self): logging.info("Getting User locations...") db = os.path.join(self.internal_cache_path, "databases", "legacy_tinder-1.db") database = Database(db) locations_list = [] cards = database.execute_query( "select latitude, longitude, state_province_long, country_short_name, country_long_name, address,route,street_number,city, last_seen_date/1000 as last_seen_date from tinder_locations;" ) for entry in cards: location = {} location["latitude"] = entry[0] location["longitude"] = entry[1] location["province"] = entry[2] location["country_short"] = entry[3] location["country_long"] = entry[4] location["address"] = entry[5] location["route"] = entry[6] location["street_number"] = str(entry[7]) location["city"] = entry[8] location["last_seen_date"] = entry[9] locations_list.append(location) timeline_event = {} timeline_event["latitude"] = location["latitude"] timeline_event["longitude"] = location["longitude"] timeline_event["address"] = location["address"] timeline_event["city"] = location["city"] timeline_event["country_long"] = location["country_long"] self.timeline.add(location["last_seen_date"], "AF_location", timeline_event) self.locations.add(location["last_seen_date"], location["latitude"], location["longitude"]) logging.info("{} locations found".format(len(locations_list))) return locations_list
def get_user_profiles(self): logging.info("Getting User Profiles...") profiles = {} db = os.path.join(self.internal_cache_path, "databases", "db_im_xx") database = Database(db) results = database.execute_query("select UID, UNIQUE_ID, NICK_NAME, AVATAR_THUMB, case when follow_status = 1 then 'Following' when follow_status = 2 then 'Followed and Following ' else 'Invalid' end from SIMPLE_USER") for entry in results: message={} message["uid"] = entry[0] message["uniqueid"] = entry[1] message["nickname"] = entry[2] dump_avatar = json.loads(entry[3]) message["avatar"] = dump_avatar["url_list"][0] message["follow_status"] = entry[4] message["url"] = "https://www.tiktok.com/@{}".format(message["uniqueid"]) profiles[message["uniqueid"]] = message logging.info("{} profiles found".format(len(profiles.keys()))) return profiles
def get_user_messages(self): logging.info("Getting User Messages...") # db1 = os.path.join(self.internal_cache_path, "databases", "db_im_xx") # db2 = None # if not db2: # print("[Tiktok] User Messages database not found!") # return "" # db2 = os.path.join(self.internal_path, db2) # attach = "ATTACH '{}' AS 'db2'".format(db2) conversations_list = [ ] #each entry means 1 conversation, including participants information and messages for db in self.databases: if not db.endswith("_im.db"): continue database = Database(db) conversations_ids_list = database.execute_query( "select conversation_id from conversation_core" ) #list if conversations for conversation in conversations_ids_list: conversation_output = {} id1 = conversation[0].split(':')[2] id2 = conversation[0].split(':')[3] conversation_output["database"] = os.path.basename(db) conversation_output[ "participant_1"] = self.get_user_uniqueid_by_id(id1) conversation_output[ "participant_2"] = self.get_user_uniqueid_by_id(id2) conversation_output["messages"] = [] #messages from conversations messages_list = database.execute_query( "select created_time/1000 as created_time, content as message, case when read_status = 0 then 'Not read' when read_status = 1 then 'Read' else read_status end read_not_read, local_info, type, case when deleted = 0 then 'Not deleted' when deleted = 1 then 'Deleted' else deleted end, sender from msg where conversation_id='{}' order by created_time;" .format(conversation[0])) #getting messages from conversations for entry in messages_list: message = {} message["createdtime"] = entry[0] message["readstatus"] = str(entry[2]) message["localinfo"] = entry[3] if entry[6] == int(id1): message["sender"] = conversation_output[ "participant_1"] message["receiver"] = conversation_output[ "participant_2"] else: message["sender"] = conversation_output[ "participant_2"] message["receiver"] = conversation_output[ "participant_1"] message["type"] = self.get_message_type_by_id(entry[4]) message["message"] = self.parse_body_message_by_id( entry[4], json.loads(entry[1])) message["deleted"] = str(entry[5]) conversation_output["messages"].append(message) timeline_event = {} timeline_event["from"] = message["sender"] timeline_event["to"] = message["receiver"] timeline_event["message"] = message["message"] self.timeline.add(message["createdtime"], "AF_message", timeline_event) #adding conversation and participants information to main array conversations_list.append(conversation_output) logging.info("{} messages found".format( len(conversation_output.get("messages")))) return conversations_list