1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-12-23 05:16:58 +00:00

logout optimization

This commit is contained in:
Austin Huang 2020-08-07 12:42:14 -04:00
parent 4e0f837ff3
commit dbc1295be6
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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/");