91 lines
4.0 KiB
Java
91 lines
4.0 KiB
Java
package com.franmontiel.persistentcookiejar.persistence;
|
|
|
|
import c.q.a.k.a;
|
|
import d0.g0.t;
|
|
import d0.g0.w;
|
|
import d0.z.d.m;
|
|
import f0.n;
|
|
import java.io.IOException;
|
|
import java.io.ObjectInputStream;
|
|
import java.io.ObjectOutputStream;
|
|
import java.io.Serializable;
|
|
import java.util.Objects;
|
|
public class SerializableCookie implements Serializable {
|
|
public static final String i = SerializableCookie.class.getSimpleName();
|
|
private static final long serialVersionUID = -8594045714036645534L;
|
|
public transient n j;
|
|
|
|
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
|
|
boolean z2;
|
|
long j;
|
|
boolean z3;
|
|
String str = (String) objectInputStream.readObject();
|
|
m.checkParameterIsNotNull(str, "name");
|
|
if (m.areEqual(w.trim(str).toString(), str)) {
|
|
String str2 = (String) objectInputStream.readObject();
|
|
m.checkParameterIsNotNull(str2, "value");
|
|
if (m.areEqual(w.trim(str2).toString(), str2)) {
|
|
long readLong = objectInputStream.readLong();
|
|
long j2 = 253402300799999L;
|
|
if (readLong != -1) {
|
|
if (readLong <= 0) {
|
|
readLong = Long.MIN_VALUE;
|
|
}
|
|
if (readLong <= 253402300799999L) {
|
|
j2 = readLong;
|
|
}
|
|
j = j2;
|
|
z2 = true;
|
|
} else {
|
|
j = 253402300799999L;
|
|
z2 = false;
|
|
}
|
|
String str3 = (String) objectInputStream.readObject();
|
|
m.checkParameterIsNotNull(str3, "domain");
|
|
String c02 = a.c0(str3);
|
|
if (c02 != null) {
|
|
String str4 = (String) objectInputStream.readObject();
|
|
m.checkParameterIsNotNull(str4, "path");
|
|
if (t.startsWith$default(str4, "/", false, 2, null)) {
|
|
boolean z4 = objectInputStream.readBoolean();
|
|
boolean z5 = objectInputStream.readBoolean();
|
|
if (objectInputStream.readBoolean()) {
|
|
m.checkParameterIsNotNull(str3, "domain");
|
|
String c03 = a.c0(str3);
|
|
if (c03 != null) {
|
|
c02 = c03;
|
|
z3 = true;
|
|
} else {
|
|
throw new IllegalArgumentException(c.d.b.a.a.u("unexpected domain: ", str3));
|
|
}
|
|
} else {
|
|
z3 = false;
|
|
}
|
|
Objects.requireNonNull(str, "builder.name == null");
|
|
Objects.requireNonNull(str2, "builder.value == null");
|
|
Objects.requireNonNull(c02, "builder.domain == null");
|
|
this.j = new n(str, str2, j, c02, str4, z4, z5, z2, z3, null);
|
|
return;
|
|
}
|
|
throw new IllegalArgumentException("path must start with '/'".toString());
|
|
}
|
|
throw new IllegalArgumentException(c.d.b.a.a.u("unexpected domain: ", str3));
|
|
}
|
|
throw new IllegalArgumentException("value is not trimmed".toString());
|
|
}
|
|
throw new IllegalArgumentException("name is not trimmed".toString());
|
|
}
|
|
|
|
private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
|
|
objectOutputStream.writeObject(this.j.f);
|
|
objectOutputStream.writeObject(this.j.g);
|
|
n nVar = this.j;
|
|
objectOutputStream.writeLong(nVar.m ? nVar.h : -1);
|
|
objectOutputStream.writeObject(this.j.i);
|
|
objectOutputStream.writeObject(this.j.j);
|
|
objectOutputStream.writeBoolean(this.j.k);
|
|
objectOutputStream.writeBoolean(this.j.l);
|
|
objectOutputStream.writeBoolean(this.j.n);
|
|
}
|
|
}
|