Vote Charlie!

No Galaxy S8 root, must fix syncing scripts

Posted at age 29.

I’m a bit frustrated right now trying to work through a small cascade of issues so I can file some claims for some corals that arrived yesterday. This is a quick entry to document where I am in the process.

To file the dead on arrival claims, I need to get the photos off my phone. I could have moved them manually, but time manually doing things that can be automated adds up, so I wanted to update my automatic phone sync process for my new phone. The Samsung Galaxy S8 US version, G950U1, apparently does not have root yet. I wouldn’t have made the switch yet had I known that, but of course I couldn’t resist using the new phone once I had it in hand.

My android-transfer-media script that worked fine for Nexus 6P needed some changes. The S8 stores some camera photos on the external SD card, which apparently has no simple path like the system storage /storage/emulated/0 path (which itself is only valid if there is only one user on the phone). For now I hardcoded the path /storage/9C33-6BBD, which I guess I could programmatically determine by process of elimination. The S8 also stores screenshots in DCIM, not Pictures, on the internal storage.

The script copied the files to my computer fine, but was unable to delete the files off the phone. I was relying on these commands (within a Bash function):

rsync -avz -P --remove-source-files -e "ssh -oProxyCommand='adb-channel tcp:2222 com.arachnoid.sshelper/.SSHelperActivity 1'" "$ssh_host:$src/" "$dst" &&
ssh "${ssh_opts[@]}" $ssh_host find "$src/" -depth -type d -delete

That produced a cascade of errors like rsync: sender failed to remove 20170623_112552.jpg: Permission denied (13).

Logging in via SSH via ADB, I found the files are all owned by root:everybod:

u0_a230@msm8998:/storage/9C33-6BBD/DCIM/Camera $ ls -halt /storage/emulated/0/DCIM/Screenshots
total 5348
drwxrwx---    5 root     everybod    4.0K Jun 24 17:06 ..
drwxrwx---    2 root     everybod    4.0K Jun 24 12:34 .
-rw-rw----    1 root     everybod   97.1K Jun 24 12:34 Screenshot_20170624-123418.png
-rw-rw----    1 root     everybod    2.0M Jun 24 12:01 Screenshot_20170624-120111.png
...

When I logged in with standard adb shell, not using SSHelper, the files were owned by root:sdcard_rw:

dreamqlteue:/ $ ls -halt /storage/emulated/0/DCIM/Screenshots
total 5.2M
drwxrwx--x 5 root sdcard_rw 4.0K 2017-06-24 17:06 ..
drwxrwx--x 2 root sdcard_rw 4.0K 2017-06-24 12:34 .
-rw-rw---- 1 root sdcard_rw  97K 2017-06-24 12:34 Screenshot_20170624-123418.png
-rw-rw---- 1 root sdcard_rw 2.0M 2017-06-24 12:01 Screenshot_20170624-120111.png
...

I may need to switch back to my pure ADB method I used before I switched to Rsync over SSH, at least for deleting the files. I’ll have to deal with that later!