// Path: AndroidVault/vault/src/main/java/com/bottlerocketstudios/vault/SharedPreferenceVault.java
// public interface SharedPreferenceVault extends SharedPreferences {
//     /**
//      * Remove all stored values and destroy cryptographic keys associated with the vault instance.
//      * <strong>This will permanently destroy all data in the preference file.</strong>
//      */
//     void clearStorage();
// 
//     /**
//      * Remove all stored values and destroy cryptographic keys associated with the vault instance.
//      * Configure the vault to use the newly provided key for future data.
//      * <strong>This will permanently destroy all data in the preference file.</strong>
//      */
//     void rekeyStorage(SecretKey secretKey);
// 
//     /**
//      * Arbitrarily set the secret key to a specific value without removing any stored values. This is primarily
//      * designed for {@link com.bottlerocketstudios.vault.keys.storage.MemoryOnlyKeyStorage} and typical
//      * usage would be through the {@link #rekeyStorage(SecretKey)} method.
//      * <strong>If this key is not the right key, existing data may become permanently unreadable.</strong>
//      */
//     void setKey(SecretKey secretKey);
// 
//     /**
//      * Determine if this instance of storage currently has a valid key with which to encrypt values.
//      */
//     boolean isKeyAvailable();
// 
//     /**
//      * Enable or disable logging operations.
//      */
//     void setDebugEnabled(boolean enabled);
// 
//     /**
//      * Determine if logging is enabled.
//      */
//     boolean isDebugEnabled();
// 
//     /**
//      * Method to find out expected security level of KeyStorage implementation being used.
//      */
//     KeyStorageType getKeyStorageType();
// }


import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import com.bottlerocketstudios.vault.SharedPreferenceVault;
import com.bottlerocketstudios.vaultsampleapplication.R;
package com.bottlerocketstudios.vaultsampleapplication.ui;



/**
 * Basis for every activity that contains a secret text field.
 */
public abstract class BaseSecretActivity extends AppCompatActivity {
    private static final String TAG = BaseSecretActivity.class.getSimpleName();

    protected static final int REQUEST_CODE_FIX_LOAD = 123;
    protected static final int REQUEST_CODE_FIX_SAVE = 124;

    private static final String PREF_SECRET = "theSecret";

    protected EditText mSecretText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(getContentViewLayoutId());

        mSecretText = (EditText) findViewById(R.id.secret_text);
        wireClick(R.id.load_secret, mClickListener);
        wireClick(R.id.save_secret, mClickListener);
    }

    protected abstract int getContentViewLayoutId();

// Path: AndroidVault/vault/src/main/java/com/bottlerocketstudios/vault/SharedPreferenceVault.java
// public interface SharedPreferenceVault extends SharedPreferences {
//     /**
//      * Remove all stored values and destroy cryptographic keys associated with the vault instance.
//      * <strong>This will permanently destroy all data in the preference file.</strong>
//      */
//     void clearStorage();
// 
//     /**
//      * Remove all stored values and destroy cryptographic keys associated with the vault instance.
//      * Configure the vault to use the newly provided key for future data.
//      * <strong>This will permanently destroy all data in the preference file.</strong>
//      */
//     void rekeyStorage(SecretKey secretKey);
// 
//     /**
//      * Arbitrarily set the secret key to a specific value without removing any stored values. This is primarily
//      * designed for {@link com.bottlerocketstudios.vault.keys.storage.MemoryOnlyKeyStorage} and typical
//      * usage would be through the {@link #rekeyStorage(SecretKey)} method.
//      * <strong>If this key is not the right key, existing data may become permanently unreadable.</strong>
//      */
//     void setKey(SecretKey secretKey);
// 
//     /**
//      * Determine if this instance of storage currently has a valid key with which to encrypt values.
//      */
//     boolean isKeyAvailable();
// 
//     /**
//      * Enable or disable logging operations.
//      */
//     void setDebugEnabled(boolean enabled);
// 
//     /**
//      * Determine if logging is enabled.
//      */
//     boolean isDebugEnabled();
// 
//     /**
//      * Method to find out expected security level of KeyStorage implementation being used.
//      */
//     KeyStorageType getKeyStorageType();
// }


// Path: SampleApplication/app/src/main/java/com/bottlerocketstudios/vaultsampleapplication/ui/BaseSecretActivity.java
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import com.bottlerocketstudios.vault.SharedPreferenceVault;
import com.bottlerocketstudios.vaultsampleapplication.R;

package com.bottlerocketstudios.vaultsampleapplication.ui;



/**
 * Basis for every activity that contains a secret text field.
 */
public abstract class BaseSecretActivity extends AppCompatActivity {
    private static final String TAG = BaseSecretActivity.class.getSimpleName();

    protected static final int REQUEST_CODE_FIX_LOAD = 123;
    protected static final int REQUEST_CODE_FIX_SAVE = 124;

    private static final String PREF_SECRET = "theSecret";

    protected EditText mSecretText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(getContentViewLayoutId());

        mSecretText = (EditText) findViewById(R.id.secret_text);
        wireClick(R.id.load_secret, mClickListener);
        wireClick(R.id.save_secret, mClickListener);
    }

    protected abstract int getContentViewLayoutId();

    protected abstract SharedPreferenceVault getVault();