Coder Social home page Coder Social logo

open-keychain / open-keychain Goto Github PK

View Code? Open in Web Editor NEW
2.1K 106.0 478.0 78.82 MB

OpenKeychain is an OpenPGP implementation for Android.

Home Page: https://www.openkeychain.org

License: GNU General Public License v3.0

Python 0.30% Shell 0.20% Java 99.38% Ruby 0.05% AIDL 0.07%
android openpgp

open-keychain's Introduction

WARNING: This software is no longer actively developed. We will still apply security fixes where reported, and do basic maintenance work, but no new features or will be worked on. We will try to consider and merge contributions where possible.

OpenKeychain (for Android)

OpenKeychain is an OpenPGP implementation for Android.
For a more detailed description and installation instructions go to https://www.openkeychain.org .

Get it on F-Droid Get it on Google Play

Branches

  • The development of OpenKeychain happens in the "master" branch.
  • For every release a new branch, e.g., "3.2-fixes" is created to backport fixes from "master"

How to help the project?

Translate the application

Translations are managed at Transifex, please contribute there at https://www.transifex.com/projects/p/open-keychain/

Contribute Code

  1. Lookout for interesting issues on Github. We have tagged issues were we explicitly like to see contributions: help wanted
  2. Read this README, especially the notes about coding style
  3. Fork OpenKeychain and contribute code (the best part 😎 )
  4. Open a pull request on Github. We will help with occurring problems and merge your changes back into the main project.
  5. PROFIT

For bigger changes

  1. Join the development mailinglist at https://lists.riseup.net/www/subscribe/openkeychain
  2. Propose bigger changes and discuss the consequences

I am happy about every code contribution and appreciate your effort to help us developing OpenKeychain!

Development

Development mailinglist at https://lists.riseup.net/www/subscribe/openkeychain

Build with Gradle

  1. Clone the project from GitHub
  2. Get all external submodules with git submodule update --init --recursive
  3. Have Android SDK "tools", "platform-tools", and "build-tools" directories in your PATH (http://developer.android.com/sdk/index.html)
  4. Open the Android SDK Manager (shell command: android). Expand the Tools directory and select "Android SDK Build-tools (Version 27.0.3)". Expand the Extras directory and install "Android Support Library", as well as "Local Maven repository for Support Libraries" Select SDK Platform for API levels 27.
  5. Export ANDROID_HOME pointing to your Android SDK
  6. Execute ./gradlew assembleDebug
  7. You can install the app with adb install -r OpenKeychain/build/outputs/apk/OpenKeychain-debug.apk

Run Tests

  1. Use OpenJDK instead of Oracle JDK
  2. Execute ./gradlew clean testDebugUnitTest --continue

Run Jacoco Test Coverage

  1. Use OpenJDK instead of Oracle JDK
  2. Execute ./gradlew clean testDebugUnitTest jacocoTestReport
  3. Report is here: OpenKeychain/build/reports/jacoco/jacocoTestReport/html/index.html

Development with Android Studio

We are using the newest Android Studio for development. Development with Eclipse is currently not possible because we are using the new project structure.

  1. Clone the project from Github
  2. Get all external submodules with git submodule update --init --recursive
  3. From Android Studio: File -> Import Project -> Select the cloned top folder

Libraries

Bouncy Castle

OpenKeychain uses a forked version with some small changes. These changes will been sent to Bouncy Castle.

see

Bouncy Castle resources

Documentation

Build System

We try to make our builds as reproducible/deterministic as possible.

Update Gradle version

  • Always use a fixed Android Gradle plugin version not a dynamic one, e.g. 0.7.3 instead of 0.7.+ (allows offline builds without lookups for new versions, also some minor Android plugin versions had serious issues, i.e. 0.7.2 and 0.8.1)
  • Update every build.gradle file with the new gradle version and/or gradle plugin version
    • build.gradle
    • OpenKeychain/build.gradle
  • run ./gradlew wrapper twice to update gradle and download the new gradle jar file
  • commit the corresponding Gradle wrapper to the repository (allows easy building for new contributors without the need to install the required Gradle version using a package manager)

Update SDK and Build Tools

  • Change SDK and Build Tools in git submodules "openkeychain-api-lib" and "openpgp-api-lib" manually. They should also build on their own without the ext variables.

Update library

  • You can check for library updates with ``./gradlew dependencyUpdates -Drevision=release

Add new library

  • You can add the library as a Maven dependency or as a git submodule (if patches are required) in the "extern" folder.
  • You can get all transitive dependencies with ./gradlew -q dependencies OpenKeychain:dependencies
  • If added as a git submodule, change the compileSdkVersion in build.gradle to use the variables from the root project:
android {
    compileSdkVersion rootProject.ext.compileSdkVersion
}
  • You can check for wrong compileSdkVersion by find -name build.gradle | xargs grep compileSdkVersion

Slow Gradle?

Error:Configuration with name 'default' not found.

Gradle project dependencies are missing. Do a git submodule init && git submodule update

Build on Mac OS X fails?

Try exporting JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"

Translations

Translations are hosted on Transifex, which is configured by ".tx/config".

  1. To pull newest translations install transifex client (e.g. apt-get install transifex-client)
  2. Config Transifex client with "~/.transifexrc"
  3. Go into root folder of git repo
  4. execute tx pull -af --skip

see http://help.transifex.net/features/client/index.html#user-client

Coding Style

Code

  • Indentation: 4 spaces, no tabs.
  • Maximum line width for code and comments: 100.
  • Opening braces don't go on their own line.
  • Field names: Non-public, non-static fields start with m.
  • Acronyms are words: Treat acronyms as words in names, yielding !XmlHttpRequest, getUrl(), etc.
  • Fully Qualify Imports: Do not use wildcard-imports such as import foo.*;
  • Android Studio warnings should be fixed, or suppressed if they are incorrect.

The full coding style can be found at http://source.android.com/source/code-style.html

Automated syntax check with CheckStyle

Linux

  1. Paste the tools/checkstyle.xml file to ~/.AndroidStudioPreview/config/codestyles/
  2. Go to Settings > Code Style > Java, select OpenPgpChecker, as well as Code Style > XML and select OpenPgpChecker again.
  3. Start code inspection and see the results by selecting Analyze > Inspect Code from Android-Studio or you can directly run checkstyle via cli with .tools/checkstyle. Make sure it's executable first.

Mac OSX

  1. Paste the tools/checkstyle.xml file to ~/Library/Preferences/AndroidStudioPreview/codestyles
  2. Go to Preferences > Code Style > Java, select OpenPgpChecker, as well as Code Style > XML and select OpenPgpChecker again.
  3. Start code inspection and see the results by selecting Analyze > Inspect Code from Android-Studio or you can directly run checkstyle via cli with .tools/checkstyle. Make sure it's executable first.

Windows

  1. Paste the tools/checkstyle.xml file to C:\Users\<UserName>\.AndroidStudioPreview\config\codestyles
  2. Go to File > Settings > Code Style > Java, select OpenPgpChecker, as well as Code Style > XML and select OpenPgpChecker again.
  3. Start code inspection and see the results by selecting Analyze > Inspect Code from Android-Studio.

Licenses

Copyright 2017 Schürmann & Breitmoser GbR

Licensed under the GPLv3.

Google Play and the Google Play logo are trademarks of Google Inc.

open-keychain's People

Contributors

007durgesh219 avatar adithyaphilip avatar af-anssi avatar alexfjw avatar artbristol avatar ashh87 avatar bhargavgolla avatar danielhass avatar droidchef avatar dschuermann avatar emantor avatar esclear avatar greg-witczak avatar hagau avatar hannesa2 avatar hav3n avatar hiperzone avatar honnel avatar josecastillo avatar mar-v-in avatar mb-14 avatar nmikhailov avatar runnerway avatar thi avatar thialfihar avatar timbray avatar uberspot avatar valodim avatar vectorijk avatar wiktor-k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

open-keychain's Issues

Check all intent actions

  • Go through all intent actions
  • make tests in API Demo
  • eventually rename extras, differentiate into result extras
  • check file encryption & decrytion

Design refactoring

Ideas:

  • Dashboard?!
  • ActionBarSherlock
  • Do we need a list on apgs home screen?

Old planned features from website

key server support
implement some trust model, allowing to sign keys easily, preferably across devices in some way
better integration with Android and possibly other email apps
link contacts and public keys

Id.java to xml files

Convert constants in Id.java to xml files were possible.

  • Move all menus seperated by activity into xml files instead of using Id.java

Sign keys

  • Can encrypt wrong in selections? Test with only sign keyring
  • dsa only signing algo, drop down wrong

Import from keyserver doesn't work

I tried importing my own public key from several keyservers, and had the same problem. I tried it both in emulator (API level 14) and on a Nexus S running Android 4.1.2, with the same results. The steps I tried are the following.

  1. I selected Manage Public Keyrings on the main screen.
  2. I clicked the search icon in the lower-right corner.
  3. I entered my e-mail address in the field and pressed Search.
  4. I clicked on a key (it didn't matter which).
  5. A progress bar appeared for a second, and then a Toast said No keyrings added or updated.

I checked the SQLite database /data/data/org.thialfihar.android.apg/databases/apg.db and the structure was created successfully, but all three tables (key_rings, keys and user_ids) were empty, so it seems to be an issue with the import logic. Below is a screenshot of the 5th and 3rd steps above (yes, they're in reverse order).

Screenshot

implement some trust model

implement some trust model, allowing to sign keys easily, preferably across devices in some way
better integration with Android and possibly other email apps

New user interface for Encrypt/Decrypt?

  • Small buttons to switch between sections in SectionView needs to be replaced by bigger more intuitive buttons

Other ideas:

  • Replace SectionView for selection of Message or File in EncryptActivity and DecryptActivity by Tabs using new ICS Tabs and Fragments like it is done in HelpActivity.

email pattern

better email pattern from android.util.Patterns.EMAIL_ADDRESS ?

java.lang.NullPointerException in decrypt

java.lang.RuntimeException: Unable to start activity ComponentInfo{org.sufficientlysecure.keychain/org.sufficientlysecure.keychain.ui.DecryptActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1960)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1985)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1151)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4482)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:561)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment.onActivityCreated(PassphraseDialogFragment.java:235)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:891)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1080)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:622)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1416)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:505)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1135)
at android.app.Activity.performStart(Activity.java:4738)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1933)
... 11 more

Trying to Manage Keys from APG results in exception

I've compiled successfully APG, but when I run it in the emulator and try to click on "Manage Keys" I get an exception telling me an unkown URI was passed (content://org.thialfihar.android.apg.internal/key_rings/public), the exception is coded in the line 544 of the file /org.thialfihar.android.apg.ui.MainActivity/src/org/thialfihar/android/apg/provider/ApgProvider.java:

default: throw new IllegalArgumentException("Unknown URI " + uri);

The same exception is thrown when I click on the "My Keys" icon.

The trace is the following one:
11-18 21:44:19.618: W/dalvikvm(534): threadid=11: thread exiting with uncaught exception (group=0x409c01f8)
11-18 21:44:19.668: E/AndroidRuntime(534): FATAL EXCEPTION: ModernAsyncTask #1
11-18 21:44:19.668: E/AndroidRuntime(534): java.lang.RuntimeException: An error occured while executing doInBackground()
11-18 21:44:19.668: E/AndroidRuntime(534): at android.support.v4.content.ModernAsyncTask$3.done(ModernAsyncTask.java:137)
11-18 21:44:19.668: E/AndroidRuntime(534): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
11-18 21:44:19.668: E/AndroidRuntime(534): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
11-18 21:44:19.668: E/AndroidRuntime(534): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
11-18 21:44:19.668: E/AndroidRuntime(534): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
11-18 21:44:19.668: E/AndroidRuntime(534): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
11-18 21:44:19.668: E/AndroidRuntime(534): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
11-18 21:44:19.668: E/AndroidRuntime(534): at java.lang.Thread.run(Thread.java:856)
11-18 21:44:19.668: E/AndroidRuntime(534): Caused by: java.lang.IllegalArgumentException: Unknown URI content://org.thialfihar.android.apg.internal/key_rings/public
11-18 21:44:19.668: E/AndroidRuntime(534): at org.thialfihar.android.apg.provider.ApgProvider.query(ApgProvider.java:544)
11-18 21:44:19.668: E/AndroidRuntime(534): at android.content.ContentProvider$Transport.query(ContentProvider.java:178)
11-18 21:44:19.668: E/AndroidRuntime(534): at android.content.ContentResolver.query(ContentResolver.java:311)
11-18 21:44:19.668: E/AndroidRuntime(534): at android.support.v4.content.CursorLoader.loadInBackground(CursorLoader.java:49)
11-18 21:44:19.668: E/AndroidRuntime(534): at android.support.v4.content.CursorLoader.loadInBackground(CursorLoader.java:35)
11-18 21:44:19.668: E/AndroidRuntime(534): at android.support.v4.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:240)
11-18 21:44:19.668: E/AndroidRuntime(534): at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:51)
11-18 21:44:19.668: E/AndroidRuntime(534): at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:40)
11-18 21:44:19.668: E/AndroidRuntime(534): at android.support.v4.content.ModernAsyncTask$2.call(ModernAsyncTask.java:123)
11-18 21:44:19.668: E/AndroidRuntime(534): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
11-18 21:44:19.668: E/AndroidRuntime(534): ... 4 more
11-18 21:44:19.708: I/dalvikvm(534): threadid=3: reacting to signal 3
11-18 21:44:19.728: I/dalvikvm(534): Wrote stack traces to '/data/anr/traces.txt'

Replace dialogs by new DialogFragments

Many dialogs use the old dialog system.
Replace these calls with the new DialogFragments.

Working examples are in EncryptActivity or DecryptActivity.

DialogFragments can be found in .ui.dialog

Import of secret keys only imports secret part

When importing a secret key, only the secret part is imported. After editing and saving the key ring the public part is generated again.

-> Fix import by also adding the public part after importing.

Make first time "wizard"

to generate or import key on first use.

Also provide information how OpenPGP works

"For inexperienced users, simplify the display. Too much information hides the important information. An initial display configuration could concentrate on giving the user the correct model of the relationship between public and private keys and a clear understanding of the functions for acquiring and distributing keys."

  1. provide information (private/pub key, web of trust, exchange, verify, can be skipped
  2. provide options to generate or import secret keyring

Handle private keys without the master key

Hi,

watching the original source to try to implement this idea (the base idea comes from http://wiki.debian.org/subkeys ), I stumbled upon this patch. As the author told, it is a quick'n'dirty patch. It should be better designed and integrated. As such as :

  • deactivate all creation of subkeys and identities when the master private key is not present
  • deactivate all web of trust action when the master private key is not present

But given the propension of smartphone being robbed, having a way to keep its master key and the web of trust linked to that master key out of the phone would be a good step towards security.

Since the original app is not updated anymore, wouldn't it be good to communicate more about this fork ? except if you think it is not stable enough ?

Linking .gpg files does not work

gpg files have no MIME type defined in Android, thus Filemanagers don't know how to open these. asc files have the MIME-type text/plain, thus they can be linked.

INTERNET permission as seperated app

We could seperate features that need the internet permission into another app, like an addon. For those who wish to use APG without having to allow it internet access

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.