Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Play APK download panics #11

Closed
NurMarvin opened this issue Sep 8, 2021 · 5 comments
Closed

Google Play APK download panics #11

NurMarvin opened this issue Sep 8, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@NurMarvin
Copy link

Description

I've been trying to download an APK from the Google Play Store using apkeep but sadly encountered an error.
I used the following command:

apkeep -a com.instagram.android -d GooglePlay -u '[email protected]' -p 'VYsAAtDzQSZ57LCE25SdKQVHZqnQsTVs2u3rmPqkAY9ph' .

Note: The username and password are altered, but contain the same type of characters as the username and password I use for the account in question, since after looking at the error it seems like the password encryption function fails with my username or password, so I figured providing credentials with the same character set could help with debugging the issue.

Anyway, running the command results in the following error:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/marvin/.cargo/registry/src/github.com-1ecc6299db9ec823/gpapi-0.2.3/src/lib.rs:128:64
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

With Rust Backtrace:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/marvin/.cargo/registry/src/github.com-1ecc6299db9ec823/gpapi-0.2.3/src/lib.rs:128:64
stack backtrace:
   0:     0x55aac0fef0c0 - std::backtrace_rs::backtrace::libunwind::trace::h34055254b57d8e79
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x55aac0fef0c0 - std::backtrace_rs::backtrace::trace_unsynchronized::h8f1e3fbd9afff6ec
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55aac0fef0c0 - std::sys_common::backtrace::_print_fmt::h3a99a796b770c360
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x55aac0fef0c0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h32d1f94a80615d18
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x55aac101122c - core::fmt::write::h306731c068f7162c
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/fmt/mod.rs:1110:17
   5:     0x55aac0fe95e5 - std::io::Write::write_fmt::hd2fa90334eee2a21
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/io/mod.rs:1588:15
   6:     0x55aac0ff111b - std::sys_common::backtrace::_print::h5abaa2601a852287
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x55aac0ff111b - std::sys_common::backtrace::print::h8d81445442bb638f
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x55aac0ff111b - std::panicking::default_hook::{{closure}}::hcfe804496a9fa747
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:208:50
   9:     0x55aac0ff0bf1 - std::panicking::default_hook::hbea8e3ccf2ba8901
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:225:9
  10:     0x55aac0ff17e4 - std::panicking::rust_panic_with_hook::h7ee9e1a2d0f8975a
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:622:17
  11:     0x55aac0ff1297 - std::panicking::begin_panic_handler::{{closure}}::h8ab3b4491718b2c7
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:517:13
  12:     0x55aac0fef5bc - std::sys_common::backtrace::__rust_end_short_backtrace::hd489062ffa586a9f
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/sys_common/backtrace.rs:141:18
  13:     0x55aac0ff1229 - rust_begin_unwind
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:515:5
  14:     0x55aac0b652e1 - core::panicking::panic_fmt::hca6330e3e14086b4
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/panicking.rs:92:14
  15:     0x55aac0b6522d - core::panicking::panic::h1a48d878ff3dcd40
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/panicking.rs:50:5
  16:     0x55aac0beb8ed - gpapi::Gpapi::login::{{closure}}::h6672c5a304ac6268
  17:     0x55aac0bf30d1 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h4de8fc0f50538533
  18:     0x55aac0c26779 - tokio::runtime::enter::Enter::block_on::h5a168d8b4a0b10b9
  19:     0x55aac0b9aedf - tokio::runtime::Runtime::block_on::h06014407f50a2936
  20:     0x55aac0bb6dda - apkeep::main::hbfb9de017ffc11c2
  21:     0x55aac0c779c3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h8caefb424b900ce0
  22:     0x55aac0c77a19 - std::rt::lang_start::{{closure}}::h091082558be5e806
  23:     0x55aac0ff1de9 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h2aabc384aab89b7b
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/ops/function.rs:259:13
  24:     0x55aac0ff1de9 - std::panicking::try::do_call::hc5fcacb7a85fc7b1
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:401:40
  25:     0x55aac0ff1de9 - std::panicking::try::hb5d9603af3abbe3a
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:365:19
  26:     0x55aac0ff1de9 - std::panic::catch_unwind::h98fe6ac3925e64b4
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panic.rs:434:14
  27:     0x55aac0ff1de9 - std::rt::lang_start_internal::h22ac7383c516f93e
                               at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/rt.rs:34:21
  28:     0x55aac0bb6ef2 - main
  29:     0x7f3f3ed910b3 - __libc_start_main
  30:     0x55aac0b65abe - _start
  31:                0x0 - <unknown>

System Specifications

OS: Ubuntu 20.04
Virtualization: KVM/QEMU
CPU: AMD EPYC-Rome (8) @ 3.593GHz
CPU Architecture: x86_64

@NurMarvin
Copy link
Author

I just experimented a bit and it seems to be related to the combined length of the username and password. If the combined character length of the username and password exceeds 86 the panic happens, anything below works without issues.

@Hainish
Copy link
Member

Hainish commented Sep 8, 2021

Interesting, thank you for the report. I'll look into this / issue a fix next week.

@Hainish Hainish added the bug Something isn't working label Sep 8, 2021
@Hainish
Copy link
Member

Hainish commented Sep 15, 2021

The underlying error is encountered when calling https://docs.rs/openssl/0.10.36/openssl/rsa/struct.Rsa.html#method.public_encrypt

error:0409A06E:rsa routines:RSA_padding_add_PKCS1_OAEP_mgf1:data too large for key size:../crypto/rsa/rsa_oaep.c:62:

I guess we have to figure out how Google encrypts the login, and what padding to use when a large username/password combo is encountered.

@Hainish
Copy link
Member

Hainish commented Sep 15, 2021

This happens in the Python https://github.com/NoMore201/googleplay-api/ (which I've modeled the Rust google play API dependency on) as well. Filed bug here: NoMore201/googleplay-api#151

@Hainish
Copy link
Member

Hainish commented Sep 16, 2021

With 5a360ed, the panic should no longer happen and a useful error message will display to the user. This doesn't solve the underlying issue, though I'm not yet sure how. I'd need to see documentation on how Google expects longer credentials to be encrypted.

Feel free to open another issue if you wish, though I can't do much about it.

@Hainish Hainish closed this as completed Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants