Browse Source

Usage of email on Android

Bob Mottram 9 years ago
parent
commit
dcc2592c83
1 changed files with 165 additions and 1 deletions
  1. 165
    1
      doc/EN/usage.org

+ 165
- 1
doc/EN/usage.org View File

206
 Make sure that "*show only subscribed folders*" is not checked.  Then click the *ok* buttons.  Folders will be re-scanned, which may take some time depending upon how much email you have, but your folders will then appear.
206
 Make sure that "*show only subscribed folders*" is not checked.  Then click the *ok* buttons.  Folders will be re-scanned, which may take some time depending upon how much email you have, but your folders will then appear.
207
 
207
 
208
 ** K9 Android client
208
 ** K9 Android client
209
-*NOTE*: Currently the K9 email client will not work with the Freedombone since it doesn't support PGP/MIME encoding. However, there is development work taking place on that feature and it is hoped that K9 may be usable in the near future.
209
+*** A point about GPG on Android
210
+Before trying to set up email on Android you may want to consider whether you really need to do this. Android (and its variants) is not a particularly secure operating system and whether or not you wish to store GPG keys on it depends on your threat model and in what situations you'll be using your device.
210
 
211
 
212
+If you are going to use email on an Android device then ensure that you have full encryption enabled via the security settings, so that if you subsequently lose it, or if it gets stolen, the chances of encryption keys being exposed are minimised.
213
+*** Compiling the development version
214
+To get K9 working with Freedombone you'll need to install development versions of OpenKeychain and K9. At the time of writing the versions available in F-Droid do not support PGP/MIME or the "hidden recipient" feature of GPG. It is hoped that at some stage the patches will be integrated into the mainline or functionally equivalent changes made. Admittedly, this is not at all user friendly, but currently it's the only way to read Freedombone email on Android systems.
215
+
216
+Build script for OpenKeychain:
217
+
218
+#+BEGIN_SRC bash
219
+#!/bin/bash
220
+
221
+# This script is intended to be used on Debian systems for building
222
+# the project. It has been tested with Debian 8
223
+
224
+USERNAME=$USER
225
+SIGNING_NAME='openkeychain'
226
+SDK_VERSION='r23.3.4'
227
+SDK_DIR=$HOME/android-sdk
228
+
229
+cd ..
230
+
231
+PROJECT_HOME=$(pwd)
232
+
233
+sudo apt-get install build-essential default-jdk \
234
+     lib32stdc++6 lib32z1 lib32z1-dev
235
+
236
+if [ ! -d $SDK_DIR ]; then
237
+    mkdir -p $SDK_DIR
238
+fi
239
+cd $SDK_DIR
240
+
241
+# download the SDK
242
+if [[ ! -f $SDK_DIR/android-sdk_$SDK_VERSION-linux.tgz ]]; then
243
+    wget https://dl.google.com/android/android-sdk_$SDK_VERSION-linux.tgz
244
+fi
245
+tar -xzvf android-sdk_$SDK_VERSION-linux.tgz
246
+SDK_DIR=$SDK_DIR/android-sdk-linux
247
+
248
+echo 'Check that you have the SDK tools installed for Android 22, SDK 21.1.2'
249
+
250
+export ANDROID_HOME=$SDK_DIR
251
+echo "sdk.dir=$SDK_DIR" > $ANDROID_HOME/local.properties
252
+export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
253
+
254
+cd $SDK_DIR/tools
255
+./android sdk
256
+
257
+if [ ! -f $SDK_DIR/tools/android ]; then
258
+    echo "$SDK_DIR/tools/android not found"
259
+    exit -1
260
+fi
261
+cd $SDK_DIR
262
+chmod -R 0755 $SDK_DIR
263
+chmod a+rx $SDK_DIR/tools
264
+
265
+# android sdk
266
+cd $PROJECT_HOME
267
+git submodule init && git submodule update
268
+
269
+if [ ! -f $SDK_DIR/tools/templates/gradle/wrapper/gradlew ]; then
270
+    echo "$SDK_DIR/tools/templates/gradle/wrapper/gradlew not found"
271
+    exit -2
272
+fi
273
+. $PROJECT_HOME/gradlew assembleDebug
274
+
275
+# cleaning up
276
+cd $PROJECT_HOME/OpenKeychain/build/outputs/apk
277
+if [ ! -f OpenKeychain-debug.apk ]; then
278
+    echo 'OpenKeychain-debug.apk was not found'
279
+    exit -3
280
+fi
281
+
282
+echo 'Build script ended successfully'
283
+echo -n 'apk is available at: '
284
+echo "$PROJECT_HOME/OpenKeychain/build/outputs/apk/OpenKeychain-debug.apk"
285
+exit 0
286
+#+END_SRC
287
+
288
+Build script for K9:
289
+
290
+#+BEGIN_SRC bash
291
+#!/bin/bash
292
+
293
+# This script is intended to be used on Debian systems for building
294
+# the project. It has been tested with Debian 8
295
+
296
+USERNAME=$USER
297
+SIGNING_NAME='k-9'
298
+SDK_VERSION='r24.3.3'
299
+SDK_DIR=$HOME/android-sdk
300
+
301
+cd ..
302
+
303
+PROJECT_HOME=$(pwd)
304
+
305
+sudo apt-get install build-essential default-jdk \
306
+     lib32stdc++6 lib32z1 lib32z1-dev
307
+
308
+if [ ! -d $SDK_DIR ]; then
309
+    mkdir -p $SDK_DIR
310
+fi
311
+cd $SDK_DIR
312
+
313
+# download the SDK
314
+if [ ! -f $SDK_DIR/android-sdk_$SDK_VERSION-linux.tgz ]; then
315
+    wget https://dl.google.com/android/android-sdk_$SDK_VERSION-linux.tgz
316
+    tar -xzvf android-sdk_$SDK_VERSION-linux.tgz
317
+fi
318
+SDK_DIR=$SDK_DIR/android-sdk-linux
319
+
320
+echo 'Check that you have the SDK tools installed for Android 17, SDK 19.1'
321
+if [ ! -f $SDK_DIR/tools/android ]; then
322
+    echo "$SDK_DIR/tools/android not found"
323
+    exit -1
324
+fi
325
+cd $SDK_DIR
326
+chmod -R 0755 $SDK_DIR
327
+chmod a+rx $SDK_DIR/tools
328
+
329
+ANDROID_HOME=$SDK_DIR
330
+echo "sdk.dir=$SDK_DIR" > $ANDROID_HOME/local.properties
331
+PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
332
+
333
+android sdk
334
+cd $PROJECT_HOME
335
+
336
+if [ ! -f $SDK_DIR/tools/templates/gradle/wrapper/gradlew ]; then
337
+    echo "$SDK_DIR/tools/templates/gradle/wrapper/gradlew not found"
338
+    exit -2
339
+fi
340
+. $PROJECT_HOME/gradlew assembleDebug
341
+
342
+# cleaning up
343
+cd $PROJECT_HOME/k9mail/build/outputs/apk
344
+if [ ! -f k9mail-debug.apk ]; then
345
+    echo 'k9mail-debug.apk was not found'
346
+    exit -3
347
+fi
348
+echo 'Build script ended successfully'
349
+echo -n 'apk is available at: '
350
+echo "$PROJECT_HOME/k9mail/build/outputs/apk/k9mail-debug.apk"
351
+exit 0
352
+#+END_SRC
353
+
354
+*** Import your GPG key into OpenKeychain
355
+With your device connected to a laptop via USB cable and with USB debugging enabled on it:
356
+
357
+#+BEGIN_SRC bash
358
+ssh username@domainname -p 2222
359
+gpg --list-keys username@domainname
360
+gpg --output ~/public_key.gpg --armor --export KEY_ID
361
+gpg --output ~/private_key.gpg --armor --export-secret-key KEY_ID
362
+cat ~/public_key.gpg ~/private_key.gpg > ~/mygpgkey.asc
363
+exit
364
+scp -P 2222 username@domainname:/home/username/mygpgkey.asc ~/
365
+sudo apt-get install android-tools-adb
366
+push ~/mygpgkey.asc /sdcard/
367
+shred -zu ~/mygpgkey.asc
368
+#+END_SRC
369
+
370
+Then on your device select OpenKeychain and import your key from file.
211
 *** Incoming server settings
371
 *** Incoming server settings
212
  * Select settings/account settings
372
  * Select settings/account settings
213
  * Select Fetching mail/incoming server
373
  * Select Fetching mail/incoming server
225
  * Set authentication to PLAIN
385
  * Set authentication to PLAIN
226
  * Enter your username and password
386
  * Enter your username and password
227
  * Accept the SSL certificate
387
  * Accept the SSL certificate
388
+*** Crypto settings
389
+Select *settings*, *Account settings*, *OpenKeychain* and then select your key and press *Allow*. You should now be able to decrypt emails by entering your GPG passphrase.
390
+
391
+You may also want to change the amount of time for which passwords are remembered, so that you don't need to enter your passphrase very often.
228
 *** Folders
392
 *** Folders
229
 To view any new folders which you may have created using the /mailinglistrule/ script from your inbox press the *K9 icon* at the top left to access folders, then press the *menu button* and select *refresh folder list*.
393
 To view any new folders which you may have created using the /mailinglistrule/ script from your inbox press the *K9 icon* at the top left to access folders, then press the *menu button* and select *refresh folder list*.
230
 
394