Created
August 5, 2016 08:13
-
-
Save ericatkin/0d068f1b23f8768b703fb93db4468784 to your computer and use it in GitHub Desktop.
[PATCH] Add GET_CONTENT and INSERT actions to MainActivity to support 3rd party app integration.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 1107d45f39f920b58dc27e45837277efd925cc64 Mon Sep 17 00:00:00 2001 | |
From: Eric Atkin <eatkin@certusllc.us> | |
Date: Fri, 5 Aug 2016 01:30:00 -0600 | |
Subject: [PATCH] Add GET_CONTENT and INSERT actions to MainActivity to support | |
3rd party app integration. | |
--- | |
.idea/.name | 2 +- | |
.idea/compiler.xml | 4 +- | |
.idea/encodings.xml | 7 +- | |
.idea/gradle.xml | 9 +- | |
.idea/misc.xml | 31 ++++- | |
.idea/modules.xml | 5 +- | |
.idea/scopes/scope_settings.xml | 5 - | |
.idea/vcs.xml | 1 - | |
app/app.iml | 37 +++++- | |
app/src/main/AndroidManifest.xml | 12 ++ | |
.../org/fedorahosted/freeotp/MainActivity.java | 131 ++++++++++++++++++++- | |
.../org/fedorahosted/freeotp/TokenPersistence.java | 3 +- | |
app/src/main/res/values/strings.xml | 10 ++ | |
build.gradle | 2 +- | |
gradle/wrapper/gradle-wrapper.properties | 4 +- | |
15 files changed, 230 insertions(+), 33 deletions(-) | |
delete mode 100644 .idea/scopes/scope_settings.xml | |
diff --git a/.idea/.name b/.idea/.name | |
index 4a8890f..d92c6e9 100644 | |
--- a/.idea/.name | |
+++ b/.idea/.name | |
@@ -1 +1 @@ | |
-FreeOTP.orig | |
\ No newline at end of file | |
+freeotp | |
\ No newline at end of file | |
diff --git a/.idea/compiler.xml b/.idea/compiler.xml | |
index 217af47..1f2af51 100644 | |
--- a/.idea/compiler.xml | |
+++ b/.idea/compiler.xml | |
@@ -1,7 +1,6 @@ | |
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="CompilerConfiguration"> | |
- <option name="DEFAULT_COMPILER" value="Javac" /> | |
<resourceExtensions /> | |
<wildcardResourcePatterns> | |
<entry name="!?*.java" /> | |
@@ -19,5 +18,4 @@ | |
</profile> | |
</annotationProcessing> | |
</component> | |
-</project> | |
- | |
+</project> | |
\ No newline at end of file | |
diff --git a/.idea/encodings.xml b/.idea/encodings.xml | |
index e206d70..97626ba 100644 | |
--- a/.idea/encodings.xml | |
+++ b/.idea/encodings.xml | |
@@ -1,5 +1,6 @@ | |
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
- <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" /> | |
-</project> | |
- | |
+ <component name="Encoding"> | |
+ <file url="PROJECT" charset="UTF-8" /> | |
+ </component> | |
+</project> | |
\ No newline at end of file | |
diff --git a/.idea/gradle.xml b/.idea/gradle.xml | |
index 039a53b..58992cc 100644 | |
--- a/.idea/gradle.xml | |
+++ b/.idea/gradle.xml | |
@@ -5,14 +5,19 @@ | |
<GradleProjectSettings> | |
<option name="distributionType" value="LOCAL" /> | |
<option name="externalProjectPath" value="$PROJECT_DIR$" /> | |
- <option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.2" /> | |
- <option name="gradleJvm" value="1.8" /> | |
+ <option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.10" /> | |
<option name="modules"> | |
<set> | |
<option value="$PROJECT_DIR$" /> | |
<option value="$PROJECT_DIR$/app" /> | |
</set> | |
</option> | |
+ <option name="myModules"> | |
+ <set> | |
+ <option value="$PROJECT_DIR$" /> | |
+ <option value="$PROJECT_DIR$/app" /> | |
+ </set> | |
+ </option> | |
</GradleProjectSettings> | |
</option> | |
</component> | |
diff --git a/.idea/misc.xml b/.idea/misc.xml | |
index 50577f8..244d2f9 100644 | |
--- a/.idea/misc.xml | |
+++ b/.idea/misc.xml | |
@@ -27,14 +27,43 @@ | |
</value> | |
</option> | |
</component> | |
+ <component name="ProjectInspectionProfilesVisibleTreeState"> | |
+ <entry key="Project Default"> | |
+ <profile-state> | |
+ <expanded-state> | |
+ <State> | |
+ <id /> | |
+ </State> | |
+ </expanded-state> | |
+ <selected-state> | |
+ <State> | |
+ <id>Abstraction issues</id> | |
+ </State> | |
+ </selected-state> | |
+ </profile-state> | |
+ </entry> | |
+ </component> | |
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false"> | |
+ <OptionsSetting value="true" id="Add" /> | |
+ <OptionsSetting value="true" id="Remove" /> | |
+ <OptionsSetting value="true" id="Checkout" /> | |
+ <OptionsSetting value="true" id="Update" /> | |
+ <OptionsSetting value="true" id="Status" /> | |
+ <OptionsSetting value="true" id="Edit" /> | |
+ <ConfirmationsSetting value="0" id="Add" /> | |
+ <ConfirmationsSetting value="0" id="Remove" /> | |
+ </component> | |
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | |
<output url="file://$PROJECT_DIR$/build/classes" /> | |
</component> | |
+ <component name="ProjectType"> | |
+ <option name="id" value="Android" /> | |
+ </component> | |
<component name="masterDetails"> | |
<states> | |
<state key="ProjectJDKs.UI"> | |
<settings> | |
- <last-edited>Android API 18 Platform</last-edited> | |
+ <last-edited>Android API 20 Platform</last-edited> | |
<splitter-proportions> | |
<option name="proportions"> | |
<list> | |
diff --git a/.idea/modules.xml b/.idea/modules.xml | |
index 8269d26..b3bc7b6 100644 | |
--- a/.idea/modules.xml | |
+++ b/.idea/modules.xml | |
@@ -2,9 +2,8 @@ | |
<project version="4"> | |
<component name="ProjectModuleManager"> | |
<modules> | |
- <module fileurl="file://$PROJECT_DIR$/FreeOTP.iml" filepath="$PROJECT_DIR$/FreeOTP.iml" /> | |
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> | |
+ <module fileurl="file://$PROJECT_DIR$/freeotp.iml" filepath="$PROJECT_DIR$/freeotp.iml" /> | |
</modules> | |
</component> | |
-</project> | |
- | |
+</project> | |
\ No newline at end of file | |
diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml | |
deleted file mode 100644 | |
index 922003b..0000000 | |
--- a/.idea/scopes/scope_settings.xml | |
+++ /dev/null | |
@@ -1,5 +0,0 @@ | |
-<component name="DependencyValidationManager"> | |
- <state> | |
- <option name="SKIP_IMPORT_STATEMENTS" value="false" /> | |
- </state> | |
-</component> | |
\ No newline at end of file | |
diff --git a/.idea/vcs.xml b/.idea/vcs.xml | |
index a6929d6..94a25f7 100644 | |
--- a/.idea/vcs.xml | |
+++ b/.idea/vcs.xml | |
@@ -1,7 +1,6 @@ | |
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="VcsDirectoryMappings"> | |
- <mapping directory="" vcs="" /> | |
<mapping directory="$PROJECT_DIR$" vcs="Git" /> | |
</component> | |
</project> | |
\ No newline at end of file | |
diff --git a/app/app.iml b/app/app.iml | |
index 787b19d..c892612 100644 | |
--- a/app/app.iml | |
+++ b/app/app.iml | |
@@ -1,5 +1,5 @@ | |
<?xml version="1.0" encoding="UTF-8"?> | |
-<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="FreeOTP" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> | |
+<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="freeotp" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> | |
<component name="FacetManager"> | |
<facet type="android-gradle" name="Android-Gradle"> | |
<configuration> | |
@@ -12,10 +12,7 @@ | |
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" /> | |
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" /> | |
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" /> | |
- <option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" /> | |
- <option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" /> | |
<afterSyncTasks> | |
- <task>generateDebugAndroidTestSources</task> | |
<task>generateDebugSources</task> | |
</afterSyncTasks> | |
<option name="ALLOW_USER_CONFIGURATION" value="false" /> | |
@@ -28,7 +25,7 @@ | |
</component> | |
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false"> | |
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" /> | |
- <output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" /> | |
+ <output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" /> | |
<exclude-output /> | |
<content url="file://$MODULE_DIR$"> | |
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" /> | |
@@ -50,6 +47,15 @@ | |
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" /> | |
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" /> | |
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" /> | |
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" /> | |
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> | |
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" /> | |
@@ -57,6 +63,7 @@ | |
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> | |
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" /> | |
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" /> | |
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" /> | |
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" /> | |
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" /> | |
@@ -64,16 +71,34 @@ | |
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" /> | |
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" /> | |
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" /> | |
+ <sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" /> | |
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" /> | |
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" /> | |
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" /> | |
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" /> | |
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" /> | |
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" /> | |
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" /> | |
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" /> | |
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" /> | |
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" /> | |
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-verifier" /> | |
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" /> | |
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" /> | |
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" /> | |
- <excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" /> | |
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" /> | |
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" /> | |
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" /> | |
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> | |
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" /> | |
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> | |
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" /> | |
<excludeFolder url="file://$MODULE_DIR$/build/outputs" /> | |
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml | |
index a2bf533..22beee2 100644 | |
--- a/app/src/main/AndroidManifest.xml | |
+++ b/app/src/main/AndroidManifest.xml | |
@@ -95,6 +95,18 @@ | |
<data android:scheme="otpauth" android:host="totp" /> | |
<data android:scheme="otpauth" android:host="hotp" /> | |
</intent-filter> | |
+ <intent-filter> | |
+ <action android:name="android.intent.action.INSERT" /> | |
+ <category android:name="android.intent.category.DEFAULT" /> | |
+ <data android:scheme="otpauth" android:host="totp" /> | |
+ <data android:scheme="otpauth" android:host="hotp" /> | |
+ </intent-filter> | |
+ <intent-filter> | |
+ <action android:name="android.intent.action.GET_CONTENT" /> | |
+ <category android:name="android.intent.category.DEFAULT" /> | |
+ <data android:scheme="otpauth" android:host="totp" /> | |
+ <data android:scheme="otpauth" android:host="hotp" /> | |
+ </intent-filter> | |
</activity> | |
</application> | |
</manifest> | |
diff --git a/app/src/main/java/org/fedorahosted/freeotp/MainActivity.java b/app/src/main/java/org/fedorahosted/freeotp/MainActivity.java | |
index f1cc81b..11358f1 100644 | |
--- a/app/src/main/java/org/fedorahosted/freeotp/MainActivity.java | |
+++ b/app/src/main/java/org/fedorahosted/freeotp/MainActivity.java | |
@@ -40,10 +40,15 @@ import org.fedorahosted.freeotp.add.AddActivity; | |
import org.fedorahosted.freeotp.add.ScanActivity; | |
import android.app.Activity; | |
+import android.app.AlertDialog; | |
+import android.content.Context; | |
+import android.content.DialogInterface; | |
import android.content.Intent; | |
+import android.content.SharedPreferences; | |
import android.database.DataSetObserver; | |
import android.net.Uri; | |
import android.os.Bundle; | |
+import android.util.Log; | |
import android.view.Menu; | |
import android.view.MenuItem; | |
import android.view.MenuItem.OnMenuItemClickListener; | |
@@ -51,6 +56,8 @@ import android.view.View; | |
import android.view.WindowManager.LayoutParams; | |
import android.widget.GridView; | |
+import com.google.gson.Gson; | |
+ | |
public class MainActivity extends Activity implements OnMenuItemClickListener { | |
private TokenAdapter mTokenAdapter; | |
private DataSetObserver mDataSetObserver; | |
@@ -132,8 +139,126 @@ public class MainActivity extends Activity implements OnMenuItemClickListener { | |
protected void onNewIntent(Intent intent) { | |
super.onNewIntent(intent); | |
- Uri uri = intent.getData(); | |
- if (uri != null) | |
- TokenPersistence.addWithToast(this, uri.toString()); | |
+ final Uri uri = intent.getData(); | |
+ if (uri != null) { | |
+ String action = intent.getAction(); | |
+ if (action.equals(Intent.ACTION_VIEW)) { | |
+ TokenPersistence.addWithToast(this, uri.toString()); | |
+ return; | |
+ } | |
+ try { | |
+ final Token token = new Token(uri); | |
+ final String key = token.getID(); | |
+ final Intent out = new Intent(); | |
+ out.putExtra("key", key); | |
+ String appname = intent.getStringExtra("appname"); | |
+ if (appname == null) { | |
+ appname = getString(R.string.default_appname); | |
+ } | |
+ final SharedPreferences prefs = getSharedPreferences(TokenPersistence.NAME, Context.MODE_PRIVATE); | |
+ switch (action) { | |
+ case Intent.ACTION_GET_CONTENT: | |
+ if (prefs.contains(key)) { | |
+ new AlertDialog.Builder(this) | |
+ .setTitle(R.string.attention) | |
+ .setMessage(appname + getString(R.string.request_code) + "\"" + key + "\"") | |
+ .setCancelable(false) | |
+ .setPositiveButton(R.string.allow, new DialogInterface.OnClickListener() { | |
+ @Override | |
+ public void onClick(DialogInterface dialogInterface, int i) { | |
+ out.putExtra("currentCode", new Gson().fromJson(prefs.getString(key, null), Token.class).generateCodes().getCurrentCode()); | |
+ setResult(Activity.RESULT_OK, out); | |
+ finish(); | |
+ } | |
+ }) | |
+ .setNegativeButton(R.string.deny, new DialogInterface.OnClickListener() { | |
+ @Override | |
+ public void onClick(DialogInterface dialogInterface, int i) { | |
+ setResult(Activity.RESULT_CANCELED, out); | |
+ finish(); | |
+ } | |
+ }) | |
+ .show() | |
+ ; | |
+ } else { | |
+ setResult(Activity.RESULT_CANCELED, out); | |
+ finish(); | |
+ } | |
+ break; | |
+ case Intent.ACTION_INSERT: | |
+ if (prefs.contains(key)) { | |
+ new AlertDialog.Builder(MainActivity.this) | |
+ .setTitle(R.string.error) | |
+ .setMessage(String.format(getString(R.string.token_already_exists), key)) | |
+ .setCancelable(false) | |
+ .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { | |
+ @Override | |
+ public void onClick(DialogInterface dialogInterface, int i) { | |
+ setResult(Activity.RESULT_CANCELED, out); | |
+ finish(); | |
+ } | |
+ }) | |
+ .show() | |
+ ; | |
+ } else { | |
+ new AlertDialog.Builder(this) | |
+ .setTitle(R.string.attention) | |
+ .setMessage(appname + getString(R.string.request_install_token) + "\"" + key + "\"") | |
+ .setCancelable(false) | |
+ .setPositiveButton(R.string.allow, new DialogInterface.OnClickListener() { | |
+ @Override | |
+ public void onClick(DialogInterface dialogInterface, int i) { | |
+ try { | |
+ new TokenPersistence(MainActivity.this).add(token); | |
+ out.putExtra("currentCode", token.generateCodes().getCurrentCode()); | |
+ out.putExtra("secret", uri.getQueryParameter("secret")); | |
+ setResult(Activity.RESULT_OK, out); | |
+ finish(); | |
+ } catch (Token.TokenUriInvalidException e) { | |
+ new AlertDialog.Builder(MainActivity.this) | |
+ .setTitle(R.string.error) | |
+ .setMessage(getString(R.string.bad_token_uri) + uri.toString()) | |
+ .setCancelable(false) | |
+ .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { | |
+ @Override | |
+ public void onClick(DialogInterface dialogInterface, int i) { | |
+ setResult(Activity.RESULT_CANCELED, out); | |
+ finish(); | |
+ } | |
+ }) | |
+ .show() | |
+ ; | |
+ } | |
+ } | |
+ }) | |
+ .setNegativeButton(R.string.deny, new DialogInterface.OnClickListener() { | |
+ @Override | |
+ public void onClick(DialogInterface dialogInterface, int i) { | |
+ setResult(Activity.RESULT_CANCELED, out); | |
+ finish(); | |
+ } | |
+ }) | |
+ .show() | |
+ ; | |
+ } | |
+ break; | |
+ default: | |
+ Log.e("LOG", "bad action: " + action); | |
+ } | |
+ } catch (Token.TokenUriInvalidException e) { | |
+ new AlertDialog.Builder(this) | |
+ .setTitle(R.string.error) | |
+ .setMessage(getString(R.string.bad_token_uri) + uri.toString()) | |
+ .setCancelable(false) | |
+ .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { | |
+ @Override | |
+ public void onClick(DialogInterface dialogInterface, int i) { | |
+ finish(); | |
+ } | |
+ }) | |
+ .show() | |
+ ; | |
+ } | |
+ } | |
} | |
} | |
diff --git a/app/src/main/java/org/fedorahosted/freeotp/TokenPersistence.java b/app/src/main/java/org/fedorahosted/freeotp/TokenPersistence.java | |
index 3d450f9..8c4ba37 100644 | |
--- a/app/src/main/java/org/fedorahosted/freeotp/TokenPersistence.java | |
+++ b/app/src/main/java/org/fedorahosted/freeotp/TokenPersistence.java | |
@@ -8,7 +8,6 @@ import org.fedorahosted.freeotp.Token.TokenUriInvalidException; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
-import android.net.Uri; | |
import android.widget.Toast; | |
import com.google.gson.Gson; | |
@@ -16,7 +15,7 @@ import com.google.gson.JsonSyntaxException; | |
import com.google.gson.reflect.TypeToken; | |
public class TokenPersistence { | |
- private static final String NAME = "tokens"; | |
+ protected static final String NAME = "tokens"; | |
private static final String ORDER = "tokenOrder"; | |
private final SharedPreferences prefs; | |
private final Gson gson; | |
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml | |
index de39f41..3f6b297 100644 | |
--- a/app/src/main/res/values/strings.xml | |
+++ b/app/src/main/res/values/strings.xml | |
@@ -38,6 +38,16 @@ | |
<string name="delete_summary">This is your last chance: if you delete this token, it will be gone forever. It will not be disabled on the server.</string> | |
<string name="delete_question">Delete this token?</string> | |
+ <string name="attention">Attention</string> | |
+ <string name="error">Error</string> | |
+ <string name="allow">Allow</string> | |
+ <string name="deny">Deny</string> | |
+ <string name="default_appname">An unspecified app</string> | |
+ <string name="request_code">" has requested a code for token "</string> | |
+ <string name="request_install_token">" has requested to install a token for "</string> | |
+ <string name="bad_token_uri">"Bad token uri: "</string> | |
+ <string name="token_already_exists">Token \"%s\" already exists</string> | |
+ | |
<string-array name="algorithms"> | |
<item>MD5</item> | |
<item>SHA1</item> | |
diff --git a/build.gradle b/build.gradle | |
index f4d8c54..aa14138 100644 | |
--- a/build.gradle | |
+++ b/build.gradle | |
@@ -4,7 +4,7 @@ buildscript { | |
jcenter() | |
} | |
dependencies { | |
- classpath 'com.android.tools.build:gradle:1.5.0' | |
+ classpath 'com.android.tools.build:gradle:2.1.2' | |
} | |
} | |
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties | |
index bb99d12..b0e29d3 100644 | |
--- a/gradle/wrapper/gradle-wrapper.properties | |
+++ b/gradle/wrapper/gradle-wrapper.properties | |
@@ -1,6 +1,6 @@ | |
-#Tue Nov 25 17:56:21 EST 2014 | |
+#Sun Jul 31 22:13:26 MDT 2016 | |
distributionBase=GRADLE_USER_HOME | |
distributionPath=wrapper/dists | |
zipStoreBase=GRADLE_USER_HOME | |
zipStorePath=wrapper/dists | |
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip | |
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip | |
-- | |
2.9.0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment