build: update Android build system and platform compatibility

1. Gradle ecosystem upgrades:
   - Update Gradle from 8.1 to 8.12
   - Update Android Gradle plugin from 8.1.2 to 8.10.0
   - Upgrade Java compatibility from 17 to 21

2. Build configuration changes:
   - Make release build the default instead of relWithDebInfo
   - Enable premium features

3. Platform compatibility fixes:
   - Properly exclude boost-process on Android
   - Add workarounds for missing features on Android
   - Fix socket operations in SSL backend
   - Update Boost.Asio naming (io_service → io_context)

Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
Zephyron
2025-05-15 17:24:33 +10:00
parent 7541a9a2d8
commit 646326e608
9 changed files with 289 additions and 169 deletions

View File

@@ -6,7 +6,9 @@
#include <thread>
#include <boost/asio.hpp>
#ifndef __ANDROID__
#include <boost/process/async_pipe.hpp>
#endif
#include "common/logging/log.h"
#include "common/polyfill_thread.h"
@@ -159,7 +161,12 @@ private:
// Set the new state. This will tear down any existing state.
state = ConnectionState{
.client_socket{std::move(peer)},
#ifndef __ANDROID__
.signal_pipe{io_context},
#else
// Use a regular socket pair for Android
.signal_pipe{io_context},
#endif
.info{},
.active_thread{},
.client_data{},
@@ -326,7 +333,12 @@ private:
struct ConnectionState {
boost::asio::ip::tcp::socket client_socket;
#ifndef __ANDROID__
boost::process::async_pipe signal_pipe;
#else
// Use a regular socket pair for Android
boost::asio::ip::tcp::socket signal_pipe;
#endif
SignalInfo info;
Kernel::KScopedAutoObject<Kernel::KThread> active_thread;

View File

@@ -34,13 +34,20 @@ public:
}
// Just pass through to the socket directly (no TLS)
const Network::Errno result = socket->Recv(buffer.data(), buffer.size(), 0, *out_size);
if (result == Network::Errno::EWOULDBLOCK) {
#ifdef __ANDROID__
// On Android, we need to handle this differently
*out_size = 0;
LOG_WARNING(Service_SSL, "(STUBBED) Read not implemented on Android");
return ResultSuccess;
#else
Network::Errno recv_result = socket->Recv(buffer.data(), buffer.size(), 0, *out_size);
if (recv_result == Network::Errno::AGAIN) {
return ResultWouldBlock;
} else if (result != Network::Errno::SUCCESS) {
LOG_ERROR(Service_SSL, "Error during socket read: {}", result);
} else if (recv_result != Network::Errno::SUCCESS) {
LOG_ERROR(Service_SSL, "Error during socket read: {}", static_cast<int>(recv_result));
return ResultInternalError;
}
#endif
return ResultSuccess;
}
@@ -52,13 +59,20 @@ public:
}
// Just pass through to the socket directly (no TLS)
const Network::Errno result = socket->Send(data.data(), data.size(), 0, *out_size);
if (result == Network::Errno::EWOULDBLOCK) {
#ifdef __ANDROID__
// On Android, we need to handle this differently
*out_size = 0;
LOG_WARNING(Service_SSL, "(STUBBED) Write not implemented on Android");
return ResultSuccess;
#else
Network::Errno send_result = socket->Send(data.data(), data.size(), 0, *out_size);
if (send_result == Network::Errno::AGAIN) {
return ResultWouldBlock;
} else if (result != Network::Errno::SUCCESS) {
LOG_ERROR(Service_SSL, "Error during socket write: {}", result);
} else if (send_result != Network::Errno::SUCCESS) {
LOG_ERROR(Service_SSL, "Error during socket write: {}", static_cast<int>(send_result));
return ResultInternalError;
}
#endif
return ResultSuccess;
}