more inputstick updates from Jakup

This commit is contained in:
Philipp Crocoll 2014-12-10 22:33:27 +01:00
parent 5f5bd67939
commit 2a2c8b0c0f
9 changed files with 108 additions and 76 deletions

View File

@ -2,5 +2,5 @@
package com.inputstick.api; package com.inputstick.api;
public final class BuildConfig { public final class BuildConfig {
public final static boolean DEBUG = false; public final static boolean DEBUG = true;
} }

View File

@ -11,5 +11,5 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target. # Project target.
target=android-20 target=android-19
android.library=true android.library=true

View File

@ -54,8 +54,14 @@
</activity> </activity>
<activity <activity
android:name=".MaskedPasswordActivity" android:name=".MaskedPasswordActivity"
android:label="@string/title_activity_masked_password"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:label="@string/title_activity_masked_password"
android:theme="@android:style/Theme.Dialog" >
</activity>
<activity
android:name=".MacSetupActivity"
android:excludeFromRecents="true"
android:label="@string/title_activity_mac_setup"
android:theme="@android:style/Theme.Dialog" > android:theme="@android:style/Theme.Dialog" >
</activity> </activity>
</application> </application>

View File

@ -15,7 +15,7 @@ public final class R {
public static final int ic_launcher = 0x7f020000; public static final int ic_launcher = 0x7f020000;
} }
public static final class id { public static final class id {
public static final int action_settings = 0x7f0b001d; public static final int action_settings = 0x7f0b0021;
} }
public static final class menu { public static final class menu {
public static final int install_utility = 0x7f0a0000; public static final int install_utility = 0x7f0a0000;

View File

@ -41,42 +41,47 @@ public final class R {
public static final int ic_notification=0x7f020001; public static final int ic_notification=0x7f020001;
} }
public static final class id { public static final class id {
public static final int LinearLayout1=0x7f0b0016; public static final int LinearLayout1=0x7f0b001a;
public static final int RelativeLayout1=0x7f0b0001; public static final int RelativeLayout1=0x7f0b0005;
public static final int action_settings=0x7f0b001d; public static final int action_settings=0x7f0b0021;
public static final int button1=0x7f0b001b; public static final int button1=0x7f0b001f;
public static final int button2=0x7f0b001c; public static final int button2=0x7f0b0020;
public static final int buttonChar1=0x7f0b0005; public static final int buttonChar1=0x7f0b0009;
public static final int buttonChar10=0x7f0b000e; public static final int buttonChar10=0x7f0b0012;
public static final int buttonChar11=0x7f0b000f; public static final int buttonChar11=0x7f0b0013;
public static final int buttonChar12=0x7f0b0010; public static final int buttonChar12=0x7f0b0014;
public static final int buttonChar13=0x7f0b0011; public static final int buttonChar13=0x7f0b0015;
public static final int buttonChar14=0x7f0b0012; public static final int buttonChar14=0x7f0b0016;
public static final int buttonChar15=0x7f0b0013; public static final int buttonChar15=0x7f0b0017;
public static final int buttonChar16=0x7f0b0014; public static final int buttonChar16=0x7f0b0018;
public static final int buttonChar2=0x7f0b0006; public static final int buttonChar2=0x7f0b000a;
public static final int buttonChar3=0x7f0b0007; public static final int buttonChar3=0x7f0b000b;
public static final int buttonChar4=0x7f0b0008; public static final int buttonChar4=0x7f0b000c;
public static final int buttonChar5=0x7f0b0009; public static final int buttonChar5=0x7f0b000d;
public static final int buttonChar6=0x7f0b000a; public static final int buttonChar6=0x7f0b000e;
public static final int buttonChar7=0x7f0b000b; public static final int buttonChar7=0x7f0b000f;
public static final int buttonChar8=0x7f0b000c; public static final int buttonChar8=0x7f0b0010;
public static final int buttonChar9=0x7f0b000d; public static final int buttonChar9=0x7f0b0011;
public static final int buttonNext=0x7f0b0004; public static final int buttonNext=0x7f0b0008;
public static final int buttonPrev=0x7f0b0002; public static final int buttonNextToShift=0x7f0b0002;
public static final int checkBoxAutoConnect=0x7f0b0017; public static final int buttonPrev=0x7f0b0006;
public static final int checkBoxShowPassword=0x7f0b0015; public static final int buttonShiftDummy=0x7f0b0001;
public static final int container=0x7f0b0000; public static final int checkBoxAutoConnect=0x7f0b001b;
public static final int linearLayout1=0x7f0b0003; public static final int checkBoxShowPassword=0x7f0b0019;
public static final int radioButtonPrimary=0x7f0b0019; public static final int container=0x7f0b0004;
public static final int radioButtonSecondary=0x7f0b001a; public static final int linearLayout1=0x7f0b0007;
public static final int radioGroup1=0x7f0b0018; public static final int radioButtonPrimary=0x7f0b001d;
public static final int radioButtonSecondary=0x7f0b001e;
public static final int radioGroup1=0x7f0b001c;
public static final int textViewLayoutInfo=0x7f0b0000;
public static final int textViewMacSetupInfo=0x7f0b0003;
} }
public static final class layout { public static final class layout {
public static final int activity_main=0x7f030000; public static final int activity_mac_setup=0x7f030000;
public static final int activity_masked_password=0x7f030001; public static final int activity_main=0x7f030001;
public static final int activity_quick_settings=0x7f030002; public static final int activity_masked_password=0x7f030002;
public static final int fragment_main=0x7f030003; public static final int activity_quick_settings=0x7f030003;
public static final int fragment_main=0x7f030004;
} }
public static final class menu { public static final class menu {
public static final int install_utility=0x7f0a0000; public static final int install_utility=0x7f0a0000;
@ -87,7 +92,8 @@ public final class R {
} }
public static final class string { public static final class string {
public static final int action_input_stick=0x7f070007; public static final int action_input_stick=0x7f070007;
public static final int action_masked_password=0x7f07000e; public static final int action_masked_password=0x7f07000f;
public static final int action_open_mac_setup=0x7f07000e;
public static final int action_open_settings=0x7f07000d; public static final int action_open_settings=0x7f07000d;
public static final int action_quick_settings=0x7f07000c; public static final int action_quick_settings=0x7f07000c;
public static final int action_settings=0x7f070002; public static final int action_settings=0x7f070002;
@ -96,41 +102,43 @@ public final class R {
public static final int action_type_user_tab_pass=0x7f07000a; public static final int action_type_user_tab_pass=0x7f07000a;
public static final int action_type_user_tab_pass_enter=0x7f07000b; public static final int action_type_user_tab_pass_enter=0x7f07000b;
public static final int app_name=0x7f070000; public static final int app_name=0x7f070000;
public static final int autoconnect_summary=0x7f070024; public static final int autoconnect_summary=0x7f070026;
public static final int autoconnect_title=0x7f070023; public static final int autoconnect_title=0x7f070025;
public static final int changelog_full_title=0x7f070013; public static final int changelog_full_title=0x7f070014;
public static final int changelog_ok_button=0x7f070015; public static final int changelog_ok_button=0x7f070016;
public static final int changelog_show_full=0x7f070016; public static final int changelog_show_full=0x7f070017;
public static final int changelog_title=0x7f070014; public static final int changelog_title=0x7f070015;
public static final int configuration_message=0x7f070012; public static final int configuration_message=0x7f070013;
public static final int configuration_title=0x7f070011; public static final int configuration_title=0x7f070012;
/** Strings related to Settings /** Strings related to Settings
*/ */
public static final int configure_plugin=0x7f070018; public static final int configure_plugin=0x7f07001a;
public static final int connection_settings_title=0x7f07001b; public static final int connection_settings_title=0x7f07001d;
public static final int enable_secondary_layout_title=0x7f07001f; public static final int enable_secondary_layout_title=0x7f070021;
public static final int enter_after_url_title=0x7f070022; public static final int enter_after_url_title=0x7f070024;
public static final int hello_world=0x7f070003; public static final int hello_world=0x7f070003;
public static final int kp2aplugin_author=0x7f070006; public static final int kp2aplugin_author=0x7f070006;
public static final int kp2aplugin_shortdesc=0x7f070005; public static final int kp2aplugin_shortdesc=0x7f070005;
public static final int kp2aplugin_title=0x7f070004; public static final int kp2aplugin_title=0x7f070004;
public static final int layout_title=0x7f07001d; public static final int layout_title=0x7f07001f;
public static final int secondary_layout_title=0x7f07001e; public static final int mac_setup_summary=0x7f07002d;
public static final int show_changelog_title=0x7f070019; public static final int secondary_layout_title=0x7f070020;
public static final int show_masked_title=0x7f070028; public static final int show_changelog_title=0x7f07001b;
public static final int show_quick_settings_title=0x7f07002a; public static final int show_mac_setup_title=0x7f07002c;
public static final int show_secondary_summary=0x7f070021; public static final int show_masked_title=0x7f07002a;
public static final int show_secondary_title=0x7f070020; public static final int show_secondary_summary=0x7f070023;
public static final int show_settings_title=0x7f070029; public static final int show_secondary_title=0x7f070022;
public static final int show_tab_enter_title=0x7f070025; public static final int show_settings_title=0x7f07002b;
public static final int show_user_pass_enter_title=0x7f070027; public static final int show_tab_enter_title=0x7f070027;
public static final int show_user_pass_title=0x7f070026; public static final int show_user_pass_enter_title=0x7f070029;
public static final int title_activity_init=0x7f070010; public static final int show_user_pass_title=0x7f070028;
public static final int title_activity_init=0x7f070011;
public static final int title_activity_install_utility=0x7f070001; public static final int title_activity_install_utility=0x7f070001;
public static final int title_activity_masked_password=0x7f07000f; public static final int title_activity_mac_setup=0x7f070018;
public static final int title_activity_settings=0x7f070017; public static final int title_activity_masked_password=0x7f070010;
public static final int typing_settings_title=0x7f07001a; public static final int title_activity_settings=0x7f070019;
public static final int ui_settings_title=0x7f07001c; public static final int typing_settings_title=0x7f07001c;
public static final int ui_settings_title=0x7f07001e;
} }
public static final class style { public static final class style {
/** /**

View File

@ -13,17 +13,17 @@
<string name="action_type_user_tab_pass_enter">Type username/password/enter with InputStick</string> <string name="action_type_user_tab_pass_enter">Type username/password/enter with InputStick</string>
<string name="action_quick_settings">(InputStick) Quick settings</string> <string name="action_quick_settings">(InputStick) Quick settings</string>
<string name="action_open_settings">(InputStick) Settings</string> <string name="action_open_settings">(InputStick) Settings</string>
<string name="action_open_mac_setup">(InputStick) Mac OSX setup</string>
<string name="action_masked_password">(InputStick) Masked Password</string> <string name="action_masked_password">(InputStick) Masked Password</string>
<string name="title_activity_masked_password">Type Masked Password</string> <string name="title_activity_masked_password">Type Masked Password</string>
<string name="title_activity_init">Plugin Init</string> <string name="title_activity_init">Plugin Init</string>
<string name="configuration_title">Plugin Configuration</string> <string name="configuration_title">Plugin Configuration</string>
<string name="configuration_message">Please take a minute to configure the plugin.\n\nConfigure as plugin -> Accept\n\nMake sure that host keyboard layout matches the one used by USB host (your PC).\nEnable and set secondary layout if you work with different keyboard layouts.\n\nENABLE autoconnect if InputStick is used most of the time. Application will try to connect to InputStick everytime entry is opened.\nDISABLE autoconnect when InputStick is used occasionally. Application will not connect unless you request typing.\n\nRemember: this plugin requires InputStickUtility app to be installed.</string> <string name="configuration_message">Please take a minute to configure the plugin.\n\nConfigure as plugin -> Accept\n\nMake sure that host keyboard layout matches the one used by USB host (your PC).\nEnable and set secondary layout if you work with different keyboard layouts.\n\nENABLE autoconnect if InputStick is used most of the time. Application will try to connect to InputStick everytime entry is opened.\nDISABLE autoconnect when InputStick is used occasionally. Application will not connect unless you request typing.\n\nRemember: this plugin requires InputStickUtility app to be installed.</string>
<string name="changelog_full_title">Change Log</string> <string name="changelog_full_title">Change Log</string>
<string name="changelog_title">What\'s New</string> <string name="changelog_title">What\'s New</string>
<string name="changelog_ok_button">OK</string> <string name="changelog_ok_button">OK</string>
<string name="changelog_show_full">more...</string> <string name="changelog_show_full">more...</string>
<string name="title_activity_mac_setup">Mac OSX Setup</string>
<string name="hello_world">Hello world!</string>
</resources> </resources>

View File

@ -29,8 +29,9 @@
<string name="show_user_pass_enter_title">Show username/password/enter shortcut</string> <string name="show_user_pass_enter_title">Show username/password/enter shortcut</string>
<string name="show_masked_title">Show Masked Password shortcut</string> <string name="show_masked_title">Show Masked Password shortcut</string>
<string name="show_settings_title">Show Settings shortcut</string> <string name="show_settings_title">Show Settings shortcut</string>
<string name="show_quick_settings_title">Show Tab and Enter actions</string>
<string name="show_mac_setup_title">Show Mac OSX Setup shortcut</string>
<string name="mac_setup_summary">Allows to properly identify InputStick as a keyboard on OSX PCs.</string>

View File

@ -88,6 +88,12 @@
android:key="show_settings" android:key="show_settings"
android:title="@string/show_settings_title" /> android:title="@string/show_settings_title" />
<CheckBoxPreference
android:defaultValue="true"
android:key="show_mac_setup"
android:summary="@string/mac_setup_summary"
android:title="@string/show_mac_setup_title" />
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

View File

@ -16,6 +16,7 @@ public class ActionReceiver extends keepass2android.pluginsdk.PluginActionBroadc
private static final String ACTION_SETTINGS = "settings"; private static final String ACTION_SETTINGS = "settings";
private static final String ACTION_USER_PASS = "user_pass"; private static final String ACTION_USER_PASS = "user_pass";
private static final String ACTION_USER_PASS_ENTER = "user_pass_enter"; private static final String ACTION_USER_PASS_ENTER = "user_pass_enter";
private static final String ACTION_MAC_SETUP = "mac_setup";
private static final int IC = R.drawable.ic_launcher; private static final int IC = R.drawable.ic_launcher;
@ -124,6 +125,12 @@ public class ActionReceiver extends keepass2android.pluginsdk.PluginActionBroadc
b.putString(Const.EXTRA_TEXT, ACTION_SETTINGS); b.putString(Const.EXTRA_TEXT, ACTION_SETTINGS);
oe.addEntryAction(ctx.getString(R.string.action_open_settings), IC, b); oe.addEntryAction(ctx.getString(R.string.action_open_settings), IC, b);
} }
if (prefs.getBoolean("show_mac_setup", true)) {
b = new Bundle();
b.putString(Const.EXTRA_TEXT, ACTION_MAC_SETUP);
oe.addEntryAction(ctx.getString(R.string.action_open_mac_setup), IC, b);
}
} catch (PluginAccessException e) { } catch (PluginAccessException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -165,7 +172,6 @@ public class ActionReceiver extends keepass2android.pluginsdk.PluginActionBroadc
if (ACTION_MASKED_PASSWORD.equals(text)) { if (ACTION_MASKED_PASSWORD.equals(text)) {
typeText(ctx, "", "en-US"); //will connect if not already connected typeText(ctx, "", "en-US"); //will connect if not already connected
Intent i = new Intent(ctx.getApplicationContext(), MaskedPasswordActivity.class); Intent i = new Intent(ctx.getApplicationContext(), MaskedPasswordActivity.class);
i.putExtra(Const.EXTRA_TEXT, actionSelected.getEntryFields().get(KeepassDefs.PasswordField)); i.putExtra(Const.EXTRA_TEXT, actionSelected.getEntryFields().get(KeepassDefs.PasswordField));
i.putExtra(Const.EXTRA_LAYOUT, layoutName); i.putExtra(Const.EXTRA_LAYOUT, layoutName);
@ -184,6 +190,11 @@ public class ActionReceiver extends keepass2android.pluginsdk.PluginActionBroadc
typeText(ctx, "\t", layoutName); typeText(ctx, "\t", layoutName);
typeText(ctx, actionSelected.getEntryFields().get(KeepassDefs.PasswordField), layoutName); typeText(ctx, actionSelected.getEntryFields().get(KeepassDefs.PasswordField), layoutName);
typeText(ctx, "\n", layoutName); typeText(ctx, "\n", layoutName);
} else if (ACTION_MAC_SETUP.equals(text)) {
typeText(ctx, "", "en-US"); //will connect if not already connected
Intent i = new Intent(ctx.getApplicationContext(), MacSetupActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
ctx.getApplicationContext().startActivity(i);
} else { } else {
typeText(ctx, text, layoutName); typeText(ctx, text, layoutName);
} }