Skip to content

Commit 355faad

Browse files
committed
added flag to download dexmetadata
1 parent dbe27cd commit 355faad

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

USAGE-google-play.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ A full list of options:
5252
* `locale`: specify a locale
5353
* `timezone`: specify a timezone
5454
* `split_apk`: when set to `1` or `true`, attempts to download a [split APK](https://developer.android.com/studio/build/configure-apk-splits)
55+
* `include_dex_metadata`: when set to `1` or `true`, attempts to download the DexMetadata (dm) file for an app, which contains the apps' cloud profile
5556
* `include_additional_files`: when set to `1` or `true`, attempts to download any [additional `obb` expansion files](https://developer.android.com/google/play/expansion-files) for the app
5657

5758
If you prefer not to provide your credentials on the command line, you can specify them in a config file named `apkeep.ini`. This config file may have to be created, and must be located in the user config directory under the subpath `apkeep`. Usually on Linux systems this will be `~/.config/apkeep/apkeep.ini`. In this file specify your email and/or AAS token:

src/download_sources/google_play.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ pub async fn download_apps(
2929
Some(val) if val == "1" || val.to_lowercase() == "true" => true,
3030
_ => false,
3131
};
32+
let include_dex_metadata = match options.remove("include_dex_metadata") {
33+
Some(val) if val == "1" || val.to_lowercase() == "true" => true,
34+
_ => false,
35+
};
3236
let mut gpa = Gpapi::new(device, email);
3337

3438
if let Some(locale) = options.remove("locale") {
@@ -85,7 +89,7 @@ pub async fn download_apps(
8589
if sleep_duration > 0 {
8690
sleep(TokioDuration::from_millis(sleep_duration)).await;
8791
}
88-
match gpa.download(&app_id, None, split_apk, include_additional_files, Path::new(outpath), Some(&progress_wrapper(mp_dl1))).await {
92+
match gpa.download(&app_id, None, split_apk, include_dex_metadata, include_additional_files, Path::new(outpath), Some(&progress_wrapper(mp_dl1))).await {
8993
Ok(_) => mp_log.suspend(|| println!("{} downloaded successfully!", app_id)),
9094
Err(err) if matches!(err.kind(), GpapiErrorKind::FileExists) => {
9195
mp_log.println(format!("File already exists for {}. Skipping...", app_id)).unwrap();
@@ -101,11 +105,11 @@ pub async fn download_apps(
101105
}
102106
Err(_) => {
103107
mp_log.println(format!("An error has occurred attempting to download {}. Retry #1...", app_id)).unwrap();
104-
match gpa.download(&app_id, None, split_apk, include_additional_files, Path::new(outpath), Some(&progress_wrapper(mp_dl2))).await {
108+
match gpa.download(&app_id, None, split_apk, include_dex_metadata, include_additional_files, Path::new(outpath), Some(&progress_wrapper(mp_dl2))).await {
105109
Ok(_) => mp_log.suspend(|| println!("{} downloaded successfully!", app_id)),
106110
Err(_) => {
107111
mp_log.println(format!("An error has occurred attempting to download {}. Retry #2...", app_id)).unwrap();
108-
match gpa.download(&app_id, None, split_apk, include_additional_files, Path::new(outpath), Some(&progress_wrapper(mp_dl3))).await {
112+
match gpa.download(&app_id, None, split_apk, include_dex_metadata, include_additional_files, Path::new(outpath), Some(&progress_wrapper(mp_dl3))).await {
109113
Ok(_) => mp_log.suspend(|| println!("{} downloaded successfully!", app_id)),
110114
Err(_) => {
111115
mp_log.println(format!("An error has occurred attempting to download {}. Skipping...", app_id)).unwrap();

0 commit comments

Comments
 (0)