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;
|
2014-12-15 20:25:55 +00:00
|
|
|
import android.support.annotation.NonNull;
|
2014-06-29 03:40:57 +00:00
|
|
|
import android.view.Menu;
|
|
|
|
import android.view.MenuInflater;
|
|
|
|
import android.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-11-03 23:16:04 +00:00
|
|
|
import org.thoughtcrime.securesms.crypto.IdentityKeyParcelable;
|
2014-12-15 20:25:55 +00:00
|
|
|
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
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 {
|
|
|
|
|
2014-12-15 20:25:55 +00:00
|
|
|
@Override
|
|
|
|
protected void onCreate(Bundle icicle, @NonNull MasterSecret masterSecret) {
|
2014-04-21 15:40:19 +00:00
|
|
|
getIntent().putExtra(ViewIdentityActivity.IDENTITY_KEY,
|
|
|
|
new IdentityKeyParcelable(IdentityKeyUtil.getIdentityKey(this)));
|
|
|
|
getIntent().putExtra(ViewIdentityActivity.TITLE,
|
2015-11-05 18:22:10 +00:00
|
|
|
getString(R.string.ViewIdentityActivity_your_identity_fingerprint));
|
2014-12-15 20:25:55 +00:00
|
|
|
super.onCreate(icicle, masterSecret);
|
2013-08-15 17:49:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onPrepareOptionsMenu(Menu menu) {
|
|
|
|
super.onPrepareOptionsMenu(menu);
|
|
|
|
|
2014-06-29 03:40:57 +00:00
|
|
|
MenuInflater inflater = this.getMenuInflater();
|
2013-08-15 17:49:06 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|