mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Report supported app version when found
This commit is contained in:
parent
aa993170f9
commit
56a21124d2
1 changed files with 34 additions and 14 deletions
|
|
@ -312,15 +312,21 @@ export default class AppFilesScanner {
|
||||||
|
|
||||||
// console.log( 'this.testResultStore', this.testResultStore )
|
// console.log( 'this.testResultStore', this.testResultStore )
|
||||||
|
|
||||||
await axios.post( this.testResultStore , {
|
const { supportedVersionNumber } = await axios.post( this.testResultStore , {
|
||||||
filename,
|
filename,
|
||||||
appVersion,
|
appVersion,
|
||||||
result,
|
result,
|
||||||
machoMeta: JSON.stringify( machoMeta ),
|
machoMeta: JSON.stringify( machoMeta ),
|
||||||
infoPlist: JSON.stringify( infoPlist )
|
infoPlist: JSON.stringify( infoPlist )
|
||||||
}).catch(function (error) {
|
|
||||||
console.error(error)
|
|
||||||
})
|
})
|
||||||
|
.then( response => response.data )
|
||||||
|
.catch(function (error) {
|
||||||
|
console.error(error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
supportedVersionNumber
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async scanFile ( file, scanIndex ) {
|
async scanFile ( file, scanIndex ) {
|
||||||
|
|
@ -502,19 +508,11 @@ export default class AppFilesScanner {
|
||||||
const binarySupportsNative = this.classifyBinaryEntryArchitecture( mainExecutableMeta )
|
const binarySupportsNative = this.classifyBinaryEntryArchitecture( mainExecutableMeta )
|
||||||
|
|
||||||
|
|
||||||
if ( binarySupportsNative ) {
|
// Submit the scan to get any reports on preexisting native reports
|
||||||
file.statusMessage = '✅ This app is natively compatible with Apple Silicon!'
|
const { supportedVersionNumber } = await this.submitScanInfo ({
|
||||||
|
|
||||||
// Shift this scan to the top
|
|
||||||
this.files.unshift( this.files.splice( scanIndex, 1 )[0] )
|
|
||||||
} else {
|
|
||||||
file.statusMessage = `🔶 This app file is not natively compatible with Apple Silicon and may only run via Rosetta 2 translation, however, software vendors will sometimes will ship separate install files for Intel and ARM instead of a single one. `
|
|
||||||
}
|
|
||||||
|
|
||||||
this.submitScanInfo ({
|
|
||||||
filename: file.name,
|
filename: file.name,
|
||||||
appVersion: file.appVersion,
|
appVersion: file.appVersion,
|
||||||
result: file.statusMessage,
|
result: finishedStatusMessage,
|
||||||
machoMeta: {
|
machoMeta: {
|
||||||
...mainExecutableMeta,
|
...mainExecutableMeta,
|
||||||
file: undefined,
|
file: undefined,
|
||||||
|
|
@ -534,6 +532,28 @@ export default class AppFilesScanner {
|
||||||
infoPlist: info
|
infoPlist: info
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log('supportedVersionNumber', supportedVersionNumber)
|
||||||
|
|
||||||
|
|
||||||
|
let finishedStatusMessage = ''
|
||||||
|
|
||||||
|
if ( binarySupportsNative ) {
|
||||||
|
finishedStatusMessage = '✅ This app is natively compatible with Apple Silicon!'
|
||||||
|
|
||||||
|
// Shift this scan to the top
|
||||||
|
this.files.unshift( this.files.splice( scanIndex, 1 )[0] )
|
||||||
|
} else if ( supportedVersionNumber !== null ) {
|
||||||
|
|
||||||
|
finishedStatusMessage = [
|
||||||
|
'✅ A native version of this has been reported',
|
||||||
|
(supportedVersionNumber.length > 0) ? `as of v${supportedVersionNumber}` : null
|
||||||
|
].join(' ')
|
||||||
|
|
||||||
|
} else {
|
||||||
|
finishedStatusMessage = `🔶 This app file is not natively compatible with Apple Silicon and may only run via Rosetta 2 translation, however, software vendors will sometimes will ship separate install files for Intel and ARM instead of a single one. `
|
||||||
|
}
|
||||||
|
|
||||||
|
file.statusMessage = finishedStatusMessage
|
||||||
file.status = 'finished'
|
file.status = 'finished'
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue