Sync android notifications encrypted to a linux desktop with tcp or bluetooth
Latest commit d506942 Jan 17, 2017 @matthiasbeyer matthiasbeyer committed with Minify assignments (#21)
Failed to load latest commit information.
.gitignore Initial commit Jan 2, 2017
LICENSE Initial commit Jan 2, 2017
LICENSE.OpenSSL Initial commit Jan 2, 2017 Update (#19) Jan 11, 2017 Minify assignments (#21) Jan 17, 2017

AN2Linux - server

Sync android notifications encrypted to a linux desktop with tcp or bluetooth.

This is the server part of AN2Linux.

Link to client part


AN2Linux is my first (not tiny) program / app and I've been working on it for quite some time now. I wanted to make an2linux because it was something I needed and also to learn.

It's been a fun ride, I have learned a lot.

But be warned, there may be many bugs / problems. If you see something that is bad please tell me why and not just that it sucks.


I'm using archlinux but I've added here what I think to be the package names for debian/ubuntu as well.

  • python (3.4+)
Arch: python
Debian / Ubuntu: python3
  • libnotify
Arch: libnotify
Debian / Ubuntu: libnotify4 gir1.2-notify-0.7 gir1.2-gdkpixbuf-2.0
  • python-gobject
Arch: python-gobject
Debian / Ubuntu: python3-gi
  • openssl (1.0.1+)

For bluetooth:

  • python-pip
Arch: python-pip
Debian / Ubuntu: python3-pip
  • BlueZ dev files
Arch: bluez-libs
Debian / Ubuntu: libbluetooth-dev
  • PyBluez
pip3 install pybluez

How to use

First time just run and follow the instructions.

AN2Linux uses TLS for encryption with both client and server authentication. That means that the client (android) and the server (your computer) need to exchange certificates first.

To initiate pairing you must have running and then in the android app press initiate pairing when in the process of adding a new server.

For bluetooth:

First you need to pair your phone and computer with each other (the normal bluetooth pairing), and then do the certificate exchange as explained above.

Why use TLS over bluetooth when it's already encrypted?

Well, firstly, because I wanted to try :)

And secondly, from the little I've read about bluetooth it seems that the encryption key size negotiated can be very small.


I'm using archlinux so I'm going to tell you have it works for me, I have no idea how it works on other distros. It may work out of the box, just try it.

This is the error I get without the fixes below:
bluetooth.btcommon.BluetoothError: (13, 'Permission denied')

So, if you're not using archlinux but still systemd and get an error like that maybe you should try something similar.

Edit file:


Make the changes in an override file:

systemctl edit bluetooth.service

Add the following lines:

ExecStart=/usr/lib/bluetooth/bluetoothd -C
ExecStartPost=/bin/chmod 662 /var/run/sdp

then apply changes:

systemctl daemon-reload
systemctl restart bluetooth.service

More info about this problem:

Run in background:

You could just run an2linux in its own terminal window but maybe you want to have it run in background somehow and maybe to autostart.

There are many different ways to do that.

You could use screen/tmux or a systemd service.
The great thing about screen/tmux is that you can attach to it if needed.

With tmux you could use something like this:

tmux new -d -s an2linux '<>'

Example user systemd service:


Description=AN2Linux server



Or you could combine tmux with a systemd service:


Description=AN2Linux server tmux

ExecStart=/usr/bin/tmux new -d -s an2linux '<>'
ExecStop=/usr/bin/tmux kill-session -t an2linux



systemctl --user start an2linux.service


systemctl --user stop an2linux.service


systemctl --user enable an2linux.service


systemctl --user status an2linux.service


GNU General Public License 3, with the additional special exception to link portions of this program with the OpenSSL library.

See LICENSE for more details.