Git Product home page Git Product logo

gilgamesh's Introduction

Pinwheel Messenger (formerly known as Gilga aka gilgamesh)

Pinwheel (formerly known as Gilgamesh) is an experimental app that is a proof-of-concept of the Wind nearby network concept (https://github.com/n8fr8/WindFarm). It utilizes bluetooth and wifi device names to enable "status casting", otherwise known as Twitter-over-Bluetooth.

Learn more at: https://github.com/n8fr8/gilgamesh and http://github.com/n8fr8/WindFarm

Some notes on the implementation, aka the glorious hack of Bluetooth Device Names. This application was original based on the Android SDK BluetoothChat sample. It used insecure (unpaired) and secure (paired) Bluetooth RFComm sockets to allow for short messages to be sent between devices. The primary modification that this project has made has been to add support for a "Broadcast" mode, that uses the Bluetooth device name, that is public visible during the Discovery process, as the message transport itself.

The design goals of this project are:

  • A truly decentralised application that requires only Bluetooth connectivity and has no central user registry
  • Incredible ease of use that ensures all "mesh" connectivity happens with as little user involvment as possible
  • Ability to enable trust or reputation for specific users or devices you message with
  • A very transient app that stores no data permanently
  • Ability to share the app easily between devices
  • A "fire and forget" mode, where the user can enter a message, put the phone in their pocket, and walk around and area and have it broadcast to all devices it encounters

Android app:

alt alt

Pinwheel also supports Linux: https://github.com/n8fr8/gilgamesh/blob/master/docs/gilgamesh.sh

The key innovations/hacks/revelations that led us to this point were:

  • As of recent Android versions, you can call an API to set your the device's Bluetooth visibility to a very long time ~1 hour
  • You can dynamically change the Bluetooth device name, and it can be long - up to 248 bytes encoded as UTF-8
  • That the first two things above could be wrapped mostly in API calls the user did not have to see or worry about

Finally, some thoughts on security, privacy and reputation:

  • This app supports both a public broadcast mode, and a private, direct message mode. It is easy to use to both. The direct message mode is optionally secured and encrypted at the Bluetooth level if you have paired with the device/user you are connected with.
  • Impersonation is combatted by simplified user id's to a short (6 character alphanumeric) value, based on the device's unique Bluetooth ID. This makes them speakable and easy to remember. If someone says "trust messages from A1BC99" then likely you will be able to rememember that.
  • If you pair with a user (using standard Bluetooth pairing settings), their userid will be appended with a *, to make it even easier to know this is someone you should trust
  • The app ONLY works in Bluetooth mode, so though is no confusion when it might be using 3G/4G, Wifi or some other mode, and possibly go through a centralised server
  • The code is open-source, very small, and the entire app is only 28kb making it easy to audit, test and share
  • We make it easy to "retweet" a message by long pressing on it, which enables reputation for something to be built up by multiple people resharing it. If the user has paired with the user, you will also see the * next to the name to further indicate trust.

gilgamesh's People

Contributors

akwizgran avatar n8fr8 avatar valerio-bozzolan 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

gilgamesh's Issues

Add WifiDirect mode

If we can hack wifidirect and use SSID in the same way we are using Bluetooth names, that would be interesting

PubSub: webbing blacklist

allow friends to subscribe to our blacklist perhaps with trustiness model [or signing].

this ought provoke some thought projects on spoofing and identity

crash on startup

since release 0.0.5 gilgamesh crashes on startup. Here's a logcat:

I/ActivityManager(29275): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=info.guardianproject.gilga/.GilgaMeshActivity bnds=[360,640][360,640]} from pid 29610
V/Zygote ( 7874): Switching descriptor 32 to /dev/null
V/Zygote ( 7874): Switching descriptor 10 to /dev/null
I/ActivityManager(29275): Start proc info.guardianproject.gilga for activity info.guardianproject.gilga/.GilgaMeshActivity: pid=7874 uid=10104 gids={50104, 3001, 3002, 3003}
D/ActivityThread( 7874): handleBindApplication:info.guardianproject.gilga
D/ActivityThread( 7874): setTargetHeapUtilization:0.75
D/ActivityThread( 7874): setTargetHeapMinFree:2097152
D/BluetoothManagerService(29275): Message: 20
D/BluetoothManagerService(29275): Added callback: android.bluetooth.IBluetoothManagerCallback$Stub$Proxy@42077bd8:true
D/BluetoothManagerService(29275): checkIfCallerIsForegroundUser: valid=true callingUser=0 foregroundUser=0
D/BluetoothManagerService(29275): checkIfCallerIsForegroundUser: valid=true callingUser=0 foregroundUser=0
D/BluetoothAdapterService(1108224144)(32613): getState(): mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@420e2dd8
D/libEGL ( 7874): loaded /system/lib/egl/libEGL_mali.so
D/libEGL ( 7874): loaded /system/lib/egl/libGLESv1_CM_mali.so
D/libEGL ( 7874): loaded /system/lib/egl/libGLESv2_mali.so
E/ ( 7874): Device driver API match
E/ ( 7874): Device driver API version: 23
E/ ( 7874): User space API version: 23
E/ ( 7874): mali: REVISION=Linux-r3p2-01rel3 BUILD_DATE=Fri Mar 21 13:52:50 KST 2014
D/OpenGLRenderer( 7874): Enabling debug mode 0
D/GilgaWifi( 7874): SUCCESS: added service request wifi name service
D/AndroidRuntime( 7874): Shutting down VM
W/dalvikvm( 7874): threadid=1: thread exiting with uncaught exception (group=0x41926ce0)
E/AndroidRuntime( 7874): FATAL EXCEPTION: main
E/AndroidRuntime( 7874): Process: info.guardianproject.gilga, PID: 7874
E/AndroidRuntime( 7874): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.wifi.p2p.THIS_DEVICE_CHANGED flg=0x4000010 (has extras) } in info.guardianproject.gilga.service.GilgaService$3@41e4f758
E/AndroidRuntime( 7874): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:776)
E/AndroidRuntime( 7874): at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime( 7874): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 7874): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 7874): at android.app.ActivityThread.main(ActivityThread.java:5146)
E/AndroidRuntime( 7874): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 7874): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 7874): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
E/AndroidRuntime( 7874): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
E/AndroidRuntime( 7874): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 7874): Caused by: java.lang.StringIndexOutOfBoundsException: length=0; regionStart=-6; regionLength=6
E/AndroidRuntime( 7874): at java.lang.String.startEndAndLength(String.java:588)
E/AndroidRuntime( 7874): at java.lang.String.substring(String.java:1475)
E/AndroidRuntime( 7874): at info.guardianproject.gilga.service.GilgaService.mapToNickname(GilgaService.java:412)
E/AndroidRuntime( 7874): at info.guardianproject.gilga.service.GilgaService$3.onReceive(GilgaService.java:654)
E/AndroidRuntime( 7874): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:766)
E/AndroidRuntime( 7874): ... 9 more
W/ActivityManager(29275): Force finishing activity info.guardianproject.gilga/.GilgaMeshActivity
I/WindowManager(29275): Screenshot max retries 4 of Token{424c16e0 ActivityRecord{41fdd468 u0 info.guardianproject.gilga/.GilgaMeshActivity t39 f}} appWin=Window{428b8a50 u0 info.guardianproject.gilga/info.guardianproject.gilga.GilgaMeshActivity} drawState=1
W/WindowManager(29275): Screenshot failure taking screenshot for (720x1280) to layer 21080
W/ActivityManager(29275): Activity pause timeout for ActivityRecord{41fdd468 u0 info.guardianproject.gilga/.GilgaMeshActivity t39 f}

Problems with translation

Hi.

I am translating the app in french.

But there are some string, that I can not translate : "s ago", "m ago", "h ago".
I suppose that there is a variable before. But, the variable should be replaced by the printing function (like GetText and printf of C).
Like that, I can translate in french : "%var s ago" -> "depuis %var s"

I am also wondering if PM means "Private Message" in "PM TO" and "PM FROM".

Thanks.

add block list based on id/bluetooth id

add ability to block devices / messages both from having public messages displayed and from connecting for direct messages.

ultimately, this block/black list could be shared between devices to combat bad actors

Don't allow to send empty message ?

Are you going to keep allowing to send empty message or not ? Because it very easy to spam this way and it's not really useful (just my opinion)

Add an about to explain how the app work

It would be easier for new user to understand how the app work if you add something about it. Like explaining what the repeater and broadcaster do and what's the difference between them.

Own ID is unreadable on small screens

I own a Samsung Galaxy Gio, which has a rather small screen. Even with the font settings set to small, Gilgamesh displays the following in the top bar:

Gilgamesh
You are broadcasting as @5e8...

In other words, my own ID gets cut off. Seeing how Gilgamesh places messages as "@me", there is no way for me to see my own Bluetooth ID.

P.S.: I sure hope there's no Github user named @5e8, if there is, I'm sorry

