// Path: app/src/main/java/eu/se_bastiaan/popcorntimeremote/utils/LogUtils.java
// public final class LogUtils {
// 
//     private static final String LOG_UTILS = "LogUtils";
// 
//     private LogUtils() throws InstantiationException {
//         throw new InstantiationException("This class is not created for instantiation");
//     }
// 
//     public static void d(Object message) {
//         d(LOG_UTILS, message);
//     }
// 
//     public static void d(Object tag, Object message) {
//         if (Constants.LOG_ENABLED) {
//             Log.d(tag.toString(), message.toString());
//         }
//     }
// 
//     public static void v(Object message) {
//         v(LOG_UTILS, message);
//     }
// 
//     public static void v(Object tag, Object message) {
//         if (Constants.LOG_ENABLED) {
//             Log.v(tag.toString(), message.toString());
//         }
//     }
// 
//     public static void e(Object message) {
//         e(LOG_UTILS, message);
//     }
// 
//     public static void e(Object tag, Object message) {
//         if (Constants.LOG_ENABLED) {
//             Log.e(tag.toString(), message.toString());
//         }
//     }
// 
//     public static void e(Object tag, Object message, Throwable t) {
//         if (Constants.LOG_ENABLED) {
//             Log.e(tag.toString(), message.toString(), t);
//         }
//     }
// 
//     public static void w(Object message) {
//         w(LOG_UTILS, message);
//     }
// 
//     public static void w(Object tag, Object message) {
//         if (Constants.LOG_ENABLED) {
//             Log.w(tag.toString(), message.toString());
//         }
//     }
// 
// }
// 
// Path: app/src/main/java/eu/se_bastiaan/popcorntimeremote/utils/Version.java
// public class Version implements Comparable<Version> {
// 
//     private final String version;
// 
//     public Version(String version) {
//         if(version == null)
//             throw new IllegalArgumentException("Version can not be null");
//         if(!version.matches("[0-9]+(\\.[0-9]+)+(\\-[0-9]+)*"))
//             throw new IllegalArgumentException("Invalid version format");
//         this.version = version;
//     }
// 
//     public final String get() {
//         return this.version;
//     }
// 
//     @Override
//     public int compareTo(Version that) {
//         if(that == null)
//             return 1;
//         String[] thisParts = this.get().split("\\.|\\-");
//         String[] thatParts = that.get().split("\\.|\\-");
//         int length = Math.max(thisParts.length, thatParts.length);
//         for(int i = 0; i < length; i++) {
//             int thisPart = i < thisParts.length ?
//                     Integer.parseInt(thisParts[i]) : 0;
//             int thatPart = i < thatParts.length ?
//                     Integer.parseInt(thatParts[i]) : 0;
//             if(thisPart < thatPart)
//                 return -1;
//             if(thisPart > thatPart)
//                 return 1;
//         }
//         return 0;
//     }
// 
//     @Override
//     public boolean equals(Object that) {
//         if(this == that)
//             return true;
//         if(that == null)
//             return false;
//         if(((Object) this).getClass() != that.getClass())
//             return false;
//         return this.compareTo((Version) that) == 0;
//     }
// 
//     /**
//      * Test if version1 is higher than version2.
//      * @param version1
//      * @param version2
//      * @return {code: true} when version1 is higher than version2.
//      */
//     public static boolean compare(String version1, String version2) {
//         Version v1 = new Version(version1);
//         Version v2 = new Version(version2);
//         if(v1.compareTo(v2) > 0) {
//             return true;
//         }
//         return false;
//     }
// 
// }


