├── data ├── .gitignore ├── seq_gocard │ ├── .gitignore │ ├── Makefile │ └── mapping.csv └── suica │ ├── Gemfile │ ├── lib │ ├── gcode.rb │ └── gtrans.rb │ └── Gemfile.lock ├── debug.keystore ├── farebot-transit-stub ├── src │ └── main │ │ ├── res │ │ └── values │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── codebutler │ │ └── farebot │ │ └── transit │ │ └── stub │ │ ├── AdelaideMetrocardStubTransitInfo.java │ │ └── AtHopStubTransitInfo.java └── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitmodules ├── farebot-app └── src │ └── main │ ├── res │ ├── drawable-hdpi │ │ ├── edy_card.png │ │ ├── hsl_card.png │ │ ├── kmt_card.png │ │ ├── myki_card.png │ │ ├── nets_card.png │ │ ├── opal_card.png │ │ ├── orca_card.png │ │ ├── ezlink_card.png │ │ ├── icoca_card.png │ │ ├── marker_end.png │ │ ├── ovchip_card.png │ │ ├── pasmo_card.png │ │ ├── seqgo_card.png │ │ ├── suica_card.png │ │ ├── clipper_card.png │ │ ├── marker_start.png │ │ ├── octopus_card.png │ │ ├── bilheteunicosp_card.png │ │ └── manly_fast_ferry_card.png │ ├── drawable-xhdpi │ │ └── easycard.png │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ ├── values-fi │ │ └── strings.xml │ ├── values-ja │ │ ├── strings-location.xml │ │ └── strings.xml │ ├── values-iw │ │ └── strings.xml │ ├── values-nl │ │ ├── strings-location.xml │ │ └── strings.xml │ ├── values-fr │ │ ├── strings-location.xml │ │ └── strings.xml │ ├── menu │ │ ├── screen_card.xml │ │ ├── action_keys.xml │ │ ├── action_history.xml │ │ ├── screen_keys.xml │ │ └── screen_history.xml │ ├── values │ │ ├── plurals.xml │ │ ├── colors.xml │ │ ├── styles.xml │ │ ├── dimens.xml │ │ └── themes.xml │ ├── drawable │ │ ├── fg_item_selectable.xml │ │ ├── ic_transaction_vend_32dp.xml │ │ ├── ic_add_black_24dp.xml │ │ ├── ic_delete_black_24dp.xml │ │ ├── ic_transaction_handheld_32dp.xml │ │ ├── ic_history_grey_24dp.xml │ │ ├── ic_help_outline_grey_24dp.xml │ │ ├── ic_lock_black_24dp.xml │ │ └── ic_transaction_pos_32dp.xml │ ├── layout │ │ ├── screen_trip_map.xml │ │ ├── screen_keys.xml │ │ ├── tab_card_advanced.xml │ │ ├── screen_help.xml │ │ └── screen_card_advanced.xml │ └── xml │ │ ├── filter_nfc.xml │ │ └── prefs.xml │ └── java │ └── com │ └── codebutler │ └── farebot │ └── app │ ├── core │ ├── inject │ │ ├── ScreenScope.kt │ │ └── ActivityScope.kt │ ├── kotlin │ │ ├── Array.kt │ │ ├── ViewGroupExtensions.kt │ │ ├── Date.kt │ │ ├── Optional.kt │ │ └── Color.kt │ ├── activity │ │ ├── ActivityResult.kt │ │ ├── RequestPermissionsResult.kt │ │ └── ActivityOperations.kt │ ├── ui │ │ ├── ScreenLifecycleEvent.kt │ │ └── ActionBarOptions.kt │ ├── serialize │ │ ├── CardKeysSerializer.kt │ │ └── gson │ │ │ ├── EpochDateTypeAdapter.kt │ │ │ ├── GsonCardSerializer.kt │ │ │ ├── CardTypeGsonTypeAdapter.kt │ │ │ ├── GsonCardKeysSerializer.kt │ │ │ └── ByteArrayGsonTypeAdapter.kt │ ├── nfc │ │ └── UnsupportedTagException.kt │ ├── sample │ │ ├── SampleTransitFactory.kt │ │ ├── SampleRefill.kt │ │ └── RawSampleCard.kt │ └── analytics │ │ └── Analytics.kt │ └── feature │ ├── keys │ └── KeyViewModel.kt │ ├── history │ └── HistoryViewModel.kt │ └── bg │ └── BackgroundTagActivity.kt ├── farebot-transit-ovc ├── src │ └── main │ │ ├── assets │ │ └── ovc_stations.db3 │ │ ├── res │ │ └── values │ │ │ └── strings.xml │ │ └── AndroidManifest.xml └── build.gradle ├── .editorconfig ├── farebot-transit-seqgo ├── src │ └── main │ │ ├── assets │ │ └── seq_go_stations.db3 │ │ ├── res │ │ ├── values-ja │ │ │ └── strings.xml │ │ ├── values-fr │ │ │ └── strings.xml │ │ ├── values-nl │ │ │ └── strings.xml │ │ └── values │ │ │ └── strings.xml │ │ └── AndroidManifest.xml └── build.gradle ├── farebot-transit-suica ├── src │ └── main │ │ ├── assets │ │ └── felica_stations.db3 │ │ └── AndroidManifest.xml └── build.gradle ├── farebot-transit-kmt ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ └── values │ │ │ └── strings.xml │ │ └── java │ │ └── com │ │ └── codebutler │ │ └── farebot │ │ └── transit │ │ └── kmt │ │ └── KMTUtil.java └── build.gradle ├── farebot-transit-manly ├── src │ └── main │ │ ├── res │ │ ├── values-ja │ │ │ └── strings.xml │ │ ├── values │ │ │ └── strings.xml │ │ ├── values-nl │ │ │ └── strings.xml │ │ └── values-fr │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── codebutler │ │ └── farebot │ │ └── transit │ │ └── manly_fast_ferry │ │ └── record │ │ └── ManlyFastFerryRecord.java └── build.gradle ├── farebot-transit-edy ├── src │ └── main │ │ ├── res │ │ ├── values-fr │ │ │ └── strings.xml │ │ ├── values-iw │ │ │ └── strings.xml │ │ ├── values-ja │ │ │ └── strings.xml │ │ ├── values-nl │ │ │ └── strings.xml │ │ └── values │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── codebutler │ │ └── farebot │ │ └── transit │ │ └── edy │ │ └── EdyUtil.java └── build.gradle ├── farebot-card-classic ├── src │ └── main │ │ ├── res │ │ ├── values-iw │ │ │ └── strings.xml │ │ ├── values-ja │ │ │ └── strings.xml │ │ ├── values-fr │ │ │ └── strings.xml │ │ ├── values-nl │ │ │ └── strings.xml │ │ └── values │ │ │ └── strings.xml │ │ ├── java │ │ └── com │ │ │ └── codebutler │ │ │ └── farebot │ │ │ └── card │ │ │ └── classic │ │ │ ├── ClassicTypeAdapterFactory.java │ │ │ ├── ClassicSector.java │ │ │ ├── UnauthorizedClassicSector.java │ │ │ └── InvalidClassicSector.java │ │ └── AndroidManifest.xml └── build.gradle ├── farebot-transit-myki ├── src │ └── main │ │ ├── res │ │ ├── values-ja │ │ │ └── strings.xml │ │ ├── values-fr │ │ │ └── strings.xml │ │ ├── values-nl │ │ │ └── strings.xml │ │ └── values │ │ │ └── strings.xml │ │ └── AndroidManifest.xml └── build.gradle ├── farebot-card-ultralight ├── src │ └── main │ │ ├── res │ │ ├── values-ja │ │ │ └── strings.xml │ │ ├── values-fr │ │ │ └── strings.xml │ │ ├── values-nl │ │ │ └── strings.xml │ │ └── values │ │ │ └── strings.xml │ │ ├── java │ │ └── com │ │ │ └── codebutler │ │ │ └── farebot │ │ │ └── card │ │ │ └── ultralight │ │ │ └── UltralightTypeAdapterFactory.java │ │ └── AndroidManifest.xml └── build.gradle ├── farebot-transit-orca ├── src │ └── main │ │ ├── res │ │ ├── values-fr │ │ │ └── strings.xml │ │ ├── values-ja │ │ │ └── strings.xml │ │ └── values-nl │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── codebutler │ │ └── farebot │ │ └── transit │ │ └── orca │ │ └── OrcaData.java └── build.gradle ├── farebot-transit-octopus ├── src │ └── main │ │ ├── res │ │ ├── values-ja │ │ │ └── strings-octopus.xml │ │ ├── values │ │ │ └── strings-octopus.xml │ │ ├── values-nl │ │ │ └── strings-octopus.xml │ │ └── values-fr │ │ │ └── strings-octopus.xml │ │ └── AndroidManifest.xml └── build.gradle ├── farebot-card-felica ├── src │ └── main │ │ ├── res │ │ └── values │ │ │ └── plurals.xml │ │ ├── java │ │ └── com │ │ │ └── codebutler │ │ │ └── farebot │ │ │ └── card │ │ │ └── felica │ │ │ ├── FelicaTypeAdapterFactory.java │ │ │ └── FelicaBlock.java │ │ └── AndroidManifest.xml └── build.gradle ├── .gitignore ├── farebot-card ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── codebutler │ └── farebot │ ├── key │ └── CardKeys.java │ └── card │ ├── serialize │ └── CardSerializer.java │ ├── RawCard.java │ └── CardType.java ├── farebot-base ├── build.gradle └── src │ └── main │ └── AndroidManifest.xml ├── farebot-transit-easycard ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── res │ └── values │ └── strings.xml ├── farebot-transit ├── build.gradle └── src │ └── main │ ├── java │ └── com │ │ └── codebutler │ │ └── farebot │ │ └── transit │ │ ├── TransitFactory.java │ │ └── TransitIdentity.java │ └── AndroidManifest.xml ├── farebot-transit-bilhete ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── codebutler │ └── farebot │ └── transit │ └── bilhete_unico │ └── BilheteUnicoSPCredit.java ├── farebot-transit-ezlink ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── res │ └── values │ └── strings.xml ├── farebot-transit-hsl ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── res │ ├── values-ja │ └── strings.xml │ └── values-fi │ └── strings.xml ├── farebot-transit-clipper ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── res │ └── values │ └── strings.xml ├── farebot-card-cepas ├── build.gradle └── src │ └── main │ ├── java │ └── com │ │ └── codebutler │ │ └── farebot │ │ └── card │ │ └── cepas │ │ ├── CEPASTypeAdapterFactory.java │ │ └── CEPASException.java │ └── AndroidManifest.xml ├── farebot-card-desfire ├── build.gradle └── src │ └── main │ ├── java │ └── com │ │ └── codebutler │ │ └── farebot │ │ └── card │ │ └── desfire │ │ ├── DesfireTypeAdapterFactory.java │ │ ├── DesfireFile.java │ │ ├── DesfireRecord.java │ │ ├── StandardDesfireFile.java │ │ ├── InvalidDesfireFile.java │ │ ├── UnauthorizedDesfireFile.java │ │ └── StandardDesfireFileSettings.java │ └── AndroidManifest.xml ├── farebot-transit-opal ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── res │ └── values-ja │ └── strings.xml ├── gradle.properties ├── farebot-app-persist ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── codebutler │ │ │ └── farebot │ │ │ └── persist │ │ │ ├── CardKeysPersister.java │ │ │ ├── db │ │ │ ├── FareBotDbConverters.kt │ │ │ ├── DbCardPersister.kt │ │ │ ├── DbCardKeysPersister.kt │ │ │ ├── model │ │ │ │ ├── SavedCard.kt │ │ │ │ └── SavedKey.kt │ │ │ └── dao │ │ │ │ ├── SavedCardDao.kt │ │ │ │ └── SavedKeyDao.kt │ │ │ └── CardPersister.java │ │ └── AndroidManifest.xml └── build.gradle ├── .travis.yml ├── settings.gradle └── config └── proguard └── proguard-rules.pro /data/.gitignore: -------------------------------------------------------------------------------- 1 | *.db3 -------------------------------------------------------------------------------- /data/seq_gocard/.gitignore: -------------------------------------------------------------------------------- 1 | SEQ.zip 2 | seq_gocard_stops.csv 3 | -------------------------------------------------------------------------------- /debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/debug.keystore -------------------------------------------------------------------------------- /farebot-transit-stub/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /data/suica/Gemfile: -------------------------------------------------------------------------------- 1 | source :rubygems 2 | 3 | gem 'sqlite3' 4 | gem 'redis' 5 | gem 'nestful' 6 | gem 'graticule' 7 | gem 'unicode_utils' 8 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "third_party/nfc-felica-lib"] 2 | path = third_party/nfc-felica-lib 3 | url = https://github.com/codebutler/nfc-felica-lib.git 4 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/edy_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/edy_card.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/hsl_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/hsl_card.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/kmt_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/kmt_card.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/myki_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/myki_card.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/nets_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/nets_card.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/opal_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/opal_card.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/orca_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/orca_card.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-xhdpi/easycard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-xhdpi/easycard.png -------------------------------------------------------------------------------- /farebot-transit-ovc/src/main/assets/ovc_stations.db3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-transit-ovc/src/main/assets/ovc_stations.db3 -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.{kt,kts}] 4 | indent_size=4 5 | continuation_indent_size=8 6 | insert_final_newline=true 7 | max_line_length=120 8 | 9 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/ezlink_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/ezlink_card.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/icoca_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/icoca_card.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/marker_end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/marker_end.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/ovchip_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/ovchip_card.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/pasmo_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/pasmo_card.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/seqgo_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/seqgo_card.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/suica_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/suica_card.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/clipper_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/clipper_card.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/marker_start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/marker_start.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/octopus_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/octopus_card.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /farebot-transit-seqgo/src/main/assets/seq_go_stations.db3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-transit-seqgo/src/main/assets/seq_go_stations.db3 -------------------------------------------------------------------------------- /farebot-transit-suica/src/main/assets/felica_stations.db3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-transit-suica/src/main/assets/felica_stations.db3 -------------------------------------------------------------------------------- /farebot-app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /farebot-transit-kmt/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/bilheteunicosp_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/bilheteunicosp_card.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable-hdpi/manly_fast_ferry_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebutler/farebot/HEAD/farebot-app/src/main/res/drawable-hdpi/manly_fast_ferry_card.png -------------------------------------------------------------------------------- /farebot-transit-manly/src/main/res/values-ja/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | カード エポック 4 | 5 | -------------------------------------------------------------------------------- /farebot-transit-manly/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Card Epoch 4 | 5 | -------------------------------------------------------------------------------- /farebot-transit-edy/src/main/res/values-fr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | # 4 | 5 | -------------------------------------------------------------------------------- /farebot-transit-edy/src/main/res/values-iw/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | # 4 | 5 | -------------------------------------------------------------------------------- /farebot-transit-edy/src/main/res/values-ja/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 順序 4 | 5 | -------------------------------------------------------------------------------- /farebot-transit-edy/src/main/res/values-nl/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | # 4 | 5 | -------------------------------------------------------------------------------- /farebot-transit-edy/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | # 4 | 5 | -------------------------------------------------------------------------------- /farebot-transit-manly/src/main/res/values-nl/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Kaartgeneratie 4 | 5 | -------------------------------------------------------------------------------- /farebot-transit-manly/src/main/res/values-fr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Époque de la carte 4 | 5 | -------------------------------------------------------------------------------- /farebot-transit-ovc/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Unknown (%s) 4 | 5 | -------------------------------------------------------------------------------- /farebot-card-classic/src/main/res/values-iw/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | בלוק: %s 4 | 5 | -------------------------------------------------------------------------------- /farebot-transit-myki/src/main/res/values-ja/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | カード番号のみ読み取ることができます。 4 | 5 | -------------------------------------------------------------------------------- /farebot-card-ultralight/src/main/res/values-ja/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ページ: 0x%s 4 | 5 | -------------------------------------------------------------------------------- /farebot-card-ultralight/src/main/res/values-fr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Page: 0x%s 4 | 5 | -------------------------------------------------------------------------------- /farebot-card-ultralight/src/main/res/values-nl/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Pagina: 0x%s 4 | 5 | -------------------------------------------------------------------------------- /farebot-transit-orca/src/main/res/values-fr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | %s (Annulé) 4 | 5 | -------------------------------------------------------------------------------- /farebot-transit-orca/src/main/res/values-ja/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | %s (キャンセル) 4 | 5 | -------------------------------------------------------------------------------- /farebot-transit-orca/src/main/res/values-nl/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | %s (geannuleerd) 4 | 5 | -------------------------------------------------------------------------------- /farebot-transit-myki/src/main/res/values-fr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Seulement le numéro de la carte peut être lu. 4 | 5 | -------------------------------------------------------------------------------- /farebot-transit-myki/src/main/res/values-nl/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Alleen het kaartnummer kan worden uitgelezen. 4 | 5 | -------------------------------------------------------------------------------- /farebot-card-ultralight/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Pages 4 | Page: 0x%s 5 | 6 | -------------------------------------------------------------------------------- /farebot-transit-octopus/src/main/res/values-ja/strings-octopus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 代替財布残高 4 | 深圳通 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /farebot-transit-octopus/src/main/res/values/strings-octopus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Shenzhen Tong 4 | Alternate purse balances 5 | 6 | -------------------------------------------------------------------------------- /farebot-card-felica/src/main/res/values/plurals.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d block 5 | %d blocks 6 | 7 | 8 | -------------------------------------------------------------------------------- /farebot-transit-octopus/src/main/res/values-nl/strings-octopus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Alternatieve portemonnee-saldi 4 | Shenzhen Tong 5 | 6 | -------------------------------------------------------------------------------- /farebot-transit-octopus/src/main/res/values-fr/strings-octopus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Solde alternatif du porte-monnaie 4 | Shenzhen Tong 5 | 6 | -------------------------------------------------------------------------------- /farebot-transit-seqgo/src/main/res/values-ja/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Go Access, Explore または SEEQ カードはサポートしません。 4 | 自動チャージ 5 | 手動チャージ 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | out/ 3 | dist/ 4 | bin/ 5 | gen/ 6 | captures/ 7 | classes/ 8 | .DS_Store 9 | .idea 10 | local.properties 11 | *.iml 12 | *.iws 13 | projectFilesBackup/ 14 | project.properties 15 | .gradle 16 | release.keystore 17 | com_crashlytics_export_strings.xml 18 | crashlytics-build.properties 19 | crashlytics.properties 20 | -------------------------------------------------------------------------------- /farebot-transit-myki/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | Only the card number can be read. 8 | 9 | -------------------------------------------------------------------------------- /farebot-card/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | api project(':farebot-base') 5 | 6 | api libs.supportV4 7 | api libs.gson 8 | 9 | implementation libs.guava 10 | 11 | compileOnly libs.autoValueAnnotations 12 | 13 | annotationProcessor libs.autoValue 14 | } 15 | 16 | android { } 17 | -------------------------------------------------------------------------------- /farebot-transit-seqgo/src/main/res/values-fr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ne gère pas les cartes Go Access, Explore ou SEEQ. 4 | Recharge automatique 5 | Recharge manuelle 6 | 7 | -------------------------------------------------------------------------------- /farebot-transit-seqgo/src/main/res/values-nl/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ondersteund geen kaarten met Go Acces, Explore of SEEQ. 4 | Automatisch opladen 5 | Handmatig opladen 6 | 7 | -------------------------------------------------------------------------------- /farebot-base/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-kapt' 4 | 5 | dependencies { 6 | implementation libs.guava 7 | implementation libs.supportV4 8 | implementation libs.kotlinStdlib 9 | 10 | compileOnly libs.autoValueAnnotations 11 | 12 | kapt libs.autoValue 13 | 14 | } 15 | 16 | android { } 17 | -------------------------------------------------------------------------------- /farebot-transit-easycard/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | 4 | dependencies { 5 | implementation project(':farebot-transit') 6 | implementation project(':farebot-card-classic') 7 | 8 | implementation libs.kotlinStdlib 9 | implementation libs.guava 10 | } 11 | 12 | android { 13 | resourcePrefix 'easycard_' 14 | } 15 | -------------------------------------------------------------------------------- /farebot-card-classic/src/main/res/values-ja/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ブロック: %s 4 | セクター: 0x%1$s (無効: %2$s) 5 | セクター: 0x%s 6 | セクター: 0x%s (未承認) 7 | 8 | -------------------------------------------------------------------------------- /farebot-card-classic/src/main/res/values-fr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Bloc: %s 4 | Secteur: 0x%1$s (Invalide: %2$s) 5 | Secteur: 0x%s 6 | Secteur: 0x%s (Non autorisé) 7 | 8 | -------------------------------------------------------------------------------- /farebot-card-classic/src/main/res/values-nl/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Blok: %s 4 | Sector: 0x%1$s (Ongeldig: %2$s) 5 | Sector: 0x%s 6 | Sector: 0x%s (ongeautoriseerd) 7 | 8 | -------------------------------------------------------------------------------- /farebot-transit-kmt/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Kartu Multi Trip 3 | For new FeliCa cards only. 4 | JABODETABEK 5 | Kereta Commuter Indonesia 6 | KCI 7 | 8 | -------------------------------------------------------------------------------- /farebot-transit/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | api project(':farebot-card') 5 | 6 | implementation libs.supportV4 7 | 8 | compileOnly libs.autoValueAnnotations 9 | 10 | annotationProcessor libs.autoValueAnnotations 11 | annotationProcessor libs.autoValueGsonAnnotations 12 | 13 | annotationProcessor libs.autoValue 14 | annotationProcessor libs.autoValueGson 15 | } 16 | 17 | android { } 18 | -------------------------------------------------------------------------------- /farebot-transit/src/main/java/com/codebutler/farebot/transit/TransitFactory.java: -------------------------------------------------------------------------------- 1 | package com.codebutler.farebot.transit; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.codebutler.farebot.card.Card; 6 | 7 | public interface TransitFactory { 8 | 9 | boolean check(@NonNull C card); 10 | 11 | @NonNull 12 | TransitIdentity parseIdentity(@NonNull C card); 13 | 14 | @NonNull 15 | T parseInfo(@NonNull C card); 16 | } 17 | -------------------------------------------------------------------------------- /data/seq_gocard/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean 2 | 3 | all: seq_go_stations.db3 4 | 5 | seq_go_stations.db3: mapping.csv SEQ.zip ../../extra/compile_stops_from_gtfs.py 6 | python ../../extra/compile_stops_from_gtfs.py SEQ.zip -m mapping.csv -e 'zone_id' --extra-fields-from-child -o $@ 7 | 8 | SEQ.zip: 9 | wget -N http://translink.com.au/sites/default/files/assets/resources/about-translink/reporting-and-publications/open-data/gtfs/$@ 10 | 11 | clean: 12 | rm -f SEQ.zip seq_gocard_stations.db3 13 | 14 | -------------------------------------------------------------------------------- /farebot-transit-edy/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | 4 | dependencies { 5 | implementation project(':farebot-transit') 6 | implementation project(':farebot-card-felica') 7 | 8 | compileOnly libs.autoValueAnnotations 9 | 10 | annotationProcessor libs.autoValueAnnotations 11 | annotationProcessor libs.autoValueGsonAnnotations 12 | 13 | annotationProcessor libs.autoValue 14 | annotationProcessor libs.autoValueGson 15 | } 16 | 17 | android { } 18 | -------------------------------------------------------------------------------- /farebot-transit-manly/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | 4 | dependencies { 5 | implementation project(':farebot-transit') 6 | implementation project(':farebot-card-classic') 7 | 8 | compileOnly libs.autoValueAnnotations 9 | 10 | annotationProcessor libs.autoValueAnnotations 11 | annotationProcessor libs.autoValueGsonAnnotations 12 | 13 | annotationProcessor libs.autoValue 14 | annotationProcessor libs.autoValueGson 15 | } 16 | 17 | android { } 18 | -------------------------------------------------------------------------------- /farebot-transit-bilhete/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | 4 | dependencies { 5 | implementation project(':farebot-transit') 6 | implementation project(':farebot-card-classic') 7 | 8 | compileOnly libs.autoValueAnnotations 9 | 10 | annotationProcessor libs.autoValueAnnotations 11 | annotationProcessor libs.autoValueGsonAnnotations 12 | 13 | annotationProcessor libs.autoValue 14 | annotationProcessor libs.autoValueGson 15 | } 16 | 17 | android { } 18 | -------------------------------------------------------------------------------- /data/seq_gocard/mapping.csv: -------------------------------------------------------------------------------- 1 | reader_id,stop_code,stop_id 2 | 4,,place_forsta 3 | 5,,place_censta 4 | 6,,place_sousta 5 | 9,,place_domsta 6 | 20,,place_romsta 7 | 60,,place_wolsta 8 | 63,,place_nunsta 9 | 88,,place_faista 10 | 194,317588, 11 | 498,000025, 12 | 614,,229 13 | 989,001077, 14 | 999,001087, 15 | 1043,001159, 16 | 1565,,place_UQLAKE 17 | 2423,,2944 18 | 2425,,2946 19 | 4006,,5031 20 | 5678,010487, 21 | 13003,,place_kgbs 22 | 15275,000043, 23 | 15276,000044, 24 | 19513,319743, 25 | 20785,,place_UQLAKE 26 | -------------------------------------------------------------------------------- /farebot-card-ultralight/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | implementation project(':farebot-card') 5 | 6 | compileOnly libs.autoValueAnnotations 7 | compileOnly libs.autoValueGsonAnnotations 8 | 9 | annotationProcessor libs.autoValueAnnotations 10 | annotationProcessor libs.autoValueGsonAnnotations 11 | 12 | annotationProcessor libs.autoValue 13 | annotationProcessor libs.autoValueGson 14 | } 15 | 16 | android { 17 | resourcePrefix 'ultralight_' 18 | } 19 | -------------------------------------------------------------------------------- /farebot-transit-seqgo/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | Manual top-up 8 | Automatic top-up 9 | Does not support Go Access, Explore or SEEQ cards. 10 | 11 | -------------------------------------------------------------------------------- /farebot-transit-octopus/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | implementation project(':farebot-transit') 5 | implementation project(':farebot-card-felica') 6 | 7 | compileOnly libs.autoValueAnnotations 8 | 9 | annotationProcessor libs.autoValueAnnotations 10 | annotationProcessor libs.autoValueGsonAnnotations 11 | 12 | annotationProcessor libs.autoValue 13 | annotationProcessor libs.autoValueGson 14 | } 15 | 16 | android { 17 | resourcePrefix 'octopus_' 18 | } 19 | -------------------------------------------------------------------------------- /farebot-transit-ezlink/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | 4 | dependencies { 5 | implementation project(':farebot-transit') 6 | implementation project(':farebot-card-cepas') 7 | 8 | implementation libs.guava 9 | 10 | compileOnly libs.autoValueAnnotations 11 | 12 | annotationProcessor libs.autoValueAnnotations 13 | annotationProcessor libs.autoValueGsonAnnotations 14 | 15 | annotationProcessor libs.autoValue 16 | annotationProcessor libs.autoValueGson 17 | } 18 | 19 | android { } 20 | -------------------------------------------------------------------------------- /farebot-transit-hsl/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | 4 | dependencies { 5 | implementation project(':farebot-transit') 6 | implementation project(':farebot-card-desfire') 7 | 8 | implementation libs.guava 9 | 10 | compileOnly libs.autoValueAnnotations 11 | 12 | annotationProcessor libs.autoValueAnnotations 13 | annotationProcessor libs.autoValueGsonAnnotations 14 | 15 | annotationProcessor libs.autoValue 16 | annotationProcessor libs.autoValueGson 17 | } 18 | 19 | android { } 20 | -------------------------------------------------------------------------------- /farebot-transit-kmt/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | 4 | dependencies { 5 | implementation project(':farebot-transit') 6 | implementation project(':farebot-card-felica') 7 | 8 | implementation libs.guava 9 | 10 | compileOnly libs.autoValueAnnotations 11 | 12 | annotationProcessor libs.autoValueAnnotations 13 | annotationProcessor libs.autoValueGsonAnnotations 14 | 15 | annotationProcessor libs.autoValue 16 | annotationProcessor libs.autoValueGson 17 | } 18 | 19 | android { } 20 | -------------------------------------------------------------------------------- /farebot-transit-clipper/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | 4 | dependencies { 5 | implementation project(':farebot-transit') 6 | implementation project(':farebot-card-desfire') 7 | 8 | implementation libs.guava 9 | 10 | compileOnly libs.autoValueAnnotations 11 | 12 | annotationProcessor libs.autoValueAnnotations 13 | annotationProcessor libs.autoValueGsonAnnotations 14 | 15 | annotationProcessor libs.autoValue 16 | annotationProcessor libs.autoValueGson 17 | } 18 | 19 | android { } 20 | -------------------------------------------------------------------------------- /farebot-transit-myki/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | 4 | dependencies { 5 | implementation project(':farebot-transit-stub') 6 | implementation project(':farebot-card-desfire') 7 | 8 | compileOnly libs.autoValueAnnotations 9 | 10 | annotationProcessor libs.autoValueAnnotations 11 | annotationProcessor libs.autoValueGsonAnnotations 12 | 13 | annotationProcessor libs.autoValue 14 | annotationProcessor libs.autoValueGson 15 | } 16 | 17 | android { 18 | resourcePrefix 'myki_' 19 | } 20 | -------------------------------------------------------------------------------- /data/suica/lib/gcode.rb: -------------------------------------------------------------------------------- 1 | require 'graticule' 2 | 3 | @geocoder = Graticule.service(:google).new "" 4 | 5 | def geocode(text) 6 | redis_key = [ 'gcode', text ].join('_') 7 | unless @redis.exists(redis_key) 8 | begin 9 | loc = @geocoder.locate(text) 10 | @redis.set(redis_key, [ loc.latitude, loc.longitude ].to_json) 11 | rescue Exception => ex 12 | raise ex unless ex.message == "unknown address" 13 | @redis.set(redis_key, [ nil, nil ].to_json) 14 | end 15 | end 16 | JSON::parse(@redis.get(redis_key)) 17 | end 18 | 19 | -------------------------------------------------------------------------------- /farebot-card-cepas/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | implementation project(':farebot-card') 5 | 6 | implementation libs.guava 7 | 8 | compileOnly libs.autoValueAnnotations 9 | compileOnly libs.autoValueGsonAnnotations 10 | 11 | annotationProcessor libs.autoValueAnnotations 12 | annotationProcessor libs.autoValueGsonAnnotations 13 | 14 | annotationProcessor libs.autoValue 15 | annotationProcessor libs.autoValueGson 16 | } 17 | 18 | android { 19 | resourcePrefix 'cepas_' 20 | } 21 | -------------------------------------------------------------------------------- /farebot-card-classic/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | implementation project(':farebot-card') 5 | 6 | implementation libs.guava 7 | 8 | compileOnly libs.autoValueAnnotations 9 | compileOnly libs.autoValueGsonAnnotations 10 | 11 | annotationProcessor libs.autoValueAnnotations 12 | annotationProcessor libs.autoValueGsonAnnotations 13 | 14 | annotationProcessor libs.autoValue 15 | annotationProcessor libs.autoValueGson 16 | } 17 | 18 | android { 19 | resourcePrefix 'classic_' 20 | } 21 | -------------------------------------------------------------------------------- /farebot-card-desfire/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | implementation project(':farebot-card') 5 | 6 | implementation libs.guava 7 | 8 | compileOnly libs.autoValueAnnotations 9 | compileOnly libs.autoValueGsonAnnotations 10 | 11 | annotationProcessor libs.autoValueAnnotations 12 | annotationProcessor libs.autoValueGsonAnnotations 13 | 14 | annotationProcessor libs.autoValue 15 | annotationProcessor libs.autoValueGson 16 | } 17 | 18 | android { 19 | resourcePrefix 'desfire_' 20 | } 21 | -------------------------------------------------------------------------------- /farebot-card-felica/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | api project(':nfc-felica-lib') 5 | 6 | implementation project(':farebot-card') 7 | 8 | compileOnly libs.autoValueAnnotations 9 | compileOnly libs.autoValueGsonAnnotations 10 | 11 | annotationProcessor libs.autoValueAnnotations 12 | annotationProcessor libs.autoValueGsonAnnotations 13 | 14 | annotationProcessor libs.autoValue 15 | annotationProcessor libs.autoValueGson 16 | } 17 | 18 | android { 19 | resourcePrefix 'felica_' 20 | } 21 | -------------------------------------------------------------------------------- /farebot-transit-ovc/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | 4 | dependencies { 5 | implementation project(':farebot-transit-stub') 6 | implementation project(':farebot-card-classic') 7 | implementation libs.guava 8 | 9 | compileOnly libs.autoValueAnnotations 10 | 11 | annotationProcessor libs.autoValueAnnotations 12 | annotationProcessor libs.autoValueGsonAnnotations 13 | 14 | annotationProcessor libs.autoValue 15 | annotationProcessor libs.autoValueGson 16 | } 17 | 18 | android { 19 | resourcePrefix 'ovc_' 20 | } 21 | -------------------------------------------------------------------------------- /farebot-card-cepas/src/main/java/com/codebutler/farebot/card/cepas/CEPASTypeAdapterFactory.java: -------------------------------------------------------------------------------- 1 | package com.codebutler.farebot.card.cepas; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.TypeAdapterFactory; 6 | import com.ryanharter.auto.value.gson.GsonTypeAdapterFactory; 7 | 8 | @GsonTypeAdapterFactory 9 | public abstract class CEPASTypeAdapterFactory implements TypeAdapterFactory { 10 | 11 | @NonNull 12 | public static CEPASTypeAdapterFactory create() { 13 | return new AutoValueGson_CEPASTypeAdapterFactory(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /farebot-transit-opal/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | 4 | dependencies { 5 | implementation project(':farebot-transit') 6 | implementation project(':farebot-card-desfire') 7 | 8 | implementation libs.guava 9 | 10 | compileOnly libs.autoValueAnnotations 11 | 12 | annotationProcessor libs.autoValueAnnotations 13 | annotationProcessor libs.autoValueGsonAnnotations 14 | 15 | annotationProcessor libs.autoValue 16 | annotationProcessor libs.autoValueGson 17 | } 18 | 19 | android { 20 | resourcePrefix 'opal_' 21 | } 22 | -------------------------------------------------------------------------------- /farebot-transit-seqgo/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | 4 | dependencies { 5 | implementation project(':farebot-transit') 6 | implementation project(':farebot-card-classic') 7 | 8 | implementation libs.guava 9 | 10 | compileOnly libs.autoValueAnnotations 11 | 12 | annotationProcessor libs.autoValueAnnotations 13 | annotationProcessor libs.autoValueGsonAnnotations 14 | 15 | annotationProcessor libs.autoValue 16 | annotationProcessor libs.autoValueGson 17 | } 18 | 19 | android { 20 | resourcePrefix 'seqgo_' 21 | } 22 | -------------------------------------------------------------------------------- /farebot-transit-suica/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | 4 | dependencies { 5 | implementation project(':farebot-transit') 6 | implementation project(':farebot-card-felica') 7 | 8 | implementation libs.guava 9 | 10 | compileOnly libs.autoValueAnnotations 11 | 12 | annotationProcessor libs.autoValueAnnotations 13 | annotationProcessor libs.autoValueGsonAnnotations 14 | 15 | annotationProcessor libs.autoValue 16 | annotationProcessor libs.autoValueGson 17 | } 18 | 19 | android { 20 | resourcePrefix 'suica_' 21 | } 22 | -------------------------------------------------------------------------------- /farebot-card-felica/src/main/java/com/codebutler/farebot/card/felica/FelicaTypeAdapterFactory.java: -------------------------------------------------------------------------------- 1 | package com.codebutler.farebot.card.felica; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.TypeAdapterFactory; 6 | import com.ryanharter.auto.value.gson.GsonTypeAdapterFactory; 7 | 8 | @GsonTypeAdapterFactory 9 | public abstract class FelicaTypeAdapterFactory implements TypeAdapterFactory { 10 | 11 | @NonNull 12 | public static FelicaTypeAdapterFactory create() { 13 | return new AutoValueGson_FelicaTypeAdapterFactory(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /farebot-transit-orca/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | 4 | dependencies { 5 | implementation project(':farebot-transit') 6 | implementation project(':farebot-card-desfire') 7 | 8 | implementation libs.guava 9 | 10 | compileOnly libs.autoValueAnnotations 11 | 12 | annotationProcessor libs.autoValueAnnotations 13 | annotationProcessor libs.autoValueGsonAnnotations 14 | 15 | annotationProcessor libs.autoValue 16 | annotationProcessor libs.autoValueGson 17 | } 18 | 19 | android { 20 | resourcePrefix 'transit_orca_' 21 | } 22 | -------------------------------------------------------------------------------- /farebot-transit-stub/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | 4 | dependencies { 5 | api project(':farebot-transit') 6 | 7 | implementation project(':farebot-card-classic') 8 | implementation project(':farebot-card-desfire') 9 | 10 | compileOnly libs.autoValueAnnotations 11 | 12 | annotationProcessor libs.autoValueAnnotations 13 | annotationProcessor libs.autoValueGsonAnnotations 14 | 15 | annotationProcessor libs.autoValue 16 | annotationProcessor libs.autoValueGson 17 | } 18 | 19 | android { 20 | resourcePrefix 'stub_' 21 | } 22 | -------------------------------------------------------------------------------- /farebot-card-classic/src/main/java/com/codebutler/farebot/card/classic/ClassicTypeAdapterFactory.java: -------------------------------------------------------------------------------- 1 | package com.codebutler.farebot.card.classic; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.TypeAdapterFactory; 6 | import com.ryanharter.auto.value.gson.GsonTypeAdapterFactory; 7 | 8 | @GsonTypeAdapterFactory 9 | public abstract class ClassicTypeAdapterFactory implements TypeAdapterFactory { 10 | 11 | @NonNull 12 | public static ClassicTypeAdapterFactory create() { 13 | return new AutoValueGson_ClassicTypeAdapterFactory(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /farebot-card-desfire/src/main/java/com/codebutler/farebot/card/desfire/DesfireTypeAdapterFactory.java: -------------------------------------------------------------------------------- 1 | package com.codebutler.farebot.card.desfire; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.TypeAdapterFactory; 6 | import com.ryanharter.auto.value.gson.GsonTypeAdapterFactory; 7 | 8 | @GsonTypeAdapterFactory 9 | public abstract class DesfireTypeAdapterFactory implements TypeAdapterFactory { 10 | 11 | @NonNull 12 | public static DesfireTypeAdapterFactory create() { 13 | return new AutoValueGson_DesfireTypeAdapterFactory(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.parallel=true 2 | org.gradle.daemon=true 3 | org.gradle.jvmargs=-Xmx2560m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 4 | org.gradle.caching=true 5 | 6 | # https://github.com/gradle/kotlin-dsl/issues/311 7 | org.gradle.configureondemand=false 8 | 9 | android.builder.sdkDownload=true 10 | android.enableBuildCache=true 11 | android.enableD8.desugaring=true 12 | 13 | # Still in preview 14 | android.enableR8=false 15 | 16 | kotlin.incremental.usePreciseJavaTracking=true 17 | android.useAndroidX=true 18 | android.enableJetifier=true 19 | -------------------------------------------------------------------------------- /farebot-card-ultralight/src/main/java/com/codebutler/farebot/card/ultralight/UltralightTypeAdapterFactory.java: -------------------------------------------------------------------------------- 1 | package com.codebutler.farebot.card.ultralight; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.TypeAdapterFactory; 6 | import com.ryanharter.auto.value.gson.GsonTypeAdapterFactory; 7 | 8 | @GsonTypeAdapterFactory 9 | public abstract class UltralightTypeAdapterFactory implements TypeAdapterFactory { 10 | 11 | @NonNull 12 | public static UltralightTypeAdapterFactory create() { 13 | return new AutoValueGson_UltralightTypeAdapterFactory(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /farebot-app-persist/src/main/java/com/codebutler/farebot/persist/CardKeysPersister.java: -------------------------------------------------------------------------------- 1 | package com.codebutler.farebot.persist; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.annotation.Nullable; 5 | 6 | import com.codebutler.farebot.persist.db.model.SavedKey; 7 | 8 | import java.util.List; 9 | 10 | public interface CardKeysPersister { 11 | 12 | @NonNull 13 | List getSavedKeys(); 14 | 15 | @Nullable 16 | SavedKey getForTagId(@NonNull String tagId); 17 | 18 | long insert(@NonNull SavedKey savedKey); 19 | 20 | void delete(@NonNull SavedKey savedKey); 21 | } 22 | -------------------------------------------------------------------------------- /farebot-app-persist/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-kapt' 4 | 5 | dependencies { 6 | implementation libs.supportV4 7 | implementation libs.guava 8 | implementation libs.gson 9 | implementation libs.kotlinStdlib 10 | 11 | api libs.roomRuntime 12 | kapt libs.roomCompiler 13 | 14 | implementation project(path: ':farebot-card') 15 | } 16 | 17 | android { 18 | defaultConfig { 19 | kapt { 20 | arguments { 21 | arg("room.schemaLocation", "$projectDir/schemas".toString()) 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /farebot-app-persist/src/main/java/com/codebutler/farebot/persist/db/FareBotDbConverters.kt: -------------------------------------------------------------------------------- 1 | package com.codebutler.farebot.persist.db 2 | 3 | import androidx.room.TypeConverter 4 | import com.codebutler.farebot.card.CardType 5 | import java.util.Date 6 | 7 | @Suppress("unused") 8 | class FareBotDbConverters { 9 | @TypeConverter 10 | fun cardTypeToString(cardType: CardType) = cardType.name 11 | 12 | @TypeConverter 13 | fun stringToCardType(cardTypeName: String) = CardType.valueOf(cardTypeName) 14 | 15 | @TypeConverter 16 | fun dateToLong(date: Date) = date.time 17 | 18 | @TypeConverter 19 | fun longToDate(dateValue: Long) = Date(dateValue) 20 | } 21 | -------------------------------------------------------------------------------- /farebot-app-persist/src/main/java/com/codebutler/farebot/persist/db/DbCardPersister.kt: -------------------------------------------------------------------------------- 1 | package com.codebutler.farebot.persist.db 2 | 3 | import com.codebutler.farebot.persist.CardPersister 4 | import com.codebutler.farebot.persist.db.model.SavedCard 5 | 6 | class DbCardPersister(private val db: FareBotDb) : CardPersister { 7 | override fun getCards(): List = db.savedCardDao().selectAll() 8 | override fun getCard(id: Long): SavedCard? = db.savedCardDao().selectById(id) 9 | override fun insertCard(savedCard: SavedCard): Long = db.savedCardDao().insert(savedCard) 10 | override fun deleteCard(savedCard: SavedCard) = db.savedCardDao().delete(savedCard) 11 | } 12 | -------------------------------------------------------------------------------- /farebot-app-persist/src/main/java/com/codebutler/farebot/persist/db/DbCardKeysPersister.kt: -------------------------------------------------------------------------------- 1 | package com.codebutler.farebot.persist.db 2 | 3 | import com.codebutler.farebot.persist.CardKeysPersister 4 | import com.codebutler.farebot.persist.db.model.SavedKey 5 | 6 | class DbCardKeysPersister(private val db: FareBotDb) : CardKeysPersister { 7 | override fun getSavedKeys(): List = db.savedKeyDao().selectAll() 8 | override fun getForTagId(tagId: String): SavedKey? = db.savedKeyDao().selectByCardId(tagId) 9 | override fun insert(savedKey: SavedKey): Long = db.savedKeyDao().insert(savedKey) 10 | override fun delete(savedKey: SavedKey) = db.savedKeyDao().delete(savedKey) 11 | } 12 | -------------------------------------------------------------------------------- /farebot-app-persist/src/main/java/com/codebutler/farebot/persist/db/model/SavedCard.kt: -------------------------------------------------------------------------------- 1 | package com.codebutler.farebot.persist.db.model 2 | 3 | import androidx.room.ColumnInfo 4 | import androidx.room.Entity 5 | import androidx.room.PrimaryKey 6 | import com.codebutler.farebot.card.CardType 7 | import java.util.Date 8 | 9 | @Entity(tableName = "cards") 10 | data class SavedCard( 11 | @PrimaryKey(autoGenerate = true) @ColumnInfo(name = "id") val id: Long = 0, 12 | @ColumnInfo(name = "type") val type: CardType, 13 | @ColumnInfo(name = "serial") val serial: String, 14 | @ColumnInfo(name = "data") val data: String, 15 | @ColumnInfo(name = "scanned_at") val scannedAt: Date = Date() 16 | ) 17 | -------------------------------------------------------------------------------- /farebot-app-persist/src/main/java/com/codebutler/farebot/persist/db/dao/SavedCardDao.kt: -------------------------------------------------------------------------------- 1 | package com.codebutler.farebot.persist.db.dao 2 | 3 | import androidx.room.Dao 4 | import androidx.room.Delete 5 | import androidx.room.Insert 6 | import androidx.room.Query 7 | import com.codebutler.farebot.persist.db.model.SavedCard 8 | 9 | @Dao 10 | interface SavedCardDao { 11 | @Query("SELECT * FROM cards ORDER BY scanned_at DESC") 12 | fun selectAll(): List 13 | 14 | @Query("SELECT * FROM cards WHERE id = :id") 15 | fun selectById(id: Long): SavedCard? 16 | 17 | @Insert 18 | fun insert(savedCard: SavedCard): Long 19 | 20 | @Delete 21 | fun delete(savedCard: SavedCard) 22 | } 23 | -------------------------------------------------------------------------------- /farebot-app-persist/src/main/java/com/codebutler/farebot/persist/db/model/SavedKey.kt: -------------------------------------------------------------------------------- 1 | package com.codebutler.farebot.persist.db.model 2 | 3 | import androidx.room.ColumnInfo 4 | import androidx.room.Entity 5 | import androidx.room.PrimaryKey 6 | import com.codebutler.farebot.card.CardType 7 | import java.util.Date 8 | 9 | @Entity(tableName = "keys") 10 | data class SavedKey( 11 | @PrimaryKey(autoGenerate = true) @ColumnInfo(name = "id") val id: Long = 0, 12 | @ColumnInfo(name = "card_id") val cardId: String, 13 | @ColumnInfo(name = "card_type") val cardType: CardType, 14 | @ColumnInfo(name = "key_data") val keyData: String, 15 | @ColumnInfo(name = "created_at") val createdAt: Date = Date() 16 | ) 17 | -------------------------------------------------------------------------------- /farebot-app-persist/src/main/java/com/codebutler/farebot/persist/db/dao/SavedKeyDao.kt: -------------------------------------------------------------------------------- 1 | package com.codebutler.farebot.persist.db.dao 2 | 3 | import androidx.room.Dao 4 | import androidx.room.Delete 5 | import androidx.room.Insert 6 | import androidx.room.Query 7 | import com.codebutler.farebot.persist.db.model.SavedKey 8 | 9 | @Dao 10 | interface SavedKeyDao { 11 | @Query("SELECT * FROM keys ORDER BY created_at DESC") 12 | fun selectAll(): List 13 | 14 | @Query("SELECT * FROM keys WHERE card_id = :cardId") 15 | fun selectByCardId(cardId: String): SavedKey? 16 | 17 | @Insert 18 | fun insert(savedKey: SavedKey): Long 19 | 20 | @Delete 21 | fun delete(savedKey: SavedKey) 22 | } 23 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | addons: 3 | artifacts: 4 | debug: true 5 | s3_region: "us-west-1" 6 | paths: 7 | - $(ls $TRAVIS_BUILD_DIR/*/build/outputs/lint-results-debug.html) 8 | jdk: 9 | - oraclejdk8 10 | android: 11 | components: 12 | - tools 13 | - android-28 14 | - build-tools-28.0.3 15 | - platform-tools 16 | - extra-google-google_play_services 17 | - extra-google-m2repository 18 | - extra-android-m2repository 19 | - addon-google_apis-google-19 20 | before_cache: 21 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock 22 | - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ 23 | cache: 24 | directories: 25 | - $HOME/.gradle/caches/ 26 | - $HOME/.gradle/wrapper/ 27 | script: ./gradlew assembleDebug checkstyle lintDebug lintKotlin check 28 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/values-fi/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Tietoja 4 | Saldo 5 | Kopioi 6 | Exporttaa kaikki 7 | Historia 8 | Import 9 | Importtaa leikepöydältä 10 | Importtaa tiedostosta 11 | NFC on pois päältä 12 | Asetukset 13 | Jaa 14 | Tuetut kortit 15 | Tuntematon kortti 16 | Tiedonsiirtoasetukset 17 | 18 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/values-ja/strings-location.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | オーストラリア クイーンズランド州 ブリスベン & SE 4 | フィンランド ヘルシンキ 5 | 香港 6 | 関西 7 | 米国 カリフォルニア州 サンフランシスコ 8 | ブラジル サンパウロ 9 | 米国 ワシントン州 シアトル 10 | シンガポール 11 | オーストラリア シドニー 12 | オランダ 13 | 東京 14 | オーストラリア ビクトリア州 15 | 16 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/values-iw/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | על אודות 4 | כמות 5 | עותק 6 | ייצוא כל 7 | היסטוריה 8 | יבוא 9 | יבוא מלוח 10 | יבוא מקובץ 11 | כרטיס נעול 12 | NFC כבוי 13 | לא סרקת כל קלפים. 14 | העדפות 15 | לחלוק 16 | כרטיסים נתמכים 17 | לא יודע כרטיס 18 | הגדרות אלחוטיות 19 | 20 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/values-nl/strings-location.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Brisbane & ZO QLD, Australië 4 | Helsinki, Finland 5 | Hongkong 6 | Kansai, Japan 7 | San Francisco, CA, VS 8 | São Paulo, Brazilië 9 | Seattle, WA, VS 10 | Singapore 11 | Sydney, Australië 12 | Nederland 13 | Tokio, Japan 14 | Victoria, Australië 15 | 16 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/values-fr/strings-location.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Brisbane & SE QLD, Australie 4 | Helsinki, Finlande 5 | Hong Kong 6 | Kansai, Japon 7 | San Francisco, CA, États-Unis 8 | São Paulo, Brésil 9 | Seattle, WA, États-Unis 10 | Singapour 11 | Sydney, Australie 12 | Pays-bas 13 | Tokyo, Japon 14 | Victoria, Australie 15 | 16 | -------------------------------------------------------------------------------- /data/suica/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: http://rubygems.org/ 3 | specs: 4 | activesupport (5.2.3) 5 | concurrent-ruby (~> 1.0, >= 1.0.2) 6 | i18n (>= 0.7, < 2) 7 | minitest (~> 5.1) 8 | tzinfo (~> 1.1) 9 | concurrent-ruby (1.1.5) 10 | graticule (2.7.2) 11 | activesupport 12 | i18n 13 | nokogiri-happymapper (>= 0.5.9) 14 | i18n (1.6.0) 15 | concurrent-ruby (~> 1.0) 16 | mini_portile2 (2.4.0) 17 | minitest (5.11.3) 18 | nestful (1.1.3) 19 | nokogiri (1.10.3) 20 | mini_portile2 (~> 2.4.0) 21 | nokogiri-happymapper (0.8.1) 22 | nokogiri (~> 1.5) 23 | redis (4.1.0) 24 | sqlite3 (1.4.1) 25 | thread_safe (0.3.6) 26 | tzinfo (1.2.5) 27 | thread_safe (~> 0.1) 28 | unicode_utils (1.4.0) 29 | 30 | PLATFORMS 31 | ruby 32 | 33 | DEPENDENCIES 34 | graticule 35 | nestful 36 | redis 37 | sqlite3 38 | unicode_utils 39 | 40 | BUNDLED WITH 41 | 2.0.1 42 | -------------------------------------------------------------------------------- /farebot-base/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-transit/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-app-persist/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-card-classic/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-card-felica/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-transit-edy/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-transit-hsl/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-transit-myki/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-transit-opal/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-transit-orca/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-transit-ovc/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-transit-stub/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-card-ultralight/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-transit-clipper/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-transit-ezlink/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-transit-octopus/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-transit-seqgo/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-transit-suica/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-transit-bilhete/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /farebot-transit-manly/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include 'nfc-felica-lib' 2 | project(':nfc-felica-lib').projectDir = new File('third_party/nfc-felica-lib') 3 | 4 | include ':farebot-base' 5 | include ':farebot-card' 6 | include ':farebot-card-cepas' 7 | include ':farebot-card-classic' 8 | include ':farebot-card-desfire' 9 | include ':farebot-card-felica' 10 | include ':farebot-card-ultralight' 11 | include ':farebot-transit' 12 | include ':farebot-transit-bilhete' 13 | include ':farebot-transit-clipper' 14 | include ':farebot-transit-easycard' 15 | include ':farebot-transit-edy' 16 | include ':farebot-transit-kmt' 17 | include ':farebot-transit-ezlink' 18 | include ':farebot-transit-hsl' 19 | include ':farebot-transit-manly' 20 | include ':farebot-transit-myki' 21 | include ':farebot-transit-octopus' 22 | include ':farebot-transit-opal' 23 | include ':farebot-transit-orca' 24 | include ':farebot-transit-ovc' 25 | include ':farebot-transit-seqgo' 26 | include ':farebot-transit-stub' 27 | include ':farebot-transit-suica' 28 | include ':farebot-app-persist' 29 | include ':farebot-app' -------------------------------------------------------------------------------- /farebot-transit-easycard/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /config/proguard/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Options 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -verbose 5 | -dontoptimize 6 | -dontpreverify 7 | -dontobfuscate 8 | 9 | # Android 10 | -keep class * implements android.os.Parcelable { 11 | public static final android.os.Parcelable$Creator *; 12 | } 13 | 14 | # Crashlytics 15 | -keep class com.crashlytics.** { *; } 16 | -dontwarn com.crashlytics.** 17 | 18 | # Dependencies 19 | -keep class com.google.android.gms.** 20 | -keep class com.wealthfront.magellan.Screen 21 | -dontwarn com.google.auto.value.** 22 | -dontwarn com.google.common.** 23 | -dontnote android.net.http.** 24 | -dontnote org.apache.http.** 25 | -dontnote sun.misc.Unsafe 26 | -dontnote com.google.common.util.concurrent.MoreExecutors 27 | -dontnote com.google.api.client.util.Key 28 | -dontnote com.google.common.collect.MapMakerInternalMap$ReferenceEntry 29 | -dontwarn javax.lang.model.element.Modifier 30 | -dontwarn afu.org.checkerframework.** 31 | -dontwarn org.checkerframework.** 32 | 33 | # FareBot 34 | -keep class com.codebutler.farebot.base.ui.FareBotUiTree 35 | 36 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/inject/ScreenScope.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * ScreenScope.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.inject 24 | 25 | import javax.inject.Scope 26 | 27 | @Scope 28 | annotation class ScreenScope 29 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/inject/ActivityScope.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * ActivityScope.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.inject 24 | 25 | import javax.inject.Scope 26 | 27 | @Scope 28 | annotation class ActivityScope 29 | -------------------------------------------------------------------------------- /farebot-card/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /farebot-transit-ezlink/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | Older generation (expired) cards only. Not compatible with many devices. 26 | 27 | -------------------------------------------------------------------------------- /farebot-card-cepas/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /farebot-card-desfire/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/kotlin/Array.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Array.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.kotlin 24 | 25 | fun Array.compact(): List = this 26 | .filter { !it.isNullOrEmpty() } 27 | .map { it!! } 28 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/menu/screen_card.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 28 | 29 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/values/plurals.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | Card Imported 27 | %d Cards Imported 28 | 29 | 30 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/activity/ActivityResult.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * ActivityResult.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.activity 24 | 25 | import android.content.Intent 26 | 27 | data class ActivityResult(val requestCode: Int, val resultCode: Int, val data: Intent?) 28 | -------------------------------------------------------------------------------- /farebot-card-cepas/src/main/java/com/codebutler/farebot/card/cepas/CEPASException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CEPASException.java 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2012, 2016 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.card.cepas; 24 | 25 | class CEPASException extends Exception { 26 | CEPASException(String detailMessage) { 27 | super(detailMessage); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/feature/keys/KeyViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * KeyViewModel.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.feature.keys 24 | 25 | import com.codebutler.farebot.persist.db.model.SavedKey 26 | 27 | data class KeyViewModel( 28 | val savedKey: SavedKey, 29 | var isSelected: Boolean = false 30 | ) 31 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | #00ACC1 26 | #e5F44336 27 | #FFFFFF 28 | #EEEEEE 29 | 30 | -------------------------------------------------------------------------------- /farebot-card-classic/src/main/java/com/codebutler/farebot/card/classic/ClassicSector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ClassicSector.java 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2012 Wilbert Duijvenvoorde 8 | * Copyright (C) 2012, 2014, 2016 Eric Butler 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see . 22 | */ 23 | 24 | package com.codebutler.farebot.card.classic; 25 | 26 | public interface ClassicSector { 27 | 28 | int getIndex(); 29 | } 30 | -------------------------------------------------------------------------------- /farebot-card/src/main/java/com/codebutler/farebot/key/CardKeys.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CardKeys.java 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2012, 2014, 2016 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.key; 24 | 25 | import androidx.annotation.NonNull; 26 | 27 | import com.codebutler.farebot.card.CardType; 28 | 29 | public interface CardKeys { 30 | 31 | @NonNull 32 | CardType cardType(); 33 | } 34 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/activity/RequestPermissionsResult.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * RequestPermissionsResult.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.activity 24 | 25 | data class RequestPermissionsResult( 26 | val requestCode: Int, 27 | val permissions: Array, 28 | val grantResults: IntArray 29 | ) 30 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable/fg_item_selectable.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/ui/ScreenLifecycleEvent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * ScreenLifecycleEvent.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.ui 24 | 25 | import androidx.annotation.RestrictTo 26 | 27 | @RestrictTo(RestrictTo.Scope.LIBRARY) 28 | enum class ScreenLifecycleEvent { 29 | RESUME, 30 | PAUSE, 31 | SHOW, 32 | HIDE 33 | } 34 | -------------------------------------------------------------------------------- /farebot-card-desfire/src/main/java/com/codebutler/farebot/card/desfire/DesfireFile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DesfireFile.java 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2011-2012, 2014-2016 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.card.desfire; 24 | 25 | import androidx.annotation.NonNull; 26 | 27 | public interface DesfireFile { 28 | 29 | int getId(); 30 | 31 | @NonNull 32 | DesfireFileSettings getFileSettings(); 33 | } 34 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable/ic_transaction_vend_32dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | 16 | 21 | 22 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/layout/screen_trip_map.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/serialize/CardKeysSerializer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * CardKeysSerializer.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.serialize 24 | 25 | import com.codebutler.farebot.key.CardKeys 26 | 27 | interface CardKeysSerializer { 28 | 29 | fun serialize(cardKeys: CardKeys): String 30 | 31 | fun deserialize(data: String): CardKeys 32 | } 33 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/ui/ActionBarOptions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * ActionBarOptions.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.ui 24 | 25 | import androidx.annotation.ColorRes 26 | 27 | data class ActionBarOptions( 28 | @ColorRes val backgroundColorRes: Int? = null, 29 | @ColorRes val textColorRes: Int? = null, 30 | val shadow: Boolean = true 31 | ) 32 | -------------------------------------------------------------------------------- /data/suica/lib/gtrans.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | require 'nestful' 4 | 5 | USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.8 (KHTML, like Gecko) Chrome/17.0.928.0 Safari/535.8' 6 | REFERRER = 'http://translate.google.com/' 7 | URL = 'http://translate.google.com/translate_a/t' 8 | 9 | def google_translate(ja_text) 10 | return nil if ja_text.nil? or ja_text.empty? 11 | 12 | redis_key = [ 'gtrans', ja_text ].join('_') 13 | 14 | unless @redis.exists(redis_key) 15 | params = { 16 | client: 't', 17 | hl: 'en', 18 | tl: 'en', 19 | sl: 'ja', 20 | text: ja_text 21 | } 22 | json = Nestful.get URL, params: params, headers: { 'User-Agent' => USER_AGENT } 23 | json = json.gsub(',,,', ',') 24 | json = json.gsub(',,', ',') 25 | 26 | result = JSON::parse(json).flatten 27 | translated = result[0] 28 | original = result[1] 29 | translit = result[3] 30 | 31 | @redis.set redis_key, [ translated, translit ].to_json 32 | end 33 | 34 | JSON::parse(@redis.get(redis_key)) 35 | end 36 | 37 | class String 38 | def contains_cjk? 39 | !!(self =~ /\p{Han}|\p{Katakana}|\p{Hiragana}\p{Hangul}/) 40 | end 41 | def contains_kana? 42 | !!(self =~ /\p{Katakana}/) 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 30 | 31 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable/ic_add_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 22 | 23 | 28 | 31 | 32 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/menu/action_keys.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 26 | 27 | 32 | 33 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/menu/action_history.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 26 | 27 | 32 | 33 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/menu/screen_keys.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 26 | 27 | 33 | 34 | -------------------------------------------------------------------------------- /farebot-transit-manly/src/main/java/com/codebutler/farebot/transit/manly_fast_ferry/record/ManlyFastFerryRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ManlyFastFerryRecord.java 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2016 Eric Butler 8 | * Copyright (C) 2016 Michael Farrell 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see . 22 | */ 23 | 24 | package com.codebutler.farebot.transit.manly_fast_ferry.record; 25 | 26 | /** 27 | * Represents a record inside of a Manly Fast Ferry 28 | */ 29 | public class ManlyFastFerryRecord { 30 | 31 | ManlyFastFerryRecord() { } 32 | } 33 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/xml/filter_nfc.xml: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | 25 | android.nfc.tech.IsoDep 26 | 27 | 28 | android.nfc.tech.MifareClassic 29 | 30 | 31 | android.nfc.tech.MifareUltralight 32 | 33 | 34 | android.nfc.tech.NfcF 35 | 36 | 37 | -------------------------------------------------------------------------------- /farebot-card/src/main/java/com/codebutler/farebot/card/serialize/CardSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CardSerializer.java 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2016 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.card.serialize; 24 | 25 | import androidx.annotation.NonNull; 26 | 27 | import com.codebutler.farebot.card.RawCard; 28 | 29 | public interface CardSerializer { 30 | 31 | @NonNull 32 | String serialize(@NonNull RawCard card); 33 | 34 | @NonNull 35 | RawCard deserialize(@NonNull String data); 36 | } 37 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable/ic_delete_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 22 | 23 | 28 | 31 | 32 | -------------------------------------------------------------------------------- /farebot-card-classic/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | Block: %s 25 | Sector: 0x%s (Unauthorized) 26 | Sector: 0x%s 27 | Sector: 0x%1$s (Invalid: %2$s) 28 | 29 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/kotlin/ViewGroupExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * ViewGroupExtensions.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.kotlin 24 | 25 | import androidx.annotation.LayoutRes 26 | import android.view.LayoutInflater 27 | import android.view.View 28 | import android.view.ViewGroup 29 | 30 | fun ViewGroup.inflate(@LayoutRes layoutRes: Int, attachToRoot: Boolean = false): View = 31 | LayoutInflater.from(context).inflate(layoutRes, this, attachToRoot) 32 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/xml/prefs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 24 | 25 | 26 | 28 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /farebot-transit-easycard/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | Taipei, Taiwan 25 | EasyCard 26 | Older insecure cards only. 27 | Manufacturing Date 28 | Unknown 29 | 30 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/values-ja/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | について 4 | 鍵を追加 5 | 残高 6 | コピー 7 | 削除 8 | すべてエクスポートする 9 | 全般 10 | ヒストリー 11 | インポート 12 | クリップボードからインポート 13 | ファイルからインポート 14 | 15 | このカードを読み取るために、暗号化鍵が必要です。 16 | バックグラウンドで起動 17 | ロックされたカード 18 | NFCは無効です 19 | NFC が利用不可 20 | カードがまだスキャンされていません。 21 | 環境設定 22 | 共有 23 | 有効な %1$s %2$s へ 24 | サブスクリプション 25 | 利用できるカード 26 | 未知のカード 27 | 無線設定 28 | 29 | -------------------------------------------------------------------------------- /farebot-transit-clipper/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | Clipper 25 | Station #0x%s 26 | (Unknown Station) 27 | Zone #%s 28 | (End of line) 29 | 30 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/layout/screen_keys.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 29 | 30 | 34 | 35 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/nfc/UnsupportedTagException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * UnsupportedTagException.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.nfc 24 | 25 | class UnsupportedTagException(private val techList: Array, private val tagId: String) : Exception() { 26 | 27 | override val message: String? 28 | get() { 29 | val techs = techList.map { tech -> tech.replace("android.nfc.tech.", "") }.joinToString { "\n " } 30 | return "Identifier: $tagId\n\nTechnologies:$techs" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /farebot-card/src/main/java/com/codebutler/farebot/card/RawCard.java: -------------------------------------------------------------------------------- 1 | /* 2 | * RawCard.java 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2016 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.card; 24 | 25 | import androidx.annotation.NonNull; 26 | 27 | import com.codebutler.farebot.base.util.ByteArray; 28 | 29 | import java.util.Date; 30 | 31 | public interface RawCard { 32 | 33 | @NonNull 34 | CardType cardType(); 35 | 36 | @NonNull 37 | ByteArray tagId(); 38 | 39 | @NonNull 40 | Date scannedAt(); 41 | 42 | boolean isUnauthorized(); 43 | 44 | @NonNull 45 | T parse(); 46 | } 47 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable/ic_transaction_handheld_32dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/feature/history/HistoryViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * HistoryViewModel.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.feature.history 24 | 25 | import com.codebutler.farebot.card.RawCard 26 | import com.codebutler.farebot.persist.db.model.SavedCard 27 | import com.codebutler.farebot.transit.TransitIdentity 28 | 29 | data class HistoryViewModel( 30 | val savedCard: SavedCard, 31 | val rawCard: RawCard<*>, 32 | val transitIdentity: TransitIdentity? = null, 33 | val parseException: Exception? = null, 34 | var isSelected: Boolean = false 35 | ) 36 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/layout/tab_card_advanced.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 28 | 29 | 33 | 34 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable/ic_history_grey_24dp.xml: -------------------------------------------------------------------------------- 1 | 22 | 23 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /farebot-app-persist/src/main/java/com/codebutler/farebot/persist/CardPersister.java: -------------------------------------------------------------------------------- 1 | /* 2 | * CardPersister.java 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2016 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.persist; 24 | 25 | import androidx.annotation.NonNull; 26 | import androidx.annotation.Nullable; 27 | 28 | import com.codebutler.farebot.persist.db.model.SavedCard; 29 | 30 | import java.util.List; 31 | 32 | public interface CardPersister { 33 | 34 | @NonNull 35 | List getCards(); 36 | 37 | @Nullable 38 | SavedCard getCard(long id); 39 | 40 | long insertCard(@NonNull SavedCard card); 41 | 42 | void deleteCard(@NonNull SavedCard card); 43 | } 44 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/serialize/gson/EpochDateTypeAdapter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * EpochDateTypeAdapter.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.serialize.gson 24 | 25 | import com.google.gson.TypeAdapter 26 | import com.google.gson.stream.JsonReader 27 | import com.google.gson.stream.JsonWriter 28 | import java.util.Date 29 | 30 | class EpochDateTypeAdapter : TypeAdapter() { 31 | 32 | override fun write(out: JsonWriter, value: Date) { 33 | out.value(value.time) 34 | } 35 | 36 | override fun read(`in`: JsonReader): Date { 37 | return Date(`in`.nextLong()) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable/ic_help_outline_grey_24dp.xml: -------------------------------------------------------------------------------- 1 | 22 | 23 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /farebot-card-desfire/src/main/java/com/codebutler/farebot/card/desfire/DesfireRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * DesfireRecord.java 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2011-2012, 2014, 2016 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.card.desfire; 24 | 25 | import androidx.annotation.NonNull; 26 | 27 | import com.codebutler.farebot.base.util.ByteArray; 28 | import com.google.auto.value.AutoValue; 29 | 30 | @AutoValue 31 | public abstract class DesfireRecord { 32 | 33 | @NonNull 34 | static DesfireRecord create(@NonNull byte[] data) { 35 | return new AutoValue_DesfireRecord(ByteArray.create(data)); 36 | } 37 | 38 | @NonNull 39 | public abstract ByteArray getData(); 40 | } 41 | -------------------------------------------------------------------------------- /farebot-card-classic/src/main/java/com/codebutler/farebot/card/classic/UnauthorizedClassicSector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * UnauthorizedClassicSector.java 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2012 Wilbert Duijvenvoorde 8 | * Copyright (C) 2012-2014, 2016 Eric Butler 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see . 22 | */ 23 | 24 | package com.codebutler.farebot.card.classic; 25 | 26 | import androidx.annotation.NonNull; 27 | 28 | import com.google.auto.value.AutoValue; 29 | 30 | @AutoValue 31 | public abstract class UnauthorizedClassicSector implements ClassicSector { 32 | 33 | @NonNull 34 | public static UnauthorizedClassicSector create(int sectorIndex) { 35 | return new AutoValue_UnauthorizedClassicSector(sectorIndex); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/serialize/gson/GsonCardSerializer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * GsonCardSerializer.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.serialize.gson 24 | 25 | import com.codebutler.farebot.card.RawCard 26 | import com.codebutler.farebot.card.serialize.CardSerializer 27 | import com.google.gson.Gson 28 | 29 | class GsonCardSerializer(private val gson: Gson) : CardSerializer { 30 | 31 | override fun serialize(card: RawCard<*>): String { 32 | return gson.toJson(card) 33 | } 34 | 35 | override fun deserialize(json: String): RawCard<*> { 36 | return gson.fromJson(json, RawCard::class.java) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/drawable/ic_lock_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 22 | 23 | 28 | 31 | 32 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 64dp 26 | 4dp 27 | 28 | 8dp 29 | 16dp 30 | 24dp 31 | 32dp 32 | 40dp 33 | 48dp 34 | 72dp 35 | 36 | 16sp 37 | 14sp 38 | 39 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/kotlin/Date.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Date.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.kotlin 24 | 25 | import java.util.Calendar 26 | import java.util.Date 27 | 28 | fun date(year: Int, month: Int, day: Int = 1, hour: Int = 0, minute: Int = 0): Date = 29 | Calendar.getInstance().apply { 30 | set(Calendar.YEAR, year) 31 | set(Calendar.MONTH, month) 32 | set(Calendar.DAY_OF_MONTH, day) 33 | set(Calendar.HOUR_OF_DAY, hour) 34 | set(Calendar.MINUTE, minute) 35 | set(Calendar.SECOND, 0) 36 | set(Calendar.MILLISECOND, 0) 37 | }.time 38 | -------------------------------------------------------------------------------- /farebot-transit-orca/src/main/java/com/codebutler/farebot/transit/orca/OrcaData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * OrcaData.java 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2014-2016 Eric Butler 8 | * Copyright (C) 2015 Sean CyberKitsune McClenaghan 9 | * 10 | * Thanks to: 11 | * Karl Koscher 12 | * 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see . 25 | */ 26 | 27 | package com.codebutler.farebot.transit.orca; 28 | 29 | public final class OrcaData { 30 | 31 | static final int TRANS_TYPE_TAP_IN = 0x03; 32 | static final int TRANS_TYPE_TAP_OUT = 0x07; 33 | static final int TRANS_TYPE_PURSE_USE = 0x0c; 34 | static final int TRANS_TYPE_CANCEL_TRIP = 0x01; 35 | static final int TRANS_TYPE_PASS_USE = 0x60; 36 | 37 | private OrcaData() { } 38 | } 39 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/serialize/gson/CardTypeGsonTypeAdapter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * CardTypeGsonTypeAdapter.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.serialize.gson 24 | 25 | import com.codebutler.farebot.card.CardType 26 | import com.google.gson.TypeAdapter 27 | import com.google.gson.stream.JsonReader 28 | import com.google.gson.stream.JsonWriter 29 | 30 | class CardTypeGsonTypeAdapter : TypeAdapter() { 31 | 32 | override fun write(out: JsonWriter, value: CardType) { 33 | out.value(value.name) 34 | } 35 | 36 | override fun read(`in`: JsonReader): CardType { 37 | return CardType.valueOf(`in`.nextString()) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/serialize/gson/GsonCardKeysSerializer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * GsonCardKeysSerializer.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.serialize.gson 24 | 25 | import com.codebutler.farebot.app.core.serialize.CardKeysSerializer 26 | import com.codebutler.farebot.key.CardKeys 27 | import com.google.gson.Gson 28 | 29 | class GsonCardKeysSerializer(private val gson: Gson) : CardKeysSerializer { 30 | 31 | override fun serialize(cardKeys: CardKeys): String { 32 | return gson.toJson(cardKeys) 33 | } 34 | 35 | override fun deserialize(data: String): CardKeys { 36 | return gson.fromJson(data, CardKeys::class.java) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/sample/SampleTransitFactory.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * SampleTransitFactory.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.sample 24 | 25 | import com.codebutler.farebot.transit.TransitFactory 26 | import com.codebutler.farebot.transit.TransitIdentity 27 | 28 | class SampleTransitFactory : TransitFactory { 29 | 30 | override fun check(card: SampleCard): Boolean = true 31 | 32 | override fun parseIdentity(card: SampleCard): TransitIdentity = 33 | TransitIdentity.create(card.cardType.toString(), card.tagId.hex()) 34 | 35 | override fun parseInfo(card: SampleCard): SampleTransitInfo = SampleTransitInfo() 36 | } 37 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/core/analytics/Analytics.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Analytics.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.core.analytics 24 | 25 | import com.crashlytics.android.answers.Answers 26 | import com.crashlytics.android.answers.CustomEvent 27 | 28 | enum class AnalyticsEventName(val value: String) { 29 | SCAN_CARD("Scan Card"), 30 | SCAN_CARD_ERROR("Scan Card Error"), 31 | VIEW_CARD("View Card"), 32 | VIEW_SCREEN("View Screen"), 33 | VIEW_TRANSIT("View Transit"), 34 | } 35 | 36 | fun logAnalyticsEvent(name: AnalyticsEventName, type: String) { 37 | Answers.getInstance().logCustom(CustomEvent(name.value) 38 | .putCustomAttribute("Type", type)) 39 | } 40 | -------------------------------------------------------------------------------- /farebot-app/src/main/java/com/codebutler/farebot/app/feature/bg/BackgroundTagActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * BackgroundTagActivity.kt 3 | * 4 | * This file is part of FareBot. 5 | * Learn more at: https://codebutler.github.io/farebot/ 6 | * 7 | * Copyright (C) 2017 Eric Butler 8 | * 9 | * This program is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package com.codebutler.farebot.app.feature.bg 24 | 25 | import android.app.Activity 26 | import android.content.Intent 27 | import android.os.Bundle 28 | import com.codebutler.farebot.app.feature.main.MainActivity 29 | 30 | class BackgroundTagActivity : Activity() { 31 | override fun onCreate(savedInstanceState: Bundle?) { 32 | super.onCreate(savedInstanceState) 33 | 34 | startActivity(Intent(this, MainActivity::class.java).apply { 35 | action = intent.action 36 | putExtras(intent.extras) 37 | }) 38 | 39 | finish() 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/layout/screen_help.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 28 | 36 | 37 | -------------------------------------------------------------------------------- /farebot-app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 36 | 37 |