PluginDetailsActivity can show an accept/deny mode

This commit is contained in:
Philipp Crocoll 2014-05-09 21:49:49 +02:00
parent 3b1b1f5fee
commit 8a6ee5623d
10 changed files with 361 additions and 257 deletions

View File

@ -26,32 +26,20 @@ namespace PluginHostTest
Categories = new[] { Intent.CategoryDefault })] Categories = new[] { Intent.CategoryDefault })]
public class PluginDetailsActivity : Activity public class PluginDetailsActivity : Activity
{ {
private CheckBox _checkbox;
private string _pluginPackageName;
protected override void OnCreate(Bundle bundle) protected override void OnCreate(Bundle bundle)
{ {
base.OnCreate(bundle); base.OnCreate(bundle);
string pluginPackage = Intent.GetStringExtra("PluginPackage"); _pluginPackageName = Intent.GetStringExtra(Strings.ExtraPluginPackage);
Intent mainIntent = new Intent(Intent.ActionMain, null); var pluginRes = PackageManager.GetResourcesForApplication(_pluginPackageName);
mainIntent.AddCategory(Intent.CategoryLauncher); var title = GetStringFromPlugin(pluginRes, _pluginPackageName, "kp2aplugin_title");
var author = GetStringFromPlugin(pluginRes, _pluginPackageName, "kp2aplugin_author");
IList<ResolveInfo> appList = PackageManager.QueryIntentActivities(mainIntent, 0); var shortDesc = GetStringFromPlugin(pluginRes, _pluginPackageName, "kp2aplugin_shortdesc");
//Collections.Sort(appList, new ResolveInfo.DisplayNameComparator(PackageManager)); var version = PackageManager.GetPackageInfo(_pluginPackageName, 0).VersionName;
foreach (ResolveInfo temp in appList)
{
Log.Verbose("my logs", "package and activity name = "
+ temp.ActivityInfo.PackageName + " "
+ temp.ActivityInfo.Name + " " + temp.ActivityInfo.IconResource);
}
var pluginRes = PackageManager.GetResourcesForApplication(pluginPackage);
var title = GetStringFromPlugin(pluginRes, pluginPackage, "kp2aplugin_title");
var author = GetStringFromPlugin(pluginRes, pluginPackage, "kp2aplugin_author");
var shortDesc = GetStringFromPlugin(pluginRes, pluginPackage, "kp2aplugin_shortdesc");
var version = PackageManager.GetPackageInfo(pluginPackage, 0).VersionName;
SetContentView(Resource.Layout.plugin_details); SetContentView(Resource.Layout.plugin_details);
if (title != null) if (title != null)
@ -60,32 +48,85 @@ namespace PluginHostTest
SetTextOrHide(Resource.Id.txtAuthor, author); SetTextOrHide(Resource.Id.txtAuthor, author);
SetTextOrHide(Resource.Id.txtShortDesc, shortDesc); SetTextOrHide(Resource.Id.txtShortDesc, shortDesc);
var checkbox = FindViewById<CheckBox>(Resource.Id.cb_enabled); _checkbox = FindViewById<CheckBox>(Resource.Id.cb_enabled);
PluginDatabase pluginDb = new PluginDatabase(this); _checkbox.CheckedChange += delegate {
checkbox.Checked = pluginDb.IsEnabled(pluginPackage); new PluginDatabase(this).SetEnabled(_pluginPackageName, _checkbox.Checked);
checkbox.CheckedChange += delegate(object sender, CompoundButton.CheckedChangeEventArgs args)
{
pluginDb.SetEnabled(pluginPackage, checkbox.Checked);
}; };
Drawable d = PackageManager.GetApplicationIcon(pluginPackage); Drawable d = PackageManager.GetApplicationIcon(_pluginPackageName);
FindViewById<ImageView>(Resource.Id.imgIcon).SetImageDrawable(d); FindViewById<ImageView>(Resource.Id.imgIcon).SetImageDrawable(d);
FindViewById<TextView>(Resource.Id.txtVersion).Text = version; FindViewById<TextView>(Resource.Id.txtVersion).Text = version;
var scopesContainer = FindViewById<LinearLayout>(Resource.Id.scopes_list); //cannot be wrong to update the view when we received an update
PluginHost.OnReceivedRequest += OnPluginHostOnOnReceivedRequest;
foreach (string scope in pluginDb.GetPluginScopes(pluginPackage)) if (Intent.Action == Strings.ActionEditPluginSettings)
{
//this action can be triggered by external apps so we don't know if anybody has ever triggered
//the plugin to request access. Do this now, don't set the view right now
PluginHost.TriggerRequest(this, _pluginPackageName, new PluginDatabase(this));
//show the buttons instead of the checkbox
_checkbox.Visibility = ViewStates.Invisible;
FindViewById(Resource.Id.accept_button).Visibility = ViewStates.Visible;
FindViewById(Resource.Id.deny_button).Visibility = ViewStates.Visible;
FindViewById(Resource.Id.accept_button).Click += delegate(object sender, EventArgs args)
{
new PluginDatabase(this).SetEnabled(_pluginPackageName, true);
SetResult(Result.Ok);
Finish();
};
FindViewById(Resource.Id.deny_button).Click += delegate(object sender, EventArgs args)
{
new PluginDatabase(this).SetEnabled(_pluginPackageName, false);
SetResult(Result.Canceled);
Finish();
};
}
else
{
UpdateView();
_checkbox.Visibility = ViewStates.Visible;
FindViewById(Resource.Id.accept_button).Visibility = ViewStates.Gone;
FindViewById(Resource.Id.deny_button).Visibility = ViewStates.Gone;
}
}
private void OnPluginHostOnOnReceivedRequest(object sender, PluginHost.PluginHostEventArgs args)
{
if (args.Package == _pluginPackageName)
{
UpdateView();
}
}
protected override void OnDestroy()
{
PluginHost.OnReceivedRequest -= OnPluginHostOnOnReceivedRequest;
base.OnDestroy();
}
private void UpdateView()
{
var scopesContainer = FindViewById<LinearLayout>(Resource.Id.scopes_list);
//scopesContainer.RemoveAllViews();
var pluginDb = new PluginDatabase(this);
_checkbox.Checked = pluginDb.IsEnabled(_pluginPackageName);
foreach (string scope in pluginDb.GetPluginScopes(_pluginPackageName))
{ {
string scopeId = scope.Substring("keepass2android.".Length); string scopeId = scope.Substring("keepass2android.".Length);
TextWithHelp help = new TextWithHelp(this, GetString(Resources.GetIdentifier(scopeId + "_title", "string", PackageName)), GetString(Resources.GetIdentifier(scopeId + "_explanation", "string", PackageName))); TextWithHelp help = new TextWithHelp(this,
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent); GetString(Resources.GetIdentifier(scopeId + "_title", "string", PackageName)),
GetString(Resources.GetIdentifier(scopeId + "_explanation", "string", PackageName)));
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FillParent,
ViewGroup.LayoutParams.WrapContent);
help.LayoutParameters = layoutParams; help.LayoutParameters = layoutParams;
scopesContainer.AddView(help); scopesContainer.AddView(help);
} }
} }
private void SetTextOrHide(int resourceId, string text) private void SetTextOrHide(int resourceId, string text)

