Skip to content

Instantly share code, notes, and snippets.

@redspirit
Created October 3, 2017 14:14
Show Gist options
  • Save redspirit/03b859e9874c9664d0c896e323ae8524 to your computer and use it in GitHub Desktop.
Save redspirit/03b859e9874c9664d0c896e323ae8524 to your computer and use it in GitHub Desktop.
class
package com.farpost.android.httpbox.a;
import android.net.Uri;
import com.farpost.android.httpbox.c;
import com.farpost.android.httpbox.o;
import com.farpost.android.httpbox.o.a;
import com.farpost.android.httpbox.o.b;
import com.farpost.android.httpbox.q;
import com.farpost.android.httpbox.y;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
public class a
extends com.farpost.android.httpbox.d
{
private final String j;
private final String k;
public a(String paramString1, String paramString2)
{
this.j = paramString1;
this.k = paramString2;
}
private String a(List<o.b> paramList, int paramInt)
{
Object localObject2 = new TreeMap();
Iterator localIterator = paramList.iterator();
while (localIterator.hasNext())
{
o.b localb = (o.b)localIterator.next();
o.a locala = (o.a)localb.a().get(paramInt);
localObject1 = (List)((Map)localObject2).get(locala.a());
paramList = (List<o.b>)localObject1;
if (localObject1 == null)
{
paramList = new ArrayList();
((Map)localObject2).put(locala.a(), paramList);
}
paramList.add(localb);
}
paramList = new StringBuilder();
Object localObject1 = ((Map)localObject2).values().iterator();
while (((Iterator)localObject1).hasNext())
{
localObject2 = (List)((Iterator)localObject1).next();
if (b((List)localObject2, paramInt)) {
paramList.append(a((List)localObject2, paramInt + 1));
} else {
paramList.append(b((List)localObject2));
}
}
return paramList.toString();
}
private String b(List<o.b> paramList)
{
if (paramList.size() == 0) {
return "";
}
StringBuilder localStringBuilder = new StringBuilder();
paramList = paramList.iterator();
while (paramList.hasNext()) {
localStringBuilder.append(String.valueOf(((o.b)paramList.next()).c())).append(',');
}
localStringBuilder.deleteCharAt(localStringBuilder.length() - 1);
return localStringBuilder.toString();
}
private boolean b(List<o.b> paramList, int paramInt)
{
if (paramList.size() <= 1) {
return false;
}
paramList = paramList.iterator();
while (paramList.hasNext())
{
Object localObject = ((o.b)paramList.next()).a();
if (((List)localObject).size() != paramInt + 1)
{
localObject = (o.a)((List)localObject).get(paramInt + 1);
if ((((o.a)localObject).c()) && (((o.a)localObject).b())) {
return true;
}
}
}
return false;
}
public q a()
{
if (this.e == null) {
this.e = new com.farpost.android.httpbox.b.d();
}
if (this.f == null) {
this.f = new com.farpost.android.httpbox.b.d();
}
if ((this.c.equals("GET")) || (this.c.equals("DELETE"))) {}
for (Object localObject1 = this.e;; localObject1 = this.f)
{
((o)localObject1).a("app_id", this.j);
((o)localObject1).a("timestamp", Long.valueOf(System.currentTimeMillis()));
localObject2 = new com.farpost.android.httpbox.b.d();
((o)localObject2).a(this.e.a());
if (this.d == null) {
break;
}
Iterator localIterator = this.d.entrySet().iterator();
while (localIterator.hasNext())
{
Map.Entry localEntry = (Map.Entry)localIterator.next();
((o)localObject2).a((String)localEntry.getKey(), localEntry.getValue());
}
}
((o)localObject2).a(this.f.a());
Object localObject2 = Arrays.asList(((o)localObject2).a());
((o)localObject1).a("secret", com.farpost.android.commons.c.d.a(a((List)localObject2, 0) + this.k));
localObject2 = a(this.a, this.d);
localObject2 = this.e.a((String)localObject2);
if (this.h) {
localObject1 = new y(this.g, (o)localObject1);
}
for (;;)
{
return new c(this.b, ((Uri)localObject2).toString(), localObject1, this.c);
if (this.f == null) {
localObject1 = null;
} else {
localObject1 = this.f.b();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment