Skip to content

Commit

Permalink
Replaced unzip with adm-zip. Removes streams
Browse files Browse the repository at this point in the history
  • Loading branch information
jofan committed Jun 17, 2016
1 parent 3905b52 commit a2d0271
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
34 changes: 19 additions & 15 deletions lib/AppBundleInfo.coffee
Expand Up @@ -6,6 +6,7 @@ tmp = require('tmp')
glob = require('glob')
Lock = require('lock')
fstream = require('fstream')
AdmZip = require('adm-zip')

class AndroidAppBundleInfo
constructor:(@pathOrStream)->
Expand All @@ -32,22 +33,25 @@ class AndroidAppBundleInfo
return callback()
@lock('extract',(release)=>
callback = release(callback)
@_getFileStream((err,stream)=>
zip = new AdmZip @pathOrStream
# @_getFileStream((err,stream)=>
# return callback(err) if err
tmp.dir((err,extractPath)=>
return callback(err) if err
tmp.dir((err,extractPath)=>
return callback(err) if err
@extractPath = extractPath
writeStream = fstream.Writer(@extractPath)
# console.log('extracting',@extractPath)
stream.pipe(unzip.Parse())
.pipe(writeStream)
.on('close',()=>
@extracted = yes
callback()
)
.on('error',callback)
)
@extractPath = extractPath
zip.extractAllTo extractPath, true
@extracted = yes
callback()
# writeStream = fstream.Writer(@extractPath)
# stream.pipe(unzip.Parse())
# .pipe(writeStream)
# .on('close',()=>
# @extracted = yes
# callback()
# )
# .on('error',callback)
)
# )
)

_getFileStream:(callback)->
Expand All @@ -71,4 +75,4 @@ class AndroidAppBundleInfo



module.exports = AndroidAppBundleInfo
module.exports = AndroidAppBundleInfo
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -5,6 +5,7 @@
"keywords": "ipa,bundle,app,plist,info,unzip,apk,android,manifest",
"license": "MIT",
"dependencies": {
"adm-zip": "^0.4.7",
"apk-parser2": "0.1.1",
"binary": "0.3.0",
"bplist": "0.0.4",
Expand Down

0 comments on commit a2d0271

Please sign in to comment.