mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-12-23 05:16:58 +00:00
logout optimization
This commit is contained in:
parent
4e0f837ff3
commit
dbc1295be6
@ -185,11 +185,12 @@ public final class SettingsDialog extends BottomSheetDialogFragment implements V
|
|||||||
if (v == btnLogin) {
|
if (v == btnLogin) {
|
||||||
startActivity(new Intent(v.getContext(), Login.class));
|
startActivity(new Intent(v.getContext(), Login.class));
|
||||||
somethingChanged = true;
|
somethingChanged = true;
|
||||||
|
this.dismiss();
|
||||||
} else if (v == btnLogout) {
|
} else if (v == btnLogout) {
|
||||||
Utils.setupCookies("LOGOUT");
|
Utils.setupCookies("LOGOUT");
|
||||||
settingsHelper.putString(Constants.COOKIE, null);
|
settingsHelper.putString(Constants.COOKIE, "");
|
||||||
|
somethingChanged = true;
|
||||||
this.dismiss();
|
this.dismiss();
|
||||||
activity.recreate();
|
|
||||||
} else if (v == btnImportExport) {
|
} else if (v == btnImportExport) {
|
||||||
if (ContextCompat.checkSelfPermission(activity, Utils.PERMS[0]) == PackageManager.PERMISSION_DENIED)
|
if (ContextCompat.checkSelfPermission(activity, Utils.PERMS[0]) == PackageManager.PERMISSION_DENIED)
|
||||||
requestPermissions(Utils.PERMS, 6007);
|
requestPermissions(Utils.PERMS, 6007);
|
||||||
|
@ -123,12 +123,11 @@ public final class Utils {
|
|||||||
public static SimpleDateFormat datetimeParser;
|
public static SimpleDateFormat datetimeParser;
|
||||||
|
|
||||||
public static void setupCookies(final String cookieRaw) {
|
public static void setupCookies(final String cookieRaw) {
|
||||||
|
final CookieStore cookieStore = NET_COOKIE_MANAGER.getCookieStore();
|
||||||
if (cookieRaw == "LOGOUT") {
|
if (cookieRaw == "LOGOUT") {
|
||||||
final CookieStore cookieStore = NET_COOKIE_MANAGER.getCookieStore();
|
|
||||||
cookieStore.removeAll();
|
cookieStore.removeAll();
|
||||||
}
|
}
|
||||||
else if (cookieRaw != null && !isEmpty(cookieRaw)) {
|
else if (cookieRaw != null && !isEmpty(cookieRaw)) {
|
||||||
final CookieStore cookieStore = NET_COOKIE_MANAGER.getCookieStore();
|
|
||||||
try {
|
try {
|
||||||
final URI uri1 = new URI("https://instagram.com");
|
final URI uri1 = new URI("https://instagram.com");
|
||||||
final URI uri2 = new URI("https://instagram.com/");
|
final URI uri2 = new URI("https://instagram.com/");
|
||||||
|
Loading…
Reference in New Issue
Block a user