Austin Huang
5 years ago
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
1 changed files with
3 additions and
3 deletions
-
app/src/main/java/awais/instagrabber/utils/UpdateChecker.java
|
|
@ -27,15 +27,15 @@ public final class UpdateChecker extends AsyncTask<Void, Void, Boolean> { |
|
|
|
|
|
|
|
HttpURLConnection conn = |
|
|
|
(HttpURLConnection) new URL("https://github.com/austinhuang0131/instagrabber/releases/latest").openConnection(); |
|
|
|
conn.setUseCaches(false); |
|
|
|
conn.setInstanceFollowRedirects(false); |
|
|
|
conn.setUseCaches(false); |
|
|
|
conn.setRequestProperty("User-Agent", Constants.A_USER_AGENT); |
|
|
|
conn.connect(); |
|
|
|
|
|
|
|
final int responseCode = conn.getResponseCode(); |
|
|
|
if (responseCode == HttpURLConnection.HTTP_MOVED_TEMP && !BuildConfig.DEBUG) { |
|
|
|
if (responseCode == HttpURLConnection.HTTP_MOVED_TEMP) { |
|
|
|
version = conn.getHeaderField("Location").split("/v")[1]; |
|
|
|
return version != BuildConfig.VERSION_NAME; |
|
|
|
return !version.equals(BuildConfig.VERSION_NAME); |
|
|
|
} |
|
|
|
|
|
|
|
conn.disconnect(); |
|
|
|