add missing webxdc api

This commit is contained in:
adbenitez
2024-12-13 13:42:39 +01:00
parent 41579de502
commit c5cb79d116
2 changed files with 20 additions and 2 deletions
@@ -74,7 +74,9 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
private DcMsg dcAppMsg;
private String baseURL;
private String sourceCodeUrl = "";
private String selfAddr = "";
private String selfAddr;
private int sendUpdateMaxSize;
private int sendUpdateInterval;
private boolean internetAccess = false;
private boolean hideActionBar = false;
@@ -199,7 +201,9 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
final JSONObject info = this.dcAppMsg.getWebxdcInfo();
internetAccess = JsonUtils.optBoolean(info, "internet_access");
selfAddr = JsonUtils.optString(info, "self_addr");
selfAddr = info.optString("self_addr");
sendUpdateMaxSize = info.optInt("send_update_max_size");
sendUpdateInterval = info.optInt("send_update_interval");
toggleFakeProxy(!internetAccess);
@@ -494,6 +498,16 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
}
class InternalJSApi {
@JavascriptInterface
public int sendUpdateMaxSize() {
return WebxdcActivity.this.sendUpdateMaxSize;
}
@JavascriptInterface
public int sendUpdateInterval() {
return WebxdcActivity.this.sendUpdateInterval;
}
@JavascriptInterface
public String selfAddr() {
return WebxdcActivity.this.selfAddr;