RetroArch icon indicating copy to clipboard operation
RetroArch copied to clipboard

Cloud Sync WebDAV Support for Android

Open eastcoastcoder opened this issue 1 year ago • 2 comments

First and foremost consider this:

  • Only RetroArch bugs should be filed here. Not core bugs or game bugs
  • This is not a forum or a help section, this is strictly developer oriented

Description

  • On iOS/TVOS platforms, an additional setting for Cloud Sync exists
  • On Android and possibly other platforms these configuration options are missing
  • I play my games on AppleTV and see the save has synced successfully to my WebDAV share, but then have to run another program (Folder Sync) manually on my Android phone to keep these saves synced up to my share.
  • Ideally both platforms could have this functionality built in.

Expected behavior

  • I would expect interfacing with a WebDAV share would work fairly similarly. However I'm unaware of the potential challenges to port this to other platforms. (Though I did read a more generic bounty issue for some universal cloud support earlier)

Actual behavior

  • Options do not exist on Android, as well as potentially other platforms.

Steps to reproduce the bug

  1. Go to Settings
  2. Go to Saving
  3. See that Cloud Sync is not at the end of the list (It would be on AppleTV)

Bisect Results

  • Feature just missing

Version/Commit

  • RetroArch: 1.19.1

Environment information

  • OS: Android

eastcoastcoder avatar Aug 05 '24 02:08 eastcoastcoder

In addition to what I've stated above, my Apple TV's last modified date for all save/savestate files is +4 hours from Eastern even though my phone and ATV are configured the same (is this UTC possibly?)

So my third party app (FolderSync) cannot properly identify which file is newer. As a result, I am one save behind or 4 hours delayed before syncing correctly. To be honest, the easiest approach is to just cut out the middleman however I'm curious if there is a underlying timing issue on ATV or a configuration issue on my end...

Screenshot attached of my ATV save synced down, and my local Android save now taking an "older" yet true, modified date due to this discrepancy.

Screenshot_20240807_014651_X-plore~2.jpg

Screenshot_20240807_014815_X-plore~2.jpg

eastcoastcoder avatar Aug 07 '24 05:08 eastcoastcoder

It should be there now, you can try to download the build artifact from the PR ( https://github.com/libretro/RetroArch/actions/runs/11086458531?pr=17060 ). Android does not have SSL enabled, so WebDav will only work over plain HTTP for this platform

KiralyCraft avatar Sep 28 '24 19:09 KiralyCraft

@KiralyCraft Nice work on getting WebDav in there! Played around with this a bit and really like how far it's come. Do you know what's needed to get SSL going in Android?

RobLoach avatar Jan 02 '25 18:01 RobLoach

Just adding that this is completely useless for me without SSL support. Please support SSL when you get this feature added.

phirestalker avatar Jan 26 '25 22:01 phirestalker

Oopsie - Looks like I missed notifications. Building OpenSSL intro Android is feasible, however due to lack of time I could not also add this. I use RetroArch with a VPN to overcome this issue.

I'd have to see what is the general recommendation for bundling OpenSSL into Android apps, as this platform is not my particular cup of tea. There has been some debate regarding bundling heavy dependencies on embedded platforms, so probably this postponed the implementation as well;

I'll look into this as soon as I get some free time, but unfortunately it doesn't seem to be happening soon.

KiralyCraft avatar Jan 27 '25 06:01 KiralyCraft

Oopsie - Looks like I missed notifications. Building OpenSSL intro Android is feasible, however due to lack of time I could not also add this. I use RetroArch with a VPN to overcome this issue.

I'd have to see what is the general recommendation for bundling OpenSSL into Android apps, as this platform is not my particular cup of tea. There has been some debate regarding bundling heavy dependencies on embedded platforms, so probably this postponed the implementation as well;

I'll look into this as soon as I get some free time, but unfortunately it doesn't seem to be happening soon.

What are you using to provide the WebDAV implementation? According to AI, SSL is built into android. Here is an excerpt for instructions on adding cloud sync

  1. Use HttpURLConnection or HttpsURLConnection for network requests.
  2. Implement your API calls to perform authentication and file transfers (e.g., upload/download).
  3. Use Android's TrustManager for SSL certificate verification (default behavior is secure for HTTPS).

I don't know if that is Java or Kotlin, as these are not my primary language, and android is not a platform I develop on.

phirestalker avatar Jan 27 '25 15:01 phirestalker

Unfortunately it's native C code that requires SSL, the WebDav library comes from the native part of RetroArch: https://github.com/libretro/RetroArch/pull/15548

KiralyCraft avatar Jan 27 '25 15:01 KiralyCraft

Does that mean that libcurl is not available on android, or that it is not compiled with SSL support on android?

phirestalker avatar Jan 30 '25 14:01 phirestalker

Does that mean that libcurl is not available on android, or that it is not compiled with SSL support on android?

More complicated than that, retroarch does not use curl, it uses its own custom http client.

@KiralyCraft Have you played around at all with the builtin mbed-tls integration? It's what's used on iOS. -DHAVE_BUILTINMBEDTLS -DHAVE_SSL

warmenhoven avatar Jan 30 '25 15:01 warmenhoven

I think I have, although i'm yet to test it again. I remember hitting a roadblock, but will look into this asap, as soon as I get some time for this. Sorry for the wait :)

KiralyCraft avatar Mar 22 '25 07:03 KiralyCraft

I only get the error "[CloudSync] could not begin" in the log, even with debug log enabled. I assume that I have this issue described here, as my server is only accessible via https. If someone still works on that a more appropriate error message would be helpful, that saves people like me the research time what could be wrong. Thanks for all the work!

breemts avatar Apr 21 '25 19:04 breemts

How can I find out what version this will be in, and how to find it in the UI?

phirestalker avatar Jun 04 '25 15:06 phirestalker

I'm not sure exactly which question you're asking, but if it's enabled, you'll see it in the main menu > information > system information, at the very bottom should be SSL Support: Yes. If you don't see that (or if it says No) then it doesn't have it.

warmenhoven avatar Jun 06 '25 03:06 warmenhoven

Sorry, my bad. The issue title says Cloud Sync WebDAV Support for Android. This issue was closed as "completed", so I was wondering when the cloud sync ability for Android would be released to an installable version (i.e., F-droid).

phirestalker avatar Jun 06 '25 13:06 phirestalker

Stable releases don't happen on a schedule so I can't say exactly when. You can install a nightly build now and test it out, https://buildbot.libretro.com/nightly/android/. I'm not sure on android if there's an equivalent to the nightly build that's put on the stores? On iOS the TestFlight is the nightly build of the App Store version.

warmenhoven avatar Jun 06 '25 14:06 warmenhoven

I'm not sure exactly which question you're asking, but if it's enabled, you'll see it in the main menu > information > system information, at the very bottom should be SSL Support: Yes. If you don't see that (or if it says No) then it doesn't have it.

I don't understand. Should SSL support be at the operating system level? Which version of Android supports this?

vsaR1SK avatar Jun 07 '25 21:06 vsaR1SK

Should SSL support be at the operating system level?

No. RetroArch has its own built in SSL library, it doesn't matter if the OS does or not, it won't use it if it has it anyway.

I downloaded RetroArch.apk from https://buildbot.libretro.com/nightly/android/ and put it on my Retroid. Then in the Main Menu > Information, System Information, at the top of the screen I see:

Image

The important bit there is the Build Date, which is today. Please also note the Git Version here.

And at the bottom I see:

Image

The important bit is the SSL Support should be Yes. If that's not what you see, please let me know what the Git Version you see is.

warmenhoven avatar Jun 08 '25 02:06 warmenhoven

Stable releases don't happen on a schedule so I can't say exactly when. You can install a nightly build now and test it out, https://buildbot.libretro.com/nightly/android/. I'm not sure on android if there's an equivalent to the nightly build that's put on the stores? On iOS the TestFlight is the nightly build of the App Store version.

There is not an equivalent to nightly on the stores, in fact, the store versions are out of date compared to the normal Stable build too!

Depresst0 avatar Jun 17 '25 23:06 Depresst0