// Path: app/src/main/java/se/oort/diplicity/apigen/PhaseMeta.java
// public class PhaseMeta implements java.io.Serializable {
//   public Long PhaseOrdinal;
//   public String Season;
//   public Long Year;
//   public String Type;
//   public Boolean Resolved;
//   public java.util.Date CreatedAt;
//   public Ticker CreatedAgo;
//   public java.util.Date ResolvedAt;
//   public Ticker ResolvedAgo;
//   public java.util.Date DeadlineAt;
//   public Ticker NextDeadlineIn;
//   public String UnitsJSON;
//   public String SCsJSON;
// }
// 
// Path: app/src/main/java/se/oort/diplicity/apigen/Ticker.java
// public class Ticker implements java.io.Serializable {
//   public Long nanos;
//   public Date unserializedAt;
//   public Ticker(Date unserializedAt, Long nanos) {
//     this.unserializedAt = unserializedAt;
//     this.nanos = nanos;
//   }
//   public Date createdAt() {
// 		Calendar cal = Calendar.getInstance();
// 		cal.setTime(unserializedAt);
// 		cal.add(Calendar.SECOND, (int) (nanos / (long) -1000000000));
// 		return cal.getTime();
// 	}
//   public Date deadlineAt() {
// 		Calendar cal = Calendar.getInstance();
// 		cal.setTime(unserializedAt);
// 		cal.add(Calendar.SECOND, (int) (nanos / (long) 1000000000));
// 		return cal.getTime();
// 	}
// 	public Long millisLeft() {
// 		return (long) (deadlineAt().getTime() - unserializedAt.getTime());
// 	}
// }
// 
// Path: app/src/main/java/se/oort/diplicity/apigen/TickerUnserializer.java
// public class TickerUnserializer implements JsonDeserializer<Ticker> {
//   public Ticker deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
//     return new Ticker(new Date(), json.getAsLong());
//   }
// }


import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Handler;
import android.support.v4.app.NotificationCompat;
import android.util.Base64;
import android.util.Log;
import com.google.android.gms.tasks.RuntimeExecutionException;
import com.google.firebase.messaging.RemoteMessage;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.io.UnsupportedEncodingException;
import java.util.AbstractSet;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.zip.DataFormatException;
import java.util.zip.Inflater;
import se.oort.diplicity.apigen.PhaseMeta;
import se.oort.diplicity.apigen.Ticker;
import se.oort.diplicity.apigen.TickerUnserializer;
package se.oort.diplicity;





// MessagingService receives messages from FCM when the app is turned on as the message
// arrives.
public class MessagingService extends com.google.firebase.messaging.FirebaseMessagingService {

    private Handler handler = new Handler();

    public static final String FCM_NOTIFY_ACTION = "se.oort.diplicity.FCMNotify";

    public static Set<RetrofitActivity> messageSubscribers = new AbstractSet<RetrofitActivity>() {
        private Map<RetrofitActivity, Object> backend = new ConcurrentHashMap<RetrofitActivity, Object>();
        @Override
        public boolean add(RetrofitActivity i) {
            boolean rval = backend.containsKey(i);
            backend.put(i, new Object());
            return rval;
        }
        @Override
        public boolean remove(Object i) {
// Path: app/src/main/java/se/oort/diplicity/apigen/PhaseMeta.java
// public class PhaseMeta implements java.io.Serializable {
//   public Long PhaseOrdinal;
//   public String Season;
//   public Long Year;
//   public String Type;
//   public Boolean Resolved;
//   public java.util.Date CreatedAt;
//   public Ticker CreatedAgo;
//   public java.util.Date ResolvedAt;
//   public Ticker ResolvedAgo;
//   public java.util.Date DeadlineAt;
//   public Ticker NextDeadlineIn;
//   public String UnitsJSON;
//   public String SCsJSON;
// }
// 
// Path: app/src/main/java/se/oort/diplicity/apigen/Ticker.java
// public class Ticker implements java.io.Serializable {
//   public Long nanos;
//   public Date unserializedAt;
//   public Ticker(Date unserializedAt, Long nanos) {
//     this.unserializedAt = unserializedAt;
//     this.nanos = nanos;
//   }
//   public Date createdAt() {
// 		Calendar cal = Calendar.getInstance();
// 		cal.setTime(unserializedAt);
// 		cal.add(Calendar.SECOND, (int) (nanos / (long) -1000000000));
// 		return cal.getTime();
// 	}
//   public Date deadlineAt() {
// 		Calendar cal = Calendar.getInstance();
// 		cal.setTime(unserializedAt);
// 		cal.add(Calendar.SECOND, (int) (nanos / (long) 1000000000));
// 		return cal.getTime();
// 	}
// 	public Long millisLeft() {
// 		return (long) (deadlineAt().getTime() - unserializedAt.getTime());
// 	}
// }
// 
// Path: app/src/main/java/se/oort/diplicity/apigen/TickerUnserializer.java
// public class TickerUnserializer implements JsonDeserializer<Ticker> {
//   public Ticker deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
//     return new Ticker(new Date(), json.getAsLong());
//   }
// }


// Path: app/src/main/java/se/oort/diplicity/MessagingService.java
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Handler;
import android.support.v4.app.NotificationCompat;
import android.util.Base64;
import android.util.Log;
import com.google.android.gms.tasks.RuntimeExecutionException;
import com.google.firebase.messaging.RemoteMessage;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.io.UnsupportedEncodingException;
import java.util.AbstractSet;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.zip.DataFormatException;
import java.util.zip.Inflater;
import se.oort.diplicity.apigen.PhaseMeta;
import se.oort.diplicity.apigen.Ticker;
import se.oort.diplicity.apigen.TickerUnserializer;

package se.oort.diplicity;





// MessagingService receives messages from FCM when the app is turned on as the message
// arrives.
public class MessagingService extends com.google.firebase.messaging.FirebaseMessagingService {

    private Handler handler = new Handler();

    public static final String FCM_NOTIFY_ACTION = "se.oort.diplicity.FCMNotify";

    public static Set<RetrofitActivity> messageSubscribers = new AbstractSet<RetrofitActivity>() {
        private Map<RetrofitActivity, Object> backend = new ConcurrentHashMap<RetrofitActivity, Object>();
        @Override
        public boolean add(RetrofitActivity i) {
            boolean rval = backend.containsKey(i);
            backend.put(i, new Object());
            return rval;
        }
        @Override
        public boolean remove(Object i) {
            boolean rval = backend.containsKey(i);