diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c26ac87..c31f966d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ ### Fixes - Fixed Lenovo A806 and most likely other cheap Lenovo devices as well by updating [adbkit](https://github.com/openstf/adbkit). +- Updated [adbkit-apkreader](https://github.com/openstf/adbkit-apkreader) to resolve issues with certain APK files that were unparseable and therefore failed installation. We've only seen a single a single APK with this issue, but there could be more. ### Misc diff --git a/lib/units/storage/plugins/apk/task/manifest.js b/lib/units/storage/plugins/apk/task/manifest.js index 6a8f8efb..988d9c14 100644 --- a/lib/units/storage/plugins/apk/task/manifest.js +++ b/lib/units/storage/plugins/apk/task/manifest.js @@ -1,19 +1,7 @@ -var Promise = require('bluebird') var ApkReader = require('adbkit-apkreader') module.exports = function(file) { - var resolver = Promise.defer() - - process.nextTick(function() { - try { - var reader = ApkReader.readFile(file.path) - var manifest = reader.readManifestSync() - resolver.resolve(manifest) - } - catch (err) { - resolver.reject(err) - } + return ApkReader.open(file.path).then(function(reader) { + return reader.readManifest() }) - - return resolver.promise } diff --git a/package.json b/package.json index 71984938..71e53ce9 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "dependencies": { "@slack/client": "^3.5.4", "adbkit": "^2.6.2", - "adbkit-apkreader": "^1.0.0", + "adbkit-apkreader": "^2.0.0", "adbkit-monkey": "^1.0.1", "aws-sdk": "^2.4.13", "basic-auth": "^1.0.3",