<commit_before>'''
   Copyright (c) 2017 <NAME>

   This file is part of mac_apt (macOS Artifact Parsing Tool).
   Usage or distribution of this software/code is subject to the
   terms of the MIT License.

   terminalstate.py
   ---------------
   This plugin reads Terminal Saved State information which includes
   full text content of terminal window.
'''

import biplist
import io
import logging
import os
import struct
from Cryptodome.Cipher import AES
from plugins.helpers.deserializer import process_nsa_plist
from plugins.helpers.macinfo import *
from plugins.helpers.writer import *


__Plugin_Name = "TERMINALSTATE" # Cannot have spaces, and must be all caps!
__Plugin_Friendly_Name = "Terminal Saved State"
__Plugin_Version = "1.0"
__Plugin_Description = "Reads Terminal saved state files which includes full text content of terminal windows"
__Plugin_Author = "<NAME>"
__Plugin_Author_Email = "<EMAIL>"

__Plugin_Modes = "MACOS,ARTIFACTONLY" # Valid values are 'MACOS', 'IOS, 'ARTIFACTONLY' 
__Plugin_ArtifactOnly_Usage = 'Provide the folder /Users/<USER>/Library/Saved Application State/com.apple.Terminal.savedState as input'

log = logging.getLogger('MAIN.' + __Plugin_Name) # Do not rename or remove this ! This is the logger object

#---- Do not change the variable names in above section ----#

class TerminalWindowInfo():
    def __init__(self, title, working_dir, content, user, source):
        self.content = content
        self.title = title
        self.working_dir = working_dir
        self.user = user
        self.source = source
        # self.file_created_time = ''
        # self.file_modified_time = ''

def PrintAll(terminals, output_params):<commit_msg>remove pycryptodomex requirement<commit_after>'''
   Copyright (c) 2017 <NAME>

   This file is part of mac_apt (macOS Artifact Parsing Tool).
   Usage or distribution of this software/code is subject to the
   terms of the MIT License.

   terminalstate.py
   ---------------
   This plugin reads Terminal Saved State information which includes
   full text content of terminal window.
'''

import biplist
import io
import logging
import os
import struct
from Crypto.Cipher import AES
from plugins.helpers.deserializer import process_nsa_plist
from plugins.helpers.macinfo import *
from plugins.helpers.writer import *


__Plugin_Name = "TERMINALSTATE" # Cannot have spaces, and must be all caps!
__Plugin_Friendly_Name = "Terminal Saved State"
__Plugin_Version = "1.0"
__Plugin_Description = "Reads Terminal saved state files which includes full text content of terminal windows"
__Plugin_Author = "<NAME>"
__Plugin_Author_Email = "<EMAIL>"

__Plugin_Modes = "MACOS,ARTIFACTONLY" # Valid values are 'MACOS', 'IOS, 'ARTIFACTONLY' 
__Plugin_ArtifactOnly_Usage = 'Provide the folder /Users/<USER>/Library/Saved Application State/com.apple.Terminal.savedState as input'

log = logging.getLogger('MAIN.' + __Plugin_Name) # Do not rename or remove this ! This is the logger object

#---- Do not change the variable names in above section ----#

class TerminalWindowInfo():
    def __init__(self, title, working_dir, content, user, source):
        self.content = content
        self.title = title
        self.working_dir = working_dir
        self.user = user
        self.source = source
        # self.file_created_time = ''
        # self.file_modified_time = ''

def PrintAll(terminals, output_params):
{'fraction_non_alphanumeric': 0.08841732979664015, 'fraction_numerical': 0.0035366931918656055, 'mean_word_length': 3.883453237410072, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1648092', 'n_tokens_mistral': 990, 'n_tokens_neox': 955, 'n_words': 339}