I made a post about this yesterday, and I managed to make a lot of progress today, but I'm stuck again, and I am trying to decide what to do. I am not really experienced with coding, but I happen to be very good at teaching myself how to do something when needed and also very bad at giving up.
Below is a summary of my progress thus far:
INITIAL PLAN
Install Android SDK, drivers to PC (Win7, 64 bit)
Root phone (used CF-Auto-Root)
Patch adbd to allow root permissions (installed adbd insecure and SuperSU)
Access /data/userdata
Get image of /userdata, attempt to find files
I am stuck at step 3. I have adbd insecure and SuperSU, but using either of these causes USB debugging to be disabled. Regardless of how I toggle things, I lose my connection to my PC and cannot enable USB debugging.
Some research uncovered that there's something called SELinux that is preventing me from enabling USB debugging while adbd insecure is enabled (patched adbd). There are posts in the adbd insecure thread on the XDA forums from other people (check the last page) describing a similar problem:
https://forum.xda-developers.com/showthread.php?t=1687590
And one post at the end explaining that they fixed it with an app called SELinux Switch:
https://forum.xda-developers.com/showpost.php?p=79689054&postcount=267
SELinux Switch would allow me to turn off the protection preventing adbd insecure from working. Can I get some feedback about this? I'm not enjoying this stuff, and I really need to get back to other endeavors, so it'd be a one-time use, and then I will probably uninstall it from my phone because I won't need it.
ALTERNATIVE PLANS
I also have two alternative "paths" I could take to attempt to recover the deleted photos. I'd rather not do that right now, because I don't think I have time, and because I am trying to avoid anything that would overwrite the deleted photos, but they exist nonetheless:
Alternative 1: Droidexplorer and busybox
I already have droidexplorer installed on my PC and my phone is rooted, so I guess I could install busybox and see if droidexplorer can recover the deleted photos.
Alternative 2: Magisk with/without busybox
I would rather not do this, because it sounds like it would take the most time and more monkeying around with internal storage, but apparently adbd insecure isn't an active project anymore and most people use magisk for rooting, etc. This is an alternative, but it's the least attractive option.
What do people think? For now I am going to try the SELinux switch, since it seems the simplest way. If people could please try to avoid using too much jargon and explain commands, etc. it would really help out; that way I wouldn't need to look up unfamiliar terms first.
adb shell
? An approach would be to extract the userdata partition (storing the image e.g. on an SD card or directly to the PC), then extracting your contents on PC using e.g. TestDisk/PhotoRec. You could use my tool Adebar to create scripts for that ("partition backup"), though that would require either Linux or Cygwin. Example command line if you know the partition:adb exec-out "su -c 'cat /dev/block/mmcblk0p46'" > "images/userdata.img"
– Izzy Aug 28 '20 at 06:52adb shell su
and lots of other commands, but I can't do anything that requires root, despite being rooted. My understanding is that /userdata is protected and requires root access; searching the internet reveals that many people using adbd insecure are prevented from root access in android 5.1.1 and higher, because SELinux doesn't allow it, and something about the kernel prevents changing the enforcement status manually. – An_Asymptote Aug 28 '20 at 08:16adb shell su
and thenadb root
briefly starts the adb daemon and then it says "error: device not found". Usingsetenforce=0
to change the SELinux status from enforced to permissive doesn't work (getenforce
gives "enforced" as a result). In addition, patching adbd while in USB debug mode kicks me out of USB debug even if I have that box ticked in the developer menu. Unless Magisk has the ability to get around this somehow, it sounds like rebuilding the kernel without the automatically enforced SELinux setting is the only way out. – An_Asymptote Aug 28 '20 at 08:21