View File

@ -39,9 +39,15 @@ namespace keepass2android
ApplicationInfo appInfo = ri.ActivityInfo.ApplicationInfo; ApplicationInfo appInfo = ri.ActivityInfo.ApplicationInfo;
String pkgName = appInfo.PackageName; String pkgName = appInfo.PackageName;
TriggerRequest(ctx, pkgName, pluginDatabase);
}
}
public static void TriggerRequest(Context ctx, string pkgName, PluginDatabase pluginDatabase)
{
try try
{ {
Intent triggerIntent = new Intent(Strings.ActionTriggerRequestAccess); Intent triggerIntent = new Intent(Strings.ActionTriggerRequestAccess);
triggerIntent.SetPackage(pkgName); triggerIntent.SetPackage(pkgName);
triggerIntent.PutExtra(Strings.ExtraSender, ctx.PackageName); triggerIntent.PutExtra(Strings.ExtraSender, ctx.PackageName);
@ -51,13 +57,9 @@ namespace keepass2android
} }
catch (Exception e) catch (Exception e)
{ {
} }
} }
}
public override void OnReceive(Context context, Intent intent) public override void OnReceive(Context context, Intent intent)
{ {
@ -116,7 +118,8 @@ namespace keepass2android
} }
} }
if (OnReceivedRequest != null)
OnReceivedRequest(this, new PluginHostEventArgs() { Package = senderPackage});
} }
} }
@ -156,5 +159,11 @@ namespace keepass2android
intent.PutExtra(Strings.ExtraEntryId, entry.Uuid.ToHexString()); intent.PutExtra(Strings.ExtraEntryId, entry.Uuid.ToHexString());
} }
public class PluginHostEventArgs
{
public string Package { get; set; }
}
public static event EventHandler<PluginHostEventArgs> OnReceivedRequest;
} }
} }

