puddly / android-otp-extractor

Extracts OTP tokens from rooted Android devices
GNU General Public License v3.0
238 stars 22 forks source link

ERROR: Failed to build installable wheels for some pyproject.toml based projects (cryptography) #53

Closed scottmeup closed 3 months ago

scottmeup commented 3 months ago

Install attempted running Termux, on Rooted Android 13

~ $ python --version Python 3.11.9

~ $ pip --version pip 24.1.2 from /data/data/com.termux/files/usr/lib/python3.11/site-packages/pip (python 3.11)

 

The full output was too long to include in this form and is available here https://pastebin.com/P7YcCjTU

The last few lines of output are included below.

 

Compiling cryptography-x509-verification v0.1.0 (/data/data/com.termux/files/usr/tmp/pip-install-_o5gmp5s/cryptography_90a8acabf9384753afc049ee51a08bc0/src/rust/cryptography-x509-verification)                                  Running `rustc --crate-name cryptography_x509_verification --edition=2021 cryptography-x509-verification/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C overflow-checks=on -C metadata=9d93f8147a38d7e8 -C extra-filename=-9d93f8147a38d7e8 --out-dir /data/data/com.termux/files/usr/tmp/pip-install-_o5gmp5s/cryptography_90a8acabf9384753afc049ee51a08bc0/src/rust/target/release/deps -C strip=debuginfo -L dependency=/data/data/com.termux/files/usr/tmp/pip-install-_o5gmp5s/cryptography_90a8acabf9384753afc049ee51a08bc0/src/rust/target/release/deps --extern asn1=/data/data/com.termux/files/usr/tmp/pip-install-_o5gmp5s/cryptography_90a8acabf9384753afc049ee51a08bc0/src/rust/target/release/deps/libasn1-987d10be9fdef50f.rmeta --extern cryptography_x509=/data/data/com.termux/files/usr/tmp/pip-install-_o5gmp5s/cryptography_90a8acabf9384753afc049ee51a08bc0/src/rust/target/release/deps/libcryptography_x509-41c5cb1627b8b4e9.rmeta --extern once_cell=/data/data/com.termux/files/usr/tmp/pip-install-_o5gmp5s/cryptography_90a8acabf9384753afc049ee51a08bc0/src/rust/target/release/deps/libonce_cell-95bb967231829187.rmeta`                                              error: failed to run custom build command for `cryptography-cffi v0.1.0 (/data/data/com.termux/files/usr/tmp/pip-install-_o5gmp5s/cryptography_90a8acabf9384753afc049ee51a08bc0/src/rust/cryptography-cffi)`              
      Caused by:                                                process didn't exit successfully: `/data/data/com.termux/files/usr/tmp/pip-install-_o5gmp5s/cryptography_90a8acabf9384753afc049ee51a08bc0/src/rust/target/release/build/cryptography-cffi-b980f7550f28693f/build-script-build` (exit status: 1)                                         --- stdout                                              cargo:rustc-check-cfg=cfg(python_implementation, values("CPython", "PyPy"))                                     cargo:rerun-if-env-changed=PYO3_PYTHON                  cargo:rerun-if-changed=../../_cffi_src/
        cargo:rerun-if-changed=../../cryptography/__about__.py
        cargo:rustc-cfg=python_implementation="CPython"         TARGET = Some("aarch64-linux-android")
        OPT_LEVEL = Some("3")                                   HOST = Some("aarch64-linux-android")
        cargo:rerun-if-env-changed=CC_aarch64-linux-android
        CC_aarch64-linux-android = None                         cargo:rerun-if-env-changed=CC_aarch64_linux_android
        CC_aarch64_linux_android = None                         cargo:rerun-if-env-changed=HOST_CC
        HOST_CC = None                                          cargo:rerun-if-env-changed=CC
        CC = None                                               cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
        CRATE_CC_NO_DEFAULTS = None                             DEBUG = Some("false")
        CARGO_CFG_TARGET_FEATURE = Some("neon")                 cargo:rerun-if-env-changed=CFLAGS_aarch64-linux-android                                                         CFLAGS_aarch64-linux-android = None
        cargo:rerun-if-env-changed=CFLAGS_aarch64_linux_android
        CFLAGS_aarch64_linux_android = None                     cargo:rerun-if-env-changed=HOST_CFLAGS
        HOST_CFLAGS = None                                      cargo:rerun-if-env-changed=CFLAGS
        CFLAGS = None                                           cargo:rerun-if-env-changed=CC_aarch64-linux-android                                                             CC_aarch64-linux-android = None
        cargo:rerun-if-env-changed=CC_aarch64_linux_android
        CC_aarch64_linux_android = None
        cargo:rerun-if-env-changed=HOST_CC
        HOST_CC = None
        cargo:rerun-if-env-changed=CC                           CC = None
        cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS         CRATE_CC_NO_DEFAULTS = None
        CARGO_CFG_TARGET_FEATURE = Some("neon")                 cargo:rerun-if-env-changed=CFLAGS_aarch64-linux-android                                                         CFLAGS_aarch64-linux-android = None                     cargo:rerun-if-env-changed=CFLAGS_aarch64_linux_android                                                         CFLAGS_aarch64_linux_android = None                     cargo:rerun-if-env-changed=HOST_CFLAGS
        HOST_CFLAGS = None                                      cargo:rerun-if-env-changed=CFLAGS                       CFLAGS = None
        cargo:rerun-if-env-changed=CC_aarch64-linux-android                                                             CC_aarch64-linux-android = None
        cargo:rerun-if-env-changed=CC_aarch64_linux_android                                                             CC_aarch64_linux_android = None
        cargo:rerun-if-env-changed=HOST_CC                      HOST_CC = None                                          cargo:rerun-if-env-changed=CC
        CC = None                                               cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS         CRATE_CC_NO_DEFAULTS = None
        CARGO_CFG_TARGET_FEATURE = Some("neon")                 cargo:rerun-if-env-changed=CFLAGS_aarch64-linux-android                                                         CFLAGS_aarch64-linux-android = None                     cargo:rerun-if-env-changed=CFLAGS_aarch64_linux_android                                                         CFLAGS_aarch64_linux_android = None                     cargo:rerun-if-env-changed=HOST_CFLAGS
        HOST_CFLAGS = None                                      cargo:rerun-if-env-changed=CFLAGS                       CFLAGS = None
        cargo:rerun-if-env-changed=CC_aarch64-linux-android                                                             CC_aarch64-linux-android = None
        cargo:rerun-if-env-changed=CC_aarch64_linux_android                                                             CC_aarch64_linux_android = None
        cargo:rerun-if-env-changed=HOST_CC                      HOST_CC = None                                          cargo:rerun-if-env-changed=CC
        CC = None                                               cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS         CRATE_CC_NO_DEFAULTS = None
        CARGO_CFG_TARGET_FEATURE = Some("neon")                 cargo:rerun-if-env-changed=CFLAGS_aarch64-linux-android
        CFLAGS_aarch64-linux-android = None                     cargo:rerun-if-env-changed=CFLAGS_aarch64_linux_android
        CFLAGS_aarch64_linux_android = None                     cargo:rerun-if-env-changed=HOST_CFLAGS                  HOST_CFLAGS = None
        cargo:rerun-if-env-changed=CFLAGS                       CFLAGS = None                                           running: "aarch64-linux-android-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-I" "/data/data/com.termux/files/usr/include" "-I" "/data/data/com.termux/files/usr/include/python3.11" "-Wall" "-Wextra" "-Wconversion" "-Wno-error=sign-conversion" "-Wno-unused-parameter" "-DPy_LIMITED_API=0x030700f0" "-o" "/data/data/com.termux/files/usr/tmp/pip-install-_o5gmp5s/cryptography_90a8acabf9384753afc049ee51a08bc0/src/rust/target/release/build/cryptography-cffi-270cb91fabfb5322/out/62433ae2f6475c40-_openssl.o" "-c" "/data/data/com.termux/files/usr/tmp/pip-install-_o5gmp5s/cryptography_90a8acabf9384753afc049ee51a08bc0/src/rust/target/release/build/cryptography-cffi-270cb91fabfb5322/out/_openssl.c"
        exit status: 0                                          cargo:rerun-if-env-changed=AR_aarch64-linux-android
        AR_aarch64-linux-android = None
        cargo:rerun-if-env-changed=AR_aarch64_linux_android
        AR_aarch64_linux_android = None
        cargo:rerun-if-env-changed=HOST_AR                      HOST_AR = None                                          cargo:rerun-if-env-changed=AR                           AR = None
        cargo:rerun-if-env-changed=ARFLAGS_aarch64-linux-android
        ARFLAGS_aarch64-linux-android = None
        cargo:rerun-if-env-changed=ARFLAGS_aarch64_linux_android
        ARFLAGS_aarch64_linux_android = None
        cargo:rerun-if-env-changed=HOST_ARFLAGS
        HOST_ARFLAGS = None                                     cargo:rerun-if-env-changed=ARFLAGS                      ARFLAGS = None                                          running: ZERO_AR_DATE="1" "aarch64-linux-android-ar" "cq" "/data/data/com.termux/files/usr/tmp/pip-install-_o5gmp5s/cryptography_90a8acabf9384753afc049ee51a08bc0/src/rust/target/release/build/cryptography-cffi-270cb91fabfb5322/out/lib_openssl.a.a" "/data/data/com.termux/files/usr/tmp/pip-install-_o5gmp5s/cryptography_90a8acabf9384753afc049ee51a08bc0/src/rust/target/release/build/cryptography-cffi-270cb91fabfb5322/out/62433ae2f6475c40-_openssl.o"

        --- stderr

                                                                error occurred: Failed to find tool. Is `aarch64-linux-android-ar` installed?

      warning: build failed, waiting for other jobs to finish...
      error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path src/rust/Cargo.toml --release -v --features pyo3/extension-module --crate-type cdylib --` failed with code 101
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cryptography         Successfully built android-otp-extractor
Failed to build cryptography
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cryptography)
puddly commented 3 months ago

This package is not really meant to run on your phone but I guess you can try connecting to the ADB daemon via localhost.

error occurred: Failed to find tool. Is aarch64-linux-android-ar installed?

You need a proper build environment to build the cryptography package.

scottmeup commented 3 months ago

This package is not really meant to run on your phone

Ah. Fantastic, got it working with no issues under Windows 11.

Thanks for your help.