Giter Site home page Giter Site logo

yeriomin / play-store-api Goto Github PK

View Code? Open in Web Editor NEW
316.0 45.0 131.0 7.51 MB

Google Play Store protobuf API wrapper in java

License: GNU General Public License v3.0

Java 100.00%
play-store playstore google google-play-store protobuf protobuf-java floss api-wrapper

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
        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.

License

play-store-api is Free Software: You can use, study share and improve it at your will. Specifically you can redistribute and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Credits

play-store-api is a fork of https://github.com/Akdeniz/google-play-crawler play-store-api has protobuf-java built-in. protobuf-java was modified to work with java 1.5 which is required for play-store-api to work on old android versions.

play-store-api's People

Contributors

tasssadar avatar yeriomin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

play-store-api's Issues

Question: Do API downloads count in Google Play Console?

Hi,
sorry if this is not the right place to ask this, but my question is: if an app is downloaded with this API, will it increment the official download number of the app in Google Play store? Or can Google know that it is not a legit download?

.

.wrong repo.

bulkDetails response is empty

Hi

BulkDetailsResponse is success, but empty.

packageNames size = 324

I/DebugHttpClientAdapter: Requesting https://android.clients.google.com/fdfe/bulkDetails
I/DebugHttpClientAdapter: HTTP result code 200

result = {BulkDetailsResponse@5331}
entry_ = {ProtobufArrayList@5334} size = 0
memoizedSerializedSize = -1
unknownFields = {UnknownFieldSetLite@5335}
memoizedHashCode = 0
shadow$klass = {Class@5332} ""
shadow$monitor = -2050010224

Other APIs like search and details are working.

Did you notice this one? Do you think there is may be a throttle?

How can I download apks ?

Hi,
I want to use this code to download current version apks , but response.hasAppDeliveryData() = false.
Thanks!

Auth 403 CaptchaRequired

request:
url=https://android.clients.google.com/auth

response:
Error=CaptchaRequired
CaptchaToken=AAWk9lRPb7tCAA75-UL8ZWxsg4Gwn5URKLcEP3rsXEyh7SIY1ZXRftMPzHTy6Iz2JLYpFLiHb60bdH0jycqA1wLCKB3d4kR_O9NhRf7t1oL1k4ncyVqybj4qx26UAQzTT19UTI7PEsM449Vp3bX3Hz9C73jUAU4PEJmWHMUwTADHbyRm38HYKdc
CaptchaUrl=https://accounts.google.com/Captcha?ctoken=AAWk9lRPb7tCAA75-UL8ZWxsg4Gwn5URKLcEP3rsXEyh7SIY1ZXRftMPzHTy6Iz2JLYpFLiHb60bdH0jycqA1wLCKB3d4kR_O9NhRf7t1oL1k4ncyVqybj4qx26UAQzTT19UTI7PEsM449Vp3bX3Hz9C73jUAU4PEJmWHMUwTADHbyRm38HYKdc&v=2

How to generate device properties from a device?

First i want to thank you for that amazing project!
Is there a script that can create device properties from a device? (using adb or so)
Or, what are the values i need to read from the device for each entry?
Thanks!

Cannot use token + gsfId in the reauth flow

When using:

PlayStoreApiBuilder builder = new PlayStoreApiBuilder()
.setHttpClient(new OkHttpClientAdapter())
.setDeviceInfoProvider(deviceInfoProvider)
.setToken(token)
.setGsfId(gsfid);
GooglePlayAPI api = builder.build();

It will throw

com.github.yeriomin.playstoreapi.ApiBuilderException: Either email-password pair or a token dispenser url is required

How can we use token and gsfId directly without needing a token dispenser?

help to add repository to android studio

i want to add repository to android studio
1)
allprojects { repositories { jcenter() google() maven { url 'https://jitpack.io' } } }
2)

dependencies {
   	        implementation 'com.github.yeriomin:play-store-api:0.42'
}

but when i sync project get following error!!!

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.github.yeriomin:play-store-api:0.42

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.github.yeriomin:play-store-api:0.42

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.github.yeriomin:play-store-api:0.42

Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.github.yeriomin:play-store-api:0.42

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.github.yeriomin:play-store-api:0.42

Add if app is now free?

hi
thank you for this api it is very useful
can you please add a way to get if the app is now free?
some apps goes from paid to free for certain period , is there a way to check if the is free now?

