adb - pull data from non-rooted android



  • I am trying to backup data from Xiaomi Mi 9t which has a software error and is non-functional:

    • the screen is stuck at 'Just a sec'
    • in settings I am only able to connect to wifi and bluetooth
    • USB debugging is enabled
    • phone is not rooted

    I am able to connect to device using adb shell but I am not able to pull any data.

    Here are few commands that I tried:

    ➜  Downloads adb devices
    List of devices attached
    897b97e8    device
    

    ➜ Downloads adb root
    adbd cannot run as root in production builds

    ➜ Downloads adb pull /sdcard ./
    adb: error: failed to stat remote object '/sdcard': No such file or directory

    ➜ Downloads adb shell
    davinci:/ $ ls
    ls: ./init.zygote64_32.rc: Permission denied
    ls: ./init.mishow.ctl.rc: Permission denied
    ls: ./init.rc: Permission denied
    ls: ./init.usb.rc: Permission denied
    ls: ./ueventd.rc: Permission denied
    ls: ./init.zygote32.rc: Permission denied
    ls: ./init.recovery.hardware.rc: Permission denied
    ls: ./init: Permission denied
    ls: ./init.miui.google_revenue_share_v2.rc: Permission denied
    ls: ./init.batterysecret.rc: Permission denied
    ls: ./init.miui.cust.rc: Permission denied
    ls: ./init.environ.rc: Permission denied
    ls: ./init.miui.post_boot.sh: Permission denied
    ls: ./init.miui.qadaemon.rc: Permission denied
    ls: ./init.batteryd.rc: Permission denied
    ls: ./verity_key: Permission denied
    ls: ./init.recovery.qcom.rc: Permission denied
    ls: ./init.mi_thermald.rc: Permission denied
    ls: ./init.miui.rc: Permission denied
    ls: ./init.usb.configfs.rc: Permission denied
    ls: ./init.miui.google_revenue_share.rc: Permission denied
    ls: ./init.miui.nativedebug.rc: Permission denied
    ls: ./init.miui.early_boot.sh: Permission denied
    acct apex bin bugreports cache charger config cust d data debug_ramdisk default.prop dev etc lost+found mnt odm oem proc product product_services res sbin sdcard storage sys system vendor
    1|davinci:/ $ cd /sdcard
    /system/bin/sh: cd: /sdcard: No such file or directory
    2|davinci:/ $ cd sdcard
    /system/bin/sh: cd: /sdcard: No such file or directory
    2|davinci:/ $

    EDIT 1:

    ➜  Downloads adb pull /storage/emulated/0
    adb: error: failed to copy '/storage/emulated/0/O,muoupUzTcgD9bevATC1B' to './0/O,muoupUzTcgD9bevATC1B': remote open failed: Required key not available
    


  • Your device seems to be encrypted using File Based Encryption (FBE). After you enter lock screen PIN the first time after boot these files will become available. But based on your description the system fails before it reaches lock screen. I don't know if there is a way to enter PIN via adb so that the encrypted files can be accessed (assuming the necessary keys are still present and not corrupted).

    Extracting the encrypted files (if it would work) doesn't make sense as the necessary key is only present on the device and can't be extracted.

    As the device is not rooted (and therefore I assume also not bootloader unlocked) you can't boot into recovery and eventually decrypt and extract the files using recovery.

    So from my perspective I don't think it is possible to extract your files.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2