mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Put scan steps into single method
This commit is contained in:
parent
50e707a4ac
commit
f82e47c4b6
1 changed files with 39 additions and 33 deletions
|
|
@ -7,7 +7,6 @@ import { isString, isNonEmptyString } from '~/helpers/check-types.js'
|
||||||
import { parsePlistBuffer } from '~/helpers/scanner/parsers/plist.js'
|
import { parsePlistBuffer } from '~/helpers/scanner/parsers/plist.js'
|
||||||
import { extractMachoMeta } from '~/helpers/scanner/parsers/macho.js'
|
import { extractMachoMeta } from '~/helpers/scanner/parsers/macho.js'
|
||||||
|
|
||||||
|
|
||||||
// https://gildas-lormeau.github.io/zip.js/core-api.html#configuration
|
// https://gildas-lormeau.github.io/zip.js/core-api.html#configuration
|
||||||
zip.configure({
|
zip.configure({
|
||||||
// Disable Web Workers for SSR since Node doesn't support them yet
|
// Disable Web Workers for SSR since Node doesn't support them yet
|
||||||
|
|
@ -383,41 +382,47 @@ export class AppScan {
|
||||||
this.binarySupportsNative = this.classifyBinaryEntryArchitecture( this.machoMeta )
|
this.binarySupportsNative = this.classifyBinaryEntryArchitecture( this.machoMeta )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async runScan () {
|
||||||
|
// Load in the file
|
||||||
|
this.sendMessage({
|
||||||
|
message: '🚛 Loading file...',
|
||||||
|
status: 'loading'
|
||||||
|
})
|
||||||
|
|
||||||
|
this.file = await this.fileLoader()
|
||||||
|
|
||||||
|
// console.log( 'File:', this.file )
|
||||||
|
|
||||||
|
this.bundleFileEntries = await this.readFileBlob( this.file )
|
||||||
|
|
||||||
|
this.sendMessage({
|
||||||
|
message: '🎬 Starting scan',
|
||||||
|
status: 'scanning'
|
||||||
|
})
|
||||||
|
|
||||||
|
await this.findTargetFiles()
|
||||||
|
|
||||||
|
this.storeResultInfo()
|
||||||
|
|
||||||
|
this.sendMessage({
|
||||||
|
message: '🔎 Checking online for native versions...',
|
||||||
|
status: 'checking'
|
||||||
|
})
|
||||||
|
|
||||||
|
// Sleep for 3 seconds
|
||||||
|
// await new Promise( resolve => setTimeout( resolve, 3000 ) )
|
||||||
|
|
||||||
|
this.sendMessage({
|
||||||
|
message: '🏁 Scan complete! ',
|
||||||
|
status: 'complete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
async start () {
|
async start () {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Load in the file
|
|
||||||
this.sendMessage({
|
|
||||||
message: '🚛 Loading file...',
|
|
||||||
status: 'loading'
|
|
||||||
})
|
|
||||||
|
|
||||||
this.file = await this.fileLoader()
|
await this.runScan()
|
||||||
|
|
||||||
// console.log( 'File:', this.file )
|
|
||||||
|
|
||||||
this.bundleFileEntries = await this.readFileBlob( this.file )
|
|
||||||
|
|
||||||
this.sendMessage({
|
|
||||||
message: '🎬 Starting scan',
|
|
||||||
status: 'scanning'
|
|
||||||
})
|
|
||||||
|
|
||||||
await this.findTargetFiles()
|
|
||||||
|
|
||||||
this.storeResultInfo()
|
|
||||||
|
|
||||||
this.sendMessage({
|
|
||||||
message: '🔎 Checking online for native versions...',
|
|
||||||
status: 'checking'
|
|
||||||
})
|
|
||||||
|
|
||||||
// Sleep for 3 seconds
|
|
||||||
// await new Promise( resolve => setTimeout( resolve, 3000 ) )
|
|
||||||
|
|
||||||
this.sendMessage({
|
|
||||||
message: '🏁 Scan complete! ',
|
|
||||||
status: 'complete'
|
|
||||||
})
|
|
||||||
|
|
||||||
} catch ( error ) {
|
} catch ( error ) {
|
||||||
this.sendMessage({
|
this.sendMessage({
|
||||||
|
|
@ -426,5 +431,6 @@ export class AppScan {
|
||||||
error
|
error
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue