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.stub;
25 |
26 | import android.content.res.Resources;
27 | import androidx.annotation.NonNull;
28 |
29 | import com.google.auto.value.AutoValue;
30 |
31 | /**
32 | * Stub implementation for Adelaide Metrocard (AU).
33 | *
34 | * https://github.com/micolous/metrodroid/wiki/Metrocard-%28Adelaide%29
35 | */
36 | @AutoValue
37 | public abstract class AdelaideMetrocardStubTransitInfo extends StubTransitInfo {
38 |
39 | @NonNull
40 | @Override
41 | public String getCardName(@NonNull Resources resources) {
42 | return "Metrocard (Adelaide)";
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/farebot-transit-stub/src/main/java/com/codebutler/farebot/transit/stub/AtHopStubTransitInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * AtHopStubTransitInfo.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.stub;
25 |
26 | import android.content.res.Resources;
27 | import androidx.annotation.NonNull;
28 |
29 | import com.google.auto.value.AutoValue;
30 |
31 | /**
32 | * Stub implementation for AT HOP (Auckland, NZ).
33 | *
34 | * https://github.com/micolous/metrodroid/wiki/AT-HOP
35 | */
36 | @AutoValue
37 | public abstract class AtHopStubTransitInfo extends StubTransitInfo {
38 |
39 | @NonNull
40 | public static AtHopStubTransitInfo create() {
41 | return new AutoValue_AtHopStubTransitInfo();
42 | }
43 |
44 | @NonNull
45 | @Override
46 | public String getCardName(@NonNull Resources resources) {
47 | return "AT HOP";
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/farebot-transit-stub/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/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-transit-suica/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/farebot-transit-suica/src/main/assets/felica_stations.db3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codebutler/farebot/fbfd9e2504738e33888959c147c49fecde088fe5/farebot-transit-suica/src/main/assets/felica_stations.db3
--------------------------------------------------------------------------------
/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/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/farebot-transit/src/main/java/com/codebutler/farebot/transit/TransitIdentity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * TransitIdentity.java
3 | *
4 | * This file is part of FareBot.
5 | * Learn more at: https://codebutler.github.io/farebot/
6 | *
7 | * Copyright (C) 2011, 2015 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.transit;
24 |
25 | import androidx.annotation.NonNull;
26 | import androidx.annotation.Nullable;
27 |
28 | import com.google.auto.value.AutoValue;
29 |
30 | @AutoValue
31 | public abstract class TransitIdentity {
32 |
33 | @NonNull
34 | public static TransitIdentity create(@NonNull String name, @Nullable String serialNumber) {
35 | return new AutoValue_TransitIdentity(name, serialNumber);
36 | }
37 |
38 | @NonNull
39 | public abstract String getName();
40 |
41 | @Nullable
42 | public abstract String getSerialNumber();
43 | }
44 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codebutler/farebot/fbfd9e2504738e33888959c147c49fecde088fe5/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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'
--------------------------------------------------------------------------------