コード例 #1
0
ファイル: modules.py プロジェクト: Ta180m/Isotope
def download_pkg2_patches(module, temp_directory, isotope_version, isotope_build):
    release = get_latest_release(module)
    fusee_patches_path = download_asset(module, release, 0)
    if fusee_patches_path is None:
        return None

    with zipfile.ZipFile(fusee_patches_path, 'r') as zip_ref:
        zip_ref.extractall(temp_directory)

    common.delete(fusee_patches_path)

    hekate_patches_path = download_asset(module, release, 1)
    if hekate_patches_path is None:
        return None

    with zipfile.ZipFile(hekate_patches_path, 'r') as zip_ref:
        zip_ref.extractall(temp_directory)

    common.delete(hekate_patches_path)
    common.delete(temp_directory.joinpath('bootloader/hekate_ipl.ini'))
    common.copy_module_file('hekate', 'hekate_ipl_patches.ini',
                            temp_directory.joinpath('bootloader/hekate_ipl.ini'))
    common.sed('ISOTOPE_VERSION', isotope_version,
               temp_directory.joinpath('bootloader/hekate_ipl.ini'))
    return get_version(module, release, 0)
コード例 #2
0
ファイル: modules.py プロジェクト: laihui0207/Kosmos
def download_hekate(module, temp_directory, kosmos_version, kosmos_build):
    release = get_latest_release(module)
    bundle_path = download_asset(module, release, 0)
    if bundle_path is None:
        return None

    with zipfile.ZipFile(bundle_path, 'r') as zip_ref:
        zip_ref.extractall(temp_directory)

    common.delete_path(bundle_path)
    
    common.copy_module_file('hekate', 'bootlogo.bmp', os.path.join(temp_directory, 'bootloader', 'bootlogo.bmp'))
    common.copy_module_file('hekate', 'hekate_ipl.ini', os.path.join(temp_directory, 'bootloader', 'hekate_ipl.ini'))
    common.sed('KOSMOS_VERSION', kosmos_version, os.path.join(temp_directory, 'bootloader', 'hekate_ipl.ini'))

    payload = common.find_file(os.path.join(temp_directory, 'hekate_ctcaer_*.bin'))
    if len(payload) != 0:
        shutil.copyfile(payload[0], os.path.join(temp_directory, 'bootloader', 'update.bin'))
        common.mkdir(os.path.join(temp_directory, 'atmosphere'))
        shutil.copyfile(payload[0], os.path.join(temp_directory, 'atmosphere', 'reboot_payload.bin'))

    if not kosmos_build:
        common.mkdir(os.path.join(temp_directory, '..', 'must_have'))
        shutil.move(os.path.join(temp_directory, 'bootloader'), os.path.join(temp_directory, '..', 'must_have'))
        shutil.move(os.path.join(temp_directory, 'atmosphere'), os.path.join(temp_directory, '..', 'must_have'))

    return release.tag_name
コード例 #3
0
ファイル: modules.py プロジェクト: laihui0207/Kosmos
def download_kosmos_updater(module, temp_directory, kosmos_version, kosmos_build):
    release = get_latest_release(module)
    app_path = download_asset(module, release, 0)
    if app_path is None:
        return None

    common.mkdir(os.path.join(temp_directory, 'switch', 'KosmosUpdater'))
    shutil.move(app_path, os.path.join(temp_directory, 'switch', 'KosmosUpdater', 'KosmosUpdater.nro'))
    common.copy_module_file('kosmos-updater', 'internal.db', os.path.join(temp_directory, 'switch', 'KosmosUpdater', 'internal.db'))
    common.sed('KOSMOS_VERSION', kosmos_version, os.path.join(temp_directory, 'switch', 'KosmosUpdater', 'internal.db'))

    return release.tag_name
コード例 #4
0
ファイル: modules.py プロジェクト: Ta180m/Isotope
def download_isotope_updater(module, temp_directory, isotope_version, isotope_build):
    release = get_latest_release(module)
    app_path = download_asset(module, release, 0)
    if app_path is None:
        return None

    common.mkdir(temp_directory.joinpath('switch/Isotope-Updater'))
    common.move(app_path, temp_directory.joinpath(
        'switch/Isotope-Updater/Isotope-Updater.nro'))
    common.copy_module_file('isotope-updater', 'internal.db',
                            temp_directory.joinpath('switch/Isotope-Updater/internal.db'))
    common.sed('ISOTOPE_VERSION', isotope_version,
               temp_directory.joinpath('switch/Isotope-Updater/internal.db'))

    return get_version(module, release, 0)
コード例 #5
0
ファイル: modules.py プロジェクト: fennectech/DeepSea
def download_kosmos_updater(module, temp_directory, deepsea_version, deepsea_build):
    release = get_latest_release(module)
    app_path = download_asset(module, release, 0)
    if app_path is None:
        return None

    common.mkdir(temp_directory.joinpath('switch/DeepSea-Updater'))
    common.move(app_path, temp_directory.joinpath(
        'switch/DeepSea-Updater/DeepSea-Updater.nro'))
    common.copy_module_file('deepsea-updater', 'internal.db',
                            temp_directory.joinpath('switch/DeepSea-Updater/internal.db'))
    common.sed('DEEPSEA_VERSION', deepsea_version,
               temp_directory.joinpath('switch/DeepSea-Updater/internal.db'))

    return get_version(module, release, 0)
コード例 #6
0
ファイル: modules.py プロジェクト: stuarthicks/DeepSea
def download_hekate(module, temp_directory, deepsea_version, parameters,
                    deepsea_build):
    release = get_latest_release(module)
    bundle_path = download_asset(module, release, 0)
    if bundle_path is None:
        return None

    with zipfile.ZipFile(bundle_path, 'r') as zip_ref:
        zip_ref.extractall(temp_directory)

    common.delete(bundle_path)

    common.copy_module_file('hekate', 'bootlogo.bmp',
                            temp_directory.joinpath('bootloader/bootlogo.bmp'))
    common.copy_module_file(
        'hekate', 'hekate_ipl.ini',
        temp_directory.joinpath('bootloader/hekate_ipl.ini'))
    common.sed('DEEPSEA_VERSION', deepsea_version,
               temp_directory.joinpath('bootloader/hekate_ipl.ini'))

    payload = common.find_file(temp_directory.joinpath('hekate_ctcaer_*.bin'))
    if len(payload) != 0:
        shutil.copyfile(payload[0],
                        temp_directory.joinpath('bootloader/update.bin'))
        common.mkdir(temp_directory.joinpath('atmosphere'))
        shutil.copyfile(
            payload[0],
            temp_directory.joinpath('atmosphere/reboot_payload.bin'))

    common.delete(
        temp_directory.joinpath(
            'nyx_usb_max_rate (run once per windows pc).reg'))

    if not deepsea_build:
        common.mkdir(temp_directory.joinpath('../must_have'))
        common.move(temp_directory.joinpath('bootloader'),
                    temp_directory.joinpath('../must_have/bootloader'))
        common.move(
            temp_directory.joinpath('atmosphere/reboot_payload.bin'),
            temp_directory.joinpath(
                '../must_have/atmosphere/reboot_payload.bin'))
        common.delete(temp_directory.joinpath('atmosphere'))

    return get_version(module, release, 0)