Austin Huang
5 years ago
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
2 changed files with
4 additions and
4 deletions
-
app/src/main/java/awais/instagrabber/dialogs/SettingsDialog.java
-
app/src/main/java/awais/instagrabber/utils/Utils.java
|
|
@ -185,11 +185,12 @@ public final class SettingsDialog extends BottomSheetDialogFragment implements V |
|
|
|
if (v == btnLogin) { |
|
|
|
startActivity(new Intent(v.getContext(), Login.class)); |
|
|
|
somethingChanged = true; |
|
|
|
this.dismiss(); |
|
|
|
} else if (v == btnLogout) { |
|
|
|
Utils.setupCookies("LOGOUT"); |
|
|
|
settingsHelper.putString(Constants.COOKIE, null); |
|
|
|
settingsHelper.putString(Constants.COOKIE, ""); |
|
|
|
somethingChanged = true; |
|
|
|
this.dismiss(); |
|
|
|
activity.recreate(); |
|
|
|
} else if (v == btnImportExport) { |
|
|
|
if (ContextCompat.checkSelfPermission(activity, Utils.PERMS[0]) == PackageManager.PERMISSION_DENIED) |
|
|
|
requestPermissions(Utils.PERMS, 6007); |
|
|
|
|
|
@ -123,12 +123,11 @@ public final class Utils { |
|
|
|
public static SimpleDateFormat datetimeParser; |
|
|
|
|
|
|
|
public static void setupCookies(final String cookieRaw) { |
|
|
|
final CookieStore cookieStore = NET_COOKIE_MANAGER.getCookieStore(); |
|
|
|
if (cookieRaw == "LOGOUT") { |
|
|
|
final CookieStore cookieStore = NET_COOKIE_MANAGER.getCookieStore(); |
|
|
|
cookieStore.removeAll(); |
|
|
|
} |
|
|
|
else if (cookieRaw != null && !isEmpty(cookieRaw)) { |
|
|
|
final CookieStore cookieStore = NET_COOKIE_MANAGER.getCookieStore(); |
|
|
|
try { |
|
|
|
final URI uri1 = new URI("https://instagram.com"); |
|
|
|
final URI uri2 = new URI("https://instagram.com/"); |
|
|
|