For a rust version of this library check out rs-gpapi.
Call Google Play APIs from Node. You might want to check out the CLI package as well.
By default behaves like a Nexus device with SDK 23 for app downloads.
var api = require('gpapi').GooglePlayAPI({
username: user,
password: pass,
androidId: android_id
// apiUserAgent: optional API agent override (see below)
// downloadUserAgent: optional download agent override (see below)
});
// usage via Promise
api.details("com.viber.voip").then(console.log);
// usage via node callback convention
api.details("com.viber.voip", function (err, res) {
console.log(err ? err : res);
});
The options accepted:
{
username: username,
password: password,
androidId: androidId,
countryCode: 'us',
language: 'en_US',
requestsDefaultParams: requestsDefaultParams,
apiUserAgent: USER_AGENT,
downloadUserAgent: DOWNLOAD_MANAGER_USER_AGENT,
useCache:true,
debug: false
}
The default apiUserAgent
and downloadUserAgent
is from Nexus 5X device, w/Play Store version 6.8.44:
e.g.,:
const USER_AGENT = (
'Android-Finsky/6.8.44.F-all%20%5B0%5D%203087104 ' +
'(api=3,versionCode=80684400,sdk=23,device=bullhead,'+
'hardware=bullhead,product=bullhead,platformVersionRelease=6.0.1,'+
'model=Nexus%205X,buildId=MHC19Q,isWideScreen=0)'
);
const DOWNLOAD_MANAGER_USER_AGENT = (
'AndroidDownloadManager/6.0.1 (Linux; U; Android 6.0.1; Nexus 5X Build/MHC19Q)'
);
Therefore you will have best luck getting an ANDROID_ID
from a Nexus 5X oroverride the value via the options object for your particular device.
Note that you'll need to grab the device-id (ANDROID_ID
) and associateduser-agents for best performance of the library.
ANDROID_ID
- the ID for the device for Google. This is the GSF ID not theid from dialing *#*#8255#*#*
. You can get the gsf id e.g., using this following app:device idappWARNING: This is not the androidId but the GSF Id that is needed by the library
Another way is to setup an HTTP proxy and install a CA to the device to seethe network traffic. Here is an example from amitmproxy session:
These values can then be passed to the API so that apps can be downloaded withthe restrictions of the particular device.
Note that this library uses the requests
module, therefore you can control proxy behavior or override defaults via the requestDefaultsParams
option.
Use env variable DEBUG
i.e., DEBUG=gp:api
to enable debug output. This is done via request-debug.
You can provide the debug option too.
{
username: username,
password: password,
androidId: androidId,
debug: false
}
Assumes you have set the following environment variables: GOOGLE_LOGIN
, GOOGLE_PASSWORD
, ANDROID_ID
± % node examples/details.js | jq '.'
{
"docid": "com.viber.voip",
"backendDocid": "com.viber.voip",
"docType": 1,
"backendId": 3,
"title": "Viber",
"creator": "Viber Media S.à r.l.",
"descriptionHtml": "With Viber, everyone in the world can connect. Freely. More than 400 million Viber users text, call, and send photo and video messages worldwide over Wifi or 3G - for free. Viber Out can be used to make calls to non-Viber mobile and landline numbers at low rates. Viber is available for many smartphones and platforms. <p>Viber is compatible with and optimized for Android tablets! Use Viber on your tablet and phone simultaneously.<br>On Viber, your phone number is your ID. The app syncs with your mobile contact list, automatically detecting which of your contacts have Viber. <p>•\tText with your friends<br>•\tMake free calls with HD sound quality<br>•\tPhoto sharing, video messages, voice messages, locations, stickers and emoticons<br>•\tGroups with up to 100 participants<br>•\tDownload stickers from the Sticker Market, making messaging fun! <br>•\tAbility to sort and reorder stickers<br>•\tPush notifications guarantee that you never miss a message or call, even when Viber is off<br>•\tIntegration with native contact list for calls and messages<br>•\tSupport for the Viber Desktop application on Windows and Mac <br>Localized to: Arabic, Catalan, Chinese (SP), Chinese (TR), Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese (BR), Portuguese (PT), Romanian, Russian, Slovak, Spanish, Swedish, Tagalog, Thai, Turkish, Ukrainian and Vietnamese<br>Viber is completely free with no advertising. <br>We value your privacy. <p>Follow us for updates and news:<br>Facebook - <a href=\"https://www.google.com/url?q=http://facebook.com/viber&sa=D&usg=AFQjCNGlVhJn65339uldBAp6MeFXZIV3mA\" target=\"_blank\">http://facebook.com/viber</a><br>Twitter - <a href=\"https://www.google.com/url?q=http://twitter.com/viber&sa=D&usg=AFQjCNG60qtBs85Z7vg5eeagjANxTrdSjQ\" target=\"_blank\">http://twitter.com/viber</a><p>(*) Network data charges may apply",
"offer": [
{
"micros": "0",
"currencyCode": "USD",
"formattedAmount": "Free",
"checkoutFlowRequired": false,
"offerType": 1
}
],
...
± % node examples/related.js | jq '.'
[
{
"backendId": 3,
"title": "Similar apps",
"child": [
{
"docid": "com.skype.raider",
"backendDocid": "com.skype.raider",
"docType": 1,
"backendId": 3,
"title": "Skype - free IM & video calls",
"creator": "Skype",
"offer": [
{
"micros": 0,
"currencyCode": "USD",
"formattedAmount": "Free",
"checkoutFlowRequired": false,
"offerType": 1
}
],
"availability": {
"restriction": 1,
"perdeviceavailabilityrestriction": [
{
"androidId": xxxxxxxxxxxxxxx9983,
"deviceRestriction": 1,
"channelId": 83938807
}
],
"availableIfOwned": true
},
...
}
}
]
± % node examples/downloadInfo.js | jq '.'
{
"url": "https://android.clients.google.com/market/download/Download?packageName=air.WatchESPN&versionCode=2100039&token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxw&downloadId=yyyyyyyyyyyyyyyyyyyy",
"cookies": [
{
"name": "MarketDA",
"value": "zzzzzzzzzzzzzzzzzzzz"
}
]
}
± % node examples/completeDownloadInfo.js | jq '.'
{ url: 'https://android.clients.google.com/market/download/Download?packageName=com.viber.voip&versionCode=37&ssl=1&token=xxxxxxxxx&downloadId=-xxxxxxxxxxx',
jar:
RequestJar {
_jar:
CookieJar {
enableLooseMode: true,
store: { idx: { 'android.clients.google.com': { '/market/download': { MarketDA: Cookie="MarketDA=xxxxxxxx; Path=/market/download; hostOnly=true; aAge=29ms; cAge=29ms" } } } } } },
headers:
{ 'User-Agent': 'AndroidDownloadManager/4.2.2 (Linux; U; Android 4.2.2; Galaxy Nexus Build/JDQ39)',
'Accept-Encoding': '' } }
随着Google的Protobuf3的发布,Google终于开发了一个可以给JavaScript使用的库。之前大家如果在node端使用了Protobuf应该用的是protobufjs这个库,但是既然Google官方支持了JavaScript,那么我们还是要去尝试一下的。 下面就开始介绍如何在node端使用google-protobuf,在解析生成proto数据的同时,我们还支持一个
From: http://blog.amt.in/nodejs-on-android I'm trying to make the recently popular (well, maybe not so recently) Node.js run on Android. So far, I've succeeded in getting it to run on the ISO1, a smar
Node程序包管理器(NPM)提供了以下两个主要功能: 在线存储库的Node.js包/模块,可搜索 search.nodejs.org 命令行实用程序来安装Node.js的包,做版本管理和Node.js包依赖管理。 NPM捆绑v0.6.3版本在一起以后,Node.js可直接安装。为了验证一致性,打开控制台,然后输入以下命令,看到的结果: $ npm --version 2.7.1 如果您正在运行旧
by Gautam Arora 由Gautam Arora 在Google Cloud Platform上持续部署Node.js (Continuous Deployment for Node.js on the Google Cloud Platform) Google Cloud Platform (GCP) provides a host of options for Node develo
回顾,前文由node.js写的基于addon的hello world例子 #include <node.h> #include <v8.h> using namespace v8; Handle<Value> Method(const Arguments& args) { HandleScope scope; return scope.Close(String::New("world"))
GOOGLE V8 JS引擎是开源项目,采用C++编写,供GOOGLE CHOME浏览器使用。 V8引擎可以独立运行,也可以嵌入C++应用中。 Node.js现在只能在V8引擎上实现(NodeJS is currently tightly coupled to Google’s V8 engine.),与GOOGLE V8是紧耦合的关系。 问题在于,V8是为客户端设计的,而Node.JS用在服务端
Node是kubernetes集群的工作节点,可以是物理机也可以是虚拟机。 Node的状态 Node包括如下状态信息: Address HostName:可以被kubelet中的--hostname-override参数替代。 ExternalIP:可以被集群外部路由到的IP地址。 InternalIP:集群内部使用的IP,集群外部无法访问。 Condition OutOfDisk:磁盘空间不足时
node 负责 peer node 子命令。
这用于确定进程需要运行的节点的值。 由于分布式编程用于在不同节点上运行函数,因此在希望在不同机器上运行程序时,此功能非常有用。 语法 (Syntax) node() 参数 (Parameters) None 返回值 (Return Value) 这将返回本地节点的名称。 如果节点未分发,则返回nonode@nohost 。 例如 (For example) -module(helloworld)
The Po.et Node The Po.et Node allows you to timestamp documents in a decentralized manner. It's built on top of the Bitcoin blockchain and IPFS. Index The Po.et Node Index How to Run the Po.et Node De
我试图下载一个文件从谷歌驱动器使用谷歌SDK API使用node.js. 但是我无法在服务器端写入/保存文件-node.js 代码:- 我得到这个在控制台:-内容xhr.response文本是这样的东西 请帮我知道我从Drive Api得到的数据的格式是什么,并把它写成哪种格式,这样我就得到了一个完整的. docx文件 编辑 如果xmlRequest有助于我下载文件(.docx),我愿意使用xml
我已经使用下面的代码对图像执行文本检测。 预期结果为BBTPB9999Q,但程序输出为BBTPB9999C 有没有办法提高精确度?