mirror of
https://github.com/PurpleI2P/i2pd-android.git
synced 2025-09-14 15:42:08 +00:00
get webconsole address from daemon
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
404cb804bc
commit
f23335b1c1
@ -15,7 +15,7 @@ android {
|
||||
targetSdkVersion 29
|
||||
minSdkVersion 14
|
||||
versionCode 23500
|
||||
versionName "2.35.0-113-g01df1647"
|
||||
versionName "2.35.0-121-gaa206d03"
|
||||
setProperty("archivesBaseName", archivesBaseName + "-" + versionName)
|
||||
|
||||
ndk {
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 01df1647bcfe7a9b92a90b457fdf2683e338a4f9
|
||||
Subproject commit aa206d034dfb744d9be28c5f0911061ebc33ead9
|
@ -9,6 +9,7 @@
|
||||
#include <jni.h>
|
||||
#include "org_purplei2p_i2pd_I2PD_JNI.h"
|
||||
#include "DaemonAndroid.h"
|
||||
#include "Config.h"
|
||||
#include "RouterContext.h"
|
||||
#include "ClientContext.h"
|
||||
#include "Transports.h"
|
||||
@ -112,3 +113,11 @@ JNIEXPORT jint JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_GetTransitTunnelsCount
|
||||
(JNIEnv *env, jclass clazz) {
|
||||
return i2p::tunnel::tunnels.CountTransitTunnels();
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_getWebConsAddr
|
||||
(JNIEnv *env, jclass clazz) {
|
||||
std::string httpAddr; i2p::config::GetOption("http.address", httpAddr);
|
||||
uint16_t httpPort; i2p::config::GetOption("http.port", httpPort);
|
||||
std::string result = "http://" + httpAddr + ":" + std::to_string(httpPort) + "/";
|
||||
return env->NewStringUTF(result.c_str());
|
||||
}
|
||||
|
@ -47,6 +47,9 @@ JNIEXPORT void JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_setDataDir
|
||||
JNIEXPORT jint JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_GetTransitTunnelsCount
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
JNIEXPORT jstring JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_getWebConsAddr
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -24,6 +24,8 @@ public class I2PD_JNI {
|
||||
|
||||
public static native int GetTransitTunnelsCount();
|
||||
|
||||
public static native String getWebConsAddr();
|
||||
|
||||
public static void loadLibraries() {
|
||||
//System.loadLibrary("c++_shared");
|
||||
System.loadLibrary("i2pd");
|
||||
|
@ -28,7 +28,7 @@ public class WebConsoleActivity extends Activity {
|
||||
final WebSettings webSettings = webView.getSettings();
|
||||
webSettings.setBuiltInZoomControls(true);
|
||||
webSettings.setJavaScriptEnabled(false);
|
||||
webView.loadUrl("http://127.0.0.1:7070"); // TODO: instead 7070 I2Pd....HttpPort
|
||||
webView.loadUrl(I2PD_JNI.getWebConsAddr());
|
||||
|
||||
swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe);
|
||||
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user