NDMAC / apk-updater

Android's apk automatic updater server module for Node.js
Apache License 2.0
29 stars 18 forks source link

What goes in the APK directory #3

Open shaungehring opened 9 years ago

shaungehring commented 9 years ago

Can i get pointed to documentation? Do i just drop the signed apk into the folder? If so, i have and i do not see it represented in the JSON.

gbourel commented 9 years ago

You just have to drop the APK into the repo folder. The default directory is .apk_repo (watch the dot at the beginning) You may change it by using the third parameter of the 'enable' function.

shaungehring commented 9 years ago

All that is showing for me is blank JSON. I tried specifying a dir a few ways with no luck...

var apkUpdater = require('apk-updater');
var express = require('express');

var app = express()

apkUpdater.enable(app, '/', '~/node_modules/apk-updater/.apk_repo/');

var server = app.listen(8090, '127.0.0.1', function () {

  var host = server.address().address;
  var port = server.address().port;

  console.log('Example app listening at http://%s:%s', host, port);

});
peturh commented 8 years ago

Not sure if you have solved it yet.

I used body-parser in my project.

var express = require('express');
var apkUpdater = require('apk-updater');
var app = express();

//These to lines are needed
var bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({extended : true}));

app.listen('9099', function () {
    console.log("App listening on port 9099");
});

apkUpdater.enable(app, '/myDirectory');
erik-miljo commented 7 years ago

Hi. Been experimenting with apk-updater.

I found that the only files listed from .apk-repo was files that had a name starting with 'test-' followed by a number. Any suggestion to make the servers scripts read all files in the directory?

Kind regards Erik Johansson

gbourel commented 7 years ago

Hi, cheked in lib/apkReader.js the search pattern for APK files is apkPattern = /([\w\.]+)-(\d+)\.apk/; Which means any file name composed as "anyString-aNumber.apk". In this example, the anyString is the package name and aNumber is package version. I will update the current documentation with this explanation but feel free to suggest any better solution if you have one :)

malajisi commented 6 years ago

@peturh Thanks, your server side work perfect. How do you deal with Android client side?

peturh commented 6 years ago

@malajisi I was never touched the Android, sorry. I only implemented the server side for it.