├── .gitignore ├── docs ├── dashboard.png ├── dashboard_en.png └── README.md ├── electron ├── icon.icns ├── alipay.png ├── wechat.png ├── wechatpay.png ├── 已损坏修复 ├── index.js └── index.html ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── help_wanted.md ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ ├── del_runs.yml │ ├── build.yml │ └── ci.yml ├── package.json ├── electron-builder.json └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | /release/ 2 | /node_modules 3 | /electron/dfuTools* 4 | /macvdmtool/ 5 | -------------------------------------------------------------------------------- /docs/dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRSec/DFU-Tools/HEAD/docs/dashboard.png -------------------------------------------------------------------------------- /electron/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRSec/DFU-Tools/HEAD/electron/icon.icns -------------------------------------------------------------------------------- /docs/dashboard_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRSec/DFU-Tools/HEAD/docs/dashboard_en.png -------------------------------------------------------------------------------- /electron/alipay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRSec/DFU-Tools/HEAD/electron/alipay.png -------------------------------------------------------------------------------- /electron/wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRSec/DFU-Tools/HEAD/electron/wechat.png -------------------------------------------------------------------------------- /electron/wechatpay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XRSec/DFU-Tools/HEAD/electron/wechatpay.png -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: 🐞 Bug report 4 | about: Create a report to help us improve 5 | title: "[Bug] the title of bug report" 6 | labels: bug 7 | assignees: '' 8 | 9 | --- 10 | 11 | #### Describe the bug 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/help_wanted.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 🥺 Help wanted 3 | about: Confuse about the use of electron-vue-vite 4 | title: "[Help] the title of help wanted report" 5 | labels: help wanted 6 | assignees: '' 7 | 8 | --- 9 | 10 | #### Describe the problem you confuse 11 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### Description 4 | 5 | 6 | 7 | ### What is the purpose of this pull request? 8 | 9 | - [ ] Bug fix 10 | - [ ] New Feature 11 | - [ ] Documentation update 12 | - [ ] Other 13 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "npm" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "monthly" 12 | -------------------------------------------------------------------------------- /.github/workflows/del_runs.yml: -------------------------------------------------------------------------------- 1 | name: Delete old workflow runs 2 | 3 | on: 4 | schedule: 5 | - cron: '0 0 * * MON' 6 | workflow_dispatch: 7 | inputs: 8 | days: 9 | description: 'Number of days.' 10 | required: true 11 | default: "10" 12 | minimum_runs: 13 | description: 'The minimum runs to keep for each workflow.' 14 | required: true 15 | default: "6" 16 | 17 | jobs: 18 | del_runs: 19 | runs-on: ubuntu-latest 20 | steps: 21 | - name: Delete workflow runs 22 | uses: Mattraks/delete-workflow-runs@v2.0.6 23 | with: 24 | token: ${{ secrets.TOKEN_GITHUB }} 25 | repository: ${{ github.repository }} 26 | retain_days: ${{ github.event.inputs.days }} 27 | keep_minimum_runs: 3 28 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dfu-tools", 3 | "productName": "DFU-Tools", 4 | "version": "1.1.9", 5 | "description": "macOS DFU TOOLS", 6 | "main": "electron/index.js", 7 | "scripts": { 8 | "start": "nodemon --exec electron electron --ext js,html", 9 | "pack": "electron-builder" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/XRSec/DFU-Tools.git" 14 | }, 15 | "keywords": [ 16 | "DFU", 17 | "macos", 18 | "recovery", 19 | "serial", 20 | "reboot", 21 | "reboot serial" 22 | ], 23 | "author": { 24 | "name": "XRSec", 25 | "email": "jalapeno1868@outlook.com", 26 | "url": "https://github.com/Ran-Xing" 27 | }, 28 | "license": "apache-2.0", 29 | "devDependencies": { 30 | "electron": "^30.0.1", 31 | "electron-builder": "^24.13.3" 32 | }, 33 | "dependencies": { 34 | "electron-prompt": "^1.7.0" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | ## macOS DFU Tools 2 | 3 | ### 必读 / Must read 4 | > 本项目是一个macOS下的DFU工具,用于快速进入DFU模式、快速重启以及进入Recovery模式(尚未测试)。 5 | > 6 | > This project is a DFU tool under mac OS for fast entry into DFU mode, fast restart, and entry into Recovery mode (not yet tested). 7 | > 8 | > 依赖于 / depend on [AsahiLinux/macvdmtool](https://github.com/AsahiLinux/macvdmtool) 9 | > 10 | > **(Apple -> Apple || Intel -> Intel)** by Apple: 400-666-8800 11 | 12 | ### 下载 / Download 13 | 14 | > [Github Release](https://github.com/XRSec/DFU-Tools/releases) 15 | > 16 | > [镜像加速(Inter 1.1.9)](https://mirror.ghproxy.com/https://github.com/XRSec/DFU-Tools/releases/download/1.1.9/DFU-Tools_x64.dmg) 17 | > 18 | > [镜像加速(Apple 1.1.9)](https://mirror.ghproxy.com/https://github.com/XRSec/DFU-Tools/releases/download/1.1.9/DFU-Tools_arm64.dmg) 19 | 20 | ### 使用 / Usage 21 | 22 | ![dashboard](./dashboard_en.png) 23 | ![dashboard](./dashboard.png) 24 | 25 | ## 报错汇总 / FAQ 26 | 27 | ### 已损坏 打不开 / Can't open 28 | 29 | ```bash 30 | sudo xattr -rd com.apple.quarantine /Applications/DFU-Tools.app 31 | ``` 32 | -------------------------------------------------------------------------------- /electron-builder.json: -------------------------------------------------------------------------------- 1 | { 2 | "appId": "com.xrsec.${name}", 3 | "asar": true, 4 | "directories": { 5 | "output": "release/${version}" 6 | }, 7 | "files": [ 8 | "!icon.icns", 9 | "!electron/dfuTools", 10 | "!macvdmtool", 11 | "!docs", 12 | "!release", 13 | "!electron/已损坏修复" 14 | ], 15 | "extraFiles": [ 16 | { 17 | "from": "electron/dfuTools/${arch}/dfuTools", 18 | "to": "./Resources/" 19 | } 20 | ], 21 | "artifactName": "${productName}_${arch}.${ext}", 22 | "mac": { 23 | "target": [ 24 | { 25 | "target": "dmg", 26 | "arch": [ 27 | "arm64", 28 | "x64" 29 | ] 30 | } 31 | ], 32 | "publish": [ 33 | "github" 34 | ], 35 | "darkModeSupport": true, 36 | "icon": "electron/icon.icns", 37 | "category": "public.app-category.productivity", 38 | "electronLanguages": [ 39 | "zh_CN", 40 | "en" 41 | ] 42 | }, 43 | "dmg": { 44 | "contents": [ 45 | { 46 | "x": 135, 47 | "y": 100 48 | }, 49 | { 50 | "x": 407, 51 | "y": 100, 52 | "type": "link", 53 | "path": "/Applications" 54 | }, 55 | { 56 | "x": 135, 57 | "y": 250, 58 | "type": "file", 59 | "path": "electron/已损坏修复" 60 | } 61 | ] 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /electron/已损坏修复: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | clear 3 | BLACK="\033[0;30m" 4 | DARK_GRAY="\033[1;30m" 5 | BLUE="\033[0;34m" 6 | LIGHT_BLUE="\033[1;34m" 7 | GREEN="\033[0;32m" 8 | LIGHT_GREEN="\033[1;32m" 9 | CYAN="\033[0;36m" 10 | LIGHT_CYAN="\033[1;36m" 11 | RED="\033[0;31m" 12 | LIGHT_RED="\033[1;31m" 13 | PURPLE="\033[0;35m" 14 | LIGHT_PURPLE="\033[1;35m" 15 | BROWN="\033[0;33m" 16 | YELLOW="\033[0;33m" 17 | LIGHT_GRAY="\033[0;37m" 18 | WHITE="\033[1;37m" 19 | NC="\033[0m" 20 | 21 | echo "" 22 | echo "" 23 | echo -e "『已损坏的应用修复工具』" 24 | parentPath=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) 25 | cd "$parentPath" 26 | appPath=$( find "$parentPath" -name '*.app' -maxdepth 1) 27 | appName=${appPath##*/} 28 | appBashName=${appName// /\ } 29 | appDIR="/Applications/${appBashName}" 30 | echo "" 31 | echo "" 32 | echo -e "『${appBashName} 已损坏,无法打开/ 来自身份不明的开发者』等问题修复工具" 33 | echo "" 34 | #未安装APP时提醒安装,已安装绕过公证 35 | if [ ! -d "$appDIR" ];then 36 | echo "" 37 | echo -e "执行结果:${RED}您还未安装 ${appBashName} ,请先安装${NC}" 38 | else 39 | #绕过公证 40 | echo -e "${YELLOW}请输入开机密码,输入完成后按下回车键(输入过程中密码是看不见的)${NC}" 41 | # sudo spctl --master-disable 42 | sudo xattr -rd com.apple.quarantine /Applications/"$appBashName" 43 | echo "" 44 | echo "" 45 | echo -e "执行结果:${GREEN}修复成功!${NC}您现在可以正常运行 ${appBashName} 了。" 46 | echo -e "" 47 | fi 48 | echo "" 49 | echo "" 50 | echo -e "本窗口可以关闭啦!" 51 | open /Applications/"$appBashName" -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | macvdmtool: 8 | runs-on: macos-latest 9 | strategy: 10 | matrix: 11 | arch: [ amd64, arm64 ] 12 | steps: 13 | - name: Checkout Code 14 | uses: actions/checkout@v5 15 | with: 16 | repository: "AsahiLinux/macvdmtool" 17 | - name: Build MacVDMTool 18 | run: | 19 | make 20 | cc -o dfuTools_${{ matrix.arch }} main.o -framework CoreFoundation -framework IOKit -lc++ 21 | - name: Upload Artifact 22 | uses: actions/upload-artifact@v4.6.2 23 | with: 24 | name: dfuTools_${{ matrix.arch }} 25 | path: dfuTools_${{ matrix.arch }} 26 | retention-days: 5 27 | build: 28 | needs: macvdmtool 29 | runs-on: macos-latest 30 | steps: 31 | - name: Checkout Code 32 | uses: actions/checkout@v5 33 | 34 | - name: Setup Node.js 35 | uses: actions/setup-node@v4.4.0 36 | with: 37 | node-version: 18 38 | 39 | - name: Install Dependencies 40 | run: npm install 41 | 42 | - name: Download Artifact (arm64) 43 | uses: actions/download-artifact@v5 44 | with: 45 | name: dfuTools_arm64 46 | path: electron/ 47 | 48 | - name: Download Artifact (amd64) 49 | uses: actions/download-artifact@v5 50 | with: 51 | name: dfuTools_amd64 52 | path: electron/ 53 | 54 | - name: Chmod dfuTools 55 | run: | 56 | chmod +x electron/dfuTools_* 57 | mkdir -p electron/dfuTools/x64 electron/dfuTools/arm64 58 | mv electron/dfuTools_amd64 electron/dfuTools/x64/dfuTools 59 | mv electron/dfuTools_arm64 electron/dfuTools/arm64/dfuTools 60 | chmod +x electron/dfuTools/x64/dfuTools electron/dfuTools/arm64/dfuTools 61 | 62 | - name: Build Release Files 63 | run: npm run pack 64 | env: 65 | GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} 66 | 67 | - name: Delete old Releases 68 | uses: dev-drprasad/delete-older-releases@v0.3.4 69 | with: 70 | repo: ${{ github.repository }} 71 | keep_latest: 3 72 | delete_tag_pattern: "" 73 | env: 74 | GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} 75 | 76 | - name: 获取版本号 77 | id: get-version 78 | run: | 79 | version=$(jq -r .version package.json) 80 | echo "version=${version}" >> $GITHUB_OUTPUT 81 | 82 | - name: Make release 83 | uses: softprops/action-gh-release@v2.3.2 84 | with: 85 | files: | 86 | release/${{ steps.get-version.outputs.version }}/DFU-Tools_x64.dmg 87 | release/${{ steps.get-version.outputs.version }}/DFU-Tools_x64.dmg.blockmap 88 | release/${{ steps.get-version.outputs.version }}/DFU-Tools_arm64.dmg 89 | release/${{ steps.get-version.outputs.version }}/DFU-Tools_arm64.dmg.blockmap 90 | release/${{ steps.get-version.outputs.version }}/latest-mac.yml 91 | body: "Update ${{ steps.get-version.outputs.version }}" 92 | name: ${{ steps.get-version.outputs.version }} 93 | tag_name: ${{ steps.get-version.outputs.version }} 94 | draft: false 95 | env: 96 | GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} 97 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | pull_request_target: 5 | branches: 6 | - main 7 | 8 | permissions: 9 | pull-requests: write 10 | 11 | jobs: 12 | job1: 13 | name: Check Not Allowed File Changes 14 | runs-on: ubuntu-latest 15 | outputs: 16 | markdown_change: ${{ steps.filter_markdown.outputs.change }} 17 | markdown_files: ${{ steps.filter_markdown.outputs.change_files }} 18 | steps: 19 | 20 | - name: Check Not Allowed File Changes 21 | uses: dorny/paths-filter@v3.0.2 22 | id: filter_not_allowed 23 | with: 24 | list-files: json 25 | filters: | 26 | change: 27 | - 'package-lock.json' 28 | - 'yarn.lock' 29 | - 'pnpm-lock.yaml' 30 | 31 | # ref: https://github.com/github/docs/blob/main/.github/workflows/triage-unallowed-contributions.yml 32 | - name: Comment About Changes We Can't Accept 33 | if: ${{ steps.filter_not_allowed.outputs.change == 'true' }} 34 | uses: actions/github-script@v7.0.1 35 | with: 36 | script: | 37 | let workflowFailMessage = "It looks like you've modified some files that we can't accept as contributions." 38 | try { 39 | const badFilesArr = [ 40 | 'package-lock.json', 41 | 'yarn.lock', 42 | 'pnpm-lock.yaml', 43 | ] 44 | const badFiles = badFilesArr.join('\n- ') 45 | const reviewMessage = `👋 Hey there spelunker. It looks like you've modified some files that we can't accept as contributions. The complete list of files we can't accept are:\n- ${badFiles}\n\nYou'll need to revert all of the files you changed in that list using [GitHub Desktop](https://docs.github.com/en/free-pro-team@latest/desktop/contributing-and-collaborating-using-github-desktop/managing-commits/reverting-a-commit) or \`git checkout origin/main \`. Once you get those files reverted, we can continue with the review process. :octocat:\n\nMore discussion:\n- https://github.com/electron-vite/electron-vite-vue/issues/192` 46 | createdComment = await github.rest.issues.createComment({ 47 | owner: context.repo.owner, 48 | repo: context.repo.repo, 49 | issue_number: context.payload.number, 50 | body: reviewMessage, 51 | }) 52 | workflowFailMessage = `${workflowFailMessage} Please see ${createdComment.data.html_url} for details.` 53 | } catch(err) { 54 | console.log("Error creating comment.", err) 55 | } 56 | core.setFailed(workflowFailMessage) 57 | 58 | - name: Check Not Linted Markdown 59 | if: ${{ always() }} 60 | uses: dorny/paths-filter@v3.0.2 61 | id: filter_markdown 62 | with: 63 | list-files: shell 64 | filters: | 65 | change: 66 | - added|modified: '*.md' 67 | 68 | 69 | job2: 70 | name: Lint Markdown 71 | runs-on: ubuntu-latest 72 | needs: job1 73 | if: ${{ always() && needs.job1.outputs.markdown_change == 'true' }} 74 | steps: 75 | - name: Checkout Code 76 | uses: actions/checkout@v5 77 | with: 78 | ref: ${{ github.event.pull_request.head.sha }} 79 | 80 | - name: Lint markdown 81 | run: npx markdownlint-cli ${{ needs.job1.outputs.markdown_files }} --ignore node_modules -------------------------------------------------------------------------------- /electron/index.js: -------------------------------------------------------------------------------- 1 | const {app, BrowserWindow, ipcMain, Menu, shell} = require('electron') 2 | const {join} = require("node:path"); 3 | const {execSync, exec} = require("child_process"); 4 | const {chmod, existsSync, lstatSync} = require("fs"); 5 | const prompt = require('electron-prompt'); 6 | 7 | const arch = process.arch === 'arm64' ? 'arm64' : 'x64'; 8 | let dfuTools = join(__dirname, `dfuTools/${arch}/dfuTools`), 9 | admin_pass = '', 10 | configuratorStatus = false, 11 | win; 12 | 13 | if (__dirname.includes('/Contents/Resources/')) { 14 | dfuTools = join(__dirname, `../../dfuTools`) 15 | } 16 | 17 | console.debug(`dfuTools: ${dfuTools}`) 18 | 19 | chmod(dfuTools, '755', (err) => { 20 | if (err) { 21 | throw err; 22 | } else { 23 | console.debug(`dfuTools chmod success`) 24 | } 25 | }); 26 | 27 | const createWindow = () => { 28 | win = new BrowserWindow({ 29 | width: 920, 30 | height: 580, 31 | minWidth: 920, 32 | minHeight: 580, 33 | webPreferences: { 34 | nodeIntegration: true, 35 | contextIsolation: false, 36 | webSecurity: true, 37 | devTools: !app.isPackaged || process.env.DFU_DEBUG, // 如果是开发模式可以使用devTools 调试 38 | scrollBounce: process.platform === "darwin", // 在macos中启用橡皮动画 39 | }, 40 | // transparent: true, //设置透明 41 | }) 42 | 43 | win.loadFile(join(__dirname, 'index.html')) 44 | win.on('closed', () => { 45 | app.quit(); 46 | }); 47 | (!app.isPackaged || process.env.DFU_DEBUG) && win.webContents.openDevTools() 48 | win.webContents.on('dom-ready', () => { 49 | if (admin_pass !== "") return; 50 | 51 | function testPrivilege() { 52 | exec(`echo '${admin_pass}' | sudo -S whoami`, {encoding: 'utf-8'}).on('exit', (code) => { 53 | (code !== 0) && getPassword(); 54 | console.debug('run as admin privilege') 55 | }).on('error', (err) => { 56 | console.debug(err) 57 | getPassword(); 58 | }) 59 | } 60 | 61 | function getPassword() { 62 | prompt({ 63 | title: '提示', 64 | label: '请输入您的密码 / Please Enter U Passwd', 65 | value: '', 66 | inputAttrs: {type: 'password'}, 67 | type: 'input' 68 | }).then((r) => { 69 | if (r === null) { 70 | console.debug('user cancelled'); 71 | } else { 72 | console.debug('pass:', r); 73 | admin_pass = r; 74 | testPrivilege(); 75 | } 76 | }).catch(console.error); 77 | } 78 | 79 | getPassword() 80 | }) 81 | } 82 | 83 | Menu.setApplicationMenu(Menu.buildFromTemplate( 84 | [{ 85 | label: 'File', 86 | submenu: [ 87 | {role: 'quit'}, 88 | {role: 'close'}, 89 | { 90 | label: 'Toggle Developer Tools', 91 | click: () => { 92 | win.webContents.toggleDevTools(); 93 | } 94 | }] 95 | }] 96 | )); 97 | 98 | app.whenReady().then(() => { 99 | if (BrowserWindow.getAllWindows().length === 0) { 100 | createWindow(); 101 | } 102 | }) 103 | 104 | ipcMain.on('openReboot', (event) => { 105 | if (!checkConfiguratorRunning()) { 106 | event.returnValue = "configurator_not_running"; 107 | return; 108 | } 109 | exec(`echo '${admin_pass}' | sudo -S ${dfuTools} reboot`, {encoding: 'utf-8'}, function (_error, stdout, _stderr) { 110 | if (stdout?.includes('No connection detected')) { 111 | event.returnValue = "no_connection"; 112 | return; 113 | } else if (stdout?.includes('IOCreatePlugInInterfaceForService failed')) { 114 | event.returnValue = "no_admin_permission"; 115 | return; 116 | } else if (_error?.toString().includes('command not found')) { 117 | event.returnValue = "no_dfu_permission"; 118 | return; 119 | } 120 | console.debug(`error: ${_error} stderr: ${_stderr}`) 121 | event.returnValue = stdout; 122 | }) 123 | }) 124 | 125 | ipcMain.on('openDFU', (event) => { 126 | if (!checkConfiguratorRunning()) { 127 | console.debug(`configurator not running`) 128 | event.returnValue = "configurator_not_running"; 129 | return; 130 | } 131 | exec(`echo '${admin_pass}' | sudo -S ${dfuTools} dfu`, {encoding: 'utf-8'}, function (_error, stdout, _stderr) { 132 | console.log(_error) 133 | if (stdout?.includes('No connection detected')) { 134 | event.returnValue = "no_connection"; 135 | return; 136 | } else if (stdout?.includes('IOCreatePlugInInterfaceForService failed')) { 137 | event.returnValue = "no_admin_permission"; 138 | return; 139 | } else if (_error?.toString().includes('command not found')) { 140 | event.returnValue = "no_dfu_permission"; 141 | return; 142 | } 143 | console.debug(`error: ${_error} stderr: ${_stderr}`) 144 | event.returnValue = stdout; 145 | }) 146 | }) 147 | 148 | ipcMain.on('openIPSW', (_event) => { 149 | const url = 'https://ipsw.me/product/Mac'; 150 | shell.openExternal(url).then(() => { 151 | return "success" 152 | }).catch((err) => { 153 | return err 154 | }) 155 | }) 156 | 157 | ipcMain.on('openMDM', (_event) => { 158 | const url = 'http://mdms.fun'; 159 | shell.openExternal(url).then(() => { 160 | return "success" 161 | }).catch((err) => { 162 | return err 163 | }) 164 | }) 165 | 166 | function checkConfiguratorRunning() { 167 | if (configuratorStatus) return true; 168 | const result = execSync('ps -ax | grep -v grep | grep com.apple.configurator; echo', {encoding: 'utf-8'}).toString().trim() 169 | configuratorStatus = result !== ''; 170 | if (configuratorStatus) return true; 171 | try { 172 | execSync('open -a "Apple Configurator" >/dev/null 2>&1') 173 | } catch (e) { 174 | console.error(e) 175 | } 176 | return configuratorStatus; 177 | } 178 | -------------------------------------------------------------------------------- /electron/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 87 | 266 | 267 | 268 | 269 | 270 |
271 | 272 | 273 | 274 | 275 |
276 | 277 |
278 | 微信 279 | 微信打赏码 280 | 支付宝打赏码 281 |
282 | 283 | 291 | 292 | 293 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------