purchase api broken

Recently purchase request stopped working.
The buyResponse.purchaseStatusResponse.appDeliveryData contains empty downloadUrl and downloadAuthCookie. (purchaseResponse.status is zero)

Details request still works - I get the version code etc.

I tried several google accounts (including one from real device and gsfid).
This worked for me before and stopped working few days ago.

Can you please verify this?
Thanks!

How I can change market location on SearchIterator

SearchIterator retrieve data which is different from playmarket application search. I try to change locales on device-*.properties, api.setLocale(locale), deviceInfoProvider.setLocaleString(locale), try to use proxy and change search settings on account, but I continue getting wrong data from unknown store. How can I specify store location what I need?

how to show all search result

dear yeriomin.

i want to know how to show all search result. it is only show about 10 apps and 2 pages for search in store.

is it possible to login with device that we want?

for example i want to login using device with Android 6 is it possible?
i use this with your token dispenser and login, it said that i use "oneplus one" device on my google account activity.
if yes, how to config it?
thanks

BulkDetails

It seems bulk details request does not work anymore.

Can't retrieve VersionString when request with bulkDetails.

Hi,

I'm very thankful for your library. It work very well. But, I'm using the latest version (0.26) and it have a little issue. When I request detail of multiple package name with bulkDetails then I get versionString of each but nothing to return.
Please fix it. I waiting for new version. Thank you!

sale info is missing

Until a few days ago saleEndTimestamp returned a timestamp when the sale ended. Now it only returns 0.

Question: origin of device info?