Not building

Hello Nathan, I've tried to run this program on my android studio but it doesn't work. I want to know if i can use another software if possible

fsUUCP : store and forward

Allow for bursty relay of messages when internets available: store and forward. BlueTooth tethering where available (XPosed module).

SHOULD require OTR payload.

Or similar to ATM Virtual Circuits.
#31
#30

Or OSTN

Crash when starting service

GilgaMesh 0.0.4 crashes with the following stacktrace when posting the first message:

E/AndroidRuntime( 2145): FATAL EXCEPTION: main
E/AndroidRuntime( 2145): java.lang.RuntimeException: Unable to start service info.guardianproject.gilga.GilgaService@41f49cd0 with Intent { cmp=info.guardianproject.gilga/.GilgaService (has extras) }: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
E/AndroidRuntime( 2145): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2721)
E/AndroidRuntime( 2145): at android.app.ActivityThread.access$1900(ActivityThread.java:141)
E/AndroidRuntime( 2145): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1353)
E/AndroidRuntime( 2145): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2145): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 2145): at android.app.ActivityThread.main(ActivityThread.java:5103)
E/AndroidRuntime( 2145): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2145): at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime( 2145): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E/AndroidRuntime( 2145): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime( 2145): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2145): Caused by: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
E/AndroidRuntime( 2145): at android.app.ContextImpl.startActivity(ContextImpl.java:953)
E/AndroidRuntime( 2145): at android.app.ContextImpl.startActivity(ContextImpl.java:940)
E/AndroidRuntime( 2145): at android.content.ContextWrapper.startActivity(ContextWrapper.java:290)
E/AndroidRuntime( 2145): at info.guardianproject.gilga.GilgaService.startBroadcasting(GilgaService.java:356)
E/AndroidRuntime( 2145): at info.guardianproject.gilga.GilgaService.onStartCommand(GilgaService.java:78)
E/AndroidRuntime( 2145): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2704)
E/AndroidRuntime( 2145): ... 10 more

This is on a Galaxy Nexus running Android 4.3.

Use more of the ID to generate the username

Bluetooth IDs are like MAC addresses so similar phones will likely have the same first three bytes, resulting in multiple identical usernames among a group of friends.

Perhaps XOR 2 bytes of the ID to create each byte of the username?

APis

(Enanchement)

With this app one day could be possible creating apps to do something in group. (E.g.: Naval battle?)

One day please provide some APIs to allow developers to use this app to send broadcast Bluetooth messages, and receive them :)

exit app

unlike other apps, gilgamesh can't be quit using the "back" button. not preventing this, would make the app feel a bit more standard since most users would possibly expect that behaviour.

Direct Message should work async

Rather than opening up a sync connection to a device, you should be able to send a message, that once, we see the device "online" in discovery, is delivered.

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.