mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Add support for binary plists
This commit is contained in:
parent
8ddf3be4f5
commit
b8a3b8e5d9
1 changed files with 14 additions and 6 deletions
|
|
@ -1,12 +1,15 @@
|
||||||
import { Blob } from 'buffer'
|
import { Buffer, Blob } from 'buffer'
|
||||||
import plist from 'plist'
|
// import plist from 'plist'
|
||||||
|
import * as plist from 'simple-plist'
|
||||||
import prettyBytes from 'pretty-bytes'
|
import prettyBytes from 'pretty-bytes'
|
||||||
// import zip from '@zip.js/zip.js'
|
// import zip from '@zip.js/zip.js'
|
||||||
import FileApi, { File } from 'file-api'
|
import FileApi, { File } from 'file-api'
|
||||||
|
|
||||||
|
|
||||||
import { isString, isNonEmptyString } from '~/helpers/check-types.js'
|
import { isString, isNonEmptyString } from '~/helpers/check-types.js'
|
||||||
import { extractMachoMeta } from '~/helpers/scanner/parsers/macho.js'
|
import { extractMachoMeta } from '~/helpers/scanner/parsers/macho.js'
|
||||||
|
|
||||||
|
|
||||||
// For some reason inline 'import()' works better than 'import from'
|
// For some reason inline 'import()' works better than 'import from'
|
||||||
// https://gildas-lormeau.github.io/zip.js/
|
// https://gildas-lormeau.github.io/zip.js/
|
||||||
const zip = await import('@zip.js/zip.js')
|
const zip = await import('@zip.js/zip.js')
|
||||||
|
|
@ -193,14 +196,19 @@ export class AppScan {
|
||||||
throw new Error( 'More than one root info.plist found' )
|
throw new Error( 'More than one root info.plist found' )
|
||||||
}
|
}
|
||||||
|
|
||||||
const infoXml = await this.readFileEntryData( fileEntry )
|
const infoBlob = await this.readFileEntryData( fileEntry, zip.Uint8ArrayWriter )
|
||||||
|
const infoBuffer = Buffer.from( infoBlob )
|
||||||
|
|
||||||
|
// const infoBuffer = await fileEntry.getData()
|
||||||
|
|
||||||
|
// console.log( 'infoBuffer', Buffer.from( infoBuffer ) )
|
||||||
|
|
||||||
// Parse the Info.plist data
|
// Parse the Info.plist data
|
||||||
this.infoPlist = plist.parse( infoXml )
|
this.infoPlist = plist.parse( infoBuffer )
|
||||||
|
|
||||||
this.sendMessage({
|
this.sendMessage({
|
||||||
message: 'ℹ️ Found Info.plist',
|
message: 'ℹ️ Found Info.plist',
|
||||||
data: this.infoPlist,
|
// data: this.infoPlist,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -258,7 +266,7 @@ export class AppScan {
|
||||||
|
|
||||||
this.machoMeta = await extractMachoMeta({ machoFileInstance, FileApi })
|
this.machoMeta = await extractMachoMeta({ machoFileInstance, FileApi })
|
||||||
|
|
||||||
console.log( 'this.machoMeta', this.machoMeta )
|
// console.log( 'this.machoMeta', this.machoMeta )
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue