Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
README.md 3.21 KiB
Newer Older
Rahul Patel's avatar
Rahul Patel committed
# GPlayAPI

Google Play Store Protobuf API wrapper in Kotlin

Aayush Gupta's avatar
Aayush Gupta committed
**For Educational & Research purpose only**
Rahul Patel's avatar
Rahul Patel committed

## Disclaimer

I'm not resposible for anything that may go wrong with:
1. You 
2. Your Google Account.
3. Socio-economic Life, especially the nudes.
4. Girlfriend.
5. Crypto Wallet.

Aayush Gupta's avatar
Aayush Gupta committed
**Hold your own beer!**
Rahul Patel's avatar
Rahul Patel committed

Aayush Gupta's avatar
Aayush Gupta committed
GPlayAPI is available on the [mavencentral](https://central.sonatype.com/artifact/com.auroraoss/gplayapi).
Aayush Gupta's avatar
Aayush Gupta committed
implementation("com.aurora:gplayapi:3.4.5")
You can get unsigned release builds for testing latest changes from our [GitLab Package Registry](https://gitlab.com/AuroraOSS/gplayapi/-/packages).
Jitpack is also available but not recommended due to unforeseen sync errors.

Rahul Patel's avatar
Rahul Patel committed
## Build

Aayush Gupta's avatar
Aayush Gupta committed
To build the library locally, run the following commands:

```shell
git clone https://gitlab.com/AuroraOSS/gplayapi.git && cd gplayapi
./gradlew publishReleasePublicationToLocalRepository
```

This will generate an unsigned release build 
([AAR](https://developer.android.com/studio/projects/android-library.html#aar-contents)) in the
`lib/build/repo` directory.
Rahul Patel's avatar
Rahul Patel committed

## Work Flow

Aayush Gupta's avatar
Aayush Gupta committed
1. Obtain AASToken from (Email, Password) pair.
2. Obtain AuthData from (Email, AASToken) pair.
3. Use AuthData to access data.

Rahul Patel's avatar
Rahul Patel committed
### AASToken
Use one of the following tools
* [Authenticator](https://github.com/whyorean/Authenticator)
* [AASTokenGrabber](https://github.com/whyorean/AASTokenGrabber)

Aayush Gupta's avatar
Aayush Gupta committed
## Usage

You need to build an instance of `AuthData` to call any method related with the API. Building an
instance requires Email and AASToken fetched from the above-mentioned workflow.

Rahul Patel's avatar
Rahul Patel committed
### AuthData 

Aayush Gupta's avatar
Aayush Gupta committed
```kotlin
val authData = AuthHelper.build(email, aastoken)
```
Rahul Patel's avatar
Rahul Patel committed

### Fetch App Details

Aayush Gupta's avatar
Aayush Gupta committed
```kotlin
val app = AppDetailsHelper(authData).getAppByPackageName(packageName)
```
Rahul Patel's avatar
Rahul Patel committed

Rahul Kumar Patel's avatar
Rahul Kumar Patel committed
### Fetch Bulk App Details
Rahul Patel's avatar
Rahul Patel committed

Aayush Gupta's avatar
Aayush Gupta committed
```kotlin
val appList = AppDetailsHelper.getAppByPackageName(packageNameList)
```
Rahul Patel's avatar
Rahul Patel committed

### Fetch APKs/OBBs/Patches

Aayush Gupta's avatar
Aayush Gupta committed
```kotlin
val files = PurchaseHelper(authData).purchase(
    app.packageName,
    app.versionCode,
    app.offerType
)
```
Rahul Patel's avatar
Rahul Patel committed

### Fetch All Categories

Aayush Gupta's avatar
Aayush Gupta committed
```kotlin
Rahul Patel's avatar
Rahul Patel committed
val categoryList = CategoryHelper(authData).getAllCategories(type) //type = GAME or APPLICATION
Aayush Gupta's avatar
Aayush Gupta committed
```
Rahul Patel's avatar
Rahul Patel committed

### Fetch Search Suggestions

Aayush Gupta's avatar
Aayush Gupta committed
```kotlin
val entries = SearchHelper(authData).searchSuggestions(query)
```
Rahul Patel's avatar
Rahul Patel committed

### Search Apps & Games

Aayush Gupta's avatar
Aayush Gupta committed
```kotlin
var helper = SearchHelper(authData)
var searchBundle = helper.searchResults(query) 
var appList = searchBundle.appList 

// To fetch next list 
appList = helper.next(searchBundle.subBundles)
```
Rahul Patel's avatar
Rahul Patel committed

Rahul Patel's avatar
Rahul Patel committed
### App Reviews

Aayush Gupta's avatar
Aayush Gupta committed
```kotlin
var helper = ReviewsHelper(authData)
var reviewCluster = helper.getReviews(packageName, filter) //filter = ALL, POSITIVE, CRITICAL

// To fetch next list    
reviewCluster = helper.next(reviewCluster.nextPageUrl)
```
Rahul Patel's avatar
Rahul Patel committed

### User Reviews

Aayush Gupta's avatar
Aayush Gupta committed
```kotlin
var helper = ReviewsHelper(authData)

//Submit or Edit review
val review = helper.addOrEditReview(packageName, title, content, rating, isBeta)

//Retrive review
val review = helper.getUserReview(packageName, isBeta)
```
Rahul Patel's avatar
Rahul Patel committed

Rahul Patel's avatar
Rahul Patel committed
## Credits
Aayush Gupta's avatar
Aayush Gupta committed

Rahul Patel's avatar
Rahul Patel committed
1. [googleplay-api](https://github.com/egirault/googleplay-api)
2. [google-play-crawler](https://github.com/Akdeniz/google-play-crawler)
3. [play-store-api](https://github.com/yeriomin/play-store-api)
4. [raccon4](https://github.com/onyxbits/raccoon4)