Browse Source

fix android 6 cookie problem

legacy
Austin Huang 4 years ago
parent
commit
86a90aff5c
No known key found for this signature in database GPG Key ID: 84C23AA04587A91F
  1. 4
      app/src/main/java/awais/instagrabber/utils/Utils.java

4
app/src/main/java/awais/instagrabber/utils/Utils.java

@ -142,10 +142,10 @@ public final class Utils {
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/");
final URI uri3 = new URI("https://i.instagram.com/"); final URI uri3 = new URI("https://i.instagram.com/");
for (final String cookie : cookieRaw.split(";")) {
for (final String cookie : cookieRaw.split("; ")) {
final String[] strings = cookie.split("=", 2); final String[] strings = cookie.split("=", 2);
final HttpCookie httpCookie = new HttpCookie(strings[0].trim(), strings[1].trim()); final HttpCookie httpCookie = new HttpCookie(strings[0].trim(), strings[1].trim());
httpCookie.setDomain("instagram.com");
httpCookie.setDomain(".instagram.com");
httpCookie.setPath("/"); httpCookie.setPath("/");
httpCookie.setVersion(0); httpCookie.setVersion(0);
cookieStore.add(uri1, httpCookie); cookieStore.add(uri1, httpCookie);

Loading…
Cancel
Save