Hi,
how did you devise the device info in src/main/resources/* ?
It is used by other projects now, but is a bit outdated and I'm looking into adding modern devices.
Thankyou

how to get content rating of an App?

I have tried with following code, the result always be 0.

       DetailsResponse response = null;
       response = api.details("org.amalgam.laboratory");
        AppDetails detail = response.getDocV2().getDetails().getAppDetails();
        System.out.println(detail.getContentRating());

Thanks a lot!

how to process split delivery response

in the delivery response there are 4 download links usually only one rarely 2(.obb file) but this one(com.supercell.brawlstars) has 4.

i installed the apk file but it did not show any launcher icon default android logo shown on install dialog and after installation on home screen.

here is the response

stdClass Object

  | (
  | [payload] => stdClass Object
  | (
  | [deliveryResponse] => stdClass Object
  | (
  | [appDeliveryData] => stdClass Object
  | (
  | [downloadSize] => 78607836
  | [sha1] => wdQHxipeSJ249fVEsJ6GK1Qz4Cw
  | [downloadUrl] => https://play.googleapis.com/download/by-token/download?token=AOTCm0S5Y8dPSl51LikuIKY-97OCPTwHOKcU5TC5W7nz7dQu87uOchzt0RohlCGM4DKckxTnTXKe4ZU47w73FjGvYysrRo1Ut5RpKAdYr665UpknZz6XofAuqTKqcSdWLLV5Jgy0NRulyN2sHsTMScn5pAJ3Dg0464drqs95RGE7TNsuglDzP1vyZdUa1OupWwsSjxggeeUiAnEWmTVxQ0sAXm7BNkj2mcSckaPV5JzmVYYnHufdK2r1mSPlExi_7XXmrlc0G_uj1wij5QZxI9gC3pzeOJSgqyRYfYhs_1nIGmiRQhZDNKqSME2r46X65eyb_ycp0j3GlO1_uTs_qV8Hl2tWeHo&cpn=1DRTcnxmClYjB_eY
  | [downloadAuthCookie] => Array
  | (
  | [0] => stdClass Object
  | (
  | [name] => a
  | [value] => 42
  | )
  |  
  | )
  |  
  | [forwardLocked] =>
  | [serverInitiated] => 1
  | [split] => Array
  | (
  | [0] => stdClass Object
  | (
  | [name] => config.xhdpi
  | [size] => 128657
  | [sha1] => qj3xxkTYCkcr-BWOBw9YX6ZJb_g
  | [downloadUrl] => https://play.googleapis.com/download/by-token/download?token=AOTCm0RUCxD8sWeHeyWPySYjJm2hILanIe2qpWtIoyJX1VMMtlb-W_Hkt0fdQlDu_vHEAX9Su40qLMeW3xckEWcbqV7pLs7z5escZtR5-LSRZim4eZPmCQ_5NoP4_DpdRDNJ1zBnj6bXhwiA-kzjAXADzPDqB18EhxG2o1MtRb8kneoMqm7mzWij5J6-I_64BT7EEUrCDu1EzLIWgOWr_5g0QoZ9V0Rhq90hJ-7XjNyq7FTC9T1vYY3LOpTwtKbEXaI8MXFYpM0OQEnyABH_Cyzh7ESKO2c2G6xVipaEum8n9EwTBgEao4gNZmNdC0zWvnzsMvTWvLmst7j2IXqdjwrwmQd_9EKivU5jaLq9NSc2X1ENeQ&cpn=0Q8bnGQQ2GbwkIWF
  | [sha256] => juOdqEZG6gzj7e8gVEf7zUIK0B_cqoOMuOcfMMOIzlA
  | )
  |  
  | [1] => stdClass Object
  | (
  | [name] => config.en
  | [size] => 23743
  | [sha1] => G4JNLs5ftYu28RU93j_BqPUoroo
  | [downloadUrl] => https://play.googleapis.com/download/by-token/download?token=AOTCm0QK1hbrP-4BYuh6d9eBlBlc3J24J7ZHDGf00gzzWo9zYamADJLqhDvC49X2GYuDxCJLJJCBFUzOFVszIFF6dCp6r8GUVWXfSsODChAlOXbHnKHyPuQ8tpjfm2b9zdQvYXJWpcHmnBkxT7d6RaY5lrIDRRqL0jOdjFNG2ftTq8kDKwjR0ykZMR1jYGdnsXblRCk3wKnlyeACJDK6OYcG7WWp8acY9QHQi_TBkngoyGmx7faZV905LCVp6arG2Xgi6oBy4lXO0QcVNWp53doSRgszrtKYcMNa9qJRWPr6fdyAPwafJyAYMZG1GAZ6goe3xSi-NcFwcM_fCV6JfzJzsS7ZSJoKPkIcXTiNjXmn&cpn=5TJt6F3kLyBqWI2V
  | [sha256] => ekAHhoMD3O9ZtNKa0ESRyUMxcUX72CHV5tzV5KZ2sJ8
  | )
  |  
  | [2] => stdClass Object
  | (
  | [name] => config.armeabi_v7a
  | [size] => 5346538
  | [sha1] => QAo98czhkFrobQTbMCc500_v5_8
  | [downloadUrl] => https://play.googleapis.com/download/by-token/download?token=AOTCm0T7Hl7U8HiSuVuy3om7ttcEhNdx80sfWHfYpkTPwG0sllQLMSoQNar7CD2umZDkLpI068sRGon-gu3OHOyorVgkwavADHq1DZkFInaXjbYgyB0DNBPLnLjnLKP_ERsLtC3Vl_HmKaTKC8Sz4XsuvTBLZ5nW3i2UttL55w6SBIB9GOTj-ynMFSNOh4P12dq3AxV7T4Fcywj5Beqkc55Vjw8iyWey4fnapX7wawGM6Iv-smPrfBE3rIpprWEpuIwIxpYouRk7NEAGfohTxAiJo9YZUsMGlNK-idfH_6xPbzSAgDCKwG9AhTknBBklBRPnT4xGGodzo7AKHXNkbQhdiT3r8TCDbryV5H0xmWflFR1lMWCOy-wCnbonlg&cpn=bMKSdu9qVXn51WcV
  | [sha256] => qqBUiH-mSHBg2DXmf8s4hH6wtV8JuJxz3Ag83ptBMyo
  | )
  |  
  | )
  |  
  | [sha256] => nSf7NerF1foHyFFVOLNsxa-hb6DWkXuqvVVGAfFuMns
  | )
  |  
  | )
  |  
  | )
  |  
  | [serverMetadata] => stdClass Object
  | (
  | [latencyMillis] => 100
  | )
  |  
  | [serverLogsCookie] => CBKaARcKEwip4tbd1ZbeAhVFOzYKHbxRCn8QAQ==
  | )

can you tell me how to assemble the files and make it a working apk file?

Wrong sdk

Привет.
В Yalp есть возможность выбрать устройство Samsung Galaxy Tab 10.1
Я пишу с него как раз.
В скобках указано 21 апи.
Наверное это ошибка. У меня tab 10.1(3g версия), андроид 5.0.2, SDK 21.
Исправьте номер sdk пожалуйста.

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.