mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Switch back to imported buffer
# Conflicts: # helpers/scanner/client.js
This commit is contained in:
parent
a51d3cd5ee
commit
cc2f2355fc
1 changed files with 3 additions and 4 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
import bufferApi from 'buffer'
|
|
||||||
// import prettyBytes from 'pretty-bytes'
|
// import prettyBytes from 'pretty-bytes'
|
||||||
import * as zip from '@zip.js/zip.js'
|
import * as zip from '@zip.js/zip.js'
|
||||||
// import FileApi from 'file-api'
|
// import FileApi from 'file-api'
|
||||||
|
|
@ -8,12 +7,12 @@ 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'
|
||||||
|
|
||||||
|
import { Buffer } from 'buffer/'
|
||||||
|
|
||||||
// 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')
|
||||||
|
|
||||||
// const bufferApi = await import('buffer')
|
|
||||||
// const FileApi = await import('file-api')
|
// const FileApi = await import('file-api')
|
||||||
// const { parse: plistParse } = await import('simple-plist/dist/index.js')
|
// const { parse: plistParse } = await import('simple-plist/dist/index.js')
|
||||||
|
|
||||||
|
|
@ -26,7 +25,7 @@ zip.configure({
|
||||||
|
|
||||||
|
|
||||||
function makeNodeFileBuffer ( buffer ) {
|
function makeNodeFileBuffer ( buffer ) {
|
||||||
const fileBuffer = new bufferApi.Buffer.alloc( buffer.byteLength )
|
const fileBuffer = new Buffer.alloc( buffer.byteLength )
|
||||||
|
|
||||||
for (var i = 0; i < buffer.length; i++)
|
for (var i = 0; i < buffer.length; i++)
|
||||||
fileBuffer[i] = buffer[i];
|
fileBuffer[i] = buffer[i];
|
||||||
|
|
@ -282,7 +281,7 @@ export class AppScan {
|
||||||
const machoFileInstance = new FileApi.File({
|
const machoFileInstance = new FileApi.File({
|
||||||
name: this.bundleExecutable.filename,
|
name: this.bundleExecutable.filename,
|
||||||
type: 'application/x-mach-binary',
|
type: 'application/x-mach-binary',
|
||||||
buffer: bundleExecutableUint8Array,
|
buffer: Buffer.from( bundleExecutableUint8Array ),
|
||||||
})
|
})
|
||||||
|
|
||||||
this.machoMeta = await extractMachoMeta({ machoFileInstance, FileApi })
|
this.machoMeta = await extractMachoMeta({ machoFileInstance, FileApi })
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue