#!/bin/sh kver=123 if [ -n "$1" ]; then kver=$1 else echo "Please enter Kefir version: " read kver fi user=Atmosphere-NX repo=Atmosphere if ! [ -d ./$repo ]; then if ! [ -f ./$repo.zip ]; then git clone --recurse-submodules https://github.com/$user/$repo # zip -r ./$repo.zip ./$repo/* else unzip ./$repo.zip if ! [ $? == 0 ]; then pacman -S unzip --noconfirm unzip ./$repo.zip fi fi fi cd ./$repo #sed -i 's///g' ./atmosphere.mk # disable debug build sed -i '/dist\: dist-no-debug/a skip\:' ./atmosphere.mk # make dir for hekate payloads sed -i '/mkdir \$(DIST_DIR)\/switch/i \\tmkdir -p \$(DIST_DIR)\/bootloader\/payloads' ./atmosphere.mk # make subdir for daybreak.nro sed -i 's/mkdir \$(DIST_DIR)\/switch/mkdir -p \$(DIST_DIR)\/switch\/daybreak/g' ./atmosphere.mk # copy fusee.bin as hekate payload sed -i '/\$(DIST_DIR)\/atmosphere\/reboot_payload.bin/a \\tcp fusee\/\$(ATMOSPHERE_BOOT_OUT_DIR)\/fusee.bin \$(DIST_DIR)\/bootloader\/payloads\/fusee.bin' ./atmosphere.mk # move daybreak.nro to subdir sed -i 's/switch\/daybreak.nro/switch\/daybreak\/daybreak.nro/g' ./atmosphere.mk #sed -i 's///g' ./stratosphere/ams_mitm/source/set_mitm/setsys_mitm_service.cpp # md5 for 1.3.0 release is fa0f38f14964ec619527832357ec617c # md5 for 1.3.1 release is 7d34d689829a6b5d95954b410519beec if ! [ $(md5sum ./stratosphere/ams_mitm/source/set_mitm/setsys_mitm_service.cpp | awk '{print $1}') = 7d34d689829a6b5d95954b410519beec ]; then echo "WARNING: md5sum is not same, replace the file and press enter" read fi rm ./stratosphere/ams_mitm/source/set_mitm/setsys_mitm_service.cpp cp ../setsys_mitm_service.kef ./stratosphere/ams_mitm/source/set_mitm/setsys_mitm_service.cpp #sed -i 's///g' ./stratosphere/loader/source/ldr_development_manager.cpp sed -i 's/return g_development_for_anti_downgrade_check/return true/g' ./stratosphere/loader/source/ldr_development_manager.cpp sed -i 's/return g_development_for_acid_signature_check/return false/g' ./stratosphere/loader/source/ldr_development_manager.cpp sed -i 's/return g_enabled_program_verification/return false/g' ./stratosphere/loader/source/ldr_development_manager.cpp #sed -i 's///g' ./stratosphere/loader/source/ldr_meta.cpp sed -i 's/a = is_signature_valid/a = false/g' ./stratosphere/loader/source/ldr_meta.cpp #sed -i 's///g' ./troposphere/daybreak/source/ui.cpp sed -i 's/bool g_exfat_supported = false/bool g_exfat_supported = true/g' ./troposphere/daybreak/source/ui.cpp sed -i 's/bool g_use_exfat = false/bool g_use_exfat = true/g' ./troposphere/daybreak/source/ui.cpp sed -i 's/g_use_exfat = false/g_use_exfat = true/g' ./troposphere/daybreak/source/ui.cpp sed -i 's/if (g_exfat_supported)/if (0)/g' ./troposphere/daybreak/source/ui.cpp #sed -i 's///g' ./stratosphere/fatal/source/fatal_task_error_report.cpp [unused] #sed -i 's/\%u.\%u.\%u-\%s/\%u.\%u.\%u-\%s-KEF'$kver'/g' ./stratosphere/fatal/source/fatal_task_error_report.cpp #sed -i 's///g' ./stratosphere/fatal/source/fatal_task_screen.cpp [unused] #sed -i 's/\%u.\%u.\%u-\%s/\%u.\%u.\%u-\%s-KEF'$kver'/g' ./stratosphere/fatal/source/fatal_task_screen.cpp #sed -i 's///g' ./libraries/libvapours/include/vapours/ams/ams_api_version.h [unused] #if [ $(wc -c ./libraries/libvapours/include/vapours/ams/ams_api_version.h | awk '{print $1}') -le 1078 ]; then # echo "#define KEFIR_RELEASE_VERSION $kver" >> ./libraries/libvapours/include/vapours/ams/ams_api_version.h #else # sed -i 's/KEFIR_RELEASE_VERSION [0-9][0-9][0-9]/KEFIR_RELEASE_VERSION '$kver'/g' ./libraries/libvapours/include/vapours/ams/ams_api_version.h #fi #sed -i 's///g' ./libraries/config/common.mk sed -i 's/dirty/KEF'$kver'/g' ./libraries/config/common.mk make