throws NoSuchAlgorithmException, InvalidKeySpecException {
char[] password = generatePassword(context);
- KeySpec keySpec = new PBEKeySpec(password, SALT, 1024, 256);
+ //KeySpec keySpec = new PBEKeySpec(password, SALT, 1024, 256);
+ KeySpec keySpec = new PBEKeySpec(password, SALT, 256, 64);
SecretKeyFactory factory = SecretKeyFactory
.getInstance("PBEWITHSHAAND256BITAES-CBC-BC");
SecretKey secretKey = factory.generateSecret(keySpec);
public class OAuthUtil {
private static final String CONSUMER_KEY = "yuji-k64613";
- private static final String CONSUMER_SECRET = "98b2cbf35f747d2d";
+ // TODO
+ // Debian
+ //private static final String CONSUMER_SECRET = "G5r7t1nHC+AIf6dYHuIVC7Jr/iVIMtgMZ0PObN6xV2Q=";
+ // Mac
+ private static final String CONSUMER_SECRET = "a/E89hlW9foWMh/ReopNucX+/WQ9WTs4YwvHP1cGH9s=" ;
private static final String APP_DATA_PATH = "/Android/data/com.yuji.em/temp/";
private static final String EVERNOTE_HOST = "www.evernote.com";
private static final String APP_VERSION = "1.0.0";
private static OAuthUtil instance = null;
+ private static String consumerSecret = null;
private EvernoteSession session;
public static OAuthUtil getInstance() {
}
public EvernoteSession setupSession(Context context) {
+ if (consumerSecret == null){
+ Encryption en = Encryption.getInstance();
+ //String s = en.getEncrypted(context, "");
+ consumerSecret = en.getDecrypted(context, CONSUMER_SECRET);
+ }
+
ApplicationInfo info = new ApplicationInfo(CONSUMER_KEY,
- CONSUMER_SECRET, EVERNOTE_HOST, APP_NAME, APP_VERSION);
+ consumerSecret, EVERNOTE_HOST, APP_NAME, APP_VERSION);
// Retrieve persisted authentication information
session = new EvernoteSession(info,