Android, Java, Kotlin, Open Source, Reflections

Open Source Work Update, Week of March 22, 2019

Aftermath of Adventure In WordPress

Last week I was doing work on the WordPress For Android repository and over the weekend and this week I have continued to work on the same issue since then to resolve the Issue properly, and I have managed so far to produce 2 solutions: Changing the appropriate string for the specific error message and Using the event.error.message function of the WordPress-FluxC for Android which is responsible for network and persistence capabilities of the WP for Android app by helping to connect and sync data from a WordPress site.

Eyes Up On K9-Mail

Other than that, I have been trying to look at an Issue on K9-Mail for Android repository The Issue pertains to an unclear Toast message that only states “null” and doesn’t state the source of the error.

What is K9-Mail?

K9-Mail is an open source email client for Android. Think of it as a Gmail-like app for your phone or Outlook except that one defining feature of it is that it supports OpenPGP – an encryption standard for encrypting emails to send confidential data or prevent possible snooping of emails from third parties, more of that can be found here.

What’s OpenPGP’s relation to K9-Mail?

OpenPGP is just a standard – that means it can be implemented in any way possible by an API as long as the implementation conforms to the standard. In Android, this implementation was provided by OpenKeychain and K9-Mail uses the OpenKeychain API to encrypt and decrypt messages.

The Issue

The problem can be divided into 2 sections – K9-Mail’s usage of the OpenKeychain API and how error handling is handled in K9Mail. Currently, I’m studying how OpenKeychain is being utilized in K9-Mail:


As you can see from above, the handleOpenPgpError() function handles the error processing capabilities of the OpenPGP implementation of the OpenKeychain API but this is K9-Mail’s usage of the API and it’s not K9-Mail’s error handling. K9-Mail’s error handling for the specific Issue at hand can be found at the file, specifically onMessageBuildException() function:


The ‘null’ message in the aforementioned Issue is caused by the ‘me.getLocalizedMessage() function call generating a null return value so obviously something’s wrong with the getLocalizedMessage() method when the OpenKeychain app is not properly setup.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s