From 3b4949fc5038af87ce08b2bf553d4c3a17d8240f Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Fri, 24 Feb 2017 21:31:29 +0100 Subject: AppUpdater: detect beta versions --- .../de/pixart/messenger/ui/UpdaterActivity.java | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java b/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java index 7e5220609..066a2fd39 100644 --- a/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java +++ b/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java @@ -182,15 +182,24 @@ public class UpdaterActivity extends Activity { private int checkVersion(String remoteVersion, String installedVersion) { String[] remote = null; String[] installed = null; + String[] remoteV = null; + String[] installedV = null; try { - remote = remoteVersion.split("\\."); - } catch (Exception ignored) { - //ignored + installedV = installedVersion.split(" "); + Log.d(Config.LOGTAG, "Updater Version installed: " + installedV[0]); + installed = installedV[0].split("\\."); + } catch (Exception e) { + e.printStackTrace(); } try { - installed = installedVersion.split("\\."); - } catch (Exception ignored) { - //ignored + remoteV = remoteVersion.split(" "); + if (installedV[1] != null) { + remoteV[0] = remoteV[0] + ".1"; + } + Log.d(Config.LOGTAG, "Updater Version on server: " + remoteV[0]); + remote = remoteV[0].split("\\."); + } catch (Exception e) { + e.printStackTrace(); } int i = 0; // set index to first non-equal ordinal or length of shortest localVersion string -- cgit v1.2.3