Struct gpapi::Gpapi

source ·
pub struct Gpapi { /* private fields */ }

Implementations§

source§

impl Gpapi

source

pub fn new<S: Into<String>>(device_codename: S, email: S) -> Self

Returns a Gpapi struct.

source

pub fn set_locale<S: Into<String>>(&mut self, locale: S)

Set the locale

source

pub fn set_timezone<S: Into<String>>(&mut self, timezone: S)

Set the time zone

source

pub fn set_aas_token<S: Into<String>>(&mut self, aas_token: S)

Set the aas token. This can be requested via request_aas_token, and is required for most other actions.

source

pub async fn request_aas_token<S: Into<String>>( &mut self, oauth_token: S ) -> Result<(), GpapiError>

Request and set the aas token given an oauth token and the associated email.

§Arguments
  • oauth_token - An oauth token you previously retrieved separately
source

pub fn get_aas_token(&self) -> Option<&str>

Get the aas token that has been previously set by either request_aas_token or set_aas_token.

source

pub async fn login(&mut self) -> Result<(), GpapiError>

Log in to Google’s Play Store API. This is required for most other actions. The aas token has to be set via request_aas_token or set_aas_token first.

source

pub async fn download<S: Into<String>>( &self, pkg_name: S, version_code: Option<i32>, split_if_available: bool, include_additional_files: bool, dst_path: &Path, cb: Option<&Box<dyn Fn(String, u64) -> Box<dyn Fn(u64)>>> ) -> Result<Vec<()>, GpapiError>

Download a package, given a package ID, optional version code, and filesystem path.

§Arguments
  • pkg_name - A string type specifying the package’s app ID, e.g. com.instagram.android
  • version_code - An optinal version code, given in i32. If omitted, the latest version will be used
  • split_if_available - A boolean indicating whether a split APK is desired, if available
  • include_additional_files - A boolean indicating if additional files should be downloaded as well, if available
  • dst_path - A path to download the file to.
  • cb - An optional callback for reporting information about the download asynchronously. The outer callback takes the filename (String) and total size in bytes of the file (u64) and returns an inner callback. The inner callback takes the position of the current download.
§Errors

If the file already exists for this download, an Err(Error) result is returned with an [ErrorKind] of FileExists. If additional files or a split APK is to be downloaded but the directory already exists, an Err(Error) result is returned with an [ErrorKind] of DirectoryExists. If the specified directory is misssing, an Err(Error) result is returned with an [ErrorKind] of DirectoryMissing.

source

pub async fn get_download_info<S: Into<String>>( &self, pkg_name: S, version_code: Option<i32> ) -> Result<(Option<String>, Vec<(Option<String>, Option<String>)>, Vec<(Option<String>, Option<String>)>), GpapiError>

Retrieve the download URL(s) and names for a package, given a package ID and optional version code.

§Arguments
  • pkg_name - A string type specifying the package’s app ID, e.g. com.instagram.android
  • version_code - An optinal version code, given in i32. If omitted, the latest version will be used
§Returns
  • An Option to the full APK download URL, followed by a Vec<(Option, Option)> which corresponds to a list of download URLs and names for the split APK, then followed by another Vec<(Option, Option)> which corresponds to the download URLs and filenames for additional files.
source

pub async fn details<S: Into<String>>( &self, pkg_name: S ) -> Result<Option<DetailsResponse>, Box<dyn Error>>

Play Store package detail request (provides more detail than bulk requests).

§Arguments
  • pkg_name - A string type specifying the package’s app ID, e.g. com.instagram.android
source

pub async fn bulk_details( &self, pkg_names: &[&str] ) -> Result<Option<BulkDetailsResponse>, GpapiError>

Play Store bulk detail request for multiple apps.

§Arguments
  • pkg_names - An array of string types specifying package app IDs
source

pub async fn accept_tos( &mut self ) -> Result<Option<AcceptTosResponse>, Box<dyn Error>>

Accept the play store terms of service.

Trait Implementations§

source§

impl Debug for Gpapi

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Gpapi

§

impl !RefUnwindSafe for Gpapi

§

impl Send for Gpapi

§

impl Sync for Gpapi

§

impl Unpin for Gpapi

§

impl !UnwindSafe for Gpapi

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more