5

I have a Galaxy Core Duos that I was playing with. It is stock rom, unrooted. However, I installed one app which is crashing the phone after startup. So I cannot use the phone anymore and I need to reset it.

However, I would like to save some data from the phone before. Especially the contacts, which unfortunately haven't been synchronized completely before this app caused crashing.

Is it possible to access my contacts data somehow via ADB from the bootloader/recovery menu? I didn't have ADB enabled in the settings, though. Or is it maybe even possible to uninstall the app from ADB from bootloader/recovery menu?

Or what else could I do?

1 Answer 1

6

No, it is not possible to remove the app from bootloader. ADB daemon is not running in the device in that tiny environment when the device is in fastboot mode and stock recovery doesn't offer shell access.

Your best bet is to flash a custom recovery, such as TWRP, CWM or Philz Touch from fastboot/download mode or from a tool using PC (if at all possible for an ordinary user) and boot straight into that recovery. Note that if the bootloader is not unlocked, unlocking a bootloader may (nowadays it does) cause a full wipe of user's data.

Once you're in a custom recovery environment, follow the instructions to remove the app:

  • mount data partition at /data/, if not already mounted through GUI using volume buttons or touch as appropriate;
  • determine package name of the troublesome app;
  • Using shell or through a file manager feature of your recovery, go to /data/app/ or wherever the app is installed per /data/system/packages.xml or per this answer from Izzy
  • remove the apk or the app's directory (for Android 5.0 and above) containing the apk using the command:

    adb shell rm -rf PATH   # PATH refers to location of APK under /data/ (excluding /data/media)   
    
    #Example:
    adb shell rm -rf /data/app/com.android.chrome-1.apk 
    adb shell rm -rf /data/app-private/org.mozilla.firefox/
    
  • Optional: remove the data of the app from /data/data/ by removing the directory with name as package name of the app using

    adb shell rm -rf /data/data/PACKAGE  # PACKAGE refers to package name of the app
    
  • If the aforesaid instructions do not work out for you, make the Android boot into safe mode. My answer can help you out.

If you intend to backup contacts, make a backup of the directory /data/data/com.android.providers.contacts. The database inside it contains the contacts. To restore them after a factory reset, boot into a custom recovery and restore the backed up directory.

By the way, it does not matter whether you had USB debugging enabled in Android or not, once you've booted outside of Android OS.

3
  • Thanks for this detailed answer. I'll hopefully find time later today to try your suggestions. Your answer about safe mode suggests the necessity of root, doesn't it? I came up with a further idea: what about writing a custom updater-script? Since I can apply updates from stock recovery?
    – TJJ
    Commented Apr 28, 2016 at 15:45
  • From a stock recovery, you can only apply updates signed by the manufacturer. If you follow my answer about safe mode, you would note that I've given commands when booted into a recovery mode, so root access is not required in Android OS. In case you're not aware of this, tampering with recovery or unlocking bootloader (if required here) could void warranty.
    – Firelord
    Commented Apr 28, 2016 at 15:48
  • Ok, so, I couldn't find a suitable custom recovery, especially because I don't remember which version of android was running currently. In the end, the short times was suddenly enough to sync the contacts to the google account. All other important data was already on the SD card. But I guess if I'd taken the risk to install the correct custom recovery, it should've worked, so I'll marked this as the answer. Especially because it answered my original question that ADB does not work from the bootloader or stock recovery.
    – TJJ
    Commented Apr 29, 2016 at 13:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .