Fix sulla porta TCP nel caso non fosse esplicita
This commit is contained in:
parent
3a5836ba4b
commit
97d27b047d
@ -63,7 +63,7 @@ public class RESTBuilder {
|
|||||||
|
|
||||||
OkHttpClient client = clientBuilder.build();
|
OkHttpClient client = clientBuilder.build();
|
||||||
|
|
||||||
String endpoint = protocol + "://" + host + ":" + port + "/" + (addEmsApi ? "ems-api/" : "");
|
String endpoint = protocol + "://" + host + (port > 0 ? ":" + port : "") + "/" + (addEmsApi ? "ems-api/" : "");
|
||||||
|
|
||||||
|
|
||||||
Gson gson = new GsonBuilder()
|
Gson gson = new GsonBuilder()
|
||||||
|
|||||||
@ -27,9 +27,11 @@ public class UpdatesManager {
|
|||||||
public void init(AppCompatActivity activityContext) {
|
public void init(AppCompatActivity activityContext) {
|
||||||
this.mContext = activityContext;
|
this.mContext = activityContext;
|
||||||
|
|
||||||
|
final String baseEndpoint = SettingsManager.i().getServer().getProtocol() + "://" + SettingsManager.i().getServer().getHost() +
|
||||||
|
(SettingsManager.i().getServer().getPort() > 0 ? ":" + SettingsManager.i().getServer().getPort() : "");
|
||||||
|
|
||||||
String currentVersionUrl = SettingsManager.i().getServer().getProtocol() + "://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/currentVersion";
|
final String currentVersionUrl = baseEndpoint + "/ems-api/wms/currentVersion";
|
||||||
String currentDownloadUrl = SettingsManager.i().getServer().getProtocol() + "://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/android-release.apk";
|
final String currentDownloadUrl = baseEndpoint + "/ems-api/wms/android-release.apk";
|
||||||
|
|
||||||
|
|
||||||
AppUpdater appUpdater = new AppUpdater(mContext)
|
AppUpdater appUpdater = new AppUpdater(mContext)
|
||||||
|
|||||||
@ -41,9 +41,15 @@ public class UtilityServer {
|
|||||||
public static void isEmsApiAvailable(final String protocol, final String serverAddress, final int serverTCPport, final Runnable onComplete, final RunnableArgs<Exception> onFailed) {
|
public static void isEmsApiAvailable(final String protocol, final String serverAddress, final int serverTCPport, final Runnable onComplete, final RunnableArgs<Exception> onFailed) {
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
|
|
||||||
|
String url = null;
|
||||||
|
|
||||||
|
if(serverTCPport > 0)
|
||||||
|
url = String.format("%s://%s:%d/ems-api/system/ok", protocol, serverAddress, serverTCPport);
|
||||||
|
else
|
||||||
|
url = String.format("%s://%s/ems-api/system/ok", protocol, serverAddress);
|
||||||
|
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(String.format("%s://%s:%d/ems-api/system/ok", protocol, serverAddress, serverTCPport))
|
.url(url)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -47,10 +47,13 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public AppContext appContext;
|
public AppContext appContext;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public SystemRESTConsumer systemRESTConsumer;
|
public SystemRESTConsumer systemRESTConsumer;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public DialogProgressView mCurrentProgress;
|
public DialogProgressView mCurrentProgress;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ExecutorService executorService;
|
public ExecutorService executorService;
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
kotlin_version = '1.8.0'
|
kotlin_version = '1.8.0'
|
||||||
agp_version = '8.0.0'
|
agp_version = '8.0.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user