├── .gitignore ├── .gitmodules ├── CHANGELOG.md ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── lint.xml ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ ├── Abfallkalender.ics │ │ └── keystore │ │ │ └── hacs_keystore.bks │ ├── java │ │ └── io │ │ │ └── mainframe │ │ │ └── hacs │ │ │ ├── MainApplication.kt │ │ │ ├── PageFragments │ │ │ ├── BasePageFragment.kt │ │ │ ├── CashboxEditFragment.kt │ │ │ ├── CashboxFragment.kt │ │ │ ├── LocationColor.kt │ │ │ ├── MachiningFragment.kt │ │ │ ├── MainAreaFragment.kt │ │ │ ├── OverviewFragment.kt │ │ │ └── WoodworkingFragment.kt │ │ │ ├── about │ │ │ └── AboutActivity.kt │ │ │ ├── cashbox │ │ │ ├── CashBoxRequester.kt │ │ │ ├── CashboxValueTask.kt │ │ │ ├── UpdateCashboxTask.kt │ │ │ └── accept-all-certs.kt │ │ │ ├── common │ │ │ ├── Constants.kt │ │ │ ├── YesNoDialog.kt │ │ │ └── logging │ │ │ │ └── LogConfig.kt │ │ │ ├── components │ │ │ └── DoorButtons.kt │ │ │ ├── log_view │ │ │ └── LogViewerActivity.kt │ │ │ ├── main │ │ │ ├── BackDoorStatus.kt │ │ │ ├── MainActivity.kt │ │ │ ├── NetworkStatus.kt │ │ │ ├── PermissionHandler.kt │ │ │ ├── SshUiHandler.kt │ │ │ └── Status.kt │ │ │ ├── settings │ │ │ ├── AppCompatPreferenceActivity.kt │ │ │ ├── EditTextWithScanPreference.kt │ │ │ └── SettingsActivity.kt │ │ │ ├── ssh │ │ │ ├── CheckPrivateKeyAsync.kt │ │ │ ├── DoorCommand.kt │ │ │ ├── PkCredentials.kt │ │ │ └── RunSshAsync.kt │ │ │ ├── status │ │ │ ├── SpaceDevices.kt │ │ │ ├── SpaceStatusService.kt │ │ │ └── StatusEvent.kt │ │ │ └── trash_notifications │ │ │ └── TrashCalendar.kt │ └── res │ │ ├── drawable-hdpi │ │ └── ic_trash.png │ │ ├── drawable-mdpi │ │ └── ic_trash.png │ │ ├── drawable-xhdpi │ │ └── ic_trash.png │ │ ├── drawable-xxhdpi │ │ └── ic_trash.png │ │ ├── drawable-xxxhdpi │ │ └── ic_trash.png │ │ ├── drawable │ │ ├── custom_spinner.xml │ │ ├── ic_autorenew_black_24dp.xml │ │ ├── ic_button_black.xml │ │ ├── ic_check_green_24dp.xml │ │ ├── ic_error_black_24dp.xml │ │ ├── ic_error_red_24dp.xml │ │ ├── ic_help_outline_grey_24dp.xml │ │ ├── ic_led_blue_black.xml │ │ ├── ic_led_red_black.xml │ │ ├── ic_verified_user_black_24dp.xml │ │ ├── ic_warning_yellow_24dp.xml │ │ └── side_nav_bar.xml │ │ ├── layout │ │ ├── activity_about.xml │ │ ├── activity_log_viewer.xml │ │ ├── activity_main.xml │ │ ├── component_door_buttons.xml │ │ ├── fragment_cashbox.xml │ │ ├── fragment_cashbox_edit.xml │ │ ├── fragment_machining.xml │ │ ├── fragment_next_status.xml │ │ ├── fragment_overview.xml │ │ ├── fragment_ssh_ui_handler.xml │ │ ├── fragment_status.xml │ │ ├── fragment_woodworking.xml │ │ └── nav_header_main.xml │ │ ├── menu │ │ ├── activity_main_drawer.xml │ │ └── log_menu.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ ├── values │ │ ├── arrays.xml │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── prefConstants.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ ├── file_paths.xml │ │ └── pref_general.xml │ └── test │ ├── kotlin │ └── io │ │ └── mainframe │ │ └── hacs │ │ ├── ssh │ │ └── KeyCheckTests.kt │ │ └── trash_notifications │ │ └── TrashCalendarTest.kt │ └── resources │ └── trash_calendar.ics ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── passcode ├── crc8.js ├── createCode.html └── index.html ├── settings.gradle └── store ├── Screenshot_20161112-192802.png ├── device-2018-05-26-214105.png ├── function_graphic.png ├── function_graphic.svg ├── logo.png └── logo.svg /.gitignore: -------------------------------------------------------------------------------- 1 | ### custom ### 2 | .DS_Store 3 | .idea/ 4 | local/ 5 | app/release/ 6 | 7 | # Created by https://www.gitignore.io/api/android 8 | 9 | ### Android ### 10 | # Built application files 11 | *.apk 12 | *.ap_ 13 | 14 | # Files for the ART/Dalvik VM 15 | *.dex 16 | 17 | # Java class files 18 | *.class 19 | 20 | # Generated files 21 | bin/ 22 | gen/ 23 | out/ 24 | 25 | # Gradle files 26 | .gradle/ 27 | build/ 28 | 29 | # Local configuration file (sdk path, etc) 30 | local.properties 31 | 32 | # Proguard folder generated by Eclipse 33 | proguard/ 34 | 35 | # Log Files 36 | *.log 37 | 38 | # Android Studio Navigation editor temp files 39 | .navigation/ 40 | 41 | # Android Studio captures folder 42 | captures/ 43 | 44 | # Intellij 45 | *.iml 46 | .idea/workspace.xml 47 | .idea/libraries 48 | 49 | # Keystore files 50 | *.jks 51 | 52 | ### Android Patch ### 53 | gen-external-apklibs 54 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "passcode/qrcodejs"] 2 | path = passcode/qrcodejs 3 | url = https://github.com/davidshimjs/qrcodejs.git 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | # 2.24.0 4 | * Key change of main area backdoor. 5 | * Update `targetSdkVersion` to 35. 6 | 7 | # 2.23.2 8 | * Internal version bump to overwrite Playstore version. 9 | 10 | # 2.23.0 11 | * Support for main area backdoor. 12 | 13 | # 2.22.0 14 | * Support for woodworking backdoor. 15 | 16 | # 2.21.0 17 | * New trash calendar 2025. 18 | 19 | # 2.20.1 20 | * Fixes Cashbox update. 21 | 22 | # 2.20.0 23 | * Removes EasyPermissions dependency. The app should work with less permissions now. 24 | 25 | # 2.19.0 26 | * Sets the correct wifi ids for wood working. 27 | 28 | ## 2.18.2 29 | * Fixes Mainframe wifi detection in Cashbox view. 30 | 31 | ## 2.18.1 32 | * Internal refactorings. 33 | * Removes trash notifications (but the trash reminder still exists) 34 | 35 | ## 2.17.0 36 | * Adds Woodworking status. 37 | 38 | ## 2.16.0 39 | * Supports Backdoor status and machining keyholder again. 40 | 41 | ## 2.15.0 42 | * Removes the mqtt implementation and replaces it with http server send events to our Status page. Not all previous features are supported anymore. 43 | 44 | ## 2.14.0 45 | * Requests permission SCHEDULE_EXACT_ALARM to fix crashes on Android 12+ 46 | 47 | ## 2.13.3 48 | * Fixes some possible NPE. 49 | 50 | ## 2.13.2 51 | * Android permission fixes. 52 | 53 | ## 2.13.1 54 | * Rollback of the ssh lib to hopefully fix a regression 55 | 56 | ## 2.13.0 57 | * Trash calendar update (2024) 58 | * Fix for CVE-2023-48795 (SSH) 59 | 60 | ## 2.12.0 61 | * New places, new places colors 62 | 63 | ## 2.11.0 64 | * Refactoring of the Cashbox part. Fixes session handling. 65 | * Adds "Holz" as location. 66 | 67 | ## 2.10.2 68 | * Reduces minSdkVersion to 26 (Android 8.0) 69 | 70 | ## 2.10.1 71 | * Fixes cashbox crash 72 | 73 | ## 2.10.0 74 | * Updates cashbox api 75 | 76 | ## 2.9.9 77 | * Fixes Trash calendar for Android 12 78 | 79 | ## 2.9.8 80 | * Trash calendar date parse fix 81 | 82 | ## 2.9.7 83 | * Bugfix for Android 12 84 | 85 | ## 2.9.6 86 | * Removes any filename restrictions for selected the private key 87 | 88 | ## 2.9.5 89 | * Trash calendar update (2023) 90 | * Fix machining 5GHz BSSID 91 | 92 | ## 2.9.4 93 | * Fix machining 5GHz BSSID 94 | 95 | ## 2.9.3 96 | * SSID list update 97 | 98 | ## 2.9.2 99 | * SSID list update 100 | * Trash calendar update (2022) 101 | 102 | ## 2.9.1 103 | * Changes the cert handling for the cashbox 104 | * Always show all status buttons 105 | 106 | ## 2.9.0 107 | * Permission refactoring for Android 11. Removed the "scan for your private key" function and uses the internal picker. 108 | * Logging fixed and removed the log to file function. Added an mail and clipboard export instead. 109 | * Fixes SSID detection for newer Android versions. 110 | 111 | ## 2.8.6 112 | * SSID list update 113 | * Trash calendar update (2021) 114 | 115 | ## 2.8.5 116 | * Shows all events if there multiple per day 117 | 118 | ## 2.8.4 119 | * UI fix for wrong private key password 120 | 121 | ## 2.8.3 122 | * Supports cashbox update 123 | 124 | ## 2.8.2 125 | * Logging improved (and fixed) 126 | * ssh lib updated 127 | * Cashbox bugfix 128 | 129 | ## 2.8.1 130 | * Disables Cashbox page if not im Mainframe wifi 131 | 132 | ## 2.8.0 133 | * Cashbox page 134 | 135 | ## 2.7.3 136 | * Trash calendar 2020 137 | 138 | ## 2.7.2 139 | * Enables the trash notification feature as a beta setting. 140 | 141 | ## 2.7.1 142 | * Fixes a crash for a wrong mqtt password. 143 | 144 | ## 2.7.0 145 | * Shows on the overview an info text about garbage events. 146 | * Shows a warning on closing the space if the garbage bin should be moved to the street. 147 | 148 | ## 2.6.7 149 | * Increases version in meta files. 150 | 151 | ## 2.6.6 152 | * Bugfix: Keystore file was missing in the FDroid build. 153 | 154 | ## 2.6.5 155 | * Bugfix: The notification time should be at 20:03 before the next event. 156 | 157 | ## 2.6.4 158 | * Bugfix: Adds several null checks. 159 | 160 | ## 2.6.3 161 | * Fixes for fdroid (repo cleanup and lint config) 162 | 163 | ## 2.6.2 164 | * Changes the logging when the settings change 165 | * Bugfix: NPE in LED status 166 | 167 | ## 2.6.1 168 | * Crash bugfix. 169 | 170 | ## 2.6.0 171 | * Shows warnings about the garbage 172 | * New permission Location to get the ssid on Android 8.1 173 | * Bugfix for the "require Mainframe wifi" option 174 | 175 | ## 2.5.2 176 | * Bugfix: Fixes "become keyholder" button enable state 177 | 178 | ## 2.5.1 179 | * Bugfix: Initial state of back door was wrong and leads to a crash. 180 | 181 | ## 2.5.0 182 | * Shows the status of the back-door 183 | * Asks the user if he really wants to close the space with an open back door 184 | * Disables 'Keyholder' button and all buttons on status if the wifi has a machining bssid 185 | 186 | ## 2.4.2 187 | * More Bugfixes (fixes broken extended door status) 188 | 189 | ## 2.4.1 190 | * Bugfixes (#2) 191 | 192 | ## 2.4.0 193 | * Machining Seite 194 | 195 | ## 2.3.1 196 | * Bugfixes for door buttons 197 | 198 | ## 2.3.0 199 | * Adds a new door buzzer button (inner metal door) 200 | * Shows the device locationsstatus 201 | 202 | ## 2.2.1 203 | * support new device list format 204 | 205 | ## 2.2.0 206 | * Adds outer door buzzer 207 | 208 | ## 2.1.0 209 | * Adds back button for fragment changes 210 | 211 | ## 2.0.0 212 | * Complete redesign of the UI 213 | * Feature: Show current keyholder 214 | * Feature: "Become keyholder" 215 | * mqtt connection handling changed 216 | 217 | ## 1.4.0 218 | * Door buzzer button added 219 | 220 | ## 1.3.0 221 | * About dialog added 222 | * Can read passwords from qr-code 223 | * Mqtt lib update to 1.1.0 224 | * New launcher icon 225 | 226 | ## 1.2.0 227 | * Support for Android >= 6 permission request system 228 | 229 | ## 1.1.0 230 | * A file browser for private key 231 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Kreativität trifft Technik e.V. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hackspace Access Control System 2 | 3 | An Android app for our "keyholder" to view and manage the door states. 4 | 5 | It uses an mqtt service to get the current status and sends door commands per ssh. 6 | 7 | # Create keystore with cert for the mqtt connection 8 | 9 | We need a Android compatible keystore with the endpoint's ssl certificate in it. Download the `bcprov-ext-jdk14-1.53.jar`, e.g. from [here](http://repo2.maven.org/maven2/org/bouncycastle/bcprov-ext-jdk14/1.53/) and run: 10 | 11 | ```sh 12 | echo -n | openssl s_client -connect mainframe.io:8883 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > mqtt_mainframe.io.crt 13 | keytool -import -trustcacerts -keystore hacs_keystore.bks -storepass keystorepw -noprompt -alias mqtt_mainframe -file mqtt_mainframe.io.crt -storetype BKS -providerClass org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath bcprov-ext-jdk14-1.53.jar 14 | ``` 15 | 16 | Copy the resulting `hacs_keystore.bks` to the `src/main/assets/keystore/` folder. 17 | 18 | 19 | # ssh keys 20 | 21 | Must start with `mf-door.` and end with `.key` and must have a password. 22 | 23 | # Download 24 | 25 | [Get it on F-Droid](https://f-droid.org/packages/io.mainframe.hacs/) 28 | [Get it on Google Play](https://play.google.com/store/apps/details?id=io.mainframe.hacs) 31 | 32 | ## TODO 33 | 34 | * [ ] Save passwords more secure, e.g. https://developer.android.com/samples/BasicAndroidKeyStore/index.html 35 | 36 | # Libs 37 | 38 | * https://github.com/googlesamples/easypermissions 39 | * https://github.com/ACRA/acra.git 40 | * http://www.jcraft.com/jsch/ 41 | 42 | # Helpful! 43 | 44 | * https://developer.android.com/training/scheduling/alarms#java 45 | * https://medium.com/@anugrahasb1997/implementing-server-sent-events-sse-in-android-with-okhttp-eventsource-226dc9b2599d 46 | 47 | # Acknowledgements 48 | 49 | * The 3 led buttons come from https://openclipart.org/user-cliparts/bnielsen 50 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | android { 5 | compileSdk 34 6 | defaultConfig { 7 | applicationId "io.mainframe.hacs" 8 | minSdkVersion 26 9 | targetSdkVersion 35 10 | versionCode 87 11 | versionName '2.24.0' 12 | resValue "string", "app_name", "HACS" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | beta { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | versionNameSuffix "-beta" 23 | resValue "string", "app_name", "HACS-Beta" 24 | } 25 | debug { 26 | applicationIdSuffix ".debug" 27 | versionNameSuffix "-debug" 28 | resValue "string", "app_name", "HACS-D" 29 | debuggable true 30 | } 31 | } 32 | productFlavors { 33 | } 34 | 35 | kotlinOptions { 36 | jvmTarget = "1.8" 37 | } 38 | compileOptions { 39 | sourceCompatibility = JavaVersion.VERSION_1_8 40 | targetCompatibility = JavaVersion.VERSION_1_8 41 | } 42 | 43 | sourceSets { 44 | main.java.srcDirs += 'src/main/kotlin' 45 | } 46 | namespace 'io.mainframe.hacs' 47 | } 48 | 49 | 50 | 51 | dependencies { 52 | implementation fileTree(include: ['*.jar'], dir: 'libs') 53 | 54 | // for Android 6 permission request 55 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 56 | implementation 'com.android.support:appcompat-v7:28.0.0' 57 | implementation 'com.android.support:design:28.0.0' 58 | 59 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 60 | 61 | 62 | implementation 'com.jcraft:jsch:0.1.54' 63 | implementation 'ch.acra:acra:4.6.2' 64 | implementation 'com.squareup.okhttp3:okhttp:4.12.0' 65 | implementation 'com.launchdarkly:okhttp-eventsource:2.5.0' 66 | implementation 'org.tinylog:tinylog:1.3.5' 67 | 68 | testImplementation 'junit:junit:4.13.2' 69 | } 70 | repositories { 71 | mavenCentral() 72 | maven { url 'https://jitpack.io' } 73 | } 74 | -------------------------------------------------------------------------------- /app/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/holger/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 39 | 40 | 45 | 46 | 47 | 48 | 49 | 50 | 57 | 58 | 63 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /app/src/main/assets/keystore/hacs_keystore.bks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ktt-ol/hacs/159f9308103423a849788aadea92fc9498ad34d3/app/src/main/assets/keystore/hacs_keystore.bks -------------------------------------------------------------------------------- /app/src/main/java/io/mainframe/hacs/MainApplication.kt: -------------------------------------------------------------------------------- 1 | package io.mainframe.hacs 2 | 3 | import android.app.Application 4 | import io.mainframe.hacs.common.logging.LogConfig.configureLogger 5 | import org.acra.ACRA 6 | import org.acra.ReportingInteractionMode 7 | import org.acra.annotation.ReportsCrashes 8 | 9 | /** 10 | * Created by holger on 02.12.15. 11 | */ 12 | @ReportsCrashes( 13 | mailTo = "holgercremer@gmail.com", 14 | mode = ReportingInteractionMode.DIALOG, 15 | resDialogText = R.string.crash_dialog_text, 16 | resDialogIcon = android.R.drawable.ic_dialog_info, 17 | resDialogCommentPrompt = R.string.crash_dialog_comment_prompt, 18 | resDialogOkToast = R.string.crash_dialog_ok_toast 19 | ) 20 | class MainApplication : Application() { 21 | override fun onCreate() { 22 | super.onCreate() 23 | 24 | // The following line triggers the initialization of ACRA 25 | ACRA.init(this) 26 | 27 | 28 | configureLogger(this) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/io/mainframe/hacs/PageFragments/BasePageFragment.kt: -------------------------------------------------------------------------------- 1 | package io.mainframe.hacs.PageFragments 2 | 3 | import android.content.Context 4 | import android.support.v4.app.Fragment 5 | import io.mainframe.hacs.common.Constants.DoorServer 6 | import io.mainframe.hacs.main.NetworkStatus 7 | import io.mainframe.hacs.ssh.DoorCommand 8 | import io.mainframe.hacs.status.SpaceStatusService 9 | import io.mainframe.hacs.trash_notifications.TrashCalendar 10 | 11 | /** 12 | * Created by holger on 06.10.17. 13 | */ 14 | abstract class BasePageFragment : Fragment() { 15 | private var _interaction: BasePageFragmentInteractionListener? = null 16 | 17 | abstract val titleRes: Int 18 | 19 | val interaction: BasePageFragmentInteractionListener get() = checkNotNull(_interaction) 20 | 21 | override fun onAttach(context: Context) { 22 | super.onAttach(context) 23 | if (context is BasePageFragmentInteractionListener) { 24 | _interaction = context 25 | } else { 26 | throw RuntimeException("$context must implement BasePageFragmentInteractionListener") 27 | } 28 | } 29 | 30 | override fun onDetach() { 31 | super.onDetach() 32 | _interaction = null 33 | } 34 | 35 | interface BasePageFragmentInteractionListener { 36 | val networkStatus: NetworkStatus 37 | val statusService: SpaceStatusService 38 | val trashCalendar: TrashCalendar 39 | fun sendSshCommand(server: DoorServer, command: DoorCommand) 40 | fun navigateToPage(target: Class) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/io/mainframe/hacs/PageFragments/CashboxEditFragment.kt: -------------------------------------------------------------------------------- 1 | package io.mainframe.hacs.PageFragments 2 | 3 | import android.app.Activity 4 | import android.os.Bundle 5 | import android.preference.PreferenceManager 6 | import android.support.v4.app.DialogFragment 7 | import android.view.LayoutInflater 8 | import android.view.View 9 | import android.view.ViewGroup 10 | import android.widget.* 11 | import io.mainframe.hacs.R 12 | import io.mainframe.hacs.cashbox.Auth 13 | import io.mainframe.hacs.cashbox.UpdateCashboxTask 14 | import io.mainframe.hacs.cashbox.UpdateParam 15 | import io.mainframe.hacs.cashbox.UpdateType 16 | import org.pmw.tinylog.Logger 17 | 18 | class CashboxEditFragment : DialogFragment() { 19 | 20 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 21 | 22 | val view = inflater.inflate(R.layout.fragment_cashbox_edit, container, false) 23 | 24 | val spinner = view.findViewById(R.id.cashbox_edit_action) 25 | // Create an ArrayAdapter using the string array and a default spinner layout 26 | ArrayAdapter.createFromResource( 27 | context!!, 28 | R.array.cashbox_edit_array, 29 | android.R.layout.simple_spinner_item 30 | ).also { adapter -> 31 | // Specify the layout to use when the list of choices appears 32 | adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item) 33 | // Apply the adapter to the spinner 34 | spinner.adapter = adapter 35 | } 36 | 37 | view.findViewById 33 | 34 |

