mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 07:53:28 +02:00
Implement APK uploads using the new storage system. Installation from URL still does not work, and dropping the file on the screen may not work either.
This commit is contained in:
19
lib/roles/storage/plugins/apk/task/manifest.js
Normal file
19
lib/roles/storage/plugins/apk/task/manifest.js
Normal file
@@ -0,0 +1,19 @@
|
||||
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 resolver.promise
|
||||
}
|
||||
Reference in New Issue
Block a user