Skip to content

Commit 3817bac

Browse files
committed
Add AndroidClient backend to lua/main.cpp
1 parent 152cce8 commit 3817bac

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/android/AndroidClient.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ std::string replace(const std::string &str, const std::string &from, const std::
2929
return ss.str();
3030
}
3131

32-
std::string fromJavaMUTF(const std::string &str)
33-
{
34-
static std::string null("", 1);
35-
return replace(str, "\xC0\x80", null);
36-
}
37-
3832
jstring newStringUTF(JNIEnv *env, const std::string &str)
3933
{
4034
static std::string null("", 1);

src/android/AndroidClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class AndroidClient: public HTTPSClient
1212
{
1313
public:
1414
AndroidClient();
15-
15+
1616
bool valid() const override;
1717
HTTPSClient::Reply request(const HTTPSClient::Request &req) override;
1818

src/lua/main.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
#ifdef USE_NSURL_BACKEND
1717
# include "macos/NSURLClient.h"
1818
#endif
19+
#ifdef USE_ANDROID_BACKEND
20+
# include "android/AndroidClient.h"
21+
#endif
1922

2023
#ifdef USE_CURL_BACKEND
2124
static CurlClient curlclient;
@@ -29,6 +32,9 @@
2932
#ifdef USE_NSURL_BACKEND
3033
static NSURLClient nsurlclient;
3134
#endif
35+
#ifdef USE_ANDROID_BACKEND
36+
static AndroidClient androidclient;
37+
#endif
3238

3339
static HTTPSClient *clients[] = {
3440
#ifdef USE_CURL_BACKEND
@@ -42,6 +48,9 @@ static HTTPSClient *clients[] = {
4248
#endif
4349
#ifdef USE_NSURL_BACKEND
4450
&nsurlclient,
51+
#endif
52+
#ifdef USE_ANDROID_BACKEND
53+
&androidclient,
4554
#endif
4655
nullptr,
4756
};

0 commit comments

Comments
 (0)