Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Has anyone successfully recovered photos from a broken Android phone?
95 points by mahathu 9 months ago | hide | past | favorite | 59 comments
The topic of data recovery from broken phones seems to be a prime target from SEO optimised blogspam so I'm posting here in hopes that someone had a similar issue in the past and may be able to help me out.

I am tasked with restoring some photos from a Huawei P30 that has a broken screen/touchpad. The photos were stored on the device directly, unfortunately not on an SD card or on a cloud provider. The phone does still turn on (it vibrates when plugged into a power outlet and shows up on Windows). However, it's only showing an installer for HiSuite (which did not help), not the file system. USB debugging is enabled.

Things I tried so far and didn't work:

- shining a flashlight at the screen to see if only the backlight is broken (it seems the whole screen is done for) - eyeballing it and trying to blindly enter the passcode - connecting phone to external monitor and keyboard via USB-C -> HDMI (monitor stays black)

Is there anything that may still have a chance of working short of replacing the screen to unlock the phone? Thanks and happy holidays.

If USB Debugging is enabled, you should be fine.

The first thing you'll need is Google's platform tools, as well as a compatible ADB driver for your device if you're on Windows.

Then, you can use `adb pull` to copy data from the phone's filesystem to Windows.

Edit: another commenter rightly pointed out that this might not work when your phone is locked.

A quick search found some really interesting tools in this thread here (srcpy especially seems amazing!): https://stackoverflow.com/questions/29072501/how-to-unlock-a...

I came to suggest scrcpy - I've successfully saved data off a locked phone with a broken screen using scrcpy.

Unfortunately, the phone seems to be in "charge only" instead of on MTP (media transfer protocol), i.e. it is not reachable via adb. Shame.

Another +1 for scrcpy, I've actually been in this exact situation before of having a functioning phone with a broken display/touchscreen, and was able to operate my phone through scrcpy until I got a replacement screen. Real lifesaver, amazing software.

True, but the chances of scrcpy being enabled on an Android device is limited and you also have to authenticate the computer connecting to the device from the device itself which most likely requires a touch screen. There may be a way to access the encrypted partition itself though using the hardware buttons, and then run a command to mount the encrypted partition.

Seconded, adb tools is the best way to recover files in this scenario. No need to replace the screen as others have suggested.

scrpy (and adb in general) looks amazing! Unfortunately, ADB doesn't recognize my device yet ("no devices/emulators found"). I'll keep trying. Thanks for the answer.

Unlocking the phone will resolve the issue (once you have ADB access, you're golden). A USB keyboard + numpad can enter a PIN, the issue is finding the key combination to press 'enter'.

* See if you can turn on talkback (typically pressing both volume buttons for 3 seconds, 2 times). This should provide you with enough information about what's happening on the screen to unlock it.

* Once you have the phone unlocked, connect to a bluetooth keyboard. This will free up the USB port for ADB

* You need to accept a confirmation dialog to pair via ADB

EDIT: `adb shell` may be able to input keypresses with an unverified device. My normal device isn't recognised at all over USB currently so I can't test.

I was able to use adb to enter my pin and unlock my first or second generation pixel device when I replaced the broken screen on it with a knockoff that wouldn't register touch support. No idea if this still works.

talkback was a great idea, unfortunately I couldn't get it to turn on. I assume you would have had to enable it in the accessibility settings on the phone.

Unlocking will resolve the issue by definitely destroying all your data forever since it is designed to be a destructive process. You cannot save your data from a locked and encrypted phone after it is broken in a way that prevents it from booting. You have to unlock and unencrypt it, replace the recovery and enable USB debugging as soon as you get it for maximum recoverability. This approach has significant disadvantages for privacy though.

Um, the phone boots. Only the screen is broken. "Unlocking" in this context just means entering the PIN on the lock screen.

This is how I did it. I borrow a phone that was the exact same model as mine, then hooked up a usb keyboard and memorized the exact series of steps needed to launch a remote screen viewing program. One thing that made this easier was using the google play store to remotely install the screen viewing program. Then I typed out the exact series of key presses that I needed to turn it on. Took me like 4 tries to type in the lock screen password and get the screen mirroring started.

To elaborate on the google play store if you go to play.google.com and you are signed into the phone with your google account you should be able to install apps directly to your phone.

This is so stupid and genius at the same time.

Yes. Phone was encrypted and so was the sd. I tried everything like adb, tapping hoping I'd mount as usb, remote deployment of some type of remote software, hdmi output (I think at the time I spent money on a hub too) but nothing worked, this continued over months.

I decided it'd be cheaper and save time to just buy a new screen. I thought of doing it myself but decided against it because my photos were too valuable. Everything only cost me about £45.

Had a local guy fit the thing for me and in the end I also had a working phone. Moral of the story for me was to set up my Google services so they sync my photos.

Fun fact, oled screens aren't as expensive as I thought and some repair shops won't let you supply a screen either.

Alternative moral: Write a bash script to adb backup your phone, and run it every month. I personally back up the photos, voice recorder, and data directory of a note taking app. My contacts and calendar are synced to Nextcloud via Davx5, and I use Ankidroid's inbuilt sync mechanism.

Is adb that reliable for you? I use adb for android development and I get random failures often.

Yes, very reliable. Sometimes I need to kill the ADB server on the desktop and very occasionally disable then reenable ADB on the device. But it's less likely to give me trouble than many other things we're used to breaking ))

