Commit Graph

235 Commits

Author SHA1 Message Date
Markus Doits
fc05dfd8b7 Prevent null pointer exception
Error-msg should be better, though.
2011-01-11 22:24:08 +00:00
Markus Doits
d367bc12f8 Make some things static
*Should* speed up encryption, or better: does not make encryption using
AIDL slower than using APG directly.
2011-01-11 17:58:13 +00:00
Markus Doits
51b63d099c Allow helper to clear args and set booleans 2011-01-09 20:12:12 +00:00
Markus Doits
3f0c80882e Explain AIDL options a little bit more in detail 2011-01-09 20:12:03 +00:00
Markus Doits
def11ad18f Document new args in AIDL 2011-01-09 19:16:54 +00:00
Markus Doits
c84c449035 Respect options but allow to overwrite them for each call
By default the values set in APG's options are respected now. But they
can be overwritten by special parameters passed through.
2011-01-09 19:16:45 +00:00
Markus Doits
9e089f03b6 Prefix local vars with "_" 2011-01-09 19:16:22 +00:00
Markus Doits
a29dfc0add Reset errors before calling, make some vars final, minor cleanups 2011-01-09 17:17:27 +00:00
Markus Doits
91da2dd2ea Remove obsolete import 2011-01-09 17:17:18 +00:00
Markus Doits
b1e8194ce2 Remove weird line 2011-01-09 17:17:08 +00:00
Markus Doits
1a338de47e Redesign AIDL-Interface once more
Using Bundles makes passing data easier and does not need to redefine
the interface if the internel functions change.

The helper class has been updated accordingly. In addition, it wrappes
completely around all input and output (if wanted).
2011-01-05 14:07:09 +00:00
Markus Doits
dbb46f1633 Remove forgotten line 2011-01-04 23:09:56 +00:00
Markus Doits
6477f60764 Add connection helper for other projects
This eases using the AIDL-Interface and is the recommended way for other
project to implement the connection.
2011-01-04 23:08:08 +00:00
Markus Doits
2660c561a1 Reload preferences on call
refs r326
2010-12-30 13:48:24 +00:00
Markus Doits
86e06eeabe Allow to regenerate shared preferences
Merge of r326 to trunk
2010-12-30 13:47:10 +00:00
Markus Doits
ed0df2803f Allow to regenerate shared preferences
I encountered a problem that changing preferences in APG did not change
the preferences in ApgService after it was called once:

1. call getPreferences
2. change settings in APG
3. call getPreferences again

--> the result at 3. was still having preferences from 1.

To work around this, the function getPreferences has been updated to
force the new generation of preferences while not breaking any other
code relying on the old behaviour.
2010-12-30 13:39:46 +00:00
Markus Doits
6634f40bc2 Merge trunk into apg_service 2010-12-29 16:43:10 +00:00
Markus Doits
e8d29c01c2 Add first basic implementation of Apgservice
Provides an AIDL-API for other apps to encrypt and decrypt a string
symmetrically with a passphrase. Function names and API is by no way
finalized and will change!

Support for asymetric encription will follow.

For reference and discussion see issue #71,
https://code.google.com/p/android-privacy-guard/issues/detail?id=71
2010-12-29 16:31:58 +00:00
Markus Doits
1edac5a61e Allow progress-meter to be null
No need to force people to use progressmeter
2010-12-29 12:11:25 +00:00
Thialfihar
9687e9b1a3 auto-click encrypt/decrypt button when using an *_AND_RETURN Intent with EXTRA_DATA or ContentURI
Fixes issue 67
2010-12-25 19:24:04 +00:00
Thialfihar
9e8b266bf0 show key fingerprint in key list
Fixes issue 76
2010-12-25 19:12:35 +00:00
Thialfihar
ee1918b7c8 DataSource: consider content URI sources "binary" also 2010-12-25 14:12:12 +00:00
Thialfihar
428cf39ba3 added an Intent and functionality to generate detached signatures 2010-12-25 14:00:25 +00:00
Thialfihar
f55d4d55a5 start encryption/decryption for ENCRYPT_AND_RETURN/DECRYPT_AND_RETURN if MESSAGE_DATA is used rather than MESSAGE_TEXT 2010-09-26 17:46:13 +00:00
Thialfihar
3052ae80d5 testing thread-pausing in verifyText() 2010-09-12 19:06:26 +00:00
Thialfihar
b91f9397d9 moved some Intent extra constants into more appropriate places, some basic preparations to test thread-pausing during decryption/encryption to deal with certain situations, mainly an unknown signature key 2010-09-11 23:21:53 +00:00
Thialfihar
bc50ca0093 catch null pointer exceptions when the private key cannot be extracted, also prevent such keys from getting imported, so the error message should never be encountered anyway
Fixes issue 66
2010-09-10 20:36:38 +00:00
Thialfihar
41c3c52a42 trivial variable renaming 2010-08-31 20:25:14 +00:00
Thialfihar
12d9bb8dee moved key editing beta warning into strings.xml
Update issue 39
added:
<string name="keyEditingIsBeta">Key editing is still kind of beta.</string>
2010-08-22 10:51:24 +00:00
Thialfihar
996a1dbe1c integrated key server look-up into decrypt Activity, allowing to touch an unkown signature to import the key
Update issue 39
added:
<string name="unknownSignatureKeyTouchToLookUp">Unknown signature, touch to look up key.</string>
2010-08-18 12:26:13 +00:00
Thialfihar
08305b4963 explicitly set a timeout for connecting and reading for a key server query 2010-08-18 00:53:18 +00:00
Thialfihar
18de5178f8 starting new versioning for beta builds, only show changelog on release builds 2010-08-18 00:42:45 +00:00
Thialfihar
4f25edbe97 added a context menu item to update public keys via key server, adding a key id look up Intent for the key server query
Update issue 9
Status: Fixed
Added public key update via key server. Considering this issue fixed now. More key server features will be added, but general support is added.
2010-08-18 00:23:28 +00:00
Thialfihar
c57c36b3a5 use the key server preference to fill a Spinner in the key server query activity, allowing to query each server, also moved some previously static labels into strings.xml
Update issue 9
Key server preferences are now used in key server query activity.
2010-08-17 23:05:41 +00:00
Thialfihar
fc0ae774cd moved IntegerListPreference to apg.ui.widget 2010-08-17 22:03:56 +00:00
Thialfihar
446f4b493d added a key server preference, allowing multiple key servers to be added
Update issue 9
Key server preference added.
2010-08-17 21:49:34 +00:00
Thialfihar
e4dd80005c gave HKP server proper error handling, going through all IPs of a pool until a response is received, reporting "too many responses", "no keys found", "insufficient query" correctly
Update issue 9
Proper error handling added.
2010-08-17 14:51:39 +00:00
Thialfihar
96162b6608 properly URI-decode file:// URIs, so the files can be found
Fixes issues 63
2010-08-17 12:50:42 +00:00
Thialfihar
6e9146c91a added initial support for HKP key servers, allowing searching and key import
Update issue 9
Can search a key server now, touch a result to import the key. Still needs better error handling and some Intents to import keys based on key ID. Also still need key server preferences.
2010-08-17 01:02:39 +00:00
Thialfihar
bd99b2590b 1.0.x merged back into trunk 2010-08-15 17:32:08 +00:00
Thialfihar
0f226e40cb minor Intent/Extra key renamings 2010-08-12 17:00:52 +00:00
Thialfihar
281535cfcc changed the account adding a bit, hopefully working with Froyo, at least preventing a crash
Update issue 39
added:
<string name="error_accountReadingNotAllowed">no permission to read the account</string>
2010-08-05 11:25:44 +00:00
Thialfihar
b13eb7dbf3 added a "force V3 signature" setting similar to the GPG version, hopefully making APG useful for some special cases where that is needed
Update issue 39
Two new strings:
<string name="section_advanced">Advanced</string>
<string name="label_forceV3Signature">Force V3 Signatures</string>

"V3" is just "version 3" and should remain untranslated, both strings can be seen at the bottom of the preferences activity.
2010-07-27 22:41:50 +00:00
Thialfihar
368f0a122f added an optional checkbox to the file dialog, can be used for instance to optionally delete files after importing them, and is used for that, also rearranged the option menu items for the main activity a little
Update issue 39
Added a new string:
<string name="label_deleteAfterImport">Delete After Import</string>
2010-07-26 21:57:28 +00:00
Thialfihar
46fb6fc613 change the text of encrypt buttons according to selected signature or keys, making sign-only less confusing
Update issue 39
New strings to give the encrypt buttons more meaningful and fitting texts:
<string name="btn_signToClipboard">Sign To Clipboard</string>
<string name="btn_signAndEmail">Sign And Email</string>
<string name="btn_sign">Sign</string>
2010-07-24 18:54:40 +00:00
Thialfihar
f65888046e added a little getting started dialog for first-time use, explaining some basics and recommending other apps
Update issue 39
Added:
    <string name="title_help">Getting Started</string>
    <string name="menu_help">Help</string>
    <!-- "OI File Manager", "ASTRO", and "K-9 Mail" must NOT be translated in order for the links to the market to work. -->
    <string name="text_help">Install K-9 Mail for the best integration, it supports APG for PGP/INLINE and lets you directly encrypt/decrypt emails.
