Triggering Database Backup over adb shell

My phone screen got shattered the other day and unfortunately it turns out I had not turned on the automatic backup of the AntennaPod database. The screen it totally cooked on the left hand side where the AntennaPod hamburger menu resides and even if it wasn’t the crack through the digitizier is causing all sorts of ghost touch events making it challenging to get anything open.

I am however able to get into the device via the adb shell. Is there a way to trigger AntennaPod to export the database via the shell?

(Usual debugging is tbd as I am writing this from work - will fill in later)
App version: x.y.z (state whether from Google Play/F-Droid/Custom built APK)

Android version: 5.x - OnePlus OxygenOS

Device model: OnePlus Nord N100

Expected behaviour:

Current behaviour:

Maybe a simple suggestion: You can plug a USB adapter into your phone and attach mouse+keyboard

Triggering the backup, no. But you might be able to access the database directly in /data/user/0/de.danoeh.antennapod/database (or similar). Not sure if the phone has to be rooted for that

Hey Unleveled, you could try using adb pull to grab the database file directly, something like:

bash

CopyEdit

adb shell run-as de.danoeh.antennapod cat /data/user/0/de.danoeh.antennapod/databases/antennapod.db > antennapod.db

Then you’ll have the .db locally to inspect or restore in another install.

@ByteHamster Ah! This is a great idea. I always forget that Android works with keyboard/mouse. Was a bit fiddly (fighting the ghost touches) but so far I’ve been able to extract a .OPML from my damaged phone!

Going to try again for the database later today. Enough of the screen is damaged that I’m working from memory/guessing for some menus.

@Jonathan_Weyer Unfortunately the package is not debuggable:

toast@bread:~/Documents/phone$ adb shell run-as de.danoeh.antennapod cat /data/user/0/de.danoeh.antennapod/databases/antennapod.db > antennapod.db
run-as: package not debuggable: de.danoeh.antennapod

I appreciate the suggestion though : )

Success! I was able to export the database.
For flavor this is what I was working against:


Mouse and keyboard saved the day in this instance but in a more totalizing screen smash I’ve have been hosed.

Lesson learned: turn on the automated backup.

Thank you for the assistance! : )

1 Like