def method_name(main_line, smali_file):
    """
    Returns the first line of the method - method definition - of a method that
    executes the given line

    :param int main_line: the executed line to get the method definition from
    :param str smali_file: the file to extract the method definition from
    :return: a pretty_grep list with the line with the method definition or
    an empty list if not found
    """

    # prepare vraiables and read content
    main_line = int(main_line)
    with open(smali_file, "r") as fp:
        smali = fp.read()

    for i, line in enumerate(reversed(smali.split("\n")[:main_line])):
        if ".method " in line:
            return [{
                "line": main_line - i,
                "details": line.strip()
            }]

    return []