Skip to content

Commit

Permalink
support OC 0.8.7 and change backup file name
Browse files Browse the repository at this point in the history
  • Loading branch information
dropdb220 committed Dec 14, 2022
1 parent fda26a4 commit 853a1e8
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 18 deletions.
1 change: 1 addition & 0 deletions README-ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ OpenCore Updater는 모든 kext를 업데이트하지 않고, 앱 내부 리스
* AirportItlwm
* IntelBluetoothFirmware
* IntelBluetoothInjector
* IntelBTPatcher
* NVMeFix
* CpuTscSync
* CPUFriend
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ OpenCore Updater doesn't update all kexts, but it will update the ones that are
* AirportItlwm
* IntelBluetoothFirmware
* IntelBluetoothInjector
* IntelBTPatcher
* NVMeFix
* CpuTscSync
* CPUFriend
Expand Down
Binary file not shown.
7 changes: 4 additions & 3 deletions index-korean.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div id="get-started">
<img src="./Logo.png" alt="OpenCore Logo" height="30%" width="30%">
<h1>OpenCore Updater</h1>
<h2>지원되는 최신 버전: 0.8.6</h2>
<h2>지원되는 최신 버전: 0.8.7</h2>
<button id="start">시작하기</button>
</div>
<div id="select-opencore-version">
Expand All @@ -26,7 +26,8 @@ <h1>OpenCore 버전 선택</h1>
<li>0.6.3 미만의 버전은 지원되지 않습니다.</li>
</ul>
<select id="oc-version-selection">
<option value="0.8.6" selected>0.8.6</option>
<option value="0.8.7" selected>0.8.7</option>
<option value="0.8.6">0.8.6</option>
<option value="0.8.5">0.8.5</option>
<option value="0.8.4">0.8.4</option>
<option value="0.8.3">0.8.3</option>
Expand Down Expand Up @@ -55,7 +56,7 @@ <h1>OpenCore 버전 선택</h1>
</div>
<div id="efiinfo">
<h1>EFI 정보</h1>
<p>최신 버전: 0.8.6</p>
<p>최신 버전: 0.8.7</p>
<p>현재 버전: <span id="oc-version"></span></p>
<p>사용 중인 kext:</p>
<div id="using-kexts"></div>
Expand Down
7 changes: 4 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div id="get-started">
<img src="./Logo.png" alt="OpenCore Logo" height="30%" width="30%">
<h1>OpenCore Updater</h1>
<h2>Current supported version: 0.8.6</h2>
<h2>Current supported version: 0.8.7</h2>
<button id="start">Get started</button>
</div>
<div id="select-opencore-version">
Expand All @@ -26,7 +26,8 @@ <h1>Select OpenCore version</h1>
<li>Versions older than 0.6.3 are not supported.</li>
</ul>
<select id="oc-version-selection">
<option value="0.8.6" selected>0.8.6</option>
<option value="0.8.7" selected>0.8.7</option>
<option value="0.8.6">0.8.6</option>
<option value="0.8.5">0.8.5</option>
<option value="0.8.4">0.8.4</option>
<option value="0.8.3">0.8.3</option>
Expand Down Expand Up @@ -55,7 +56,7 @@ <h1>Select OpenCore version</h1>
</div>
<div id="efiinfo">
<h1>Your EFI info</h1>
<p>Latest version is 0.8.6.</p>
<p>Latest version is 0.8.7.</p>
<p>Your OpenCore version is <span id="oc-version"></span>.</p>
<p>You're using the following kexts:</p>
<div id="using-kexts"></div>
Expand Down
21 changes: 11 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import util from 'util';
import { autoUpdater } from 'electron-updater';
const PID = Math.floor(Math.random() * 1000000);
const checksums = {
'80fb8017dffa74dea70fc0ee0baf10b57d47ad51f2fa7a0915c9760e48effc9c': '0.8.7',
'48e87cd14d440ae122986c23b7442156d95c336e796bcd743ec5a904036c4fb8': '0.8.7',
'562b0fb7905feac796863979e8e62de7065b89c60348e8226a3b86f338fbe90c': '0.8.6',
'2b4fcc93e039f6ca289ec4cff5db5d94d50dab3eff2c70a05e44b738d5aa7fc6': '0.8.5',
'a175242302a50511de74c080057c018a23f9e88467bf1c1b4d445f82c486c95b': '0.8.4',
Expand Down Expand Up @@ -47,12 +49,12 @@ const checksums = {
'dc2381c5ab49ac79ed6be75f9867c5933e6f1e88cb4e860359967fc5ee4916e3': '0.6.3'
}
const versions = {
OpenCore: ['0.8.6', 86],
OpenCore: ['0.8.7', 87],
VirtualSMC: '1.3.0',
Lilu: '1.6.2',
WhateverGreen: '1.6.1',
AppleALC: '1.7.6',
VoodooPS2Controller: '2.3.1',
WhateverGreen: '1.6.2',
AppleALC: '1.7.7',
VoodooPS2Controller: '2.3.2',
VoodooI2C: '2.7',
ECEnabler: '1.0.3',
BrightnessKeys: '1.0.2',
Expand All @@ -65,7 +67,7 @@ const versions = {
IntelBluetoothFirmware: '2.2.0',
CpuTscSync: '1.0.9',
CPUFriend: '1.2.6',
HibernationFixup: '1.4.6',
HibernationFixup: '1.4.7',
AirportBrcmFixup: '2.1.6',
BrcmPatchRAM: '2.6.4',
RealtekCardReader: ['0.9.7', '0.9.7_006a845'],
Expand Down Expand Up @@ -250,7 +252,7 @@ electron.ipcMain.on('download-kexts', async (evt, kexts) => {
if (kexts.includes('AirportItlwm.kext')) {
if (os.release().startsWith('22.')) {
kextsToDownload.push({
url: 'https://raw.githubusercontent.com/mswgen/oc-updater/main/etc/AirportItlwm-Ventura-v2.2.0-DEBUG-alpha-ee56708.zip',
url: 'https://raw.githubusercontent.com/mswgen/oc-updater/main/etc/AirportItlwm-Ventura-v2.2.0-DEBUG-alpha-acc7ff9.zip',
name: 'AirportItlwm'
})
} else {
Expand Down Expand Up @@ -349,10 +351,9 @@ electron.ipcMain.on('download-bindata', evt => {
cp.execSync(`cd ~; mkdir -p .oc-update/${PID}; cd .oc-update/${PID}; curl -L -s -o OcBinaryData-master.zip https://github.com/acidanthera/OcBinaryData/archive/refs/heads/master.zip; mkdir OcBinaryData-master; cd OcBinaryData-master; unzip ../OcBinaryData-master.zip`);
evt.returnValue = 'success';
});
electron.ipcMain.on('create-backup', (evt, dir) => {
const dat = new Date();
const dateStr = `${dat.getFullYear()}-${dat.getMonth() + 1}-${dat.getDate()}-${dat.getHours()}-${dat.getMinutes()}-${dat.getSeconds()}`;
backupDir = `${os.homedir()}/EFI-${dateStr}`;
electron.ipcMain.on('create-backup', (evt, dir, oldver) => {
if (!fs.existsSync(`${os.homedir()}/EFI Backup`) || !fs.lstatSync(`${os.homedir()}/EFI Backup`).isDirectory()) fs.mkdirSync(`${os.homedir()}/EFI Backup`);
backupDir = `${os.homedir()}/EFI Backup/OC ${oldver}`;
cp.execSync(`mkdir -p "${backupDir}"; cp -r "${dir}" "${backupDir}"`);
evt.returnValue = 'success';
});
Expand Down
4 changes: 2 additions & 2 deletions src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function afterOcverSelection(ocver: string, efidir: string) {
const ocverNum = Number(ocver.split('.').join(''));
document.querySelector('#oc-version')!.innerHTML = ocver;
document.querySelector('#using-kexts')!.innerHTML = kexts.join('<br>');
if (ocverNum < 86) {
if (ocverNum < 87) {
document.querySelector('#is-outdated')!.innerHTML = isKorean ? '구버전 OpenCore를 사용하고 있어요.' : 'Your OpenCore is outdated.';
document.querySelector<HTMLElement>('#update')!.style.display = 'block';
document.querySelector('#update')?.addEventListener('click', async () => {
Expand Down Expand Up @@ -50,7 +50,7 @@ Do you want to contnue?`)) ipc.send('quit');
ipc.sendSync('download-bindata');
document.querySelector('#progress')!.innerHTML = isKorean ? '4/7. 백업 생성 중...' : '4/7. Creating backup...'
await sleep(1000);
ipc.sendSync('create-backup', efidir);
ipc.sendSync('create-backup', efidir, ocver);
document.querySelector('#progress')!.innerHTML = isKorean ? '5/7. 파일 변경 중...' : '5/7. Swapping files...'
await sleep(1000);
ipc.sendSync('swap-files', efidir, kexts);
Expand Down
17 changes: 17 additions & 0 deletions src/update/086-to-087.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// import plist and fs
import fs from 'fs';
import plist from 'plist';
export default {
from: 86,
configPlistChange: true,
exec: (file: string) => {
// read ${file} as utf8, parse it as plist, and save it to variable `plistParsed`
const plistParsed: any = plist.parse(fs.readFileSync(file, 'utf8'));
/*
// Changes of OpenCore 0.8.7
set Misc - Boot - HibernateSkipsPicker to false
*/
plistParsed.Misc.Boot.HibernateSkipsPicker = false;
fs.writeFileSync(file, plist.build(plistParsed));
}
}

0 comments on commit 853a1e8

Please sign in to comment.