35 | 36 |

37 | 38 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /passcode/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Passcode to qrcodes 6 | 7 | 8 | 9 | 38 | 39 | 40 |

41 | 44 |

45 | 46 | 47 | 48 |
49 | 50 |
51 | 52 | Private Key password: 53 | 54 | 55 | 56 |
57 | 58 |
59 | Mqtt password: 60 | 61 | 62 | 63 |
64 |
65 | 66 | 131 | 132 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /store/Screenshot_20161112-192802.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ktt-ol/hacs/159f9308103423a849788aadea92fc9498ad34d3/store/Screenshot_20161112-192802.png -------------------------------------------------------------------------------- /store/device-2018-05-26-214105.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ktt-ol/hacs/159f9308103423a849788aadea92fc9498ad34d3/store/device-2018-05-26-214105.png -------------------------------------------------------------------------------- /store/function_graphic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ktt-ol/hacs/159f9308103423a849788aadea92fc9498ad34d3/store/function_graphic.png -------------------------------------------------------------------------------- /store/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ktt-ol/hacs/159f9308103423a849788aadea92fc9498ad34d3/store/logo.png -------------------------------------------------------------------------------- /store/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 22 | 24 | image/svg+xml 25 | 27 | 28 | 29 | 30 | 31 | 33 | 57 | 61 | 65 | 71 | 75 | 76 | 81 | 86 | 87 | 88 | --------------------------------------------------------------------------------