Code Monkey home page Code Monkey logo

farebot's Introduction

FareBot

View your remaining balance, recent trips, and other information from contactless public transit cards using your NFC Android phone!

Build Status

Written By

Thanks To

License

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Supported Protocols

Supported Cards

Supported Cards (Keys Required)

These cards require that you crack the encryption key (using a proxmark3 or mfcuk+mfoc) and are not compatible with all devices.

Supported Phones

FareBot requires an NFC Android phone running 5.0 or later.

Building

$ git clone https://github.com/codebutler/farebot.git
$ cd farebot
$ git submodule update --init
$ ./gradlew assembleDebug

Open Source Libraries

FareBot uses the following open-source libraries:

farebot's People

Contributors

4u6u57 avatar bakavic avatar bdwyer2 avatar cnorden avatar codebutler avatar cookieguru avatar cyberkitsune avatar deadmoose avatar dhowett avatar gaul avatar hemonserrat avatar jashsu avatar kageiit avatar kramerc avatar landler avatar micolous avatar mlc avatar mliberato avatar mranostay avatar supersat avatar sybond avatar tbonang avatar tian2992 avatar unparalleled avatar vantablack avatar wandcode avatar xaviablaza avatar zifnab06 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

farebot's Issues

Now in thailand launch Rabbitcard

Now i thai land launch rabbit card and i need to fare bot support it. If you need help i can send my card for you and help you about anything.

Support For: Pittsburgh's "PortAuthority Connectix" (Mifare Ultralight)

Instructions:

  1. Install "NFC TagInfo by NXP" from the play store @
    https://play.google.com/store/apps/details?id=com.nxp.taginfolite&hl=en
  2. Start app, scan your transit card and go to the "TECH" tab
  3. Share the raw data dump via email or similar and paste here in this thread
  4. (optional) Include additional information such as type of card (prepaid amount OR "Ten Trip Ticket") with notes on current balance, info on last trip (fare, location, mode), and any other relevant information

OV-chipkaart bugs

Just did a few quick tests with the latest code and found some bugs.

  • The date displayed under Subscriptions is wrong. The code misses the conversion to the actual date. An example conversion method already exists in OVChipTransitData named convertDate.
  • When importing a key, on selecting 'KeyA', 'KeyB' keeps being selected.
  • Not really a bug but the Java implementation might be confusing. Negative credit shows up between parentheses, for example: (€1,18) instead of -€1,18 or € -1,18.
  • I haven't thoroughly tested this, but when testing dump BD7C7CA0_16 from Huuf's collection the output from Farebot differs from mfocGUI. The amounts are incorrect or missing or maybe even put in the wrong place, duplicates are shown and the banned flag is ignored/not detected.
  • Farebot encounters an IOException ("transceive failed") on sectors where reading is not permitted and stops reading all together. On an original card (or a copy with the same access bits) this happens on sectors 1 to 21. See this wiki entry for more info on the access bits.

I will do some more thorough testing when I have some time to spare.

Clipper cards with Caltrain passes cause farebot to freeze

If a clipper card with a caltrain pass on it is read into farebot the app will sit there with a spinning circle and will not read any other cards until app data is cleared. if you go back to the title screen and examine the scanned cards it will show the scanned card serial number but attempting to bring up it's info will cause the same spinning circle.

Bogota - Transmilenio

I am interested in getting the information off of the mifare cards that We use here in Bogota, Colombia. Right now there are a lot of news about this right now because the municipality in the process of changing the technology.

What is the way to add support to a card into farebot?

Outdated documentation OV-Chipkaart

I really love the Farebot app.
I did magaged it to set it up one time, but that was with a prev version.
How do you import keys now? Because when I open a .farebotkeys but it looks like the app does not import the keys. I checked the file README-OVChipkaart.md but when I follow that steps, the keys still would not import :(

Could you anybody please update the documentation / instruction how to import the keys?

Add preference to not launch app when card detected

I really like the app, but I'd like a way to only scan a card when the app is already open; I have a CardNinja wallet, so my Clipper card is stuck to the back of my phone, and every time I unlock the phone it launches the app. It'd be nice to have a way to only scan the card when the app is open.

I'm actually happy to implement this, but I wanted to confirm that you'd be okay with pulling it into mainline if I did before I start. Thanks!

Nexus 5 Ov-Chipkaart

Hello all,

When i scan my OV-Chipkaart it says:

Unsupported Tag
Indentifier: 7157d31b

Technologies:
NfcA

Maybe anyone can fix this?

Thanks,
Jelmer

Farebot incompatible with recent mfocGUI keyfiles

Looking at the code in Farebot is seems farebot expects a concatenation of 40 6-byte keys in the .farebotkeys file but the last mfocGUI produces a file that contains 40 bytes indicating succes or failure per sector and after that 40 6-byte keys. This makes farebot incompatible with recent mfocGUI keyfiles.

BART trips showed on incorrect dates

I took 4 trips on 2 separate days within a month. All 4 trips show up on the same date. This is always the later date. Attaching screenshot. Will try to attach the card data as well.

Screenshot_2013-03-18-17-18-16

Detect if NFC is turned off

It'd be a nice feature to show a toast or dialog if on application start you detect that NFC is turned off.

Mifare4K unsupported

Hi, I have a dutch public transport card which results in an error of "Unsupported Card Type: Mifare4K"

I'de be happy to help you get this card working, is there anything I can do?

TORONTO Presto Cards

I am interested in getting the information off of the presto cards we have here in the GTA.

I modified one of the other cards class and got the data from one of 2 application addresses with the default key, all zeros. I believe that this only stores the cards id number, just 32 bits long

there is a second application with many more files but they come back null when accessed.

How do i read these files? do i need another key?

App randomly opens for any NFC capable card

For example if put my credit card next to my phone, the app opens with a popup saying "Invalid response"

I think it would be better to ignore cards that aren't recognized instead of opening that dialog.

(Ideally I would prefer to have an option to only scan for cards when the activity is visible)

Marta Breeze card support

I was interested in seeing Marta Breeze card (from Atlanta, Georgia) support in this app, which uses Mifare Classic. Could somebody integrate this feature into farebot?

Support for E-Go ( Luxemburg public transportation )

Tag Type : Generic NFC FOrum Type 2 ( ISO/IEC 14443 Type A)
SAK : 136 ( Hex 88 )
ATQA : 0004
Tag Size : 128 byte
Manufacturer : Infineon Technologies AG
Page Size : 4
No of Pages : 32
Got an error reading Data 0 with NFC TAgExplorer

Problem on Galaxy S3

Hello
Application not work on Galaxy S3: java.lang.NullPointerException
How i can debug this application?

Farebot doesn't read iso14443_3a cards

I'd like to make Farebolt able to read this card, but I need help to understand how this app works.
I've debugged a little and found that an IOException("transcieve failed") is thrown at NfcInternal.java:44.

Key import from Farebot

The key import process in Farebot is quite awkward. You need to mail yoursefl a .farebotkeys file and hope the mailclient offers farebot as a handler (which the default imap client doesn't!). It would be nice to have a import button on the keys dialog that could be pointed to a keyfile location on the device, after which a recent existing scan could be mapped to this (without having to rescan the card). Using a recent "raw" scan is more intuitive than having to scan the card again.

OV-chipkaart key not being read

Farebot doesn't seem to read the OV-chipkaart keys even though ID's match.

Using HTC One 4.2.2

Steps:

  1. Using mfocGUI v29. Make dump of A Keys only, set option 'read everything' on.
  2. Rename and email dump
  3. Open attachment, shows overlay: Tap a card
  4. Hold card
  5. Shows ID, miFare classic, select Key A
  6. Shows key in keylist with same ID as my card

But when I scan my card it says unauthorized and that I need to load keys.

This might be the culprit, I'm not sure cause this is 4 months old.
#41

Any help would be appreciated.

Support for Metrolinx PRESTO Card

I was wondering what the procedure is to either a request a certain transit card to be supported, or to help with the implementation of a new transit card.

The Metrolinx PretoCard is used throughout most the the GTA(Greater Toronto Area) and by adding it Farebot would gain a mountain of new users from this area as the use of the cards is on the rise and the number of users with NFC enabled phones is becoming high in the area.

As I said I'd be willing to help implement and roll out this support if the standard procedures are outlined.

Support for Thailand's MRT card

** TagInfo scan (version 2.00) 2013-09-19 14:27:09 **

-- INFO ------------------------------

IC manufacturer:

Unknown manufacturer

IC type:

FeliCa

-- NDEF ------------------------------

No NFC data set storage:

-- EXTRA ------------------------------

-- TECH ------------------------------

Technologies supported:

JIS X 6319-4 compatible

Android technology information:

Tag description:

  • TAG: Tech [android.nfc.tech.NfcF]
    android.nfc.tech.NfcF
  • Maximum transceive length: 252 bytes
  • Default maximum transceive time-out: 255 ms
    MIFARE Classic support present in Android

Detailed protocol information:

ID: 01:01:06:01:5A:08:73:14
PMm: 0x03004B024F498A8A

  • IC code: 0x0300
    • ROM type: 0x03
    • IC type: 0x00
  • Max. command response times:
    • Req. Service: 4.83 + n*2.42 ms
    • Req. Response: 0.91 ms
    • Authenticate: 9.66 + n*2.42 ms
    • Read/Check: 2.42 + n*2.42 ms
    • Write/Update: 14.50 + n*9.66 ms
    • Issuance command: 14.50 ms
      ('n': no. of blocks/services)

Primary System Code: 0x812B
No Advanced Protocol Features supported

  • Supported communication rate: 212 kbit/s

Alternative keys import method

The only way to import (OV-chipkaart) keys at this moment is by using the mfocGUI keys export file. This file is a binary concatenation of the 40 sector A-keys (it's a bit different, but that's discussed in another issue). The native linux mfoc does not generate such a file, but does display the found keys. Using a combination of output redirection and grep I could create a key-per-line ascii representation of my keys. It would be nice if farebot could read/import such a file as well.

Example keyfile as ascii list:
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
b5ff67cba951
42316190b265
3f496ef58187
31b52d9de071
babbcfdb2dac
5969b9f698fd
81867b5c0a4c
8e3feb74de95
c6aa9e28afc7
e0c68751bef0
70405fb1ed94
cd78af652596
185ae4b09fd6
d1aac695c8e3
153cf12e4e83
aa044ec52db7
dfe99d49d21e
eb822f33cddb
9bf63230d1d6

Caltrain fare adjustments not reflected in transaction list

Caltrain (and presumably some other transit systems that don't use fare gates) uses a mechanism of deducting the maximum possible fare at the tag-in and rebating the difference on the tag-out. Unfortunately, FareBot does not reflect the rebated fare in the transaction list. However, the Balance amount is consistent with actual value.

FareBot view:
http://i.imgur.com/6LpPw.png

Clippercard.com history:
Dual-tag entry transaction, maximum fare deducted (purse debit) 4th and King (Caltrain) Translink E-Cash 12.75 94.65
Dual-tag exit transaction, fare adjustment (purse rebate) Redwood City Translink E-Cash 8.00 102.65

Support for Ruter/Flexus card Oslo, Norway

Same as for RATB:
The card is encrypted and no NFC readers seem to be able to ready anything useful from it. I can provide a raw export from Flexus if anyone wants to try and add support for this card.

Build problem

I'm trying to build this for F-droid FOSS repository which uses platform tools v14 and ant. I got the following error at e96622

com.codebutler.farebot/res/drawable/list_selector_holo_dark.xml:17: error: No resource identifier found for attribute 'exitFadeDuration' in package 'android'

Compilation / building instructions

I find that when I have enough spare time to look at this, I waste all of it trying to get the app to load into eclipse and successfully compile, then I don't have time to actually fix anything.

The README.md file should have some kind of step by step guide on what has to be done, starting with a new install of eclipse with the android tools. The first step would (I assume) be to run:

git checkout [email protected]:codebutler/farebot.git

but I have no idea what to do next - maybe install graddle or something?

Clipper card refill appears as "Unknown (0x248)"

I got a Clipper card and put credit on it at the information desk at San Francisco airport. This refill appears as "Unknown (0x248)" in Farebot. On the Clipper website it appears as "Cash payment at a TOT, TRU or AVM".

Support for HK Octopus Card

Scanning with NFC TagInfo returns a balance for HK Octopus. It doesn't look like there is adequate memory on the card to store transaction history (I may be wrong), but a balance would definitely be a start!

Clipper: Refill location info

Refill: Unknown (0x1db)

Cash payment at a TOT, TRU or AVM
WALGREENS #6291

I don't know if the cards treat each location as a different id number but there is the info just in case

Keyfiles

Hello,

In the last play store release importing keys for mifare classic 4k is quite difficult. I already had the keys on my sd-card and had to think of a work-around to open it. This was using a general available file explorer. Maybe a integrated filebrowser, or still support for key files on the sdcard would be great. Any thoughts?

Read HVD balances from BART

It would be awesome if Farebot could parse out the BART HVD purses stored on Clipper cards, and to identify transactions debiting from that purse separately in the UI.

Currently HVD transactions and refills are just lumped in with cash, which makes it very difficult to figure out what the current state of all the 'buckets' on a card is.

I can provide a dump with these transactions/this purse, just message me.

Add support for Kopitiam card

Kopitiam, a foodcourt in Singapore, offers a MiFare Classic card used to pay for meals with discounts. The balance stored in it appears to be in Sector 2. In the NXP TagInfo app:

Sector 2 (0x02)
[08] rwi  00 00 39 97 AE 00 00 21 78 59 00 00 00 00 00 20 |..9....!xY..... |
[09] rwi  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
[0A] rwi  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
[0B] wxx  A0:A1:A2:A3:A4:A5 FF:07:80 69 B0:B1:B2:B3:B4:B5
          MAD access key                (unknown key) (readable)

where "39 97" is the card's balance ($39.97), and "21 78" is the amount spent ($21.78)

Maybe support could be added in farebot?

Clipper card stopped working

On Galaxy Nexus. Stopped working around the time I upgraded to Jelly Bean, but I don't know exactly when so there may or may not be a relationship.

It's the same problem someone else reported in the Play Store comments - it gets stuck on the Loading screen. If you wait a while then press "Advanced Info", Android will say the app has crashed

Versions: Farebot 2.2.1, Android 4.1.1

Support for NY/NJ PATH SmartLink Card

I'm happy to help out reverse engineering this where necessary. Here's an initial dump of data from the card (via the NFC TagInfo app).

<Value name="rfTechnology" description="RF technology">Type A (ISO/IEC 14443 Type A)</Value>
<Value name="tagType" description="Tag type">ISO/IEC 14443-4 Smart Card,
Mifare DESFire (MF3ICD40)</Value>
<Value name="manufacturer" description="Manufacturer">NXP Semiconductors (Germany)</Value>
<Value name="atqa" description="ATQA">0344</Value>
<Value name="sak" description="SAK">20</Value>
<Value name="historicalBytes" description="Historical bytes">80</Value>

Memory Tag: Mifare DESFire (MF3ICD40)
<Value name="batchNumber" description="Batch number">BA24139930</Value>
<Value name="productionDate" description="Production date">04/2011</Value>
<Value name="hardwareVendor" description="Hardware vendor">NXP Semiconductors (Germany)</Value>
<Value name="hardwareVersion" description="Hardware version">0.2</Value>
<Value name="hardwareType" description="Hardware type">0x0101</Value>
<Value name="hardwareCommProtocol" description="Hardware communication protocol">0x05</Value>
<Value name="hardwareMemorySize" description="Hardware memory size">4096 Byte</Value>
<Value name="softwareVendor" description="Software vendor">NXP Semiconductors (Germany)</Value>
<Value name="softwareVersion" description="Software version">0.6</Value>
<Value name="softwareType" description="Software type">0x0101</Value>
<Value name="softwareCommProtocol" description="Software communication protocol">0x05</Value>
<Value name="softwareMemorySize" description="Software memory size">4096 Byte</Value>

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.