import android.util.Log;
import com.google.gson.Gson;
import com.google.gson.internal.LinkedTreeMap;
import com.squareup.okhttp.Authenticator;
import com.squareup.okhttp.Call;
import com.squareup.okhttp.Callback;
import com.squareup.okhttp.Credentials;
import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response;
import java.io.IOException;
import java.net.Proxy;
import java.util.ArrayList;
import java.util.Arrays;
import eu.se_bastiaan.popcorntimeremote.utils.LogUtils;
import eu.se_bastiaan.popcorntimeremote.utils.Version;
        return request(request, callback);
    }

    public Call down(Callback callback) {
        RpcRequest request  = new RpcRequest("down", RequestId.DOWN);
        return request(request, callback);
    }

    public Call left(Callback callback) {
        RpcRequest request  = new RpcRequest("left", RequestId.LEFT);
        return request(request, callback);
    }

    public Call right(Callback callback) {
        RpcRequest request  = new RpcRequest("right", RequestId.RIGHT);
        return request(request, callback);
    }

    public Call enter(Callback callback) {
        RpcRequest request  = new RpcRequest("enter", RequestId.ENTER);
        return request(request, callback);
    }

    public Call back(Callback callback) {
        RpcRequest request  = new RpcRequest("back", RequestId.BACK);
        return request(request, callback);
    }

    public Call toggleQuality(Callback callback) {
        RpcRequest request;
// Path: app/src/main/java/eu/se_bastiaan/popcorntimeremote/utils/LogUtils.java
// public final class LogUtils {
// 
//     private static final String LOG_UTILS = "LogUtils";
// 
//     private LogUtils() throws InstantiationException {
//         throw new InstantiationException("This class is not created for instantiation");
//     }
// 
//     public static void d(Object message) {
//         d(LOG_UTILS, message);
//     }
// 
//     public static void d(Object tag, Object message) {
//         if (Constants.LOG_ENABLED) {
//             Log.d(tag.toString(), message.toString());
//         }
//     }
// 
//     public static void v(Object message) {
//         v(LOG_UTILS, message);
//     }
// 
//     public static void v(Object tag, Object message) {
//         if (Constants.LOG_ENABLED) {
//             Log.v(tag.toString(), message.toString());
//         }
//     }
// 
//     public static void e(Object message) {
//         e(LOG_UTILS, message);
//     }
// 
//     public static void e(Object tag, Object message) {
//         if (Constants.LOG_ENABLED) {
//             Log.e(tag.toString(), message.toString());
//         }
//     }
// 
//     public static void e(Object tag, Object message, Throwable t) {
//         if (Constants.LOG_ENABLED) {
//             Log.e(tag.toString(), message.toString(), t);
//         }
//     }
// 
//     public static void w(Object message) {
//         w(LOG_UTILS, message);
//     }
// 
//     public static void w(Object tag, Object message) {
//         if (Constants.LOG_ENABLED) {
//             Log.w(tag.toString(), message.toString());
//         }
//     }
// 
// }
// 
// Path: app/src/main/java/eu/se_bastiaan/popcorntimeremote/utils/Version.java
// public class Version implements Comparable<Version> {
// 
//     private final String version;
// 
//     public Version(String version) {
//         if(version == null)
//             throw new IllegalArgumentException("Version can not be null");
//         if(!version.matches("[0-9]+(\\.[0-9]+)+(\\-[0-9]+)*"))
//             throw new IllegalArgumentException("Invalid version format");
//         this.version = version;
//     }
// 
//     public final String get() {
//         return this.version;
//     }
// 
//     @Override
//     public int compareTo(Version that) {
//         if(that == null)
//             return 1;
//         String[] thisParts = this.get().split("\\.|\\-");
//         String[] thatParts = that.get().split("\\.|\\-");
//         int length = Math.max(thisParts.length, thatParts.length);
//         for(int i = 0; i < length; i++) {
//             int thisPart = i < thisParts.length ?
//                     Integer.parseInt(thisParts[i]) : 0;
//             int thatPart = i < thatParts.length ?
//                     Integer.parseInt(thatParts[i]) : 0;
//             if(thisPart < thatPart)
//                 return -1;
//             if(thisPart > thatPart)
//                 return 1;
//         }
//         return 0;
//     }
// 
//     @Override
//     public boolean equals(Object that) {
//         if(this == that)
//             return true;
//         if(that == null)
//             return false;
//         if(((Object) this).getClass() != that.getClass())
//             return false;
//         return this.compareTo((Version) that) == 0;
//     }
// 
//     /**
//      * Test if version1 is higher than version2.
//      * @param version1
//      * @param version2
//      * @return {code: true} when version1 is higher than version2.
//      */
//     public static boolean compare(String version1, String version2) {
//         Version v1 = new Version(version1);
//         Version v2 = new Version(version2);
//         if(v1.compareTo(v2) > 0) {
//             return true;
//         }
//         return false;
//     }
// 
// }


// Path: app/src/main/java/eu/se_bastiaan/popcorntimeremote/rpc/PopcornTimeRpcClient.java
import android.util.Log;
import com.google.gson.Gson;
import com.google.gson.internal.LinkedTreeMap;
import com.squareup.okhttp.Authenticator;
import com.squareup.okhttp.Call;
import com.squareup.okhttp.Callback;
import com.squareup.okhttp.Credentials;
import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response;
import java.io.IOException;
import java.net.Proxy;
import java.util.ArrayList;
import java.util.Arrays;
import eu.se_bastiaan.popcorntimeremote.utils.LogUtils;
import eu.se_bastiaan.popcorntimeremote.utils.Version;

        return request(request, callback);
    }

    public Call down(Callback callback) {
        RpcRequest request  = new RpcRequest("down", RequestId.DOWN);
        return request(request, callback);
    }

    public Call left(Callback callback) {
        RpcRequest request  = new RpcRequest("left", RequestId.LEFT);
        return request(request, callback);
    }

    public Call right(Callback callback) {
        RpcRequest request  = new RpcRequest("right", RequestId.RIGHT);
        return request(request, callback);
    }

    public Call enter(Callback callback) {
        RpcRequest request  = new RpcRequest("enter", RequestId.ENTER);
        return request(request, callback);
    }

    public Call back(Callback callback) {
        RpcRequest request  = new RpcRequest("back", RequestId.BACK);
        return request(request, callback);
    }

    public Call toggleQuality(Callback callback) {
        RpcRequest request;
        if(Version.compare(mVersion, ZERO_VERSION)) {