// Path: app/src/main/java/com/pushapp/press/interfaces/AuthenticationManager/AuthenticationDelegate.java
// public interface AuthenticationDelegate {
//     void didLoginSuccessfully();
//     void didReceiveErrorOnLogin();
// }
// 
// Path: app/src/main/java/com/pushapp/press/interfaces/RestApi.java
// public interface RestApi {
// 
//     @GET("/articles.json")
//     void getArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, Callback<ArticlePost> response);
// 
//     @GET("/articles.json")
//     void getArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, Callback<ArticlePost> response, @Query("categories")boolean categories);
// 
//     @GET("/articles.json")
//     void getArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("language")String language, Callback<ArticlePost> response);
// 
//     @GET("/articles.json")
//     void getArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("language")String language, @Query("categories")boolean categories, Callback<ArticlePost> response);
// 
//     @GET("/articles.json")
//     void getArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("start_date")long start_date,@Query("end_date")long end_date,@Query("pages")int pages,@Query("page_size")int page_size, Callback<ArticlePost> response);
// 
//     @GET("/articles.json")
//     void getArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("categories")boolean categories, @Query("start_date")long start_date,@Query("end_date")long end_date,@Query("pages")int pages,@Query("page_size")int page_size, Callback<ArticlePost> response);
// 
//     @GET("/articles.json")
//     void getArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("start_date")long start_date,@Query("end_date")long end_date,@Query("pages")int pages,@Query("page_size")int page_size, @Query("language")String language ,Callback<ArticlePost> response);
// 
//     @GET("/articles.json")
//     void getArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("categories")boolean categories,@Query("start_date")long start_date,@Query("end_date")long end_date,@Query("pages")int pages,@Query("page_size")int page_size, @Query("language")String language ,Callback<ArticlePost> response);
// 
//     @GET("/search.json")
//     void searchArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("q")String query,@Query("start_date")long start_date,@Query("end_date")long end_date,@Query("pages")int pages,@Query("page_size")int page_size,Callback<ArticlePost> response);
// 
//     @GET("/search.json")
//     void searchArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("q")String query,@Query("start_date")long start_date,@Query("end_date")long end_date,@Query("pages")int pages,@Query("page_size")int page_size,@Query("language")String language,Callback<ArticlePost> response);
// 
//     @GET("/article.json")
//     void getArticle(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("id")String id, Callback<ArticlePost> response);
// 
//     @GET("/article.json")
//     void getArticle(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("id")String id,@Query("language")String language, Callback<ArticlePost> response);
// 
//     @POST("/authenticate")
//     void login(@Body()HashMap body, Callback<LoginRequest> response);
//     //void login(@Query("installation_uuid")String installation_uuid, @Query("language")String language, @Query("username")String username, @Query("password")String password, Callback<LoginRequest> response);
// }
// 
// Path: app/src/main/java/com/pushapp/press/model/LoginRequest.java
// public class LoginRequest implements Serializable {
//     @SerializedName("code")
//     @Expose
//     private Integer code;
//     @SerializedName("status")
//     @Expose
//     private String status;
//     @SerializedName("api_key")
//     @Expose
//     private String apiKey;
//     @SerializedName("username")
//     @Expose
//     private String username;
// 
//     /**
//      *
//      * @return
//      * The code
//      */
//     public Integer getCode() {
//         return code;
//     }
// 
//     /**
//      *
//      * @return
//      * The status
//      */
//     public String getStatus() {
//         return status;
//     }
// 
//     /**
//      *
//      * @return
//      * The status
//      */
//     public String getApiKey() {
//         return apiKey;
//     }
// 
//     /**
//      *
//      * @return
//      * The status
//      */
//     public String getUsername() {
//         return username;
//     }
// 
// }


import android.content.Context;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;
import com.pushapp.press.R;
import com.pushapp.press.interfaces.AuthenticationManager.AuthenticationDelegate;
import com.pushapp.press.interfaces.RestApi;
import com.pushapp.press.model.LoginRequest;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import java.util.HashMap;
import java.util.Locale;
import retrofit.Callback;
import retrofit.RequestInterceptor;
import retrofit.RestAdapter;
import retrofit.RetrofitError;
import retrofit.client.Response;
package com.pushapp.press.util;





