• This repository has been archived on 12/Mar/2022
  • Stars
    star
    263
  • Rank 155,624 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Get details and download apps from https://play.google.com by emulating an Android (Nexus 5X) device by default. For a rust version of this library check out https://github.com/dweinstein/rs-google-play

NPM

Build Status npm

For a rust version of this library check out rs-gpapi.

SYNOPSIS

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.

USAGE

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);
});

Options

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
}

Defaults

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 or override the value via the options object for your particular device.

ID and User-Agent

Note that you'll need to grab the device-id (ANDROID_ID) and associated user-agents for best performance of the library.

  • ANDROID_ID - the ID for the device for Google. This is the GSF ID not the id from dialing *#*#8255#*#*. You can get the gsf id e.g., using this following app: device id app WARNING: 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 see the network traffic. Here is an example from a mitmproxy session:

Device ID and API User-Agent

Download User-Agent

These values can then be passed to the API so that apps can be downloaded with the restrictions of the particular device.

requests defaults

Note that this library uses the requests module, therefore you can control proxy behavior or override defaults via the requestDefaultsParams option.

Debugging

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
}

EXAMPLES

Assumes you have set the following environment variables: GOOGLE_LOGIN, GOOGLE_PASSWORD, ANDROID_ID

App details

Β± % 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&amp;sa=D&amp;usg=AFQjCNGlVhJn65339uldBAp6MeFXZIV3mA\" target=\"_blank\">http://facebook.com/viber</a><br>Twitter - <a href=\"https://www.google.com/url?q=http://twitter.com/viber&amp;sa=D&amp;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
    }
  ],
 ...

Related apps

Β± % 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
        },
        ...
      }
  }
]

Download info

Β± % 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"
    }
  ]
}

Complete Download info - complete object to be passed seamlessly to request.js

Β± % 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': '' } }

NOTES

More Repositories

1

awesome-frida

Awesome Frida - A curated list of Frida resources http://www.frida.re/ (https://github.com/frida/frida)
2,708
star
2

node-google-play-cli

command line tools using the node-google-play library
JavaScript
69
star
3

dockerfile-qemu-arm-chroot

qemu-arm-static in a docker container to run apps compiled for ARM on x86
Makefile
65
star
4

dockerfile-androguard

docker file for use with androguard python android app analysis tool
38
star
5

google-play-proto

Protobuf definitions for google play services.
25
star
6

node-frida-contrib

frida utility-belt
JavaScript
23
star
7

rs-google-play

Rust conversion (in-progress) of https://github.com/dweinstein/node-google-play.
Rust
23
star
8

pscout

Mirror of PScout (http://pscout.csl.toronto.edu/).
Perl
23
star
9

node-aptoide

aptoide app store APK download
JavaScript
22
star
10

openssh-ios

Automated building of openssh binaries for aarch64 / iOS. Get rid of some of the mystery...
Shell
18
star
11

node-appland

appland client
JavaScript
15
star
12

AndroidReboot

Repository for PoC rebooting of Android from unprivileged apps.
Java
13
star
13

analysis-runner

Shell
11
star
14

level-mailinator

leveldb backed mail repl.
JavaScript
10
star
15

docker-knot-resolver

DNS over TLS configuration to use Cloudflare via knot-resolver project docker container
Shell
9
star
16

node-itms-services

itms services asset downloader for apple iOS ad hoc distribution builds
JavaScript
8
star
17

node-mailinator

node mailinator api
JavaScript
6
star
18

docker-beef

Browser Exploitation Framework
Shell
5
star
19

levelfs

a FUSE fs for leveldb
JavaScript
5
star
20

node-chaotic-cb

return a callback that introduces errors with a certain ratio
JavaScript
5
star
21

dockerfile-androguard-manifest

dump the manifest with androguard
Python
4
star
22

node-itunes-rss

Overengineered iTunes rss feed lister https://rss.itunes.apple.com/
JavaScript
4
star
23

docker-spawn

node.js ChildProcess.spawn for running docker containers
4
star
24

vmxos-osx

vmxos with scripts ported to build in os x
C
4
star
25

restify-endpoints-auth

This bolts on an http-signature authentication middleware for restify-endpoints.
JavaScript
3
star
26

last-bytes

Keep the last count bytes around from a stream.
JavaScript
3
star
27

pull-async-filter

A through stream that filters items out with an async filter.
JavaScript
3
star
28

rust-macho-codesig

Rust
2
star
29

ikev2-vpn-server

Shell
2
star
30

pull-delay

Delays the input through the stream. A pull.through for dominictarr's pull-stream.
JavaScript
2
star
31

node-ec2-instances

JavaScript
2
star
32

openai-erlang-client

Erlang OpenAI client auto-generated by OpenAPI-generator
Erlang
2
star
33

node-ssh-agent

replacement for ssh-agent in node
JavaScript
2
star
34

yara-insp

util to inspect a compiled yara rules file
C
1
star
35

sarif-test

Swift
1
star
36

example_elixir_docker_sup

Elixir
1
star
37

elsim

C
1
star
38

actions-test

1
star
39

node-docker-pull-images

pull multiple images by wrapping docker CLI tool
JavaScript
1
star
40

google-play-endpoints

JavaScript
1
star
41

dockerfile-theos

dockerfile for theos. theos is a tool to assist in building plugins for jailbroken iOS devices
Shell
1
star
42

burp-parse

print a burp flow with base64 components to stdout
JavaScript
1
star
43

linux-modmem

C++
1
star
44

dockerfile-mitmproxy

1
star
45

pyfuzzy

Python
1
star
46

dockerode-authconfig

Normalize auth info from ~/.docker/config.json to the authConfig format for the docker daemon.
JavaScript
1
star
47

sidecar

Pull docker images by watching a list of images stored in consul kv
JavaScript
1
star
48

codespace-eg

JavaScript
1
star
49

go-http-logger-example

Logging the status code for an HTTP response in Go turns out to be a little tricker than first anticipated. You don't get access to the `Response` object after your handler, rather you only have the `ResponseWriter` which is like a byte stream.
Go
1
star
50

bin-android-repack

binaries for repack.sh and unpack.sh (Using mkbootimg) for Android. Useful for repackaging boot images with a different Android kernel
Shell
1
star