View File

@ -5,6 +5,7 @@ using Android.Content;
using Android.Content.PM; using Android.Content.PM;
using Android.OS; using Android.OS;
using Android.Widget; using Android.Widget;
using Keepass2android.Pluginsdk;
using PluginHostTest; using PluginHostTest;
namespace keepass2android namespace keepass2android
@ -29,7 +30,7 @@ namespace keepass2android
(sender, args) => (sender, args) =>
{ {
Intent i = new Intent(this, typeof(PluginDetailsActivity)); Intent i = new Intent(this, typeof(PluginDetailsActivity));
i.PutExtra("PluginPackage", _items[args.Position].Package); i.PutExtra(Strings.ExtraPluginPackage, _items[args.Position].Package);
StartActivity(i); StartActivity(i);
}; };

View File

@ -1,11 +1,57 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/bottom_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:divider="?android:attr/dividerVertical"
android:showDividers="middle"
android:layout_alignParentBottom="true"
android:dividerPadding="12dp"
android:baselineAligned="false">
<FrameLayout
android:id="@+id/accept_button"
style="?android:attr/actionButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
style="?android:actionBarTabTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingRight="20dp"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:text="@string/accept" />
</FrameLayout>
<FrameLayout
android:id="@+id/deny_button"
style="?android:attr/actionButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
style="?android:actionBarTabTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingRight="20dp"
android:drawableLeft="?attr/CancelDrawable"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:text="@string/deny" />
</FrameLayout>
</LinearLayout>
<ScrollView <ScrollView
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/plugin_scroll" android:id="@+id/plugin_scroll"
android:layout_width="fill_parent" android:layout_width="wrap_content"
android:layout_height="fill_parent" android:layout_height="wrap_content"
android:fillViewport="true"
android:scrollbarStyle="insideOverlay"> android:scrollbarStyle="insideOverlay">
<LinearLayout android:id="@+id/scopes_list" <LinearLayout android:id="@+id/scopes_list"
android:layout_width="fill_parent" android:layout_width="fill_parent"
@ -80,3 +126,4 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
</RelativeLayout>

View File

@ -7,6 +7,7 @@
<string name="CreditsText">The User Interface is based on a port of KeepassDroid developed by Brian Pellin. Code for database operations is based on KeePass by Dominik Reichl. The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.</string> <string name="CreditsText">The User Interface is based on a port of KeepassDroid developed by Brian Pellin. Code for database operations is based on KeePass by Dominik Reichl. The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.</string>
<string name="CreditsTextSFTP">SFTP support is implemented using the JSch library under BSD licence, created by JCraft, Inc.</string> <string name="CreditsTextSFTP">SFTP support is implemented using the JSch library under BSD licence, created by JCraft, Inc.</string>
<string name="accept">Accept</string> <string name="accept">Accept</string>
<string name="deny">Deny</string>
<string name="add_entry">Add entry</string> <string name="add_entry">Add entry</string>
<string name="add_url_entry">Create entry for URL</string> <string name="add_url_entry">Create entry for URL</string>
<string name="add_group">Add group</string> <string name="add_group">Add group</string>

View File

