Loading src/org/lineageos/updater/misc/Utils.java +5 −4 Original line number Diff line number Diff line Loading @@ -147,7 +147,10 @@ public class Utils { String[] versionParts = versionCode.split(Pattern.quote(".")); int major = Integer.parseInt(versionParts[0]); int minor = Integer.parseInt(versionParts[1]); return new int[]{ major, minor }; int patch = 0; if(versionParts.length >=3) patch = Integer.parseInt(versionParts[2]); return new int[]{ major, minor, patch }; } public static boolean canInstall(UpdateBaseInfo update) { Loading Loading @@ -273,10 +276,8 @@ public class Utils { public static boolean checkForNewUpdates(File newJson) throws IOException, JSONException { List<UpdateInfo> newList = parseJson(newJson, true); float currentVersion = Float.parseFloat(BuildInfoUtils.getBuildVersion()); for (UpdateInfo update : newList) { if (Float.parseFloat(update.getVersion()) > currentVersion) { if (isCompatible(update)) { Log.d(TAG, "New compatiable update available"); return true; } Loading Loading
src/org/lineageos/updater/misc/Utils.java +5 −4 Original line number Diff line number Diff line Loading @@ -147,7 +147,10 @@ public class Utils { String[] versionParts = versionCode.split(Pattern.quote(".")); int major = Integer.parseInt(versionParts[0]); int minor = Integer.parseInt(versionParts[1]); return new int[]{ major, minor }; int patch = 0; if(versionParts.length >=3) patch = Integer.parseInt(versionParts[2]); return new int[]{ major, minor, patch }; } public static boolean canInstall(UpdateBaseInfo update) { Loading Loading @@ -273,10 +276,8 @@ public class Utils { public static boolean checkForNewUpdates(File newJson) throws IOException, JSONException { List<UpdateInfo> newList = parseJson(newJson, true); float currentVersion = Float.parseFloat(BuildInfoUtils.getBuildVersion()); for (UpdateInfo update : newList) { if (Float.parseFloat(update.getVersion()) > currentVersion) { if (isCompatible(update)) { Log.d(TAG, "New compatiable update available"); return true; } Loading