Skip to content

Commit

Permalink
removed restrictions and made a fast patch on cube recognition to all…
Browse files Browse the repository at this point in the history
…ow flash with official firmware
  • Loading branch information
qlrd committed Jul 14, 2024
1 parent 67c3817 commit 634f3c8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
28 changes: 12 additions & 16 deletions lib/check-if-it-will-flash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,19 @@ export default class CheckIfItWillFlashHandler extends Handler {

if (device.match(/maixpy_(m5stickv|amigo|amigo_ips|amigo_tft|bit|dock|yahboom|cube)/g)) {
if (version.match(/selfcustody\/.*/g)) {
if (device === 'maixpy_cube') {
this.send(`${this.name}:success`, { showFlash: false })
} else {
const __version__ = version.split('tag/')[1]
const destinationResourceZip = join(resources, __version__, `krux-${__version__}.zip`)
const destinationResourceSha = join(resources, __version__, `krux-${__version__}.zip.sha256.txt`)
const destinationResourceSig = join(resources, __version__, `krux-${__version__}.zip.sig`)
const __version__ = version.split('tag/')[1]
const destinationResourceZip = join(resources, __version__, `krux-${__version__}.zip`)
const destinationResourceSha = join(resources, __version__, `krux-${__version__}.zip.sha256.txt`)
const destinationResourceSig = join(resources, __version__, `krux-${__version__}.zip.sig`)

if (
await existsAsync(destinationResourceZip) &&
await existsAsync(destinationResourceSha) &&
await existsAsync(destinationResourceSig)
) {
this.send(`${this.name}:success`, { showFlash: true })
} else {
this.send(`${this.name}:success`, { showFlash: false })
}
if (
await existsAsync(destinationResourceZip) &&
await existsAsync(destinationResourceSha) &&
await existsAsync(destinationResourceSig)
) {
this.send(`${this.name}:success`, { showFlash: true })
} else {
this.send(`${this.name}:success`, { showFlash: false })
}
} else if (version.match(/odudex\/krux_binaries/g)) {
const destinationResourceFirmware = join(resources, version, 'main', device, 'firmware.bin')
Expand Down
8 changes: 4 additions & 4 deletions lib/unzip-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ export default class UnzipResourceHandler extends Handler {
const error = new Error(`Device '${device}' not used anymore in version ${version}. Use 'maixpy_amigo' instead`)
this.send(`${this.name}:error`, { name: error.name, message: error.message, stack: error.stack})
}
if (device.match(/maixpy_cube/g)) {
const error = new Error(`Device '${device}' not implemented for version '${version}'`)
this.send(`${this.name}:error`, { name: error.name, message: error.message, stack: error.stack})
}
//if (device.match(/maixpy_cube/g)) {
// const error = new Error(`Device '${device}' not implemented for version '${version}'`)
// this.send(`${this.name}:error`, { name: error.name, message: error.message, stack: error.stack})
//}
}
this.onUnzip(zipFilePath, resources, device, os, isMac10, options)
} else if (version === 'Select version') {
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@
"@wdio/mocha-framework": "^8.27.0",
"@wdio/spec-reporter": "^8.27.0",
"chai": "^5.1.0",
"electron": "^30.1.0",
"electron-builder": "^25.0.0-alpha.9",
"markdownlint-cli": "^0.41.0",
"electron": "^29.1.0",
"electron-builder": "^24.4.0",
"markdownlint-cli": "^0.39.0",
"mocha": "^10.2.0",
"os-lang": "^3.1.1",
"rimraf": "^5.0.1",
"ts-node": "^10.9.1",
"typescript": "^5.1.6",
"vite": "^5.0.10",
"vite-plugin-electron": "^0.28.7",
"vite-plugin-electron": "^0.28.2",
"vite-plugin-electron-renderer": "^0.14.1",
"vite-plugin-html": "^3.2.0",
"vue": "^3.3.13",
Expand All @@ -81,7 +81,7 @@
"axios": "^1.4.0",
"command-exists": "^1.2.9",
"debug": "^4.3.4",
"electron-store": "^9.0.0",
"electron-store": "^8.1.0",
"glob": "^10.3.3",
"serialport": "^12.0.0",
"vite-plugin-vuetify": "^2.0.1",
Expand Down

0 comments on commit 634f3c8

Please sign in to comment.