@ -15,6 +15,9 @@ public class Strings {
*/ */
public static final String EXTRA_SCOPES = "keepass2android.EXTRA_SCOPES"; public static final String EXTRA_SCOPES = "keepass2android.EXTRA_SCOPES";
public static final String EXTRA_PLUGIN_PACKAGE = "keepass2android.EXTRA_PLUGIN_PACKAGE";
/** /**
* Extra key for sending the package name of the sender of a broadcast. * Extra key for sending the package name of the sender of a broadcast.
* Should be set in every broadcast. * Should be set in every broadcast.

View File

@ -143,140 +143,140 @@ public final class R {
public static final int beep=0x7f050000; public static final int beep=0x7f050000;
} }
public static final class string { public static final class string {
public static final int action_settings=0x7f070003; public static final int action_settings=0x7f070077;
public static final int action_show_qr=0x7f07007a; public static final int action_show_qr=0x7f070078;
public static final int all_fields=0x7f07007c; public static final int all_fields=0x7f07007a;
public static final int app_name=0x7f070000; public static final int app_name=0x7f070000;
public static final int app_picker_name=0x7f070004; public static final int app_picker_name=0x7f070001;
public static final int bookmark_picker_name=0x7f070005; public static final int bookmark_picker_name=0x7f070002;
public static final int button_add_calendar=0x7f070006; public static final int button_add_calendar=0x7f070003;
public static final int button_add_contact=0x7f070007; public static final int button_add_contact=0x7f070004;
public static final int button_book_search=0x7f070008; public static final int button_book_search=0x7f070005;
public static final int button_cancel=0x7f070009; public static final int button_cancel=0x7f070006;
public static final int button_custom_product_search=0x7f07000a; public static final int button_custom_product_search=0x7f070007;
public static final int button_dial=0x7f07000b; public static final int button_dial=0x7f070008;
public static final int button_email=0x7f07000c; public static final int button_email=0x7f070009;
public static final int button_get_directions=0x7f07000d; public static final int button_get_directions=0x7f07000a;
public static final int button_mms=0x7f07000e; public static final int button_mms=0x7f07000b;
public static final int button_ok=0x7f07000f; public static final int button_ok=0x7f07000c;
public static final int button_open_browser=0x7f070010; public static final int button_open_browser=0x7f07000d;
public static final int button_product_search=0x7f070011; public static final int button_product_search=0x7f07000e;
public static final int button_search_book_contents=0x7f070012; public static final int button_search_book_contents=0x7f07000f;
public static final int button_share_app=0x7f070013; public static final int button_share_app=0x7f070010;
public static final int button_share_bookmark=0x7f070014; public static final int button_share_bookmark=0x7f070011;
public static final int button_share_by_email=0x7f070015; public static final int button_share_by_email=0x7f070012;
public static final int button_share_by_sms=0x7f070016; public static final int button_share_by_sms=0x7f070013;
public static final int button_share_clipboard=0x7f070017; public static final int button_share_clipboard=0x7f070014;
public static final int button_share_contact=0x7f070018; public static final int button_share_contact=0x7f070015;
public static final int button_show_map=0x7f070019; public static final int button_show_map=0x7f070016;
public static final int button_sms=0x7f07001a; public static final int button_sms=0x7f070017;
public static final int button_web_search=0x7f07001b; public static final int button_web_search=0x7f070018;
public static final int button_wifi=0x7f07001c; public static final int button_wifi=0x7f070019;
public static final int contents_contact=0x7f07001d; public static final int contents_contact=0x7f07001a;
public static final int contents_email=0x7f07001e; public static final int contents_email=0x7f07001b;
public static final int contents_location=0x7f07001f; public static final int contents_location=0x7f07001c;
public static final int contents_phone=0x7f070020; public static final int contents_phone=0x7f07001d;
public static final int contents_sms=0x7f070021; public static final int contents_sms=0x7f07001e;
public static final int contents_text=0x7f070022; public static final int contents_text=0x7f07001f;
public static final int enable_as_plugin=0x7f070085; public static final int enable_as_plugin=0x7f070085;
public static final int enabled_as_plugin=0x7f070084; public static final int enabled_as_plugin=0x7f070084;
public static final int hello_world=0x7f070002; public static final int hello_world=0x7f07007f;
public static final int history_clear_one_history_text=0x7f070024; public static final int history_clear_one_history_text=0x7f070021;
public static final int history_clear_text=0x7f070023; public static final int history_clear_text=0x7f070020;
public static final int history_email_title=0x7f070025; public static final int history_email_title=0x7f070022;
public static final int history_empty=0x7f070026; public static final int history_empty=0x7f070023;
public static final int history_empty_detail=0x7f070027; public static final int history_empty_detail=0x7f070024;
public static final int history_send=0x7f070028; public static final int history_send=0x7f070025;
public static final int history_title=0x7f070029; public static final int history_title=0x7f070026;
public static final int include_label=0x7f07007b; public static final int include_label=0x7f070079;
public static final int kp2aplugin_author=0x7f07007f; public static final int kp2aplugin_author=0x7f07007d;
public static final int kp2aplugin_shortdesc=0x7f07007e; public static final int kp2aplugin_shortdesc=0x7f07007c;
public static final int kp2aplugin_title=0x7f07007d; public static final int kp2aplugin_title=0x7f07007b;
public static final int menu_encode_mecard=0x7f07002a; public static final int menu_encode_mecard=0x7f070027;
public static final int menu_encode_vcard=0x7f07002b; public static final int menu_encode_vcard=0x7f070028;
public static final int menu_help=0x7f07002c; public static final int menu_help=0x7f070029;
public static final int menu_history=0x7f07002d; public static final int menu_history=0x7f07002a;
public static final int menu_settings=0x7f07002e; public static final int menu_settings=0x7f07002b;
public static final int menu_share=0x7f07002f; public static final int menu_share=0x7f07002c;
public static final int msg_bulk_mode_scanned=0x7f070030; public static final int msg_bulk_mode_scanned=0x7f07002d;
public static final int msg_camera_framework_bug=0x7f070031; public static final int msg_camera_framework_bug=0x7f07002e;
public static final int msg_default_format=0x7f070032; public static final int msg_default_format=0x7f07002f;
public static final int msg_default_meta=0x7f070033; public static final int msg_default_meta=0x7f070030;
public static final int msg_default_mms_subject=0x7f070034; public static final int msg_default_mms_subject=0x7f070031;
public static final int msg_default_status=0x7f070035; public static final int msg_default_status=0x7f070032;
public static final int msg_default_time=0x7f070036; public static final int msg_default_time=0x7f070033;
public static final int msg_default_type=0x7f070037; public static final int msg_default_type=0x7f070034;
public static final int msg_encode_contents_failed=0x7f070038; public static final int msg_encode_contents_failed=0x7f070035;
public static final int msg_google_books=0x7f070039; public static final int msg_google_books=0x7f070036;
public static final int msg_google_product=0x7f07003a; public static final int msg_google_product=0x7f070037;
public static final int msg_intent_failed=0x7f07003b; public static final int msg_intent_failed=0x7f070038;
public static final int msg_redirect=0x7f07003c; public static final int msg_redirect=0x7f070039;
public static final int msg_sbc_book_not_searchable=0x7f07003d; public static final int msg_sbc_book_not_searchable=0x7f07003a;
public static final int msg_sbc_failed=0x7f07003e; public static final int msg_sbc_failed=0x7f07003b;
public static final int msg_sbc_no_page_returned=0x7f07003f; public static final int msg_sbc_no_page_returned=0x7f07003c;
public static final int msg_sbc_page=0x7f070040; public static final int msg_sbc_page=0x7f07003d;
public static final int msg_sbc_results=0x7f070041; public static final int msg_sbc_results=0x7f07003e;
public static final int msg_sbc_searching_book=0x7f070042; public static final int msg_sbc_searching_book=0x7f07003f;
public static final int msg_sbc_snippet_unavailable=0x7f070043; public static final int msg_sbc_snippet_unavailable=0x7f070040;
public static final int msg_share_explanation=0x7f070044; public static final int msg_share_explanation=0x7f070041;
public static final int msg_share_text=0x7f070045; public static final int msg_share_text=0x7f070042;
public static final int msg_sure=0x7f070046; public static final int msg_sure=0x7f070043;
public static final int msg_unmount_usb=0x7f070047; public static final int msg_unmount_usb=0x7f070044;
public static final int no_host_app=0x7f070082; public static final int no_host_app=0x7f070082;
public static final int not_enabled_as_plugin=0x7f070083; public static final int not_enabled_as_plugin=0x7f070083;
public static final int preferences_actions_title=0x7f070048; public static final int preferences_actions_title=0x7f070045;
public static final int preferences_auto_focus_title=0x7f070049; public static final int preferences_auto_focus_title=0x7f070046;
public static final int preferences_bulk_mode_summary=0x7f07004a; public static final int preferences_bulk_mode_summary=0x7f070047;
public static final int preferences_bulk_mode_title=0x7f07004b; public static final int preferences_bulk_mode_title=0x7f070048;
public static final int preferences_copy_to_clipboard_title=0x7f07004c; public static final int preferences_copy_to_clipboard_title=0x7f070049;
public static final int preferences_custom_product_search_summary=0x7f07004d; public static final int preferences_custom_product_search_summary=0x7f07004a;
public static final int preferences_custom_product_search_title=0x7f07004e; public static final int preferences_custom_product_search_title=0x7f07004b;
public static final int preferences_decode_1D_title=0x7f07004f; public static final int preferences_decode_1D_title=0x7f07004c;
public static final int preferences_decode_Data_Matrix_title=0x7f070050; public static final int preferences_decode_Data_Matrix_title=0x7f07004d;
public static final int preferences_decode_QR_title=0x7f070051; public static final int preferences_decode_QR_title=0x7f07004e;
public static final int preferences_device_bug_workarounds_title=0x7f070052; public static final int preferences_device_bug_workarounds_title=0x7f07004f;
public static final int preferences_disable_continuous_focus_summary=0x7f070053; public static final int preferences_disable_continuous_focus_summary=0x7f070050;
public static final int preferences_disable_continuous_focus_title=0x7f070054; public static final int preferences_disable_continuous_focus_title=0x7f070051;
public static final int preferences_disable_exposure_title=0x7f070055; public static final int preferences_disable_exposure_title=0x7f070052;
public static final int preferences_front_light_auto=0x7f070058; public static final int preferences_front_light_auto=0x7f070055;
public static final int preferences_front_light_off=0x7f070059; public static final int preferences_front_light_off=0x7f070056;
public static final int preferences_front_light_on=0x7f07005a; public static final int preferences_front_light_on=0x7f070057;
public static final int preferences_front_light_summary=0x7f070056; public static final int preferences_front_light_summary=0x7f070053;
public static final int preferences_front_light_title=0x7f070057; public static final int preferences_front_light_title=0x7f070054;
public static final int preferences_general_title=0x7f07005b; public static final int preferences_general_title=0x7f070058;
public static final int preferences_invert_scan_summary=0x7f07005d; public static final int preferences_invert_scan_summary=0x7f07005a;
public static final int preferences_invert_scan_title=0x7f07005c; public static final int preferences_invert_scan_title=0x7f070059;
public static final int preferences_name=0x7f07005e; public static final int preferences_name=0x7f07005b;
public static final int preferences_play_beep_title=0x7f07005f; public static final int preferences_play_beep_title=0x7f07005c;
public static final int preferences_remember_duplicates_summary=0x7f070060; public static final int preferences_remember_duplicates_summary=0x7f07005d;
public static final int preferences_remember_duplicates_title=0x7f070061; public static final int preferences_remember_duplicates_title=0x7f07005e;
public static final int preferences_result_title=0x7f070062; public static final int preferences_result_title=0x7f07005f;
public static final int preferences_scanning_title=0x7f070063; public static final int preferences_scanning_title=0x7f070060;
public static final int preferences_search_country=0x7f070064; public static final int preferences_search_country=0x7f070061;
public static final int preferences_supplemental_summary=0x7f070065; public static final int preferences_supplemental_summary=0x7f070062;
public static final int preferences_supplemental_title=0x7f070066; public static final int preferences_supplemental_title=0x7f070063;
public static final int preferences_try_bsplus=0x7f070077; public static final int preferences_try_bsplus=0x7f070074;
public static final int preferences_try_bsplus_summary=0x7f070078; public static final int preferences_try_bsplus_summary=0x7f070075;
public static final int preferences_vibrate_title=0x7f070067; public static final int preferences_vibrate_title=0x7f070064;
public static final int result_address_book=0x7f070068; public static final int result_address_book=0x7f070065;
public static final int result_calendar=0x7f070069; public static final int result_calendar=0x7f070066;
public static final int result_email_address=0x7f07006a; public static final int result_email_address=0x7f070067;
public static final int result_geo=0x7f07006b; public static final int result_geo=0x7f070068;
public static final int result_isbn=0x7f07006c; public static final int result_isbn=0x7f070069;
public static final int result_product=0x7f07006d; public static final int result_product=0x7f07006a;
public static final int result_sms=0x7f07006e; public static final int result_sms=0x7f07006b;
public static final int result_tel=0x7f07006f; public static final int result_tel=0x7f07006c;
public static final int result_text=0x7f070070; public static final int result_text=0x7f07006d;
public static final int result_uri=0x7f070071; public static final int result_uri=0x7f07006e;
public static final int result_wifi=0x7f070072; public static final int result_wifi=0x7f07006f;
public static final int sbc_name=0x7f070073; public static final int sbc_name=0x7f070070;
public static final int scan_qr=0x7f070080; public static final int scan_qr=0x7f070080;
public static final int show_qr=0x7f070081; public static final int show_qr=0x7f070081;
public static final int title_activity_main=0x7f070001; public static final int title_activity_main=0x7f07007e;
public static final int title_activity_qr=0x7f070079; public static final int title_activity_qr=0x7f070076;
public static final int wifi_changing_network=0x7f070074; public static final int wifi_changing_network=0x7f070071;
public static final int wifi_ssid_label=0x7f070075; public static final int wifi_ssid_label=0x7f070072;
public static final int wifi_type_label=0x7f070076; public static final int wifi_type_label=0x7f070073;
} }
public static final class style { public static final class style {
/** /**

View File

@ -15,10 +15,7 @@ public final class R {
public static final int ic_launcher = 0x7f020000; public static final int ic_launcher = 0x7f020000;
} }
public static final class string { public static final class string {
public static final int action_settings = 0x7f070003;
public static final int app_name = 0x7f070000; public static final int app_name = 0x7f070000;
public static final int hello_world = 0x7f070002;
public static final int title_activity_main = 0x7f070001;
} }
public static final class style { public static final class style {
public static final int AppBaseTheme = 0x7f080000; public static final int AppBaseTheme = 0x7f080000;

View File

@ -1,6 +1,7 @@
package keepass2android.plugin.qr; package keepass2android.plugin.qr;
import keepass2android.pluginsdk.AccessManager; import keepass2android.pluginsdk.AccessManager;
import keepass2android.pluginsdk.Strings;
import com.google.zxing.client.android.CaptureActivity; import com.google.zxing.client.android.CaptureActivity;
@ -135,7 +136,9 @@ public class MainActivity extends Activity {
public void onClick(View v) { public void onClick(View v) {
try try
{ {
Intent i = new Intent(Strings.ACTION_EDIT_PLUGIN_SETTINGS);
i.putExtra(Strings.EXTRA_PLUGIN_PACKAGE, getActivity().getPackageName());
startActivityForResult(i, 123);
} }
catch(Exception e) catch(Exception e)
{ {

View File

@ -346,7 +346,9 @@
<AndroidResource Include="Resources\layout\file_selection.xml" /> <AndroidResource Include="Resources\layout\file_selection.xml" />
<AndroidResource Include="Resources\layout\file_selection_filename.xml" /> <AndroidResource Include="Resources\layout\file_selection_filename.xml" />
<AndroidResource Include="Resources\layout\file_selection_no_recent.xml" /> <AndroidResource Include="Resources\layout\file_selection_no_recent.xml" />
<AndroidResource Include="Resources\layout\generate_password.xml" /> <AndroidResource Include="Resources\layout\generate_password.xml">
<SubType>Designer</SubType>
</AndroidResource>
<AndroidResource Include="Resources\layout\group_add_entry.xml" /> <AndroidResource Include="Resources\layout\group_add_entry.xml" />
<AndroidResource Include="Resources\layout\group_edit.xml" /> <AndroidResource Include="Resources\layout\group_edit.xml" />
<AndroidResource Include="Resources\layout\group_empty.xml" /> <AndroidResource Include="Resources\layout\group_empty.xml" />