Compare commits

...

178 Commits

Author SHA1 Message Date
Jannik 28520bee74
changelog: minor text fixes 2 years ago
Jannik 0c6a486dd9 Merge pull request 'version 0.6.0' (#46) from develop into master 2 years ago
Jannik ec15c79b63
update fastlane screenshot 2 years ago
Jannik 4592d1984f
release version 0.6.0 2 years ago
Jannik aae74cf9db „README.md“ ändern 2 years ago
Jannik e19b0db39d
add missing licenses to license dialog 2 years ago
Jannik 23fd52b0c5
fab: use plus as icon 2 years ago
Jannik 62a62049c3
code clean up 2 years ago
Jannik 849698779b
add icon as svg 2 years ago
Jannik a42a92a3c5
update constraintlayout 2 years ago
Jannik be30e2f968
enable optimisations and minifying for release builds 2 years ago
Jannik c629b2aec2
fix login button 2 years ago
Jannik 99ba87c3f6
init fragment in onViewCreated() 2 years ago
Jannik 953b4825a9
check qispos status and show message if unavailable 2 years ago
Jannik 2807843d25
fix grades divider shown when sub-subject was added 2 years ago
Jannik 638c321798
grades ui polishing & sorting fix 2 years ago
Jannik 42d938b0bc
fix background in fragment_grades 2 years ago
Jannik 9d7504bbaf
add grades ui 2 years ago
Jannik 8ecfe8f120
QISPOSParser [Part 2] 2 years ago
Jannik ff0c4ad1a7
QISPOSParser [Part 1] 2 years ago
Jannik ea0caea91e
save email and password to encrypted preference 2 years ago
Jannik 1f660bdd37
add login dialog 2 years ago
Jannik be43d87b1a
fix more lint warnings 2 years ago
Jannik dd5c7b3fb8
fix some lint warnings 2 years ago
Jannik fb3dab6dc3
save additional subjects and load them on start 2 years ago
Jannik bcfdb83d14
rework CacheController and TCoRAPIController 2 years ago
Jannik 8c55366ec0
update libs 2 years ago
Jannik 6f68fbb73c „README.md“ ändern 2 years ago
Jannik 297dd77e79
use gradle wrapper for drone 2 years ago
Jannik 6a70f26807
update .drone.yml 2 years ago
Jannik f6b00a8d81
additional Subject are now added to the timetable 2 years ago
Jannik 69ce9fef5a
code clean up 2 years ago
Jannik 2d753851c0
more "Additional Lessons" work 2 years ago
Jannik 6c0624c793
make the app more tolerant about wrong API Data 2 years ago
Jannik 7779296345
change default accent color, code clean up 2 years ago
Jannik 3e2ef0521e
change primary color to reflect mosad.xyz design guidelines 2 years ago
Jannik bdfeb46faf
add "Manage Lessons" Dialog to Settings, minor style fixes 2 years ago
Jannik 18ca435764
update TCoRAPIController to API version 1.2.0 2 years ago
Jannik 948f330ebe
TimeTableFragment clean up 2 years ago
Jannik 72e9efb9e7
fix warings in TCoRAPIController 2 years ago
Jannik bea1b47396
complete & move AddLessonDialog to separate class 2 years ago
Jannik 34a68ff75d
add courses to addLesson Dialog, read lessonSubjects from tcor 2 years ago
Jannik 1ba3f1fa87
update gradle tool to 4.0.0 2 years ago
Jannik 48544aef2f
add a complete version of the addLesson Dialog 2 years ago
Jannik bc09e33147
update gradle, constraintlayout & coroutines 2 years ago
Jannik 6ec9b9f5e2
update commons-lang and coroutines 2 years ago
Jannik a19173b499
update kotlin 2 years ago
Jannik 85dc3181fd
fix compatibility with tcor version 1.2.2 and higher 2 years ago
Jannik e46c234b6c
fix OnboardingActivity is not closed on start of MainActivity 2 years ago
Jannik faa07966da
fix crash on first start, if tcor is not reachable 2 years ago
Jannik ccc0f0f2bc
Onboarding [Part 2] 2 years ago
Jannik e15bf95b85
update to gradle 6.2.1 and gradle android plugin 3.6.0 2 years ago
Jannik 01677c04ef
Onboarding [Part 1] 2 years ago
Jannik 6e9c63d3d4 Merge branch 'develop' of Seil0/ProjectLaogai into master [Hotfix] 2 years ago
Jannik c343735b57
fix crash on first startup 2 years ago
Jannik 9c5274dc06 Merge branch 'develop' of Seil0/ProjectLaogai into master 2 years ago
Jannik b186a2e96e
release version 0.5.1 2 years ago
Jannik 2cb4b72369
anko code removed, coroutines are now used for asynchronous functions 2 years ago
Jannik 2d497d1a96
update gradle wrapper to version 6.0.1 2 years ago
Jannik 9d2de3fcb3
don't use deprecated Gson methods 2 years ago
Jannik bed3f5d978
added Timetable and Moodle shortcut, cleaned up activity init 2 years ago
Jannik 8f5a4dd1b3
reworked preference saving 2 years ago
Jannik 9907d083e9
added a Mensa shortcut 3 years ago
Jannik d4860b2a32
updated some libs 3 years ago
Jannik 5ec2b53bce
added "Get it on Google Play" badge 3 years ago
Jannik 701a351e6e
update .drone.yml 3 years ago
Jannik 5cad924b26
removed anko dependency from PreferenceController 3 years ago
Jannik 605bf6248d release 0.5.0 3 years ago
Jannik d5adc4df51
release 0.5.0 3 years ago
Jannik c23454f081
removed versionNameSuffix, f-droid does not like that 3 years ago
Jannik b240beacc9
turns out there is a current week too 3 years ago
Jannik aa69d2242f
fixed course name not being updated on change 3 years ago
Jannik 6e6c9f71a0
reworked the way the timetable date is calculated 3 years ago
Jannik 889c673c5d Update 'README.md' 3 years ago
Jannik 522f31e077
added new screenshots 3 years ago
Jannik b9ca18044c
drone use gradle test instead of assembleRelease 3 years ago
Jannik bd49e482e2
updated some libs 3 years ago
Jannik 2f5b2a6579
added drone ci 3 years ago
Jannik 4ce37b3dcf
updated desfire legal notes 3 years ago
Jannik 7550fcfd22 Update 'README.md' 3 years ago
Jannik a23f7c9212
update to release 0.5.0 3 years ago
Jannik 75168c6688
some more logging and version 0.4.99 (RC1) 3 years ago
Jannik be916a74ab
the license dialog will now follow the theme too 3 years ago
Jannik 3e909ab68f
color the selected element in the NavigationView too 3 years ago
Jannik 5f2b3aa496
clean up the layout & polished Mensa credit dialog 3 years ago
Jannik 6cc1671a52
don't crash on devices without nfc 3 years ago
Jannik b4ed1ca927
migrated all farebot code to kotlin 3 years ago
Jannik e74c307566
cleand up the nfc part, added foreground-dispatch 3 years ago
Jannik 733b675ffa
first working implementation of the mensa card reader 3 years ago
Jannik 3a0a31f781
first bits of the nfc reader 3 years ago
Jannik f52151fbf1
the no lesson card now has the correct text color 3 years ago
Jannik e8cae7e807
update to gradle 5.5.1, update gradle plugin to 3.4.2 3 years ago
Jannik c6ac19bfae
fixed the Sunday-fix 3 years ago
Jannik a7abd48726
moved all cache checking code tho the CacheController 3 years ago
Jannik 9a22d9b737
use a ScrollView for the settings fragment 3 years ago
Jannik 2cc2ecf952
theme the dialogs and navView too, added a License dialog 3 years ago
Jannik ea70aedbd0
added the fastlane changelog for version 14 3 years ago
Jannik 98b3adbf3b
update to kotlin 1.3.40, added theme choose option 3 years ago
Jannik a055f59cc8
added a dark theme, see #15 3 years ago
Jannik 01db6bb451
don't use the faBtn in MensaFragment, use it in TimetableFragment 3 years ago
Jannik 4838c9406c
fastlane description spelling fixes 3 years ago
Jannik 23195f94e0
don't us deprecated tcor api requests 3 years ago
Jannik 5e766ec126
hide the mensa card value button 3 years ago
Jannik 9c1f95ca25
some lib updates & new sunday-bug fix 3 years ago
Jannik e99127a63a Update 'README.md' 3 years ago
Jannik f7fa96b1ae
use gradle 5.4.1 3 years ago
Jannik ac37bce145 Merge branch 'develop' of Seil0/ProjectLaogai into master 3 years ago
Jannik 6fd82254e0
updated description for f-droid 3 years ago
Jannik 0dd8ba9475
release 0.4.1 3 years ago
Jannik 770e9a255d Update 'README.md' 3 years ago
Jannik 4589badbfc
updated versionName to 0.4.1 3 years ago
Jannik 74f75bfbde update to kotlin 1.3.31, gradle 5.1.1 & gradle plugin 3.4.0 3 years ago
Jannik a00c651bfd disable layout change animation 3 years ago
Jannik 77757ad9ca fixed mensa screen crash if day has no meals 3 years ago
Jannik fe111ac56b added refresh to timetable screen 3 years ago
Jannik 4971d0b1b8 added fastlane metadata 3 years ago
Jannik 2bd86ff6bb added fastlane metadata 3 years ago
Jannik dbaf496a79 minor clean up and refactoring 3 years ago
Jannik 77326a8ed6 added ability to refresh the mensa menus 3 years ago
Jannik 9fc897e194 fixed initial accent color 3 years ago
Jannik f9ac219ec6 Merge remote-tracking branch 'origin/master' into develop 3 years ago
Jannik a87e57c80e removed versionNameSuffix 3 years ago
Jannik ff1d353cae removed versionNameSuffix 3 years ago
Jannik 6e5cf29eaa removed maven repo 3 years ago
Jannik ee388bf5a5 removed maven repo 3 years ago
Jannik 8aaf8e3647 release 0.4.0 3 years ago
Jannik d645d75bbf fixed showing wrong meal of tomorrow on Wednesday 3 years ago
Jannik f97491addd added mensa sunday workaround 3 years ago
Jannik e08790aaa4 show the next day with a lecture on Sundays too 3 years ago
Jannik 750a808fbe the homescreen now shows the next day with a lecture 3 years ago
Jannik e51a80b78d home screen redesign 3 years ago
Jannik a4eaea2918 timetable and mensa gui redesign 3 years ago
Jannik cd3136715f spelling 3 years ago
Jannik 15f1386b6e some minor gui fixes 3 years ago
Jannik 3bace6c155 Update 'README.md' 3 years ago
Jannik 61716f8eb4 Update 'README.md' 3 years ago
Jannik a1410f7b80 sort of worked around the Sunday problem 3 years ago
Jannik 953185425b fixed menu formatting 3 years ago
Jannik a6d14044c2 added initial course selection 3 years ago
Jannik f3b7ff066d added the tcor api 3 years ago
Jannik 040eb26dcf update app version to 0.3.90 3 years ago
Jannik 1a5d2b6561 fix homescreen 3 years ago
Jannik 92b60d660c updated gradle build tool to 3.3.2 3 years ago
Jannik a4eceeddc9 added 2nd week menus & option to disable buffet in the mensa tab 3 years ago
Jannik 3e3a80442e next weeks menu & accent color 3 years ago
Jannik 5a1a07cd42 minor gui updates 3 years ago
Jannik dbfdaffe99 the app can now display multiple lessons per time slot 3 years ago
Jannik 58eb217ab7 added a new timetable parser implementation 3 years ago
Jannik 24f920c05f Added PreferenceController 3 years ago
Jannik 6301308d76 Update 'README.md' 3 years ago
Jannik 8e205fa889 updated the gradle plugin to 3.3.1 3 years ago
Jannik e9bdcee443 some clean up 3 years ago
Jannik b214cfccb2 „README.md“ ändern 3 years ago
Jannik 404ddd58b8 „README.md“ ändern 3 years ago
Jannik 137ff7df0c „README.md“ ändern 3 years ago
Jannik b4071d7456 updated some libs 3 years ago
Jannik 5e6e6cfde6 updated gradle plugin to 3.3.0 3 years ago
Jannik ffeb09a37f fixed a possible issue with the mensa parser 3 years ago
Jannik 75a457312d major bug fixes & version 0.3.2 3 years ago
Jannik 87bf614d28 added color saving 3 years ago
Jannik e69354af96 clean up 3 years ago
Jannik ec74a8e4f8 basic color selection 3 years ago
Jannik b49d16b1a1 updated some libs, meal tomorrow shows correct string if there's no meal 4 years ago
Jannik 70059b4b0c added moodle webview 4 years ago
Jannik 3d7f6f961a the menus text is now selectable 4 years ago
Jannik f97e8b2b14 fixed text overlapping and some crashes 4 years ago
Jannik deaf139b70 updated some libraries 4 years ago
Jannik bf48bec16b minor fixes 4 years ago
Jannik e6c4096787 minor gui fixes, clean up 4 years ago
Jannik b083e44711 added a new icon, gui cleanup 4 years ago
Jannik 2df58311cb updated version number 4 years ago
Jannik f6f652ffb6 the home screen will now always show the first 2 meals 4 years ago
Jannik 8fa0d496c6 updated some libraries 4 years ago
Jannik 0607d58760 show tomorrows meal if iths latr than 1500 4 years ago
Jannik 3cd831e72c timetable week view shows the current + the following 5 days, bugfixes 4 years ago
Jannik e8aa09b902 Merge remote-tracking branch 'origin/master' 4 years ago
Jannik 03fa1eca84 fixed crash on days between saturday and monday, verion 0.2.1 4 years ago
Jannik 72bdbf698c „README.md“ ändern 4 years ago
  1. 9
      .drone.yml
  2. 28
      README.md
  3. 71
      app/build.gradle
  4. 9
      app/proguard-rules.pro
  5. 6
      app/src/androidTest/java/org/mosad/seil0/projectlaogai/ExampleInstrumentedTest.kt
  6. 40
      app/src/main/AndroidManifest.xml
  7. BIN
      app/src/main/ic_laogai_icon-playstore.png
  8. 227
      app/src/main/java/com/codebutler/farebot/Utils.kt
  9. 9
      app/src/main/java/com/codebutler/farebot/card/desfire/DesfireException.kt
  10. 104
      app/src/main/java/com/codebutler/farebot/card/desfire/DesfireFile.kt
  11. 248
      app/src/main/java/com/codebutler/farebot/card/desfire/DesfireFileSettings.kt
  12. 181
      app/src/main/java/com/codebutler/farebot/card/desfire/DesfireManufacturingData.kt
  13. 214
      app/src/main/java/com/codebutler/farebot/card/desfire/DesfireProtocol.kt
  14. 26
      app/src/main/java/com/codebutler/farebot/card/desfire/DesfireRecord.kt
  15. 254
      app/src/main/java/org/mosad/seil0/projectlaogai/MainActivity.kt
  16. 145
      app/src/main/java/org/mosad/seil0/projectlaogai/OnboardingActivity.kt
  17. 106
      app/src/main/java/org/mosad/seil0/projectlaogai/controller/NFCMensaCard.kt
  18. 236
      app/src/main/java/org/mosad/seil0/projectlaogai/controller/QISPOSParser.kt
  19. 116
      app/src/main/java/org/mosad/seil0/projectlaogai/controller/TCoRAPIController.kt
  20. 375
      app/src/main/java/org/mosad/seil0/projectlaogai/controller/cache/CacheController.kt
  21. 131
      app/src/main/java/org/mosad/seil0/projectlaogai/controller/cache/TimetableController.kt
  22. 110
      app/src/main/java/org/mosad/seil0/projectlaogai/controller/preferences/EncryptedPreferences.kt
  23. 192
      app/src/main/java/org/mosad/seil0/projectlaogai/controller/preferences/Preferences.kt
  24. 200
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/GradesFragment.kt
  25. 175
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/HomeFragment.kt
  26. 176
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/MensaFragment.kt
  27. 59
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/MoodleFragment.kt
  28. 288
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/SettingsFragment.kt
  29. 136
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/TimeTableFragment.kt
  30. 42
      app/src/main/java/org/mosad/seil0/projectlaogai/hsoparser/DataTypes.kt
  31. 79
      app/src/main/java/org/mosad/seil0/projectlaogai/hsoparser/MensaParser.kt
  32. 94
      app/src/main/java/org/mosad/seil0/projectlaogai/hsoparser/TimeTableParser.kt
  33. 59
      app/src/main/java/org/mosad/seil0/projectlaogai/onboarding/ViewPagerAdapter.kt
  34. 89
      app/src/main/java/org/mosad/seil0/projectlaogai/uicomponents/DayCardView.kt
  35. 36
      app/src/main/java/org/mosad/seil0/projectlaogai/uicomponents/GradeLinearLayout.kt
  36. 34
      app/src/main/java/org/mosad/seil0/projectlaogai/uicomponents/LessonLinearLayout.kt
  37. 52
      app/src/main/java/org/mosad/seil0/projectlaogai/uicomponents/MealLinearLayout.kt
  38. 31
      app/src/main/java/org/mosad/seil0/projectlaogai/uicomponents/MenuCardView.kt
  39. 63
      app/src/main/java/org/mosad/seil0/projectlaogai/uicomponents/TextViewInfo.kt
  40. 164
      app/src/main/java/org/mosad/seil0/projectlaogai/uicomponents/dialogs/AddSubjectDialog.kt
  41. 87
      app/src/main/java/org/mosad/seil0/projectlaogai/uicomponents/dialogs/LoginDialog.kt
  42. 119
      app/src/main/java/org/mosad/seil0/projectlaogai/util/DataTypes.kt
  43. 64
      app/src/main/java/org/mosad/seil0/projectlaogai/util/NotRetardedCalendar.kt
  44. BIN
      app/src/main/res/drawable-v24/ic_launcher.png
  45. 34
      app/src/main/res/drawable-v24/ic_launcher_foreground.xml
  46. 9
      app/src/main/res/drawable/background_splash.xml
  47. 9
      app/src/main/res/drawable/ic_add_black_24dp.xml
  48. 9
      app/src/main/res/drawable/ic_error_outline_black_24dp.xml
  49. 9
      app/src/main/res/drawable/ic_grading_black_24dp.xml
  50. 74
      app/src/main/res/drawable/ic_launcher_background.xml
  51. 9
      app/src/main/res/drawable/ic_local_dining_black_24dp.xml
  52. 9
      app/src/main/res/drawable/ic_menu_send.xml
  53. 9
      app/src/main/res/drawable/ic_menu_share.xml
  54. 9
      app/src/main/res/drawable/ic_menu_slideshow.xml
  55. 2
      app/src/main/res/drawable/ic_school_black_24dp.xml
  56. 5
      app/src/main/res/drawable/ic_settings_black_24dp.xml
  57. BIN
      app/src/main/res/drawable/ic_splash_logo.png
  58. 9
      app/src/main/res/drawable/side_nav_bar.xml
  59. 108
      app/src/main/res/layout/fragment_home.xml
  60. 26
      app/src/main/res/layout/fragment_mensa.xml
  61. 147
      app/src/main/res/layout/fragment_settings.xml
  62. 34
      app/src/main/res/layout/lesson_cardview.xml
  63. 22
      app/src/main/res/layout/mensaday_cardview.xml
  64. 42
      app/src/main/res/layout/menu_cardview.xml
  65. 4
      app/src/main/res/layouts/activities/layout/activity_main.xml
  66. 53
      app/src/main/res/layouts/activities/layout/activity_onboarding.xml
  67. 2
      app/src/main/res/layouts/activities/layout/app_bar_main.xml
  68. 21
      app/src/main/res/layouts/activities/layout/cardview_day.xml
  69. 30
      app/src/main/res/layouts/activities/layout/dialog_login.xml
  70. 70
      app/src/main/res/layouts/activities/layout/linearlayout_grade.xml
  71. 52
      app/src/main/res/layouts/activities/layout/linearlayout_lesson.xml
  72. 35
      app/src/main/res/layouts/activities/layout/linearlayout_meal.xml
  73. 29
      app/src/main/res/layouts/activities/layout/nav_header_main.xml
  74. 33
      app/src/main/res/layouts/activities/values/css_styles.xml
  75. 43
      app/src/main/res/layouts/activities/xml/shortcuts.xml
  76. 42
      app/src/main/res/layouts/dialogs/layout/dialog_add_lesson.xml
  77. 0
      app/src/main/res/layouts/dialogs/layout/dialog_loading.xml
  78. 34
      app/src/main/res/layouts/dialogs/layout/dialog_mensa_credit.xml
  79. 38
      app/src/main/res/layouts/fragments/layout/fragment_grades.xml
  80. 7
      app/src/main/res/layouts/fragments/layout/fragment_home.xml
  81. 29
      app/src/main/res/layouts/fragments/layout/fragment_mensa.xml
  82. 14
      app/src/main/res/layouts/fragments/layout/fragment_moodle.xml
  83. 72
      app/src/main/res/layouts/fragments/layout/fragment_on_course.xml
  84. 93
      app/src/main/res/layouts/fragments/layout/fragment_on_login.xml
  85. 70
      app/src/main/res/layouts/fragments/layout/fragment_on_welcome.xml
  86. 348
      app/src/main/res/layouts/fragments/layout/fragment_settings.xml
  87. 41
      app/src/main/res/layouts/fragments/layout/fragment_timetable.xml
  88. 15
      app/src/main/res/menu/activity_main_drawer.xml
  89. 2
      app/src/main/res/menu/main.xml
  90. 5
      app/src/main/res/mipmap-anydpi-v26/ic_laogai_icon.xml
  91. 5
      app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  92. 5
      app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  93. BIN
      app/src/main/res/mipmap-hdpi/ic_laogai_icon.png
  94. BIN
      app/src/main/res/mipmap-hdpi/ic_laogai_icon_foreground.png
  95. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher.png
  96. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  97. BIN
      app/src/main/res/mipmap-mdpi/ic_laogai_icon.png
  98. BIN
      app/src/main/res/mipmap-mdpi/ic_laogai_icon_foreground.png
  99. BIN
      app/src/main/res/mipmap-mdpi/ic_launcher.png
  100. BIN
      app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  101. Some files were not shown because too many files have changed in this diff Show More

9
.drone.yml

@ -0,0 +1,9 @@
kind: pipeline
name: default
steps:
- name: assembleRelease
image: nextcloudci/android10:android-56
commands:
- ./gradlew assembleRelease

28
README.md

@ -1 +1,27 @@
projectlaogai
[![Build Status](https://drone.mosad.xyz/api/badges/Seil0/ProjectLaogai/status.svg)](https://drone.mosad.xyz/Seil0/ProjectLaogai)
![fdroid version](https://img.shields.io/f-droid/v/org.mosad.seil0.projectlaogai.svg?style=flat-square)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg?style=flat-square)](https://www.gnu.org/licenses/gpl-3.0)
# Project Laogai
Project Laogai is an app to access the timetable, grades (qispos) and the canteen menu of Hochschule Offenburg. Laogai uses the TCoR-API fot timetables and the canteen menu, wich makes acessing them super fast. To get the grades from Qispos, Laogai will ask for your login data, wich are stored encrypted on your device.
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" height="75">](https://f-droid.org/packages/org.mosad.seil0.projectlaogai/)
[<img src="https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png" height="75">](https://play.google.com/store/apps/details?id=org.mosad.seil0.projectlaogai)
## Features
* have your grades displayed directly in the app
* show the timetable of your course
* take a look at the canteen menu for the current and next week
* check the current balance of your mensa card
* open moodle directly in the app
Please report bugs and issues to support@mosad.xyz
## Screenshots
[<img src="https://www.mosad.xyz/images/Project_Laogai/ProjectLaogai_HomeScreen.png" width=180>](https://www.mosad.xyz/images/Project_Laogai/ProjectLaogai_HomeScreen.png)
[<img src="https://www.mosad.xyz/images/Project_Laogai/ProjectLaogai_Mensa.png" width=180>](https://www.mosad.xyz/images/Project_Laogai/ProjectLaogai_Mensa.png)
[<img src="https://www.mosad.xyz/images/Project_Laogai/ProjectLaogai_Timetable.png" width=180>](https://www.mosad.xyz/images/Project_Laogai/ProjectLaogai_Timetable.png)
[<img src="https://www.mosad.xyz/images/Project_Laogai/ProjectLaogai_Settings.png" width=180>](https://www.mosad.xyz/images/Project_Laogai/ProjectLaogai_Settings.png)
[<img src="https://www.mosad.xyz/images/Project_Laogai/ProjectLaogai_Mensa_dark.png" width=180>](https://www.mosad.xyz/images/Project_Laogai/ProjectLaogai_Mensa_dark.png)
ProjectLaogai © 2019-2020 [@Seil0](https://git.mosad.xyz/Seil0), a [mosad.xyz](http://www.mosad.xyz) Project

71
app/build.gradle

@ -1,42 +1,75 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
signingConfigs {
}
compileSdkVersion 29
defaultConfig {
applicationId "org.mosad.seil0.projectlaogai"
minSdkVersion 21
targetSdkVersion 28
versionCode 5
versionName "0.2.0"
minSdkVersion 23
targetSdkVersion 29
versionCode 6000 // 0006000
versionName "0.6.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resValue "string", "build_time", buildTime()
setProperty("archivesBaseName", "projectlaogai-$versionName")
}
buildTypes {
release {
minifyEnabled false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets {
main {
res.srcDirs =
[
'src/main/res/layouts/activities',
'src/main/res/layouts/dialogs',
'src/main/res/layouts/fragments',
'src/main/res/layouts',
'src/main/res'
]
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8'
implementation 'androidx.core:core:1.3.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
implementation 'org.jsoup:jsoup:1.11.3'
implementation 'org.jetbrains.anko:anko-commons:0.10.7'
implementation 'com.afollestad.material-dialogs:core:2.0.0-beta4'
implementation 'com.afollestad.material-dialogs:color:2.0.0-beta4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.security:security-crypto:1.1.0-alpha02'
implementation 'com.google.android.material:material:1.2.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.afollestad:aesthetic:1.0.0-beta05'
implementation 'com.afollestad.material-dialogs:core:3.3.0'
implementation 'com.afollestad.material-dialogs:color:3.3.0'
implementation 'com.afollestad.material-dialogs:bottomsheets:3.3.0'
implementation 'de.psdev.licensesdialog:licensesdialog:2.1.0'
implementation 'org.apache.commons:commons-lang3:3.11'
implementation 'org.jsoup:jsoup:1.13.1'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test:core:1.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
}
static def buildTime() {
return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC"))
}

9
app/proguard-rules.pro vendored

@ -15,7 +15,16 @@
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
-dontobfuscate
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-keep class org.mosad.seil0.projectlaogai.util.** { <fields>; }
#Gson
-keepattributes Signature
-dontwarn sun.misc.**
#misc
-dontwarn java.lang.instrument.ClassFileTransformer

6
app/src/androidTest/java/org/mosad/seil0/projectlaogai/ExampleInstrumentedTest.kt

@ -1,7 +1,7 @@
package org.mosad.seil0.projectlaogai
import androidx.test.InstrumentationRegistry
import androidx.test.runner.AndroidJUnit4
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Test
import org.junit.runner.RunWith
@ -18,7 +18,7 @@ class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getTargetContext()
val appContext = InstrumentationRegistry.getInstrumentation().context
assertEquals("org.mosad.seil0.projectlaogai", appContext.packageName)
}
}

40
app/src/main/AndroidManifest.xml

@ -2,31 +2,55 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.mosad.seil0.projectlaogai">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.NFC" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:fullBackupContent="@xml/backup_descriptor"
android:icon="@mipmap/ic_laogai_icon"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@mipmap/ic_laogai_icon"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme.Light">
<activity
android:name=".SplashActivity"
android:label="@string/app_name"
android:theme="@style/SplashTheme"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>
<activity
android:name=".OnboardingActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.Light"
android:screenOrientation="portrait"
android:launchMode="singleTop">
</activity>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait">
android:theme="@style/AppTheme.Light"
android:screenOrientation="portrait"
android:launchMode="singleTop">
<!-- nfc stuff -->
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED"/>
</intent-filter>
<meta-data android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfc_tech_filter" />
</activity>
</application>

BIN
app/src/main/ic_laogai_icon-playstore.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

227
app/src/main/java/com/codebutler/farebot/Utils.kt

@ -0,0 +1,227 @@
/**
* Utils.kt
*
* Copyright (C) 2011 Eric Butler
* Copyright (C) 2019 <seil0@mosad.xyz>
*
* Authors:
* Eric Butler <eric@codebutler.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.codebutler.farebot
import android.app.Activity
import android.app.AlertDialog
import android.util.Log
import android.view.WindowManager
import com.codebutler.farebot.card.desfire.DesfireException
import com.codebutler.farebot.card.desfire.DesfireFileSettings
import com.codebutler.farebot.card.desfire.DesfireProtocol
import org.w3c.dom.Node
import java.io.StringWriter
import javax.xml.transform.OutputKeys
import javax.xml.transform.TransformerFactory
import javax.xml.transform.dom.DOMSource
import javax.xml.transform.stream.StreamResult
import kotlin.experimental.and
class Utils {
companion object {
private val TAG = Utils::class.java.name
@Suppress("unused")
fun showError(activity: Activity, ex: Exception) {
Log.e(activity.javaClass.name, ex.message, ex)
AlertDialog.Builder(activity)
.setMessage(getErrorMessage(ex))
.show()
}
@Suppress("unused")
fun showErrorAndFinish(activity: Activity, ex: Exception) {
try {
Log.e(activity.javaClass.name, getErrorMessage(ex))
ex.printStackTrace()
AlertDialog.Builder(activity)
.setMessage(getErrorMessage(ex))
.setCancelable(false)
.setPositiveButton(android.R.string.ok) { _, _ -> activity.finish() }
.show()
} catch (unused: WindowManager.BadTokenException) {
/* Ignore... happens if the activity was destroyed */
}
}
@Throws(Exception::class)
fun getHexString(b: ByteArray): String {
var result = ""
for (i in b.indices) {
result += ((b[i] and 0xff.toByte()) + 0x100).toString(16).substring(1)
}
return result
}
@Suppress("unused")
fun getHexString(b: ByteArray, defaultResult: String): String {
return try {
getHexString(b)
} catch (ex: Exception) {
defaultResult
}
}
@Suppress("unused")
fun hexStringToByteArray(s: String): ByteArray {
if (s.length % 2 != 0) {
throw IllegalArgumentException("Bad input string: $s")
}
val len = s.length
val data = ByteArray(len / 2)
var i = 0
while (i < len) {
data[i / 2] = ((Character.digit(s[i], 16) shl 4) + Character.digit(s[i + 1], 16)).toByte()
i += 2
}
return data
}
@JvmOverloads
fun byteArrayToInt(b: ByteArray, offset: Int = 0, length: Int = b.size): Int {
return byteArrayToLong(b, offset, length).toInt()
}
fun byteArrayToLong(b: ByteArray, offset: Int, length: Int): Long {
if (b.size < length)
throw IllegalArgumentException("length must be less than or equal to b.length")
var value: Long = 0
for (i in 0 until length) {
val shift = (length - 1 - i) * 8
value += ((b[i + offset].toInt() and 0x000000FF).toLong() shl shift)
}
return value
}
@Suppress("unused")
fun byteArraySlice(b: ByteArray, offset: Int, length: Int): ByteArray {
val ret = ByteArray(length)
for (i in 0 until length)
ret[i] = b[offset + i]
return ret
}
@Suppress("unused")
@Throws(Exception::class)
fun xmlNodeToString(node: Node): String {
// The amount of code required to do simple things in Java is incredible.
val source = DOMSource(node)
val stringWriter = StringWriter()
val result = StreamResult(stringWriter)
val factory = TransformerFactory.newInstance()
val transformer = factory.newTransformer()
transformer.setOutputProperty(OutputKeys.INDENT, "yes")
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2")
transformer.uriResolver = null
transformer.transform(source, result)
return stringWriter.buffer.toString()
}
fun getErrorMessage(ex: Throwable): String {
var errorMessage: String? = ex.localizedMessage
if (errorMessage == null)
errorMessage = ex.message
if (errorMessage == null)
errorMessage = ex.toString()
if (ex.cause != null) {
var causeMessage: String? = ex.cause!!.localizedMessage
if (causeMessage == null)
causeMessage = ex.cause!!.message
if (causeMessage == null)
causeMessage = ex.cause.toString()
errorMessage += ": $causeMessage"
}
return errorMessage
}
@Suppress("unused")
fun <T> findInList(list: List<T>, matcher: Matcher<T>): T? {
for (item in list) {
if (matcher.matches(item)) {
return item
}
}
return null
}
interface Matcher<T> {
fun matches(t: T): Boolean
}
fun selectAppFile(tag: DesfireProtocol, appID: Int, fileID: Int): DesfireFileSettings? {
try {
tag.selectApp(appID)
} catch (e: DesfireException) {
Log.w(TAG, "App not found")
return null
}
return try {
tag.getFileSettings(fileID)
} catch (e: DesfireException) {
Log.w(TAG, "File not found")
null
}
}
fun arrayContains(arr: IntArray, item: Int): Boolean {
for (i in arr)
if (i == item)
return true
return false
}
@Suppress("unused")
fun containsAppFile(tag: DesfireProtocol, appID: Int, fileID: Int): Boolean {
try {
tag.selectApp(appID)
} catch (e: DesfireException) {
Log.w(TAG, "App not found")
Log.w(TAG, e)
return false
}
return try {
arrayContains(tag.fileList, fileID)
} catch (e: DesfireException) {
Log.w(TAG, "File not found")
Log.w(TAG, e)
false
}
}
}
}

9
app/src/main/java/com/codebutler/farebot/card/desfire/DesfireException.kt

@ -0,0 +1,9 @@
package com.codebutler.farebot.card.desfire
/**
* Created by Jakob Wenzel on 16.11.13.
*/
class DesfireException : Exception {
constructor(message: String) : super(message)
constructor(cause: Throwable) : super(cause)
}

104
app/src/main/java/com/codebutler/farebot/card/desfire/DesfireFile.kt

@ -0,0 +1,104 @@
/**
* DesfireFile.kt
*
* Copyright (C) 2011 Eric Butler
* Copyright (C) 2019 <seil0@mosad.xyz>
*
* Authors:
* Eric Butler <eric@codebutler.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.codebutler.farebot.card.desfire
import android.os.Parcel
import android.os.Parcelable
import com.codebutler.farebot.card.desfire.DesfireFileSettings.RecordDesfireFileSettings
import org.apache.commons.lang3.ArrayUtils
open class DesfireFile private constructor(val id: Int, private val fileSettings: DesfireFileSettings?, val data: ByteArray) :
Parcelable {
override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeInt(id)
if (this is InvalidDesfireFile) {
parcel.writeInt(1)
parcel.writeString(this.errorMessage)
} else {
parcel.writeInt(0)
parcel.writeParcelable(fileSettings, 0)
parcel.writeInt(data.size)
parcel.writeByteArray(data)
}
}
override fun describeContents(): Int {
return 0
}
class RecordDesfireFile(fileId: Int, fileSettings: DesfireFileSettings, fileData: ByteArray) :
DesfireFile(fileId, fileSettings, fileData) {
private val records: Array<DesfireRecord?>
init {
val settings = fileSettings as RecordDesfireFileSettings
val records = arrayOfNulls<DesfireRecord>(settings.curRecords)
for (i in 0 until settings.curRecords) {
val offset = settings.recordSize * i
records[i] = DesfireRecord(ArrayUtils.subarray(data, offset, offset + settings.recordSize))
}
this.records = records
}
}
class InvalidDesfireFile(fileId: Int, val errorMessage: String?) : DesfireFile(fileId, null, ByteArray(0))
companion object {
fun create(fileId: Int, fileSettings: DesfireFileSettings, fileData: ByteArray): DesfireFile {
return (fileSettings as? RecordDesfireFileSettings)?.let { RecordDesfireFile(fileId, it, fileData) }
?: DesfireFile(fileId, fileSettings, fileData)
}
@Suppress("unused")
@JvmField
val CREATOR: Parcelable.Creator<DesfireFile> = object : Parcelable.Creator<DesfireFile> {
override fun createFromParcel(source: Parcel): DesfireFile {
val fileId = source.readInt()
val isError = source.readInt() == 1
return if (!isError) {
val fileSettings =
source.readParcelable<Parcelable>(DesfireFileSettings::class.java.classLoader) as DesfireFileSettings
val dataLength = source.readInt()
val fileData = ByteArray(dataLength)
source.readByteArray(fileData)
create(fileId, fileSettings, fileData)
} else {
InvalidDesfireFile(fileId, source.readString())
}
}
override fun newArray(size: Int): Array<DesfireFile?> {
return arrayOfNulls(size)
}
}
}
}

248
app/src/main/java/com/codebutler/farebot/card/desfire/DesfireFileSettings.kt

@ -0,0 +1,248 @@
/**
* DesfireFileSettings.kt
*
* Copyright (C) 2011 Eric Butler
* Copyright (C) 2019 <seil0@mosad.xyz>
*
* Authors:
* Eric Butler <eric@codebutler.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.codebutler.farebot.card.desfire
import android.os.Parcel
import android.os.Parcelable
import com.codebutler.farebot.Utils
import org.apache.commons.lang3.ArrayUtils
import java.io.ByteArrayInputStream
abstract class DesfireFileSettings : Parcelable {
private val fileType: Byte
private val commSetting: Byte
private val accessRights: ByteArray
@Suppress("unused")
val fileTypeName: String
get() {
return when (fileType) {
STANDARD_DATA_FILE -> "Standard"
BACKUP_DATA_FILE -> "Backup"
VALUE_FILE -> "Value"
LINEAR_RECORD_FILE -> "Linear Record"
CYCLIC_RECORD_FILE -> "Cyclic Record"
else -> "Unknown"
}
}
private constructor(stream: ByteArrayInputStream) {
fileType = stream.read().toByte()
commSetting = stream.read().toByte()
accessRights = ByteArray(2)
stream.read(accessRights, 0, accessRights.size)
}
private constructor(fileType: Byte, commSetting: Byte, accessRights: ByteArray) {
this.fileType = fileType
this.commSetting = commSetting
this.accessRights = accessRights
}
override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeByte(fileType)
parcel.writeByte(commSetting)
parcel.writeInt(accessRights.size)
parcel.writeByteArray(accessRights)
}
override fun describeContents(): Int {
return 0
}
class StandardDesfireFileSettings : DesfireFileSettings {
private val fileSize: Int
internal constructor(stream: ByteArrayInputStream) : super(stream) {
val buf = ByteArray(3)
stream.read(buf, 0, buf.size)
ArrayUtils.reverse(buf)
fileSize = Utils.byteArrayToInt(buf)
}
internal constructor(
fileType: Byte,
commSetting: Byte,
accessRights: ByteArray,
fileSize: Int
) : super(fileType, commSetting, accessRights) {
this.fileSize = fileSize
}
override fun writeToParcel(parcel: Parcel, flags: Int) {
super.writeToParcel(parcel, flags)
parcel.writeInt(fileSize)
}
}
class RecordDesfireFileSettings : DesfireFileSettings {
private val maxRecords: Int
val recordSize: Int
val curRecords: Int
constructor(stream: ByteArrayInputStream) : super(stream) {
var buf = ByteArray(3)
stream.read(buf, 0, buf.size)
ArrayUtils.reverse(buf)
recordSize = Utils.byteArrayToInt(buf)
buf = ByteArray(3)
stream.read(buf, 0, buf.size)
ArrayUtils.reverse(buf)
maxRecords = Utils.byteArrayToInt(buf)
buf = ByteArray(3)
stream.read(buf, 0, buf.size)
ArrayUtils.reverse(buf)
curRecords = Utils.byteArrayToInt(buf)
}
internal constructor(
fileType: Byte,
commSetting: Byte,
accessRights: ByteArray,