Giter Site home page Giter Site logo

play-store-api's Introduction

play-store-api Build Status Release downloads

Google Play Store protobuf API wrapper in java

Include

Get it from jitpack. Or...

Build separately

git clone https://github.com/yeriomin/play-store-api
gradlew :assemble
gradlew :build

Protobuf classes generation happens on assemble step, tests a ran on build step.

Usage

First login

        // A device definition is required to log in
        // See resources for a list of available devices
        Properties properties = new Properties();
        try {
            properties.load(getClass().getClassLoader().getSystemResourceAsStream("device-honami.properties"));
        } catch (IOException e) {
            System.out.println("device-honami.properties not found");
            return null;
        }
        PropertiesDeviceInfoProvider deviceInfoProvider = new PropertiesDeviceInfoProvider();
        deviceInfoProvider.setProperties(properties);
        deviceInfoProvider.setLocaleString(Locale.ENGLISH.toString());
        
        // Provide valid google account info
        PlayStoreApiBuilder builder = new PlayStoreApiBuilder()
            // Extend HttpClientAdapter using a http library of your choice
            .setHttpClient(new HttpClientAdapterImplementation())
            .setDeviceInfoProvider(deviceInfoProvider)
            .setEmail(email)
            .setPassword(password)
        ;
        GooglePlayAPI api = builder.build();
        
        // We are logged in now
        // Save and reuse the generated auth token and gsf id,
        // unless you want to get banned for frequent relogins
        // The token has a very long validity time. Months.
        api.getToken();
        api.getGsfId();
        
        // API wrapper instance is ready
        DetailsResponse response = api.details("com.cpuid.cpu_z");

Further logins

        // A device definition is required for routine requests too
        // See resources for a list of available devices
        Properties properties = new Properties();
        try {
            properties.load(getClass().getClassLoader().getSystemResourceAsStream("device-honami.properties"));
        } catch (IOException e) {
            System.out.println("device-honami.properties not found");
            return null;
        }
        PropertiesDeviceInfoProvider deviceInfoProvider = new PropertiesDeviceInfoProvider();
        deviceInfoProvider.setProperties(properties);
        deviceInfoProvider.setLocaleString(Locale.ENGLISH.toString());
        
        // Provide auth token and gsf id you previously saved
        PlayStoreApiBuilder builder = new PlayStoreApiBuilder()
            // Extend HttpClientAdapter using a http library of your choice
            .setHttpClient(new HttpClientAdapterImplementation())
            .setDeviceInfoProvider(deviceInfoProvider)
            .setToken(token)
            .setGsfId(gsfId)
        ;
        GooglePlayAPI api = builder.build();
        
        // API wrapper instance is ready
        DetailsResponse response = api.details("com.cpuid.cpu_z");

Examples

See tests and the project which this library was made for for examples.

Further studies

Looking through GooglePlay.proto will let you know what responses to expect.

play-store-api's People

Contributors

yeriomin avatar

Watchers

James Cloos avatar Zach Kirke avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.