Exemplo n.º 1
0
def repack_asar():
    try:
        with Asar.from_path("./core") as a:
            with open("./core.asar", "wb") as fp:
                a.fp.seek(0)
                fp.write(a.fp.read())
        shutil.rmtree("./core")
    except Exception as e:
        print("ERROR: {0.__class__.__name__} {0}".format(e))
Exemplo n.º 2
0
def repack_asar():
    try:
        with Asar.from_path('./core') as a:
            with open('./core.asar', 'wb') as fp:
                a.fp.seek(0)
                fp.write(a.fp.read())
        shutil.rmtree('./core')
    except Exception as e:
        print('ERROR: {0.__class__.__name__} {0}'.format(e))
Exemplo n.º 3
0
def extract_asar():
    try:
        with Asar.open('./app.asar') as a:
            try:
                a.extract('./app')
            except FileExistsError:
                answer = input('asar already extracted, overwrite? (Y/n): ')

                if answer.lower().startswith('n'):
                    print('Exiting.')
                    return False

                shutil.rmtree('./app')
                a.extract('./app')

        shutil.move('./app.asar', './original_app.asar')
    except FileNotFoundError as e:
        print('WARNING: app.asar not found')
    return True
Exemplo n.º 4
0
def extract_asar():
    try:
        with Asar.open("./core.asar") as a:
            try:
                a.extract("./core")
            except FileExistsError:
                answer = input("asar already extracted, overwrite? (Y/n): ")

                if answer.lower().startswith("n"):
                    print("Exiting.")
                    return False

                shutil.rmtree("./core")
                a.extract("./core")

        shutil.move("./core.asar", "./original_core.asar")
    except FileNotFoundError as e:
        print("WARNING: app.asar not found")

    return True