2013-08-15 17:49:06 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2011 Whisper Systems
|
2013-11-10 12:15:29 +00:00
|
|
|
* Copyright (C) 2013 Open Whisper Systems
|
2013-08-15 17:49:06 +00:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
package org.thoughtcrime.securesms;
|
|
|
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
|
|
|
import com.actionbarsherlock.view.Menu;
|
|
|
|
import com.actionbarsherlock.view.MenuInflater;
|
|
|
|
import com.actionbarsherlock.view.MenuItem;
|
2014-04-10 03:02:46 +00:00
|
|
|
|
2013-08-15 17:49:06 +00:00
|
|
|
import org.thoughtcrime.securesms.crypto.IdentityKeyUtil;
|
2014-04-21 15:40:19 +00:00
|
|
|
import org.whispersystems.textsecure.crypto.IdentityKeyParcelable;
|
2013-08-15 17:49:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Activity that displays the local identity key and offers the option to regenerate it.
|
|
|
|
*
|
|
|
|
* @author Moxie Marlinspike
|
|
|
|
*/
|
|
|
|
public class ViewLocalIdentityActivity extends ViewIdentityActivity {
|
|
|
|
|
|
|
|
public void onCreate(Bundle bundle) {
|
2014-04-21 15:40:19 +00:00
|
|
|
getIntent().putExtra(ViewIdentityActivity.IDENTITY_KEY,
|
|
|
|
new IdentityKeyParcelable(IdentityKeyUtil.getIdentityKey(this)));
|
|
|
|
getIntent().putExtra(ViewIdentityActivity.TITLE,
|
|
|
|
getString(R.string.ViewIdentityActivity_my_identity_fingerprint));
|
2013-08-15 17:49:06 +00:00
|
|
|
super.onCreate(bundle);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onPrepareOptionsMenu(Menu menu) {
|
|
|
|
super.onPrepareOptionsMenu(menu);
|
|
|
|
|
|
|
|
MenuInflater inflater = this.getSupportMenuInflater();
|
|
|
|
inflater.inflate(R.menu.local_identity, menu);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
|
super.onOptionsItemSelected(item);
|
|
|
|
|
|
|
|
switch (item.getItemId()) {
|
2014-04-21 15:40:19 +00:00
|
|
|
case android.R.id.home:finish(); return true;
|
2013-08-15 17:49:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|