anod / AppWatcher

App Watcher for Android helps you to follow updates of applications in Play Store that are not installed currently on your device.
https://play.google.com/store/apps/details?id=com.anod.appwatcher
Other
77 stars 9 forks source link

License to use part of the app's code? #93

Closed AndroidDeveloperLB closed 2 years ago

AndroidDeveloperLB commented 2 years ago

Hello,

I'm very curious how this app succeeded getting information from the Play Store that are related to the current user. The only app I've known so far to do it is this one: https://play.google.com/store/apps/details?id=com.azefsw.purchasedapps

But it's not open sourced.

I've asked multiple times on StackOverflow how they did it, but failed to find any clue.

I'm wondering if it's ok to use some of the app's code in this matter, because when checking the license page, it talks only about licenses of other libraries: https://github.com/anod/AppWatcher/blob/master/third_party_licenses

Currently the only thing that I want to fetch is the list of apps (including their details) that the user has ever installed (so that he could check them out). If possible, please let me know if this app is capable of doing it, and where in code I should check it out.

anod commented 2 years ago

There is no official api for play store,

You can use the following library (this is not official play store api) https://gitlab.com/AuroraOSS/gplayapi

"My apps" sounds similar for what you are looking for https://gitlab.com/AuroraOSS/gplayapi/-/blob/master/src/main/java/com/aurora/gplayapi/GooglePlayApi.kt#L203

AndroidDeveloperLB commented 2 years ago

@anod Thank you for answering.

Does this app ("App Watcher") use this API somewhere to get this list? If so, how did you learn how to use it? Probably requires login and then query of some kind.

anod commented 2 years ago

API: Is google play store api - there is only one The link that I mentioned is a library that implements the api

Does this app ("App Watcher") use this API somewhere to get this list?

App Wathcer also uses the API , but not via the library, it has its own implementation, both library and the app are open source and you can learn from the code

If so, how did you learn how to use it? Probably requires login and then query of some kind.

You can start from readme there

AuroraStore uses the library underhood: https://gitlab.com/AuroraOSS/AuroraStore

AndroidDeveloperLB commented 2 years ago

@anod So you've checked their code and modified it to your needs and put it into the app? I remember I tried to understand how it works (Aurora library) but I failed for some reason. I hope checking here will help me.

anod commented 2 years ago

The app is 10 years old and was based on old android-market-api library https://github.com/dheerajbhaskar/android-market-api

The flow it the fiollowing:

  1. Select a google account using AccountManager https://github.com/anod/AppWatcher/blob/5fed598fb02e52d2fb9d70bbea996d06d599e01b/app/src/main/java/com/anod/appwatcher/accounts/AccountSelectionDialog.kt#L49
  2. Retrieve authentication token https://github.com/anod/AppWatcher/blob/cb1ea848718c272184262e730da5b47ab8db03d7/app/src/main/java/com/anod/appwatcher/accounts/AuthTokenBlocking.kt#L52
  3. Create a request to an API https://github.com/anod/AppWatcher/blob/85a526a5a76dbcc750760839432b44e89d2c07f1/playstore/src/main/java/finsky/api/DfeApiImpl.kt#L115
  4. Provide headers inlcuding token from step 2 https://github.com/anod/AppWatcher/blob/85a526a5a76dbcc750760839432b44e89d2c07f1/playstore/src/main/java/finsky/api/DfeApiContext.kt#L51
  5. Send request and parse response

Messages in request and reponse based on Protocol Buffers: https://developers.google.com/protocol-buffers

Some definitions used byu that app can be found here: https://github.com/anod/AppWatcher/blob/85a526a5a76dbcc750760839432b44e89d2c07f1/playstore/src/main/proto/messages.proto

Aura store or any other app will use similar steps Hope that helps

AndroidDeveloperLB commented 2 years ago

@anod Thank you very very much!

AndroidDeveloperLB commented 2 years ago

@anod If you wish, I can set a bounty of the question on StackOverflow, and if you have there a working sample that would be easy for me to test, I will grant it to you :

https://stackoverflow.com/q/66944492/878126