public class DfeApi
extends java.lang.Object
ResponseWrapper
and leave it to the caller to extract the actual
response object from it. Reasons for this lack of comfort are:
ResponseWrapper
typically also contains some meta information
that may or may not be of interest to the caller, in particular a
ServerCommands
or a Notification
.
ResponseWrapper
actually varies for different
user agent strings!
Payload
containing the actual response object.
ServerCommands
object (which will automatically
converted to an exception in case
ServerCommands.getDisplayErrorMessage()
is not empty.
Notification
, e.g. the server telling the client
that its local library is dirty.
ResponseWrapper
objects when possible (HTTP GET method only).
DfeHeaders.NO_PREFETCH
header is
specified, the server is free to anticipate the next request and already
include the answer for it as a ResponseWrapper.getPreFetchList()
list. If the api receives prefetches, it will automatically cache them.Constructor and Description |
---|
DfeApi(ClientProvider cp,
RequestContextProvider rcp)
The API will not cache results and makes requests to the default DFE base.
|
DfeApi(ClientProvider cp,
RequestContextProvider rcp,
DfeCache cache)
Make requests to the default DFE base.
|
DfeApi(ClientProvider cp,
RequestContextProvider rcp,
DfeCache cache,
java.net.URI base) |
DfeApi(org.apache.hc.client5.http.classic.HttpClient client,
org.apache.hc.core5.http.Header... headers)
Convenience constructor that wraps client in a
DefaultClientProvider and headers in a
DefaultRequestContextProvider . |
Modifier and Type | Method and Description |
---|---|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestAcceptTos(java.lang.String tosToken,
java.lang.String checkinConsistencyToken,
java.lang.Boolean emailOptIn,
java.lang.Boolean unknownOptIn)
Accept Google Play Terms of Service.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestAckNotification(java.lang.String nid)
Acknowledge a
Notification |
de.onyxbits.raccoon.proto.ResponseWrapper |
requestAddToLibrary(java.lang.String libId,
java.util.List<java.lang.String> docId)
Add an item to a library.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestBulkDetails(java.util.List<java.lang.String> docIds,
boolean includeChildDocs,
boolean includeDetails)
Like
requestDetails(String) , just with multiple docIds in
one bulk request. |
de.onyxbits.raccoon.proto.ResponseWrapper |
requestCheckReview(java.lang.String docId)
View the user's review for a given item.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestContactEmail()
Check the users contact email address.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestDeliverApp(java.lang.String docId,
int versionCode)
Fetch the download parameters for a purchased app.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestDeliverPatch(java.lang.String docId,
int fromVersion,
int toVersion,
PatchFormat pf)
Request download parameters for a patch.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestDeliverSelfUpdate(int versionCode,
java.lang.String certificateHashSelfUpdateMD5,
java.lang.String certificateHash)
Download the Google Play Store APK
(
com.android.vending ). |
de.onyxbits.raccoon.proto.ResponseWrapper |
requestDetails(java.lang.String docId)
Get a document by its identifier with prefetching disabled.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestDetails(java.lang.String docId,
boolean noPreFetch)
Get a document by its identifier.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestEarlyDeliverApp(java.lang.String docId,
int versionCode)
Needs more research.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestJoinBetaTest(java.lang.String docId)
Join an app's beta test program.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestLeaveBetaTest(java.lang.String docId)
Leave an app's beta test program.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestLibrary(java.lang.String libraryId,
int category,
int docType,
byte[] serverToken)
List a library.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestListBetaPrograms()
List beta program participations.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestMyAccount()
A more or less pointless endpoint.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestMyApps()
List apps bound to the account.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestMyWishlist()
Request wishlisted items
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestPurchaseApp(java.lang.String docId,
int versionCode)
Bind an app to the account.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestPurchaseHistory()
Request a log(?)
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestRemoveFromLibrary(java.lang.String libId,
java.util.List<java.lang.String> docId)
Remove an item from a library.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestReviews(java.lang.String reviewUrl,
SortType st,
int rating,
int versionCode,
boolean device)
Get reviews.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestSearch(Category cat,
java.lang.String query)
Perform a generic search.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestSearchSuggest(java.lang.String query,
int backEndId,
int iconSize,
boolean requestNavigationSuggestions)
Provide search suggestions as the user types.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestSelfUpdate()
Get the latest version code of the Finsky client
(
com.android.vending ) for the given device. |
de.onyxbits.raccoon.proto.ResponseWrapper |
requestSetReview(java.lang.String docId,
java.lang.String title,
java.lang.String content,
int rating,
boolean ipr)
Adds or updates the user's review for a given item (each user can have at
most one review per docId).
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestToc()
Get Terms of "C"(?).
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestToc(java.lang.String deviceConfigToken)
Get Terms of "C"(?)
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestUnsetReview(java.lang.String docId)
Deletes the user's review for a given item.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestUploadDeviceConfig(Device device,
java.lang.String deviceConfigToken)
Add a device profile to the account.
|
de.onyxbits.raccoon.proto.ResponseWrapper |
requestUrl(java.lang.String url)
Perform a HTTP get on a given DFE url.
|
public DfeApi(org.apache.hc.client5.http.classic.HttpClient client, org.apache.hc.core5.http.Header... headers)
DefaultClientProvider
and headers in a
DefaultRequestContextProvider
. The API will not cache results and
makes requests to the default DFE base.client
- client for making requests.headers
- headers to add when making a request.public DfeApi(ClientProvider cp, RequestContextProvider rcp)
cp
- will be called to get a HttpClient
instance whenever a
request is made.rcp
- will be queried for headers whenever a request is made.public DfeApi(ClientProvider cp, RequestContextProvider rcp, DfeCache cache)
cp
- rcp
- cache
- public DfeApi(ClientProvider cp, RequestContextProvider rcp, DfeCache cache, java.net.URI base)
cp
- will be called to get a HttpClient
instance whenever a
request is made.rcp
- will be queried for headers whenever a request is made.cache
- cache object. May be null. A cache should always be used when
requests are made that may contain PreFetch
messages.base
- DFE base uri.public de.onyxbits.raccoon.proto.ResponseWrapper requestSelfUpdate() throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
com.android.vending
) for the given device. The actual
Google Play Store APK must be downloaded via
requestDeliverSelfUpdate(int, String, String)
NOTE: The latest client version code can also be learned via
requestToc(String)
.
Payload
containing SelfUpdateResponse
.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestUploadDeviceConfig(Device device, java.lang.String deviceConfigToken) throws java.io.IOException
NOTE: Play needs a moment to settle. Wait around 10 seconds after this before trying to download apps with compatibility issues.
device
- device profile.deviceConfigToken
- null for the initial upload or the previous token to modify a
device.Payload
containing UploadDeviceConfigResponse
.java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestToc(java.lang.String deviceConfigToken) throws java.io.IOException, org.apache.hc.client5.http.HttpResponseException
deviceConfigToken
- obtained from
requestUploadDeviceConfig(Device, String)
. May be
null in which case the RequestContextProvider
is queried.Payload
containing TocResponse
.java.io.IOException
org.apache.hc.client5.http.HttpResponseException
public de.onyxbits.raccoon.proto.ResponseWrapper requestToc() throws java.io.IOException, org.apache.hc.client5.http.HttpResponseException
requestToc(String)
.Payload
containing TocResponse
.java.io.IOException
org.apache.hc.client5.http.HttpResponseException
public de.onyxbits.raccoon.proto.ResponseWrapper requestAcceptTos(java.lang.String tosToken, java.lang.String checkinConsistencyToken, java.lang.Boolean emailOptIn, java.lang.Boolean unknownOptIn) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
tosToken
- obtained from requestToc(String)
. See
TosToken
for details.checkinConsistencyToken
- from CheckinApi
. If null, HeaderProvider is queried.emailOptIn
- Accept marketing emailunknownOptIn
- To be researched. Guess: Email notification when developers reply
to reviews?Payload
containing AcceptTosResponse
(empty, can be
discarded).org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestAckNotification(java.lang.String nid) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
Notification
nid
- notification ID (from a Notification
message).Payload
containing AckNotificationResponse
.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestDetails(java.lang.String docId, boolean noPreFetch) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
docId
- can be found by using a search query. In case of apps, it is
simply the packagename. Books start with "book-"noPreFetch
- disable prefetchingPayload
containing DetailsResponse
. If details of
an app were requested, and the AppDetails
message does not
contain a versioncode, then the mocked device is incompatible. If a
HTTP not found exception is thrown, but the app is listed on the
Play website, then it is probably in beta (use
requestJoinBetaTest(String)
.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestDetails(java.lang.String docId) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
docId
- can be found by using a search query. In case of apps, it is
simply the packagename. Books start with "book-"Payload
containing DetailsResponse
.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestMyAccount() throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
Payload
containing MyAccountResponse
.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestUrl(java.lang.String url) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
url
- url obtained from another query.Payload
containing an unspecified message type.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestPurchaseHistory() throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
ResponseWrapper
containing ListResponse
.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestBulkDetails(java.util.List<java.lang.String> docIds, boolean includeChildDocs, boolean includeDetails) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
requestDetails(String)
, just with multiple docIds in
one bulk request.
This endpoint works without authorization, but requires a valid GSF id.
docIds
- requested documents. The max number of allowed IDs is unknown.includeChildDocs
- false to exclude this information.includeDetails
- false to exclude this DocumentDetails
Payload
containing BulkDetailsResponse
.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestSearch(Category cat, java.lang.String query) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
query
- query string - parsed remotely.cat
- search category.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestSearchSuggest(java.lang.String query, int backEndId, int iconSize, boolean requestNavigationSuggestions) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
This method asks for an optional DfeHeaders.USER_CONTEXT
header.
The value of this header is a base64 encoded UserContext protocol buffer.
query
- (incomplete) search term.backEndId
- category to search in.iconSize
- if greater than 0, include iconsize in request url.requestNavigationSuggestions
- include a navigation path to a fitting details document.Payload
containing SearchSuggestResponse
.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestReviews(java.lang.String reviewUrl, SortType st, int rating, int versionCode, boolean device) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
reviewUrl
- obtainable from a details query.st
- sort orderrating
- filter by star rating (0 to disable)versionCode
- filter by versioncode (0 to disable).device
- filter by device.Payload
containing ReviewResponse
.java.io.IOException
org.apache.hc.client5.http.HttpResponseException
public de.onyxbits.raccoon.proto.ResponseWrapper requestSetReview(java.lang.String docId, java.lang.String title, java.lang.String content, int rating, boolean ipr) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
NOTE: A review cannot be posted while the user participates in the beta test program.
docId
- the item to review.title
- subject line (may be null).content
- body (may be null)rating
- a value between 1 and 5 (the method does not perform a range
check).ipr
- To be researched (default seems to be "true").Payload
containing ReviewResponse
.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestUnsetReview(java.lang.String docId) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
docId
- the item from which to delete the user's review.Payload
containing ReviewResponse
org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestCheckReview(java.lang.String docId) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
docId
- the item for which to request the review.Payload
containing ReviewResponse
.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestPurchaseApp(java.lang.String docId, int versionCode) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
NOTE: once a region locked app is purchased, it becomes accessible worldwide (for that account).
NOTE: an app's status can be checked by doing a
requestDetails(String)
call. Bound apps return
true
when calling Availability.getAvailableIfOwned()
docId
- packagename of the appversionCode
- any valid version number for this app.Payload
containing BuyResponse
. Format varies.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestDeliverApp(java.lang.String docId, int versionCode) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
docId
- packagenameversionCode
- versioncodePayload
containing DeliveryResponse
. Use
AppStreamer
to download.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
AppStreamer
public de.onyxbits.raccoon.proto.ResponseWrapper requestEarlyDeliverApp(java.lang.String docId, int versionCode) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
Cannot be used to download paid apps.
docId
- versionCode
- Payload
org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestDeliverPatch(java.lang.String docId, int fromVersion, int toVersion, PatchFormat pf) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
docId
- app packagenametoVersion
- remote versionfromVersion
- local version.pf
- format.Payload
containing DeliveryResponse
. Use
AppStreamer
to download.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestDeliverSelfUpdate(int versionCode, java.lang.String certificateHashSelfUpdateMD5, java.lang.String certificateHash) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
com.android.vending
).versionCode
- queried via requestSelfUpdate()
certificateHashSelfUpdateMD5
- md5 hash of the package signature of the finsky app (or null if
unknown).certificateHash
- sha1 has of the package signature of the finsky app (or null if
unknown).Payload
containing DeliveryResponse
. Use
AppStreamer
to download the file.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestContactEmail() throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestListBetaPrograms() throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
ListResponse
containing paginated DocV2
, containing
DocV2
of type DocumentType.ANDROID_APP
.java.io.IOException
org.apache.hc.client5.http.HttpResponseException
public de.onyxbits.raccoon.proto.ResponseWrapper requestJoinBetaTest(java.lang.String docId) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
docId
- app packagenameorg.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestLeaveBetaTest(java.lang.String docId) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
docId
- org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestAddToLibrary(java.lang.String libId, java.util.List<java.lang.String> docId) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
libId
- library ID, see Libraries
. Only wishlist and
preregistration seem to be supported.docId
- itemPayload
containingorg.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestRemoveFromLibrary(java.lang.String libId, java.util.List<java.lang.String> docId) throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
libId
- Libraries.LID_PREREGISTRATION
or
Libraries.LID_WISHLIST
docId
- item(s) to remove.org.apache.hc.client5.http.HttpResponseException
java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestLibrary(java.lang.String libraryId, int category, int docType, byte[] serverToken) throws java.io.IOException
libraryId
- see Libraries
.category
- see Category
docType
- See DocumentType
.serverToken
- seems to be optional. May be null.java.io.IOException
public de.onyxbits.raccoon.proto.ResponseWrapper requestMyApps() throws org.apache.hc.client5.http.HttpResponseException, java.io.IOException
ListResponse
containing paginated DocV2
, containing
DocV2
of type DocumentType.ANDROID_APP
java.io.IOException
org.apache.hc.client5.http.HttpResponseException
public de.onyxbits.raccoon.proto.ResponseWrapper requestMyWishlist() throws java.io.IOException
java.io.IOException