googleplay

package module
v1.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2021 License: OSL-3.0 Imports: 18 Imported by: 2

README

googleplay

Download APK from Google Play or send API requests

https://godocs.io/github.com/89z/googleplay

Tool examples

Create a file containing Token (aas_et) for future requests:

googleplay -e EMAIL -p PASSWORD

Create a file containing Android_ID for future requests:

googleplay -d

Get app details:

googleplay -a com.google.android.youtube

Get APK URL:

googleplay -a com.google.android.youtube -v 1524094400

Module example

package main

import (
   "fmt"
   "time"
   gp "github.com/89z/googleplay"
)

func main() {
   tok, err := gp.NewToken("EMAIL", "PASSWORD")
   if err != nil {
      panic(err)
   }
   auth, err := tok.Auth()
   if err != nil {
      panic(err)
   }
   dev, err := gp.NewDevice(gp.DefaultCheckin)
   if err != nil {
      panic(err)
   }
   auth.Upload(dev, gp.DefaultConfig)
   time.Sleep(gp.Sleep)
   del, err := auth.Delivery(dev, "com.google.android.youtube", 1524094400)
   if err != nil {
      panic(err)
   }
   fmt.Printf("%+v\n", del)
}

How to get Android JA3?

First install:

https://github.com/emanuele-f/PCAPdroid

Start app, then change from HTTP Server to PCAP File. Then click start, if prompted to save, choose Downloads. Start Android Chrome and wait for a page to load. Then stop monitoring, and copy file to computer:

adb ls /sdcard/Download
adb pull /sdcard/Download/PCAPdroid_22_Oct_15_19_28.pcap

Then my other package can get you the rest of the way:

https://godocs.io/github.com/89z/parse/crypto

How to get Android public key?

Get this:

https://apkpure.com/google-play-services/com.google.android.gms

Then extract:

apktool d com.google.android.gms.apk

The Android public key modulus length should always be 128, which Base64 encoded looks like:

AAAAgA

So you should be able to search the extracted files for one of these:

AAAAg
public key available

Result:

smali\gnt.smali
320: const-string v1, "no public key available, using default"
321-
322- invoke-interface {v0, v1}, Lalyp;->u(Ljava/lang/String;)V
323-
324- const-string v0, "AAAAgMom/1a/v0lblO2Ubrt60J2gcuXSljGFQXgcyZWveWLEwo6prwg...

Thanks

https://github.com/4thel00z/google-play

Documentation

Index

Constants

View Source
const (
	Sleep = 16 * time.Second
)

Variables

View Source
var DefaultCheckin = Checkin{Version: 3}
View Source
var DefaultConfig = Config{
	DeviceConfiguration: DeviceConfiguration{
		TouchScreen:          1,
		Keyboard:             1,
		Navigation:           1,
		ScreenLayout:         1,
		HasHardKeyboard:      true,
		HasFiveWayNavigation: true,
		ScreenDensity:        1,

		GlEsVersion: 0x0009_0000,

		SystemAvailableFeature: []string{

			"android.hardware.camera",

			"android.hardware.faketouch",

			"android.hardware.location",

			"android.hardware.screen.portrait",

			"android.hardware.touchscreen",

			"android.hardware.wifi",
		},

		NativePlatform: []string{
			"armeabi-v7a",
		},
	},
}

Functions

This section is empty.

Types

type AppDetails added in v1.1.4

type AppDetails struct {
	DeveloperName    string   `json:"1"`
	VersionCode      int      `json:"3"`
	Version          string   `json:"4"`
	InstallationSize int      `json:"9"`
	Permission       []string `json:"10"`
}

type Auth added in v1.0.4

type Auth struct {
	url.Values
}

func (Auth) Delivery added in v1.1.9

func (a Auth) Delivery(dev *Device, app string, ver int) (protobuf.Decoder, error)

func (Auth) Details added in v1.0.4

func (a Auth) Details(dev *Device, app string) (*AppDetails, error)

func (Auth) Upload added in v1.1.3

func (a Auth) Upload(dev *Device, con Config) error

This seems to return `StatusOK`, even with invalid requests, and the response body only contains a token, that doesnt seem to indicate success or failure. Only way I know to check, it to try the `deviceID` with a `details` request or similar. Also, after the POST, you need to wait at least 16 seconds before the `deviceID` can be used.

type Checkin added in v1.0.6

type Checkin struct {
	Checkin struct{} `json:"checkin"`
	Version int      `json:"version"`
}

type Config added in v1.2.1

type Config struct {
	DeviceConfiguration DeviceConfiguration `json:"1"`
}

type Device added in v1.0.6

type Device struct {
	Android_ID int64
}

func NewDevice added in v1.0.6

func NewDevice(check Checkin) (*Device, error)

func (*Device) Decode added in v1.2.1

func (d *Device) Decode(r io.Reader) error

Read Device from file.

func (Device) Encode added in v1.2.1

func (d Device) Encode(w io.Writer) error

Write Device to file.

func (Device) String added in v1.2.1

func (d Device) String() string

type DeviceConfiguration added in v1.2.1

type DeviceConfiguration struct {
	TouchScreen            int32    `json:"1"`
	Keyboard               int32    `json:"2"`
	Navigation             int32    `json:"3"`
	ScreenLayout           int32    `json:"4"`
	HasHardKeyboard        bool     `json:"5"`
	HasFiveWayNavigation   bool     `json:"6"`
	ScreenDensity          int32    `json:"7"`
	GlEsVersion            int32    `json:"8"`
	SystemAvailableFeature []string `json:"10"`
	NativePlatform         []string `json:"11"`
}

type Token added in v1.0.1

type Token struct {
	url.Values
}

func NewToken added in v1.0.4

func NewToken(email, password string) (*Token, error)

Request refresh token.

func (Token) Auth added in v1.0.4

func (t Token) Auth() (*Auth, error)

Exchange refresh token for access token.

func (*Token) Decode added in v1.1.0

func (t *Token) Decode(r io.Reader) error

Read Token from file.

func (Token) Encode added in v1.1.0

func (t Token) Encode(w io.Writer) error

Write Token to file.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL