From 4817f11cb0181f66e3724404b391706d09829b3c Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 21 Nov 2013 06:53:01 +0100 Subject: Fix lints warnings, change folder icons --- .hgignore | 2 +- res/drawable-hdpi/ic_doc_generic_am.png | Bin 0 -> 694 bytes res/drawable-hdpi/ic_root_folder_am.png | Bin 0 -> 508 bytes res/drawable-mdpi/ic_doc_generic_am.png | Bin 0 -> 561 bytes res/drawable-mdpi/ic_root_folder_am.png | Bin 0 -> 442 bytes res/drawable-xhdpi/ic_doc_generic_am.png | Bin 0 -> 831 bytes res/drawable-xhdpi/ic_root_folder_am.png | Bin 0 -> 582 bytes res/drawable-xxhdpi/ic_doc_generic_am.png | Bin 0 -> 585 bytes res/drawable-xxhdpi/ic_root_folder_am.png | Bin 0 -> 1263 bytes res/drawable/file.png | Bin 571 -> 0 bytes res/drawable/folder.png | Bin 392 -> 0 bytes res/layout/log_silders.xml | 8 ++--- res/layout/vpnstatus.xml | 6 ++-- res/values/strings.xml | 7 ++++ .../blinkt/openvpn/fragments/Settings_Basic.java | 8 +++-- .../blinkt/openvpn/fragments/VPNProfileList.java | 39 ++++++++++++--------- 16 files changed, 42 insertions(+), 28 deletions(-) create mode 100644 res/drawable-hdpi/ic_doc_generic_am.png create mode 100644 res/drawable-hdpi/ic_root_folder_am.png create mode 100644 res/drawable-mdpi/ic_doc_generic_am.png create mode 100644 res/drawable-mdpi/ic_root_folder_am.png create mode 100644 res/drawable-xhdpi/ic_doc_generic_am.png create mode 100644 res/drawable-xhdpi/ic_root_folder_am.png create mode 100644 res/drawable-xxhdpi/ic_doc_generic_am.png create mode 100644 res/drawable-xxhdpi/ic_root_folder_am.png delete mode 100644 res/drawable/file.png delete mode 100644 res/drawable/folder.png diff --git a/.hgignore b/.hgignore index 34541a5b..9c91375a 100644 --- a/.hgignore +++ b/.hgignore @@ -1,7 +1,7 @@ obj bin libs -gen +^gen$ build openvpn/.git openvpn/autom4te.cache diff --git a/res/drawable-hdpi/ic_doc_generic_am.png b/res/drawable-hdpi/ic_doc_generic_am.png new file mode 100644 index 00000000..55b9b7d3 Binary files /dev/null and b/res/drawable-hdpi/ic_doc_generic_am.png differ diff --git a/res/drawable-hdpi/ic_root_folder_am.png b/res/drawable-hdpi/ic_root_folder_am.png new file mode 100644 index 00000000..915e1182 Binary files /dev/null and b/res/drawable-hdpi/ic_root_folder_am.png differ diff --git a/res/drawable-mdpi/ic_doc_generic_am.png b/res/drawable-mdpi/ic_doc_generic_am.png new file mode 100644 index 00000000..a1bd14ea Binary files /dev/null and b/res/drawable-mdpi/ic_doc_generic_am.png differ diff --git a/res/drawable-mdpi/ic_root_folder_am.png b/res/drawable-mdpi/ic_root_folder_am.png new file mode 100644 index 00000000..4352d08d Binary files /dev/null and b/res/drawable-mdpi/ic_root_folder_am.png differ diff --git a/res/drawable-xhdpi/ic_doc_generic_am.png b/res/drawable-xhdpi/ic_doc_generic_am.png new file mode 100644 index 00000000..e05c4b48 Binary files /dev/null and b/res/drawable-xhdpi/ic_doc_generic_am.png differ diff --git a/res/drawable-xhdpi/ic_root_folder_am.png b/res/drawable-xhdpi/ic_root_folder_am.png new file mode 100644 index 00000000..c916e0be Binary files /dev/null and b/res/drawable-xhdpi/ic_root_folder_am.png differ diff --git a/res/drawable-xxhdpi/ic_doc_generic_am.png b/res/drawable-xxhdpi/ic_doc_generic_am.png new file mode 100644 index 00000000..c0988663 Binary files /dev/null and b/res/drawable-xxhdpi/ic_doc_generic_am.png differ diff --git a/res/drawable-xxhdpi/ic_root_folder_am.png b/res/drawable-xxhdpi/ic_root_folder_am.png new file mode 100644 index 00000000..077c851c Binary files /dev/null and b/res/drawable-xxhdpi/ic_root_folder_am.png differ diff --git a/res/drawable/file.png b/res/drawable/file.png deleted file mode 100644 index fa45699e..00000000 Binary files a/res/drawable/file.png and /dev/null differ diff --git a/res/drawable/folder.png b/res/drawable/folder.png deleted file mode 100644 index 0108ed93..00000000 Binary files a/res/drawable/folder.png and /dev/null differ diff --git a/res/layout/log_silders.xml b/res/layout/log_silders.xml index 5df97490..1035cb4a 100644 --- a/res/layout/log_silders.xml +++ b/res/layout/log_silders.xml @@ -27,7 +27,7 @@ + android:text="@string/timestamps"/> diff --git a/res/layout/vpnstatus.xml b/res/layout/vpnstatus.xml index 0c765fe6..eb7c53ee 100644 --- a/res/layout/vpnstatus.xml +++ b/res/layout/vpnstatus.xml @@ -9,7 +9,7 @@ Log cleared. Show password KeyChain Access error: %s + Short + ISO + Timestamps + None + Upload + Download + Vpn Status diff --git a/src/de/blinkt/openvpn/fragments/Settings_Basic.java b/src/de/blinkt/openvpn/fragments/Settings_Basic.java index 88941bea..a559cda2 100644 --- a/src/de/blinkt/openvpn/fragments/Settings_Basic.java +++ b/src/de/blinkt/openvpn/fragments/Settings_Basic.java @@ -1,5 +1,6 @@ package de.blinkt.openvpn.fragments; +import android.annotation.TargetApi; import android.app.Activity; import android.app.AlertDialog; import android.app.AlertDialog.Builder; @@ -88,9 +89,10 @@ public class Settings_Basic extends Fragment implements View.OnClickListener, On X509Certificate cert = KeyChain.getCertificateChain(getActivity(), mProfile.mAlias)[0]; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { - String algorithm= KeyChain.getPrivateKey(getActivity(),mProfile.mAlias).getAlgorithm(); - if (KeyChain.isBoundKeyAlgorithm(algorithm)) - certstr+=getString(R.string.hwkeychain); + String algorithm= KeyChain.getPrivateKey(getActivity(),mProfile.mAlias).getAlgorithm(); + if (KeyChain.isBoundKeyAlgorithm(algorithm)) + certstr+=getString(R.string.hwkeychain); + } certstr+=X509Utils.getCertificateFriendlyName(cert); diff --git a/src/de/blinkt/openvpn/fragments/VPNProfileList.java b/src/de/blinkt/openvpn/fragments/VPNProfileList.java index 447ed1e0..4d54bc68 100644 --- a/src/de/blinkt/openvpn/fragments/VPNProfileList.java +++ b/src/de/blinkt/openvpn/fragments/VPNProfileList.java @@ -201,8 +201,8 @@ public class VPNProfileList extends ListFragment { onAddProfileClicked(); return true; } else if (itemId == MENU_IMPORT_PROFILE) { - //startImportConfig(); - startFilePicker(); + startImportConfig(); + //startFilePicker(); return true; } else { return super.onOptionsItemSelected(item); @@ -212,8 +212,8 @@ public class VPNProfileList extends ListFragment { private void startFilePicker() { Intent i = new Intent(Intent.ACTION_OPEN_DOCUMENT); i.addCategory(Intent.CATEGORY_OPENABLE); - i.setType("application/x-openvpn-profile"); - startActivityForResult(i,FILE_PICKER_RESULT); + i.setType("*/*"); + startActivityForResult(i, FILE_PICKER_RESULT); } private void startImportConfig() { @@ -261,7 +261,6 @@ public class VPNProfileList extends ListFragment { } - private void addProfile(VpnProfile profile) { getPM().addProfile(profile); getPM().saveProfileList(getActivity()); @@ -269,10 +268,6 @@ public class VPNProfileList extends ListFragment { mArrayadapter.add(profile); } - - - - private ProfileManager getPM() { return ProfileManager.getInstance(getActivity()); } @@ -299,21 +294,31 @@ public class VPNProfileList extends ListFragment { setListAdapter(); } else if(requestCode== SELECT_PROFILE) { - String filedata = data.getStringExtra(FileSelect.RESULT_DATA); - Intent startImport = new Intent(getActivity(),ConfigConverter.class); - startImport.setAction(ConfigConverter.IMPORT_PROFILE); - Uri uri = new Uri.Builder().path(filedata).scheme("file").build(); - startImport.setData(uri); - startActivityForResult(startImport, IMPORT_PROFILE); + String fileData = data.getStringExtra(FileSelect.RESULT_DATA); + Uri uri = new Uri.Builder().path(fileData).scheme("file").build(); + + startConfigImport(uri); } else if(requestCode == IMPORT_PROFILE) { String profileUUID = data.getStringExtra(VpnProfile.EXTRA_PROFILEUUID); mArrayadapter.add(ProfileManager.get(getActivity(), profileUUID)); - } + } else if(resultCode == FILE_PICKER_RESULT) { + if (data != null) { + Uri uri = data.getData(); + startConfigImport(uri); + } + } } + private void startConfigImport(Uri uri) { + Intent startImport = new Intent(getActivity(),ConfigConverter.class); + startImport.setAction(ConfigConverter.IMPORT_PROFILE); + startImport.setData(uri); + startActivityForResult(startImport, IMPORT_PROFILE); + } + - private void editVPN(VpnProfile profile) { + private void editVPN(VpnProfile profile) { mEditProfile =profile; Intent vprefintent = new Intent(getActivity(),VPNPreferences.class) .putExtra(getActivity().getPackageName() + ".profileUUID", profile.getUUID().toString()); -- cgit v1.2.3