android: Switch to AppCompat/Material theme and use custom Toolbar as AppBar
Also includes some whitespace/formatting changes due to the switch to Android Studio.
This commit is contained in:
@@ -66,7 +66,7 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".ui.TrustedCertificateImportActivity"
|
android:name=".ui.TrustedCertificateImportActivity"
|
||||||
android:label="@string/import_certificate"
|
android:label="@string/import_certificate"
|
||||||
android:theme="@android:style/Theme.Holo.Dialog.NoActionBar" >
|
android:theme="@style/Theme.AppCompat.Dialog" >
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
|||||||
+11
-11
@@ -15,21 +15,21 @@
|
|||||||
|
|
||||||
package org.strongswan.android.ui;
|
package org.strongswan.android.ui;
|
||||||
|
|
||||||
import java.io.File;
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import org.strongswan.android.R;
|
import org.strongswan.android.R;
|
||||||
import org.strongswan.android.data.LogContentProvider;
|
import org.strongswan.android.data.LogContentProvider;
|
||||||
import org.strongswan.android.logic.CharonVpnService;
|
import org.strongswan.android.logic.CharonVpnService;
|
||||||
|
|
||||||
import android.app.Activity;
|
import java.io.File;
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.pm.PackageManager.NameNotFoundException;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
public class LogActivity extends Activity
|
public class LogActivity extends AppCompatActivity
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState)
|
public void onCreate(Bundle savedInstanceState)
|
||||||
@@ -37,7 +37,7 @@ public class LogActivity extends Activity
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.log_activity);
|
setContentView(R.layout.log_activity);
|
||||||
|
|
||||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -74,7 +74,7 @@ public class LogActivity extends Activity
|
|||||||
}
|
}
|
||||||
|
|
||||||
Intent intent = new Intent(Intent.ACTION_SEND);
|
Intent intent = new Intent(Intent.ACTION_SEND);
|
||||||
intent.putExtra(Intent.EXTRA_EMAIL, new String[] { MainActivity.CONTACT_EMAIL });
|
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{MainActivity.CONTACT_EMAIL});
|
||||||
intent.putExtra(Intent.EXTRA_SUBJECT, String.format(getString(R.string.log_mail_subject), version));
|
intent.putExtra(Intent.EXTRA_SUBJECT, String.format(getString(R.string.log_mail_subject), version));
|
||||||
intent.setType("text/plain");
|
intent.setType("text/plain");
|
||||||
intent.putExtra(Intent.EXTRA_STREAM, LogContentProvider.createContentUri());
|
intent.putExtra(Intent.EXTRA_STREAM, LogContentProvider.createContentUri());
|
||||||
|
|||||||
+42
-27
@@ -17,19 +17,7 @@
|
|||||||
|
|
||||||
package org.strongswan.android.ui;
|
package org.strongswan.android.ui;
|
||||||
|
|
||||||
import org.strongswan.android.R;
|
|
||||||
import org.strongswan.android.data.VpnProfile;
|
|
||||||
import org.strongswan.android.data.VpnProfileDataSource;
|
|
||||||
import org.strongswan.android.data.VpnType.VpnTypeFeature;
|
|
||||||
import org.strongswan.android.logic.CharonVpnService;
|
|
||||||
import org.strongswan.android.logic.TrustedCertificateManager;
|
|
||||||
import org.strongswan.android.logic.VpnStateService;
|
|
||||||
import org.strongswan.android.logic.VpnStateService.State;
|
|
||||||
import org.strongswan.android.ui.VpnProfileListFragment.OnVpnProfileSelectedListener;
|
|
||||||
|
|
||||||
import android.app.ActionBar;
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
import android.app.AlertDialog.Builder;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.DialogFragment;
|
import android.app.DialogFragment;
|
||||||
@@ -46,6 +34,8 @@ import android.net.VpnService;
|
|||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
@@ -54,12 +44,24 @@ import android.view.Window;
|
|||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
public class MainActivity extends Activity implements OnVpnProfileSelectedListener
|
import org.strongswan.android.R;
|
||||||
|
import org.strongswan.android.data.VpnProfile;
|
||||||
|
import org.strongswan.android.data.VpnProfileDataSource;
|
||||||
|
import org.strongswan.android.data.VpnType.VpnTypeFeature;
|
||||||
|
import org.strongswan.android.logic.CharonVpnService;
|
||||||
|
import org.strongswan.android.logic.TrustedCertificateManager;
|
||||||
|
import org.strongswan.android.logic.VpnStateService;
|
||||||
|
import org.strongswan.android.logic.VpnStateService.State;
|
||||||
|
import org.strongswan.android.ui.VpnProfileListFragment.OnVpnProfileSelectedListener;
|
||||||
|
|
||||||
|
public class MainActivity extends AppCompatActivity implements OnVpnProfileSelectedListener
|
||||||
{
|
{
|
||||||
public static final String CONTACT_EMAIL = "[email protected]";
|
public static final String CONTACT_EMAIL = "[email protected]";
|
||||||
public static final String START_PROFILE = "org.strongswan.android.action.START_PROFILE";
|
public static final String START_PROFILE = "org.strongswan.android.action.START_PROFILE";
|
||||||
public static final String EXTRA_VPN_PROFILE_ID = "org.strongswan.android.VPN_PROFILE_ID";
|
public static final String EXTRA_VPN_PROFILE_ID = "org.strongswan.android.VPN_PROFILE_ID";
|
||||||
/** Use "bring your own device" (BYOD) features */
|
/**
|
||||||
|
* Use "bring your own device" (BYOD) features
|
||||||
|
*/
|
||||||
public static final boolean USE_BYOD = true;
|
public static final boolean USE_BYOD = true;
|
||||||
private static final int PREPARE_VPN_SERVICE = 0;
|
private static final int PREPARE_VPN_SERVICE = 0;
|
||||||
private static final String PROFILE_NAME = "org.strongswan.android.MainActivity.PROFILE_NAME";
|
private static final String PROFILE_NAME = "org.strongswan.android.MainActivity.PROFILE_NAME";
|
||||||
@@ -69,7 +71,8 @@ public class MainActivity extends Activity implements OnVpnProfileSelectedListen
|
|||||||
|
|
||||||
private Bundle mProfileInfo;
|
private Bundle mProfileInfo;
|
||||||
private VpnStateService mService;
|
private VpnStateService mService;
|
||||||
private final ServiceConnection mServiceConnection = new ServiceConnection() {
|
private final ServiceConnection mServiceConnection = new ServiceConnection()
|
||||||
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onServiceDisconnected(ComponentName name)
|
public void onServiceDisconnected(ComponentName name)
|
||||||
{
|
{
|
||||||
@@ -91,16 +94,18 @@ public class MainActivity extends Activity implements OnVpnProfileSelectedListen
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState)
|
public void onCreate(Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.main);
|
setContentView(R.layout.main);
|
||||||
|
|
||||||
|
ActionBar bar = getSupportActionBar();
|
||||||
|
bar.setDisplayShowHomeEnabled(true);
|
||||||
|
bar.setDisplayShowTitleEnabled(false);
|
||||||
|
bar.setIcon(R.drawable.ic_launcher);
|
||||||
|
|
||||||
this.bindService(new Intent(this, VpnStateService.class),
|
this.bindService(new Intent(this, VpnStateService.class),
|
||||||
mServiceConnection, Service.BIND_AUTO_CREATE);
|
mServiceConnection, Service.BIND_AUTO_CREATE);
|
||||||
|
|
||||||
ActionBar bar = getActionBar();
|
|
||||||
bar.setDisplayShowTitleEnabled(false);
|
|
||||||
|
|
||||||
/* load CA certificates in a background task */
|
/* load CA certificates in a background task */
|
||||||
new LoadCertificatesTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new LoadCertificatesTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
}
|
}
|
||||||
@@ -157,6 +162,7 @@ public class MainActivity extends Activity implements OnVpnProfileSelectedListen
|
|||||||
/**
|
/**
|
||||||
* Prepare the VpnService. If this succeeds the current VPN profile is
|
* Prepare the VpnService. If this succeeds the current VPN profile is
|
||||||
* started.
|
* started.
|
||||||
|
*
|
||||||
* @param profileInfo a bundle containing the information about the profile to be started
|
* @param profileInfo a bundle containing the information about the profile to be started
|
||||||
*/
|
*/
|
||||||
protected void prepareVpnService(Bundle profileInfo)
|
protected void prepareVpnService(Bundle profileInfo)
|
||||||
@@ -239,6 +245,7 @@ public class MainActivity extends Activity implements OnVpnProfileSelectedListen
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Start the given VPN profile asking the user for a password if required.
|
* Start the given VPN profile asking the user for a password if required.
|
||||||
|
*
|
||||||
* @param profileInfo data about the profile
|
* @param profileInfo data about the profile
|
||||||
*/
|
*/
|
||||||
private void startVpnProfile(Bundle profileInfo)
|
private void startVpnProfile(Bundle profileInfo)
|
||||||
@@ -257,6 +264,7 @@ public class MainActivity extends Activity implements OnVpnProfileSelectedListen
|
|||||||
/**
|
/**
|
||||||
* Start the VPN profile referred to by the given intent. Displays an error
|
* Start the VPN profile referred to by the given intent. Displays an error
|
||||||
* if the profile doesn't exist.
|
* if the profile doesn't exist.
|
||||||
|
*
|
||||||
* @param intent Intent that caused us to start this
|
* @param intent Intent that caused us to start this
|
||||||
*/
|
*/
|
||||||
private void startVpnProfile(Intent intent)
|
private void startVpnProfile(Intent intent)
|
||||||
@@ -291,11 +299,13 @@ public class MainActivity extends Activity implements OnVpnProfileSelectedListen
|
|||||||
{
|
{
|
||||||
setProgressBarIndeterminateVisibility(true);
|
setProgressBarIndeterminateVisibility(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TrustedCertificateManager doInBackground(Void... params)
|
protected TrustedCertificateManager doInBackground(Void... params)
|
||||||
{
|
{
|
||||||
return TrustedCertificateManager.getInstance().load();
|
return TrustedCertificateManager.getInstance().load();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(TrustedCertificateManager result)
|
protected void onPostExecute(TrustedCertificateManager result)
|
||||||
{
|
{
|
||||||
@@ -341,11 +351,12 @@ public class MainActivity extends Activity implements OnVpnProfileSelectedListen
|
|||||||
button = R.string.reconnect;
|
button = R.string.reconnect;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new AlertDialog.Builder(getActivity())
|
return new Builder(getActivity())
|
||||||
.setIcon(icon)
|
.setIcon(icon)
|
||||||
.setTitle(String.format(getString(title), profileInfo.getString(PROFILE_NAME)))
|
.setTitle(String.format(getString(title), profileInfo.getString(PROFILE_NAME)))
|
||||||
.setMessage(message)
|
.setMessage(message)
|
||||||
.setPositiveButton(button, new DialogInterface.OnClickListener() {
|
.setPositiveButton(button, new DialogInterface.OnClickListener()
|
||||||
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int whichButton)
|
public void onClick(DialogInterface dialog, int whichButton)
|
||||||
{
|
{
|
||||||
@@ -353,7 +364,8 @@ public class MainActivity extends Activity implements OnVpnProfileSelectedListen
|
|||||||
activity.startVpnProfile(profileInfo);
|
activity.startVpnProfile(profileInfo);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
|
.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener()
|
||||||
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which)
|
public void onClick(DialogInterface dialog, int which)
|
||||||
{
|
{
|
||||||
@@ -379,10 +391,11 @@ public class MainActivity extends Activity implements OnVpnProfileSelectedListen
|
|||||||
username.setText(profileInfo.getString(VpnProfileDataSource.KEY_USERNAME));
|
username.setText(profileInfo.getString(VpnProfileDataSource.KEY_USERNAME));
|
||||||
final EditText password = (EditText)view.findViewById(R.id.password);
|
final EditText password = (EditText)view.findViewById(R.id.password);
|
||||||
|
|
||||||
Builder adb = new AlertDialog.Builder(getActivity());
|
Builder adb = new Builder(getActivity());
|
||||||
adb.setView(view);
|
adb.setView(view);
|
||||||
adb.setTitle(getString(R.string.login_title));
|
adb.setTitle(getString(R.string.login_title));
|
||||||
adb.setPositiveButton(R.string.login_confirm, new DialogInterface.OnClickListener() {
|
adb.setPositiveButton(R.string.login_confirm, new DialogInterface.OnClickListener()
|
||||||
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int whichButton)
|
public void onClick(DialogInterface dialog, int whichButton)
|
||||||
{
|
{
|
||||||
@@ -391,7 +404,8 @@ public class MainActivity extends Activity implements OnVpnProfileSelectedListen
|
|||||||
activity.prepareVpnService(profileInfo);
|
activity.prepareVpnService(profileInfo);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
adb.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
|
adb.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener()
|
||||||
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which)
|
public void onClick(DialogInterface dialog, int which)
|
||||||
{
|
{
|
||||||
@@ -424,11 +438,12 @@ public class MainActivity extends Activity implements OnVpnProfileSelectedListen
|
|||||||
{
|
{
|
||||||
final Bundle arguments = getArguments();
|
final Bundle arguments = getArguments();
|
||||||
final int messageId = arguments.getInt(ERROR_MESSAGE_ID);
|
final int messageId = arguments.getInt(ERROR_MESSAGE_ID);
|
||||||
return new AlertDialog.Builder(getActivity())
|
return new Builder(getActivity())
|
||||||
.setTitle(R.string.vpn_not_supported_title)
|
.setTitle(R.string.vpn_not_supported_title)
|
||||||
.setMessage(messageId)
|
.setMessage(messageId)
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener()
|
||||||
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int id)
|
public void onClick(DialogInterface dialog, int id)
|
||||||
{
|
{
|
||||||
|
|||||||
+8
-8
@@ -15,24 +15,24 @@
|
|||||||
|
|
||||||
package org.strongswan.android.ui;
|
package org.strongswan.android.ui;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import org.strongswan.android.R;
|
import org.strongswan.android.R;
|
||||||
import org.strongswan.android.logic.imc.RemediationInstruction;
|
import org.strongswan.android.logic.imc.RemediationInstruction;
|
||||||
import org.strongswan.android.ui.RemediationInstructionsFragment.OnRemediationInstructionSelectedListener;
|
import org.strongswan.android.ui.RemediationInstructionsFragment.OnRemediationInstructionSelectedListener;
|
||||||
|
|
||||||
import android.app.Activity;
|
import java.util.ArrayList;
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
|
|
||||||
public class RemediationInstructionsActivity extends Activity implements OnRemediationInstructionSelectedListener
|
public class RemediationInstructionsActivity extends AppCompatActivity implements OnRemediationInstructionSelectedListener
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState)
|
protected void onCreate(Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.remediation_instructions);
|
setContentView(R.layout.remediation_instructions);
|
||||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
if (savedInstanceState != null)
|
if (savedInstanceState != null)
|
||||||
{ /* only update if we're not restoring */
|
{ /* only update if we're not restoring */
|
||||||
@@ -64,7 +64,7 @@ public class RemediationInstructionsActivity extends Activity implements OnRemed
|
|||||||
{
|
{
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
getActionBar().setTitle(getTitle());
|
getSupportActionBar().setTitle(getTitle());
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
@@ -88,7 +88,7 @@ public class RemediationInstructionsActivity extends Activity implements OnRemed
|
|||||||
frag.setArguments(args);
|
frag.setArguments(args);
|
||||||
|
|
||||||
getFragmentManager().beginTransaction().replace(R.id.fragment_container, frag).addToBackStack(null).commit();
|
getFragmentManager().beginTransaction().replace(R.id.fragment_container, frag).addToBackStack(null).commit();
|
||||||
getActionBar().setTitle(instruction.getTitle());
|
getSupportActionBar().setTitle(instruction.getTitle());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-18
@@ -15,17 +15,6 @@
|
|||||||
|
|
||||||
package org.strongswan.android.ui;
|
package org.strongswan.android.ui;
|
||||||
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.security.KeyStore;
|
|
||||||
import java.security.cert.CertificateException;
|
|
||||||
import java.security.cert.CertificateFactory;
|
|
||||||
import java.security.cert.X509Certificate;
|
|
||||||
|
|
||||||
import org.strongswan.android.R;
|
|
||||||
import org.strongswan.android.data.VpnProfileDataSource;
|
|
||||||
import org.strongswan.android.logic.TrustedCertificateManager;
|
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
@@ -37,19 +26,31 @@ import android.content.Intent;
|
|||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
public class TrustedCertificateImportActivity extends Activity
|
import org.strongswan.android.R;
|
||||||
|
import org.strongswan.android.data.VpnProfileDataSource;
|
||||||
|
import org.strongswan.android.logic.TrustedCertificateManager;
|
||||||
|
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.security.KeyStore;
|
||||||
|
import java.security.cert.CertificateException;
|
||||||
|
import java.security.cert.CertificateFactory;
|
||||||
|
import java.security.cert.X509Certificate;
|
||||||
|
|
||||||
|
public class TrustedCertificateImportActivity extends AppCompatActivity
|
||||||
{
|
{
|
||||||
private static final int OPEN_DOCUMENT = 0;
|
private static final int OPEN_DOCUMENT = 0;
|
||||||
private static final String DIALOG_TAG = "Dialog";
|
private static final String DIALOG_TAG = "Dialog";
|
||||||
|
|
||||||
/* same as those listed in the manifest */
|
/* same as those listed in the manifest */
|
||||||
private static final String[] ACCEPTED_MIME_TYPES = {
|
private static final String[] ACCEPTED_MIME_TYPES = {
|
||||||
"application/x-x509-ca-cert",
|
"application/x-x509-ca-cert",
|
||||||
"application/x-x509-server-cert",
|
"application/x-x509-server-cert",
|
||||||
"application/x-pem-file",
|
"application/x-pem-file",
|
||||||
"application/pkix-cert"
|
"application/pkix-cert"
|
||||||
};
|
};
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.KITKAT)
|
@TargetApi(Build.VERSION_CODES.KITKAT)
|
||||||
@@ -97,6 +98,7 @@ public class TrustedCertificateImportActivity extends Activity
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Import the file pointed to by the given URI as a certificate.
|
* Import the file pointed to by the given URI as a certificate.
|
||||||
|
*
|
||||||
* @param uri
|
* @param uri
|
||||||
*/
|
*/
|
||||||
private void importCertificate(Uri uri)
|
private void importCertificate(Uri uri)
|
||||||
@@ -124,6 +126,7 @@ public class TrustedCertificateImportActivity extends Activity
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the file from the given URI and try to parse it as X.509 certificate.
|
* Load the file from the given URI and try to parse it as X.509 certificate.
|
||||||
|
*
|
||||||
* @param uri
|
* @param uri
|
||||||
* @return certificate or null
|
* @return certificate or null
|
||||||
*/
|
*/
|
||||||
@@ -151,6 +154,7 @@ public class TrustedCertificateImportActivity extends Activity
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to store the given certificate in the KeyStore.
|
* Try to store the given certificate in the KeyStore.
|
||||||
|
*
|
||||||
* @param certificate
|
* @param certificate
|
||||||
* @return whether it was successfully stored
|
* @return whether it was successfully stored
|
||||||
*/
|
*/
|
||||||
@@ -188,7 +192,8 @@ public class TrustedCertificateImportActivity extends Activity
|
|||||||
.setIcon(R.drawable.ic_launcher)
|
.setIcon(R.drawable.ic_launcher)
|
||||||
.setTitle(R.string.import_certificate)
|
.setTitle(R.string.import_certificate)
|
||||||
.setMessage(certificate.getSubjectDN().toString())
|
.setMessage(certificate.getSubjectDN().toString())
|
||||||
.setPositiveButton(R.string.import_certificate, new DialogInterface.OnClickListener() {
|
.setPositiveButton(R.string.import_certificate, new DialogInterface.OnClickListener()
|
||||||
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int whichButton)
|
public void onClick(DialogInterface dialog, int whichButton)
|
||||||
{
|
{
|
||||||
@@ -205,7 +210,8 @@ public class TrustedCertificateImportActivity extends Activity
|
|||||||
getActivity().finish();
|
getActivity().finish();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
|
.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener()
|
||||||
|
{
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which)
|
public void onClick(DialogInterface dialog, int which)
|
||||||
{
|
{
|
||||||
|
|||||||
+21
-20
@@ -15,26 +15,13 @@
|
|||||||
|
|
||||||
package org.strongswan.android.ui;
|
package org.strongswan.android.ui;
|
||||||
|
|
||||||
import java.security.cert.X509Certificate;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Hashtable;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
|
|
||||||
import org.strongswan.android.R;
|
|
||||||
import org.strongswan.android.logic.TrustedCertificateManager;
|
|
||||||
import org.strongswan.android.logic.TrustedCertificateManager.TrustedCertificateSource;
|
|
||||||
import org.strongswan.android.security.TrustedCertificateEntry;
|
|
||||||
import org.strongswan.android.ui.adapter.TrustedCertificateAdapter;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.ListFragment;
|
|
||||||
import android.app.LoaderManager.LoaderCallbacks;
|
|
||||||
import android.content.AsyncTaskLoader;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Loader;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v4.app.ListFragment;
|
||||||
|
import android.support.v4.app.LoaderManager;
|
||||||
|
import android.support.v4.content.AsyncTaskLoader;
|
||||||
|
import android.support.v4.content.Loader;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
@@ -44,7 +31,20 @@ import android.widget.ListView;
|
|||||||
import android.widget.SearchView;
|
import android.widget.SearchView;
|
||||||
import android.widget.SearchView.OnQueryTextListener;
|
import android.widget.SearchView.OnQueryTextListener;
|
||||||
|
|
||||||
public class TrustedCertificateListFragment extends ListFragment implements LoaderCallbacks<List<TrustedCertificateEntry>>, OnQueryTextListener
|
import org.strongswan.android.R;
|
||||||
|
import org.strongswan.android.logic.TrustedCertificateManager;
|
||||||
|
import org.strongswan.android.logic.TrustedCertificateManager.TrustedCertificateSource;
|
||||||
|
import org.strongswan.android.security.TrustedCertificateEntry;
|
||||||
|
import org.strongswan.android.ui.adapter.TrustedCertificateAdapter;
|
||||||
|
|
||||||
|
import java.security.cert.X509Certificate;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Hashtable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
public class TrustedCertificateListFragment extends ListFragment implements LoaderManager.LoaderCallbacks<List<TrustedCertificateEntry>>, OnQueryTextListener
|
||||||
{
|
{
|
||||||
public static final String EXTRA_CERTIFICATE_SOURCE = "certificate_source";
|
public static final String EXTRA_CERTIFICATE_SOURCE = "certificate_source";
|
||||||
private OnTrustedCertificateSelectedListener mListener;
|
private OnTrustedCertificateSelectedListener mListener;
|
||||||
@@ -54,7 +54,8 @@ public class TrustedCertificateListFragment extends ListFragment implements Load
|
|||||||
/**
|
/**
|
||||||
* The activity containing this fragment should implement this interface
|
* The activity containing this fragment should implement this interface
|
||||||
*/
|
*/
|
||||||
public interface OnTrustedCertificateSelectedListener {
|
public interface OnTrustedCertificateSelectedListener
|
||||||
|
{
|
||||||
public void onTrustedCertificateSelected(TrustedCertificateEntry selected);
|
public void onTrustedCertificateSelected(TrustedCertificateEntry selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,7 +187,7 @@ public class TrustedCertificateListFragment extends ListFragment implements Load
|
|||||||
public List<TrustedCertificateEntry> loadInBackground()
|
public List<TrustedCertificateEntry> loadInBackground()
|
||||||
{
|
{
|
||||||
TrustedCertificateManager certman = TrustedCertificateManager.getInstance().load();
|
TrustedCertificateManager certman = TrustedCertificateManager.getInstance().load();
|
||||||
Hashtable<String,X509Certificate> certificates = certman.getCACertificates(mSource);
|
Hashtable<String, X509Certificate> certificates = certman.getCACertificates(mSource);
|
||||||
List<TrustedCertificateEntry> selected;
|
List<TrustedCertificateEntry> selected;
|
||||||
|
|
||||||
selected = new ArrayList<TrustedCertificateEntry>();
|
selected = new ArrayList<TrustedCertificateEntry>();
|
||||||
|
|||||||
+35
-35
@@ -15,7 +15,16 @@
|
|||||||
|
|
||||||
package org.strongswan.android.ui;
|
package org.strongswan.android.ui;
|
||||||
|
|
||||||
import java.security.KeyStore;
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.support.v4.app.FragmentTransaction;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import org.strongswan.android.R;
|
import org.strongswan.android.R;
|
||||||
import org.strongswan.android.data.VpnProfileDataSource;
|
import org.strongswan.android.data.VpnProfileDataSource;
|
||||||
@@ -24,18 +33,9 @@ import org.strongswan.android.logic.TrustedCertificateManager.TrustedCertificate
|
|||||||
import org.strongswan.android.security.TrustedCertificateEntry;
|
import org.strongswan.android.security.TrustedCertificateEntry;
|
||||||
import org.strongswan.android.ui.CertificateDeleteConfirmationDialog.OnCertificateDeleteListener;
|
import org.strongswan.android.ui.CertificateDeleteConfirmationDialog.OnCertificateDeleteListener;
|
||||||
|
|
||||||
import android.app.ActionBar;
|
import java.security.KeyStore;
|
||||||
import android.app.ActionBar.Tab;
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.Fragment;
|
|
||||||
import android.app.FragmentTransaction;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
|
|
||||||
public class TrustedCertificatesActivity extends Activity implements TrustedCertificateListFragment.OnTrustedCertificateSelectedListener, OnCertificateDeleteListener
|
public class TrustedCertificatesActivity extends AppCompatActivity implements TrustedCertificateListFragment.OnTrustedCertificateSelectedListener, OnCertificateDeleteListener
|
||||||
{
|
{
|
||||||
public static final String SELECT_CERTIFICATE = "org.strongswan.android.action.SELECT_CERTIFICATE";
|
public static final String SELECT_CERTIFICATE = "org.strongswan.android.action.SELECT_CERTIFICATE";
|
||||||
private static final String DIALOG_TAG = "Dialog";
|
private static final String DIALOG_TAG = "Dialog";
|
||||||
@@ -48,29 +48,29 @@ public class TrustedCertificatesActivity extends Activity implements TrustedCert
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.trusted_certificates_activity);
|
setContentView(R.layout.trusted_certificates_activity);
|
||||||
|
|
||||||
ActionBar actionBar = getActionBar();
|
ActionBar actionBar = getSupportActionBar();
|
||||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
|
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
|
||||||
|
|
||||||
TrustedCertificatesTabListener listener;
|
TrustedCertificatesTabListener listener;
|
||||||
listener = new TrustedCertificatesTabListener(this, "system", TrustedCertificateSource.SYSTEM);
|
listener = new TrustedCertificatesTabListener(this, "system", TrustedCertificateSource.SYSTEM);
|
||||||
actionBar.addTab(actionBar
|
actionBar.addTab(actionBar
|
||||||
.newTab()
|
.newTab()
|
||||||
.setText(R.string.system_tab)
|
.setText(R.string.system_tab)
|
||||||
.setTag(listener)
|
.setTag(listener)
|
||||||
.setTabListener(listener));
|
.setTabListener(listener));
|
||||||
listener = new TrustedCertificatesTabListener(this, "user", TrustedCertificateSource.USER);
|
listener = new TrustedCertificatesTabListener(this, "user", TrustedCertificateSource.USER);
|
||||||
actionBar.addTab(actionBar
|
actionBar.addTab(actionBar
|
||||||
.newTab()
|
.newTab()
|
||||||
.setText(R.string.user_tab)
|
.setText(R.string.user_tab)
|
||||||
.setTag(listener)
|
.setTag(listener)
|
||||||
.setTabListener(listener));
|
.setTabListener(listener));
|
||||||
listener = new TrustedCertificatesTabListener(this, "local", TrustedCertificateSource.LOCAL);
|
listener = new TrustedCertificatesTabListener(this, "local", TrustedCertificateSource.LOCAL);
|
||||||
actionBar.addTab(actionBar
|
actionBar.addTab(actionBar
|
||||||
.newTab()
|
.newTab()
|
||||||
.setText(R.string.local_tab)
|
.setText(R.string.local_tab)
|
||||||
.setTag(listener)
|
.setTag(listener)
|
||||||
.setTabListener(listener));
|
.setTabListener(listener));
|
||||||
|
|
||||||
if (savedInstanceState != null)
|
if (savedInstanceState != null)
|
||||||
{
|
{
|
||||||
@@ -83,7 +83,7 @@ public class TrustedCertificatesActivity extends Activity implements TrustedCert
|
|||||||
protected void onSaveInstanceState(Bundle outState)
|
protected void onSaveInstanceState(Bundle outState)
|
||||||
{
|
{
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
outState.putInt("tab", getActionBar().getSelectedNavigationIndex());
|
outState.putInt("tab", getSupportActionBar().getSelectedNavigationIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -151,7 +151,7 @@ public class TrustedCertificatesActivity extends Activity implements TrustedCert
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
TrustedCertificatesTabListener listener;
|
TrustedCertificatesTabListener listener;
|
||||||
listener = (TrustedCertificatesTabListener)getActionBar().getSelectedTab().getTag();
|
listener = (TrustedCertificatesTabListener)getSupportActionBar().getSelectedTab().getTag();
|
||||||
if (listener.mTag == "local")
|
if (listener.mTag == "local")
|
||||||
{
|
{
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
@@ -182,9 +182,9 @@ public class TrustedCertificatesActivity extends Activity implements TrustedCert
|
|||||||
private void reloadCertificates()
|
private void reloadCertificates()
|
||||||
{
|
{
|
||||||
TrustedCertificateManager.getInstance().reset();
|
TrustedCertificateManager.getInstance().reset();
|
||||||
for (int i = 0; i < getActionBar().getTabCount(); i++)
|
for (int i = 0; i < getSupportActionBar().getTabCount(); i++)
|
||||||
{
|
{
|
||||||
Tab tab = getActionBar().getTabAt(i);
|
ActionBar.Tab tab = getSupportActionBar().getTabAt(i);
|
||||||
TrustedCertificatesTabListener listener = (TrustedCertificatesTabListener)tab.getTag();
|
TrustedCertificatesTabListener listener = (TrustedCertificatesTabListener)tab.getTag();
|
||||||
listener.reset();
|
listener.reset();
|
||||||
}
|
}
|
||||||
@@ -196,24 +196,24 @@ public class TrustedCertificatesActivity extends Activity implements TrustedCert
|
|||||||
private final TrustedCertificateSource mSource;
|
private final TrustedCertificateSource mSource;
|
||||||
private Fragment mFragment;
|
private Fragment mFragment;
|
||||||
|
|
||||||
public TrustedCertificatesTabListener(Activity activity, String tag, TrustedCertificateSource source)
|
public TrustedCertificatesTabListener(AppCompatActivity activity, String tag, TrustedCertificateSource source)
|
||||||
{
|
{
|
||||||
mTag = tag;
|
mTag = tag;
|
||||||
mSource = source;
|
mSource = source;
|
||||||
/* check to see if we already have a fragment for this tab, probably
|
/* check to see if we already have a fragment for this tab, probably
|
||||||
* from a previously saved state. if so, deactivate it, because the
|
* from a previously saved state. if so, deactivate it, because the
|
||||||
* initial state is that no tab is shown */
|
* initial state is that no tab is shown */
|
||||||
mFragment = activity.getFragmentManager().findFragmentByTag(mTag);
|
mFragment = activity.getSupportFragmentManager().findFragmentByTag(mTag);
|
||||||
if (mFragment != null && !mFragment.isDetached())
|
if (mFragment != null && !mFragment.isDetached())
|
||||||
{
|
{
|
||||||
FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
|
FragmentTransaction ft = activity.getSupportFragmentManager().beginTransaction();
|
||||||
ft.detach(mFragment);
|
ft.detach(mFragment);
|
||||||
ft.commit();
|
ft.commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTabSelected(Tab tab, FragmentTransaction ft)
|
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft)
|
||||||
{
|
{
|
||||||
if (mFragment == null)
|
if (mFragment == null)
|
||||||
{
|
{
|
||||||
@@ -230,7 +230,7 @@ public class TrustedCertificatesActivity extends Activity implements TrustedCert
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTabUnselected(Tab tab, FragmentTransaction ft)
|
public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction ft)
|
||||||
{
|
{
|
||||||
if (mFragment != null)
|
if (mFragment != null)
|
||||||
{
|
{
|
||||||
@@ -239,7 +239,7 @@ public class TrustedCertificatesActivity extends Activity implements TrustedCert
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTabReselected(Tab tab, FragmentTransaction ft)
|
public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft)
|
||||||
{
|
{
|
||||||
/* nothing to be done */
|
/* nothing to be done */
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-15
@@ -17,17 +17,6 @@
|
|||||||
|
|
||||||
package org.strongswan.android.ui;
|
package org.strongswan.android.ui;
|
||||||
|
|
||||||
import java.security.cert.X509Certificate;
|
|
||||||
|
|
||||||
import org.strongswan.android.R;
|
|
||||||
import org.strongswan.android.data.VpnProfile;
|
|
||||||
import org.strongswan.android.data.VpnProfileDataSource;
|
|
||||||
import org.strongswan.android.data.VpnType;
|
|
||||||
import org.strongswan.android.data.VpnType.VpnTypeFeature;
|
|
||||||
import org.strongswan.android.logic.TrustedCertificateManager;
|
|
||||||
import org.strongswan.android.security.TrustedCertificateEntry;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.DialogFragment;
|
import android.app.DialogFragment;
|
||||||
@@ -39,6 +28,7 @@ import android.os.Bundle;
|
|||||||
import android.security.KeyChain;
|
import android.security.KeyChain;
|
||||||
import android.security.KeyChainAliasCallback;
|
import android.security.KeyChainAliasCallback;
|
||||||
import android.security.KeyChainException;
|
import android.security.KeyChainException;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
@@ -57,7 +47,17 @@ import android.widget.RelativeLayout;
|
|||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
public class VpnProfileDetailActivity extends Activity
|
import org.strongswan.android.R;
|
||||||
|
import org.strongswan.android.data.VpnProfile;
|
||||||
|
import org.strongswan.android.data.VpnProfileDataSource;
|
||||||
|
import org.strongswan.android.data.VpnType;
|
||||||
|
import org.strongswan.android.data.VpnType.VpnTypeFeature;
|
||||||
|
import org.strongswan.android.logic.TrustedCertificateManager;
|
||||||
|
import org.strongswan.android.security.TrustedCertificateEntry;
|
||||||
|
|
||||||
|
import java.security.cert.X509Certificate;
|
||||||
|
|
||||||
|
public class VpnProfileDetailActivity extends AppCompatActivity
|
||||||
{
|
{
|
||||||
private static final int SELECT_TRUSTED_CERTIFICATE = 0;
|
private static final int SELECT_TRUSTED_CERTIFICATE = 0;
|
||||||
private static final int MTU_MIN = 1280;
|
private static final int MTU_MIN = 1280;
|
||||||
@@ -94,7 +94,7 @@ public class VpnProfileDetailActivity extends Activity
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
/* the title is set when we load the profile, if any */
|
/* the title is set when we load the profile, if any */
|
||||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
mDataSource = new VpnProfileDataSource(this);
|
mDataSource = new VpnProfileDataSource(this);
|
||||||
mDataSource.open();
|
mDataSource.open();
|
||||||
@@ -465,7 +465,7 @@ public class VpnProfileDetailActivity extends Activity
|
|||||||
{
|
{
|
||||||
String useralias = null, alias = null;
|
String useralias = null, alias = null;
|
||||||
|
|
||||||
getActionBar().setTitle(R.string.add_profile);
|
getSupportActionBar().setTitle(R.string.add_profile);
|
||||||
if (mId != null && mId != 0)
|
if (mId != null && mId != 0)
|
||||||
{
|
{
|
||||||
mProfile = mDataSource.getVpnProfile(mId);
|
mProfile = mDataSource.getVpnProfile(mId);
|
||||||
@@ -482,7 +482,7 @@ public class VpnProfileDetailActivity extends Activity
|
|||||||
mBlockIPv6.setChecked(mProfile.getSplitTunneling() != null ? (mProfile.getSplitTunneling() & VpnProfile.SPLIT_TUNNELING_BLOCK_IPV6) != 0 : false);
|
mBlockIPv6.setChecked(mProfile.getSplitTunneling() != null ? (mProfile.getSplitTunneling() & VpnProfile.SPLIT_TUNNELING_BLOCK_IPV6) != 0 : false);
|
||||||
useralias = mProfile.getUserCertificateAlias();
|
useralias = mProfile.getUserCertificateAlias();
|
||||||
alias = mProfile.getCertificateAlias();
|
alias = mProfile.getCertificateAlias();
|
||||||
getActionBar().setTitle(mProfile.getName());
|
getSupportActionBar().setTitle(mProfile.getName());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
+5
-5
@@ -15,15 +15,15 @@
|
|||||||
|
|
||||||
package org.strongswan.android.ui;
|
package org.strongswan.android.ui;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
|
||||||
import org.strongswan.android.R;
|
import org.strongswan.android.R;
|
||||||
import org.strongswan.android.data.VpnProfile;
|
import org.strongswan.android.data.VpnProfile;
|
||||||
import org.strongswan.android.ui.VpnProfileListFragment.OnVpnProfileSelectedListener;
|
import org.strongswan.android.ui.VpnProfileListFragment.OnVpnProfileSelectedListener;
|
||||||
|
|
||||||
import android.app.Activity;
|
public class VpnProfileSelectActivity extends AppCompatActivity implements OnVpnProfileSelectedListener
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
public class VpnProfileSelectActivity extends Activity implements OnVpnProfileSelectedListener
|
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState)
|
protected void onCreate(Bundle savedInstanceState)
|
||||||
|
|||||||
@@ -13,16 +13,17 @@
|
|||||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
for more details.
|
for more details.
|
||||||
-->
|
-->
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_import_certificate"
|
android:id="@+id/menu_import_certificate"
|
||||||
android:title="@string/import_certificate"
|
android:title="@string/import_certificate"
|
||||||
android:showAsAction="withText" />
|
app:showAsAction="withText" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_reload_certs"
|
android:id="@+id/menu_reload_certs"
|
||||||
android:title="@string/reload_trusted_certs"
|
android:title="@string/reload_trusted_certs"
|
||||||
android:showAsAction="withText" />
|
app:showAsAction="withText" />
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
|
|||||||
@@ -13,11 +13,12 @@
|
|||||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
for more details.
|
for more details.
|
||||||
-->
|
-->
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_send_log"
|
android:id="@+id/menu_send_log"
|
||||||
android:title="@string/send_log"
|
android:title="@string/send_log"
|
||||||
android:showAsAction="ifRoom|withText" />
|
app:showAsAction="ifRoom|withText" />
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
|
|||||||
@@ -13,16 +13,17 @@
|
|||||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
for more details.
|
for more details.
|
||||||
-->
|
-->
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_manage_certs"
|
android:id="@+id/menu_manage_certs"
|
||||||
android:title="@string/trusted_certs_title"
|
android:title="@string/trusted_certs_title"
|
||||||
android:showAsAction="withText" />
|
app:showAsAction="withText" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_show_log"
|
android:id="@+id/menu_show_log"
|
||||||
android:title="@string/show_log"
|
android:title="@string/show_log"
|
||||||
android:showAsAction="withText" />
|
app:showAsAction="withText" />
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
|
|||||||
@@ -13,16 +13,17 @@
|
|||||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
for more details.
|
for more details.
|
||||||
-->
|
-->
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_accept"
|
android:id="@+id/menu_accept"
|
||||||
android:title="@string/profile_edit_save"
|
android:title="@string/profile_edit_save"
|
||||||
android:showAsAction="always|withText" />
|
app:showAsAction="always|withText" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_cancel"
|
android:id="@+id/menu_cancel"
|
||||||
android:title="@string/profile_edit_cancel"
|
android:title="@string/profile_edit_cancel"
|
||||||
android:showAsAction="ifRoom" />
|
app:showAsAction="ifRoom" />
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
|
|||||||
@@ -13,10 +13,11 @@
|
|||||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
for more details.
|
for more details.
|
||||||
-->
|
-->
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<item android:id="@+id/add_profile"
|
<item android:id="@+id/add_profile"
|
||||||
android:title="@string/add_profile"
|
android:title="@string/add_profile"
|
||||||
android:showAsAction="always|withText" />
|
app:showAsAction="always|withText" />
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
|
|||||||
@@ -16,9 +16,9 @@
|
|||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||||
|
|
||||||
<item android:id="@+id/edit_profile"
|
<item android:id="@+id/edit_profile"
|
||||||
android:title="@string/edit_profile" ></item>
|
android:title="@string/edit_profile" />
|
||||||
|
|
||||||
<item android:id="@+id/delete_profile"
|
<item android:id="@+id/delete_profile"
|
||||||
android:title="@string/delete_profile" ></item>
|
android:title="@string/delete_profile" />
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
-->
|
-->
|
||||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<style name="ApplicationTheme" parent="@android:style/Theme.Holo">
|
<style name="ApplicationTheme" parent="Theme.AppCompat">
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user