\n\nIt is recommended that you install OI File Manager or ASTRO to be able to use the browse button for file selection in APG.
\n\nFirst you need some keys. Either import them via the option menus in \"Manage Public Keys\" and \"Manage Secret Keys\" or create them in \"Manage Secret Keys\".
\n\nYou can also add a GMail account in the main activity via \"Add Account\", which simplifies decrypting emails received there.
\n\nCheck out the option menus in the various activities to find more functions.
    </string>
2010-07-24 16:30:38 +00:00
Thialfihar
b650b30a11 added secure file deletion, overwriting the file with random data before actual deletion
Update issue 56
Added a method for secure file deletion. We'll possibly have to test this a bit and make sure it actually *is* secure on the filesystems used (vfat for SD card, yaffs2 for phone flash memory by default). This sort of overwrite might be absolutely useless on some filesystems.
I also wanted to add an option at first, but this seems reasonably fast and in general it should be what the user wants, so for now it will ALWAYS securely delete. If there is a demand for plain deletion, then options can be added.

Update issue 39
A new string:
<string name="progress_deletingSecurely">deleting \'%s\' securely...</string>
2010-07-24 14:24:42 +00:00
Thialfihar
2407f3b989 have a direct set/change pass phrase button in key creation/editing, instead of hiding it in the menu, also capitalize user id names automatically and give the email field an inputType of textEmailAddress 2010-07-23 12:57:02 +00:00
Thialfihar
a34adb09a4 added a language setting to change the language directly 2010-07-18 07:19:57 +00:00
Thialfihar
c3600ee679 fixed two variable names 2010-07-18 07:12:41 +00:00
Thialfihar
92059d6d3b fixed the made-up word "authentification", also changed the title of that dialog to "Pass Phrase", dialog message then only contains the key details or "Symmetric encryption."
Update issue 39
I tried to change "title_athentication", "passPhraseForSymmetricEncryption", and "passPhraseFor" in all languages. I think the changes are correct, but if you guys could make sure I didn't do anything dumb, then that'd be better. :)
2010-07-18 06:54:39 +00:00
Thialfihar
93835f5595 1.0.x changes merged into trunk 2010-07-16 20:18:43 +00:00
Thialfihar
f5efd73d33 set svn:eol-style to LF for all code/resource files 2010-07-16 20:13:12 +00:00
Thialfihar
ec10329664 removed unnecessary imports 2010-07-16 19:50:51 +00:00
Thialfihar
2c47734f0f trying to add support for various source and destination modes for encryption and decryption (String, byte[], filename, content stream), also more Intent options added 2010-07-09 20:55:17 +00:00
Thialfihar
3ac472125a some playing with content stream decryption and providing the result as content stream 2010-07-09 11:28:39 +00:00
Thialfihar
ff2da0c5d1 added some info about the speed of compression algorithms, mostly to warn about BZIP2, also added support for content URIs in file encrypt/decrypt activities 2010-07-05 13:22:03 +00:00
Thialfihar
c1699150a8 prevent endless loop on some binary data during stream content determination in GeneralActivity 2010-07-01 23:50:14 +00:00
Thialfihar
16cea885e2 merge 1.0.x back into trunk 2010-06-30 19:59:33 +00:00
Thialfihar
bda9745d8b much better version reading by directly looking for the APG package, rather than looping through all installed packages 2010-06-18 15:14:41 +00:00
Thialfihar
8d0160ba12 removed an outdated TODO comment 2010-06-17 13:24:30 +00:00
Thialfihar
1bad192a91 using proper PreferenceActivity now, tho the underlying storage of the values remained almost the same, some changes how the preferences are accessed and how the cache service is started 2010-06-17 13:23:07 +00:00
Thialfihar
865c998abd recent 1.0.x changes into trunk 2010-06-17 13:08:28 +00:00
Thialfihar
81327ee60b useless imports removed 2010-06-08 13:48:43 +00:00
Thialfihar
315093c5bc finally read APG version dynamicly, so the version name doesn't have to be changed anywhere but the manifest 2010-06-08 13:46:21 +00:00
Thialfihar
ce1120b66e make sure the preselected encryption key can encrypt, otherwise deselect it again at display time 2010-06-07 15:25:11 +00:00
Thialfihar
7b219c5f72 in the encrypt activity automatically select the signature key as encryption key, if it is set, and if the button is pressed 2010-06-07 14:21:28 +00:00
Thialfihar
6d2a1edd17 limit GeneralActivity to non-Uri Intents or file:// Uri Intents, now handling key imports as well 2010-06-06 19:46:49 +00:00
Thialfihar
edd755bd0e content provider changes, especially querying key rings by emails 2010-06-06 18:40:51 +00:00
Thialfihar
6a4c8c96db should have been in the last commit 2010-06-06 17:41:40 +00:00
Thialfihar
68d74b4d54 the select public key list now uses the selection for the ordering, putting already selected keys on top, also correctly maintains the selection over repeated filtering 2010-06-06 15:54:27 +00:00
Thialfihar
a0ab240214 some Activity Intent filter cleanup, pass messages via Strings rather than ByteArrays, avoid some encoding issues 2010-06-06 11:42:41 +00:00
Thialfihar
26a500956f working encryption/decryption of text and files after GeneralActivity hands it over 2010-06-06 00:35:00 +00:00
Thialfihar
8c404d83d7 added search to option menu and make it pop up when keys on the physical keyboard are pressed 2010-06-05 22:44:47 +00:00
Thialfihar
84d00abea1 added search feature for key management and select Activities 2010-06-05 21:47:16 +00:00
Thialfihar
a089dbbb73 introduced a general application to handle certain Intents, only to hand them to other APG Activities after looking at the content of the passed data 2010-06-05 17:54:40 +00:00
Thialfihar
a571ce7c52 make sure the Intent passed to Service.onStart() is not null, not sure why it would be, but saw such an exception on the market 2010-06-04 21:52:20 +00:00
Thialfihar
e334a36194 fix the inbox list for GMail account 2010-06-04 20:21:51 +00:00
Thialfihar
4acca3b54f lifted 1.0.x to new version 2010-06-03 21:31:02 +00:00
Thialfihar
031f9bb5e1 make sure previously cache settings of "until quit" are changed to the new default of 3 minutes, as indefinite caching is no longer supported 2010-06-03 16:24:04 +00:00
Thialfihar
600b44b9fc added a service to handle the caching, this'll ensure the cache works while no activity is around, which is better for k9mail integration
it also is a more efficient and much smarter cache, not requiring an own timer thread, just a service that sleeps must of the time, it also is more accurate in cleaning up the entries, ensuring that the worst case of too late removal is 5 seconds
2010-06-03 16:17:55 +00:00
Thialfihar
371dc31b97 changes adjusted once more 2010-06-03 15:08:06 +00:00
Thialfihar
c9b49f5ece changes adjusted 2010-06-02 19:49:46 +00:00
Thialfihar
c2ecd48d19 added changes for 1.0.0 2010-06-02 19:46:01 +00:00
Thialfihar
2f04e7ee05 some small bugfixes 2010-06-02 19:30:27 +00:00
Thialfihar
9ad474e95b trivial 2010-06-02 19:10:48 +00:00
Thialfihar
2170069d8a force message encrypt/decrypt view if the activities are called via *_AND_RETURN Intents 2010-06-02 15:33:40 +00:00
Thialfihar
7193edbba2 added content provider again and read permission to grab key details 2010-06-02 14:01:18 +00:00
Thialfihar
1d023b0372 betterly store the information that the intent demands an immediate return, check action equality without verbose null checks 2010-06-02 10:45:26 +00:00
Thialfihar
72b899fa79 by default show the undecrypted block without line wrapping, just feels less messy, switch after decryption 2010-06-02 10:20:41 +00:00
Thialfihar
ca5416532f support ASTRO and others for the file selection 2010-06-01 21:28:30 +00:00
Thialfihar
5547f61e4f deliver the user id as well for secret key selection, so k9mail can use it to display the signature key 2010-06-01 14:59:06 +00:00
Thialfihar
4229b94270 working encryption out of k9mail 2010-06-01 03:20:13 +00:00
Thialfihar
24a53d548b use string constants for bundle keys, first Intent for k9mail 2010-05-31 23:15:20 +00:00
Thialfihar
d483feb64c minor fixes to make key retrieval more stable 2010-05-30 16:53:04 +00:00
Thialfihar
d1fa1895f1 fixed a method name 2010-05-29 20:38:45 +00:00
Thialfihar
334852402d adjust version number 2010-05-28 11:15:54 +00:00
Thialfihar
2f3bc6dcaf trivial 2010-05-28 08:12:54 +00:00
Thialfihar
eed42b2e34 fully removed old DataProvider for now, manage queries, clean up old database stuff 2010-05-28 07:04:01 +00:00
Thialfihar
b943f706b6 some coding practice and potential bug fixes 2010-05-27 20:31:34 +00:00