This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TokenManager { | |
private static final String TAG = TokenManager.class.getName(); | |
private static TokenManager instance; | |
private String token; | |
private TokenManager() { | |
token = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class APIKeyInterceptor implements Interceptor { | |
private static final String SECRET_KEY_HEADER = "secret_key"; | |
private static final String UUID_HEADER = "uuid"; | |
private static final String TAG = "APIKeyInterceptor"; | |
@Override | |
public Response intercept(Chain chain) throws IOException { | |
Request request = chain.request(); | |
Log.d(TAG, "intercept ===============> "+request.url()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TokenInterceptor implements Interceptor { | |
private static final String TAG = TokenManager.class.getName(); | |
private static final String header = "X-Header"; | |
/** | |
* Constructor for Token interceptor | |
*/ | |
public TokenInterceptor() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by ChrisC on 22/05/17. | |
*/ | |
public enum RestClient { | |
INSTANCE; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Handler; | |
import android.os.Looper; | |
import com.squareup.otto.Bus; | |
/** | |
* Maintains a singleton instance for obtaining the bus. Ideally this would be replaced with a more efficient means | |
* such as through injection directly into interested classes. | |
* <p> | |
* Created by ChrisC on 17/05/17. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.twinpeek.android.app; | |
import java.io.File; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.NoSuchProviderException; | |
import android.content.Context; | |
import android.content.pm.ApplicationInfo; | |
import android.content.pm.PackageInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replaces firewalld by iptables: | |
# yum install iptables-services | |
# yum install ebtables | |
# yum install ipset-service | |
# systemctl mask --now firewalld.service // disable firewalld | |
# systemctl status iptables.service // should be inactive | |
# systemctl enable --now iptables.service | |
# systemctl enable --now ip6tables.service | |
# systemctl enable --now etables.service |
NewerOlder