I almost want to suggest to find the cheapest version of the same phone or finding the cheapest screen for it somewhere. Then replacing the screen just long enough to get the files out. This is also a valuable lesson on why you backup things.

This is what I did the last time a phone died. Got the screen replaced, which was $120, but worth it to recover my 2FA setup. Then I switched to a better 2FA app. That was the only important thing on the phone with no backup. It lasted another six months before the new screen died. I could probably replace it again, so I could recover a few config files, but it's not worth the cost.

I plugged in a mouse with a usb to micro usb / usbc adapter to my broken Huwawei Nova 2i

This gives a cursor (yes a windows like cursor) on your phone screen that you can move and click which imitates the touch.

I selected my files and sent it over to my computer with WiFi direct. I had to install a 3rd party app on my phone to act it as a server so I can connect from my computer and download.

There are plenty of apps like that on the play store. But I don’t know what I’d have done if the screen was completely broken.

In my case the screen was heavily cracked and touch wasn’t working but it was viewable.

Whoa, I might have to try the mouse -> usbc adapter just for fun! I had no idea that was a thing.

You can also get USB-C to DP/HDMI/VGA/DVI adaptors that support USB passthrough. "Most" (?) modern phones support DP-over-USB-C now and some even open a DeX-inspired desktop environment when connected (which even if it's broken/buggy like Huawei's implementation means the external display is driven at its native resolution, so media plays properly).

The adapters on AliExpress run $6-15 and are entirely adequate for the task IME.

Very cool! I'm definitely going to try this out.

You should try something like this:


Not all USB-C -> HDMI connectors work properly. This works with Huawei P20 Pro

I suggest this before going with the USB debugging way (using the android console and tools)

Phone storage on Android has been encrypted for years, so recovering it without unlocking the phone isn't really possible. Since you said USB-C to HDMI adapter doesn't work, you'll need to fix the screen to decrypt the storage and make a backup.

Is there a way to copy the encrypted contents without the phone being usable in order to use it in another phone? I have an old phone that bootloops due to some damaged electrical components, and getting the data off would be awesome. I know the code and everything but just can't even get that far. The bootloader itself even bootloops.

This is a fair point.

Poking around, it seems there are both CLI and GUI solutions to get around this, though: https://stackoverflow.com/questions/29072501/how-to-unlock-a...

adb requires authorization of the computer to function.

This(fortunately) is the correct answer. Unless of course the phone was setup without any security. Is that still allowed in Android?

Yes it is, as it should be. (Examples use cases: kids, elderly and people with disabilities)

Interesting. I seem to remember they still make you swipe up to unlock, do you by chance know if there is still some implicit decrypting at that stage?

I may be wrong on the swipe up, it's been a couple years since I went unlocked for a bit.

Assuming your phone's standard IOs and UIs are truly borked, if you can find an electronics engineer, ask them if they are familiar with JTAG. If your version of Android is old enough, you can pluck out the data unencrypted by soldering directly to the chip debug pins.

Something like




Most smartphones now have USBOTG, mean, limited usb host, so You could try to connect ordinary usb mouse with simple cheap connector "microusb otg" or in Your case, "USB-C otg", and it will emulate touchscreen (just appear mouse coursor and than interface will work very like Apple single-button mouse interface, sure multitouch gestures will not work, or attached to other buttons/dial).

You only need somehow turn on smartphone, so it will boot system and show SYSTEM login/lock screen.

BTW I'm not sure, what You talked about "pin code". I mean, classically, smartphone boot Android, and it have running usb-otg drivers, etc. But exists "feature-phones", like samsungs with "secure-boot" included directly into SoC, so it's boot loader have some interactivity with very limited interface (like grub), and it does not have usb drivers/etc. I usually avoid such interfaces, prefer to use less secure, but more reliable stock Android.

Other options need to do some things before crash - install app, install alternative boot, activate developer mode, backup all to cloud.

Good luck!

It won't help if your screen is totally dead but I got a hairline fracture in an old Sony phone that made the touch part stop working. When I took it in to the shop I learned if you plug in a corded mouse to the charging port of an Android phone, a mouse will show on screen.

Everything on my phone was already backed up but it did let me wipe the phone completely. Nice feature that I'm sure most people never even think to use.

If you can run adb shell, you should also be able to run sendevent, which lets you inject touch events into the screen. Coupled with screencap to capture screen contents, you have a way to fully remote control your phone from a connected computer.

