package epson.server.service;

import android.content.Context;
import com.epson.iprint.storage.SecureKeyStore;
import com.evernote.client.android.EvernoteSession;

public class EvernoteClient {
    static EvernoteSession session;

    public static EvernoteSession getEvernoteSession(Context context) {
        EvernoteSession evernoteSession = session;
        if (evernoteSession != null) {
            return evernoteSession;
        }
        session = new EvernoteSession.Builder(context).setEvernoteService(EvernoteSession.EvernoteService.PRODUCTION).setSupportAppLinkedNotebooks(false).build(new SecureKeyStore().getApiKeyB(context), new SecureKeyStore().getSecKeyB(context)).asSingleton();
        return session;
    }

    public static void logout(Context context) {
        try {
            getEvernoteSession(context).logOut();
        } catch (Exception unused) {
        }
    }
}