public class AuthenticationManager {
    public static AuthenticationManager authenticationManager;
    private Context applicationContext;
// Path: app/src/main/java/com/pushapp/press/interfaces/AuthenticationManager/AuthenticationDelegate.java
// public interface AuthenticationDelegate {
//     void didLoginSuccessfully();
//     void didReceiveErrorOnLogin();
// }
// 
// Path: app/src/main/java/com/pushapp/press/interfaces/RestApi.java
// public interface RestApi {
// 
//     @GET("/articles.json")
//     void getArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, Callback<ArticlePost> response);
// 
//     @GET("/articles.json")
//     void getArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, Callback<ArticlePost> response, @Query("categories")boolean categories);
// 
//     @GET("/articles.json")
//     void getArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("language")String language, Callback<ArticlePost> response);
// 
//     @GET("/articles.json")
//     void getArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("language")String language, @Query("categories")boolean categories, Callback<ArticlePost> response);
// 
//     @GET("/articles.json")
//     void getArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("start_date")long start_date,@Query("end_date")long end_date,@Query("pages")int pages,@Query("page_size")int page_size, Callback<ArticlePost> response);
// 
//     @GET("/articles.json")
//     void getArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("categories")boolean categories, @Query("start_date")long start_date,@Query("end_date")long end_date,@Query("pages")int pages,@Query("page_size")int page_size, Callback<ArticlePost> response);
// 
//     @GET("/articles.json")
//     void getArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("start_date")long start_date,@Query("end_date")long end_date,@Query("pages")int pages,@Query("page_size")int page_size, @Query("language")String language ,Callback<ArticlePost> response);
// 
//     @GET("/articles.json")
//     void getArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("categories")boolean categories,@Query("start_date")long start_date,@Query("end_date")long end_date,@Query("pages")int pages,@Query("page_size")int page_size, @Query("language")String language ,Callback<ArticlePost> response);
// 
//     @GET("/search.json")
//     void searchArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("q")String query,@Query("start_date")long start_date,@Query("end_date")long end_date,@Query("pages")int pages,@Query("page_size")int page_size,Callback<ArticlePost> response);
// 
//     @GET("/search.json")
//     void searchArticles(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("q")String query,@Query("start_date")long start_date,@Query("end_date")long end_date,@Query("pages")int pages,@Query("page_size")int page_size,@Query("language")String language,Callback<ArticlePost> response);
// 
//     @GET("/article.json")
//     void getArticle(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("id")String id, Callback<ArticlePost> response);
// 
//     @GET("/article.json")
//     void getArticle(@Query("installation_uuid")String installation_uuid, @Query("api_key")String api_key, @Query("id")String id,@Query("language")String language, Callback<ArticlePost> response);
// 
//     @POST("/authenticate")
//     void login(@Body()HashMap body, Callback<LoginRequest> response);
//     //void login(@Query("installation_uuid")String installation_uuid, @Query("language")String language, @Query("username")String username, @Query("password")String password, Callback<LoginRequest> response);
// }
// 
// Path: app/src/main/java/com/pushapp/press/model/LoginRequest.java
// public class LoginRequest implements Serializable {
//     @SerializedName("code")
//     @Expose
//     private Integer code;
//     @SerializedName("status")
//     @Expose
//     private String status;
//     @SerializedName("api_key")
//     @Expose
//     private String apiKey;
//     @SerializedName("username")
//     @Expose
//     private String username;
// 
//     /**
//      *
//      * @return
//      * The code
//      */
//     public Integer getCode() {
//         return code;
//     }
// 
//     /**
//      *
//      * @return
//      * The status
//      */
//     public String getStatus() {
//         return status;
//     }
// 
//     /**
//      *
//      * @return
//      * The status
//      */
//     public String getApiKey() {
//         return apiKey;
//     }
// 
//     /**
//      *
//      * @return
//      * The status
//      */
//     public String getUsername() {
//         return username;
//     }
// 
// }


// Path: app/src/main/java/com/pushapp/press/util/AuthenticationManager.java
import android.content.Context;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;
import com.pushapp.press.R;
import com.pushapp.press.interfaces.AuthenticationManager.AuthenticationDelegate;
import com.pushapp.press.interfaces.RestApi;
import com.pushapp.press.model.LoginRequest;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import java.util.HashMap;
import java.util.Locale;
import retrofit.Callback;
import retrofit.RequestInterceptor;
import retrofit.RestAdapter;
import retrofit.RetrofitError;
import retrofit.client.Response;

package com.pushapp.press.util;





public class AuthenticationManager {
    public static AuthenticationManager authenticationManager;
    private Context applicationContext;
    private RestApi restAPI;