Ages ago, I implemented a really simple program to screenshot the screen periodically and inject touch events via adb shell commands: https://github.com/nneonneo/android_remote_control. I used this successfully to recover all of the data off of a OnePlus with a broken touchscreen. I believe scrcpy, linked in other threads, is probably a better supported and more mature implementation of this idea, so you should probably try that first. Nevertheless, my little project should demonstrate that it’s possible to implement this kind of control without too much coding effort.

Unfortunately I can't connect via adb because I need to "enable file transfer" on my phone first. I think I can control it with my usb keyboard + mousepad, but I don't see what's going on as the screen is broken.

The screen might not be expensive. I got quoted about 30 quid once for an old Honor View 10, which I was surprised about.

I recovered my partner's photos and notes from her Samsung phone when she dropped it and the screen broke.

Spoilers: I had to replace the screen.

I had already flashed Lineage OS on it, but this was not helpful.

I first tried to mount the userdata via ADB shell (via LineageOS Recovery or another recovery), but was unable to. AIUI, the recoveries don't have support for Samsung encryption.

Second attempt was to try to boot to GUI, then control the GUI over ADB using scrcpy. This required USB debugging enabled, but I was unable to enable this.

Final attempt was to buy a replacement screen, and follow a YouTube video to replace it.

This was new to me, but it worked. I needed a kit of mobile phone repair prying tools ($15), the screen ($100) and patience.

I've since enabled backups on my partner's phone. :)

If you have a USB OTG dongle, try plugging in a USB mouse and/or keyboard and accepting the ADB keys / enabling USB debugging that way. I have successfully recovered damaged phones for family members that way.

I did exactly that with a usb-c dock connected to an android smartphone to operate the keyboard. It was good enough for unlocking it. The screen partially worked, it was good enough to bypass the Passcode. A mouse works, too.

I personally use my USB cable, the same that charges my phone and plug it on my desktop computer (Linux) and access my Internal storage directly from there; that's really it!

That requires authorization for computer to access data.

You mentioned USB debugging is enabled, any luck connecting up via ADB and poking around? If `adb shell` and trying to look at the filesystem doesn't work, maybe try this out to unlock the phone https://github.com/oberien/adb-remote-control

If adb is enabled on the phone you can try using WebADB - https://webadb.com to pull data from the phone. It includes a file browser that allows you to see and pull files from the phone as well as a web based version of scrcpy.

Have you tried hooking it up to a dock and plugging in a monitor cable and keyboard/mouse?

Yes, unfortunately it doesn't show up on the monitor, it's just a black screen

I had success buying a usb-c hub, that contained an hdmi output and 2x usb. This allowed me to use a monitor, keyboard, and mouse to use the device. Not all android phones support hdmi out though.

I have done that but adb didn't work for me. I just a phone of the same model and moved the mainboard to the new phone. More expensive solution if others don't pan out.

While we are on the subject:

Is it easy/recommended to look into creating backup with borg ? Can I regularly backup up an android phone like I do with my laptop ?

I do backups with Termux (a Debian Linux inside an app) f-droid version nowadays) and rsync everything over ssh onto a desktop machine.

Works like a charm for most data, but a caveat: you should prefer apps which store their data in the public storage parts of Android. Pictures, photos (DCIM) and music mostly live there.

Similar here. Termux with restic, so it does deduplication and encryption and such (also compression since a few months but haven't turned it on yet). I also enjoy having the same backup mechanism for my phone, laptop, and server.

On local laptop: run https://github.com/restic/rest-server/ to accept the incoming data, then (if 1234 is the port that rest-server runs on):

    user@laptop:~$ ssh -R 1234:localhost:1234 root@phone
    root@phone:~# restic backup /data/ -r rest:http://user:password@localhost:1234 -x --exclude /data/media/0/Android/data/com.spotify.music/
Can also do this without root and just sync pictures, but this way you actually get all your data.

Or set up a rest-server on a remote system somewhere, since it's encrypted it doesn't matter where you run it so long as you trust the remote end not to delete your files on the same day as your phone crashes.

Rsync is simpler if you don't need features like encryption (at least to get started: any backup mechanism today is better than a perfect backup mechanism tomorrow).

somewhat related, anyone have advice for data recovery from old external USB drives?

I have a couple western digital USB drives, about 10 years old. they show up as a drive when plugged into a Mac or windows laptop but they disconnect when trying to navigate the folders or open/copy files.

On the Mac, figure out the device that gets assigned (e.g. /dev/sda) - you can find this in the disk utility app. Try to make a disk image from that device using dd on the command line. If you can mount the disk image, you should be able to access the files from there.

If you can get to a point you can read it as a generic usb mass storage, try Photorec.

Replace the display.

If the data is not worth the cost of the replacement display, walk away.

Far from my expertise, but I had some luck with recovering some old photos from an Android which was factory reseted.

Used a common software.

Hopefully someone with more knowledge will pick it up and help you.

Applications are open for YC Winter 2024

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact